@longzai-intelligence-dependencies/cli 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env bun
2
- import{c as e,d as t,l as n,n as r,t as i,u as a}from"./node-DRSjVtZB.js";import"node:module";import o,{homedir as s}from"node:os";import"node:util";import*as c from"fs";import{readdir as l,readdirSync as u,realpath as d,realpathSync as f,stat as p,statSync as m}from"fs";import{basename as h,dirname as g,isAbsolute as _,normalize as v,posix as y,relative as b,resolve as x,sep as S}from"path";import{createRequire as C}from"module";import{existsSync as w,lstatSync as T,promises as E,readFileSync as D,readdirSync as O,statSync as ee}from"node:fs";import{dirname as k,isAbsolute as te,join as A,relative as ne,resolve as re}from"node:path";import"node:url";import{fileURLToPath as ie}from"url";import{AsyncLocalStorage as ae}from"node:async_hooks";import j from"node:process";import{Buffer as M}from"node:buffer";import N from"node:http";import oe from"node:https";import"node:zlib";import"node:stream";import"node:net";import*as P from"node:fs/promises";import{readFile as F,writeFile as I}from"node:fs/promises";var L=/* @__PURE__ */ n(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
2
+ import{c as e,d as t,l as n,n as r,t as i,u as a}from"./node-lZStpsDn.js";import"node:module";import o,{homedir as s}from"node:os";import"node:util";import*as c from"fs";import{readdir as l,readdirSync as u,realpath as d,realpathSync as f,stat as p,statSync as m}from"fs";import{basename as h,dirname as g,isAbsolute as _,normalize as v,posix as y,relative as b,resolve as x,sep as S}from"path";import{createRequire as C}from"module";import{existsSync as w,lstatSync as T,promises as E,readFileSync as D,readdirSync as O,statSync as ee}from"node:fs";import{dirname as k,isAbsolute as te,join as A,relative as ne,resolve as re}from"node:path";import"node:url";import{fileURLToPath as ie}from"url";import{AsyncLocalStorage as ae}from"node:async_hooks";import j from"node:process";import{Buffer as M}from"node:buffer";import N from"node:http";import oe from"node:https";import"node:zlib";import"node:stream";import"node:net";import*as P from"node:fs/promises";import{readFile as F,writeFile as I}from"node:fs/promises";var L=/* @__PURE__ */ n(((e,t)=>{let n=e=>e&&typeof e.message==`string`,r=e=>{if(!e)return;let t=e.cause;if(typeof t==`function`){let t=e.cause();return n(t)?t:void 0}return n(t)?t:void 0},i=(e,t)=>{if(!n(e))return``;let a=e.stack||``;if(t.has(e))return a+`
3
3
  causes have become circular...`;let o=r(e);return o?(t.add(e),a+`
4
- caused by: `+i(o,t)):a},a=e=>i(e,/* @__PURE__ */ new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,/* @__PURE__ */ new Set)}})),se=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),ce=/* @__PURE__ */ n(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=L(),{pinoErrProto:a,pinoErrorSymbols:o}=se(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),R=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{isErrorLike:n}=L(),{pinoErrProto:r,pinoErrorSymbols:i}=se(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),le=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=Object.create({},{id:{enumerable:!0,writable:!0,value:``},method:{enumerable:!0,writable:!0,value:``},url:{enumerable:!0,writable:!0,value:``},query:{enumerable:!0,writable:!0,value:``},params:{enumerable:!0,writable:!0,value:``},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:``},remotePort:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),ue=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),de=/* @__PURE__ */ n(((e,t)=>{let n=ce(),r=R(),i=le(),a=ue();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),fe=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:util`),r=n.getCallSites??n.getCallSite;function i(e,t){return t}t.exports=function(){if(r)return r().slice(2).map(e=>e.scriptName);let e=Error.prepareStackTrace;Error.prepareStackTrace=i;let t=(/* @__PURE__ */ Error()).stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let n=t.slice(2),a=[];for(let e of n)e&&a.push(e.getFileName());return a}})),z=/* @__PURE__ */ n(((e,t)=>{function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=n(e[r]);return t}if(typeof e==`object`){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=/* @__PURE__ */ new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,/* @__PURE__ */ new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),pe=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),ee=Symbol.for(`pino.serializers`),k=Symbol.for(`pino.formatters`),te=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:ee,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:k,hooksSym:te,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D,transportUsesMultistreamSym:Symbol.for(`pino.transport.usesMultistream`)}})),me=/* @__PURE__ */ n(((e,t)=>{let n=z(),{redactFmtSym:r,wildcardFirstSym:i}=pe(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},Object.create(null)),d=Object.assign(Object.create(null),{[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})}),f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),he=/* @__PURE__ */ n(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),ge=/* @__PURE__ */ n(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),_e=/* @__PURE__ */ n(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))throw typeof t!=`number`&&typeof t!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),ve=/* @__PURE__ */ n(((e,t)=>{let n=a(`fs`),r=a(`events`),i=a(`util`).inherits,o=a(`path`),s=_e(),c=a(`assert`),l=Buffer.allocUnsafe(0),u=`buffer`,d=`utf8`,[f,p]=(process.versions.node||`0.0`).split(`.`).map(Number),m=f>=22&&p>=7;function h(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&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,a=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(o.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,a))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(o.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,a,r)}):n.open(e,i,a,r)}function g(e){if(!(this instanceof g))return new g(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:c,sync:f,append:p=!0,mkdir:m,retryEAGAIN:y,fsync:S,contentMode:k,mode:te}=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=!1,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=c||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=S||!1,this.append=p||!1,this.mode=te,this.retryEAGAIN=y||(()=>!0),this.mkdir=m||!1;let A,ne;if(k===u)this._writingBuf=l,this.write=x,this.flush=w,this.flushSync=E,this._actualWrite=O,A=()=>n.writeSync(this.fd,this._writingBuf),ne=()=>n.write(this.fd,this._writingBuf,this.release);else if(k===void 0||k===d)this._writingBuf=``,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ne=()=>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 "${d}" and "${u}", but passed ${k}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)h(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){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&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 setTimeout(ne,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=_(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){ne();return}try{do{let e=A(),t=_(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>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,ee(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(v,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function _(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 v(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(g,r);function y(e,t){return e.length===0?l:e.length===1?e[0]:Buffer.concat(e,t)}function b(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 x(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 S(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function C(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}if(this.minLength<=0){e?.();return}e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite())}function w(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}if(this.minLength<=0){e?.();return}e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}g.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{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)})}),h(this.file,this)},g.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():ee(this)))};function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let e=``;for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=_(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}try{n.fsyncSync(this.fd)}catch{}}function E(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=l);let e=l;for(;this._bufs.length||e.length;){e.length<=0&&(e=y(this._bufs[0],this._lens[0]));try{let t=n.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}}g.prototype.destroy=function(){this.destroyed||ee(this)};function D(){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 O(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:y(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else m&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function ee(e){if(e.fd===-1){e.once(`ready`,ee.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],c(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){if(t){e.emit(`error`,t);return}e._ending&&!e._writing&&e.emit(`finish`),e.emit(`close`)}}g.SonicBoom=g,g.default=g,t.exports=g})),ye=/* @__PURE__ */ n(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;
4
+ caused by: `+i(o,t)):a},a=e=>i(e,/* @__PURE__ */ new Set),o=(e,t,i)=>{if(!n(e))return``;let a=i?``:e.message||``;if(t.has(e))return a+`: ...`;let s=r(e);if(s){t.add(e);let n=typeof e.cause==`function`;return a+(n?``:`: `)+o(s,t,n)}return a};t.exports={isErrorLike:n,getErrorCause:r,stackWithCauses:a,messageWithCauses:e=>o(e,/* @__PURE__ */ new Set)}})),se=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`circular-ref-tag`),r=Symbol(`pino-raw-err-ref`),i=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[r]},set:function(e){this[r]=e}}});Object.defineProperty(i,r,{writable:!0,value:{}}),t.exports={pinoErrProto:i,pinoErrorSymbols:{seen:n,rawSymbol:r}}})),ce=/* @__PURE__ */ n(((e,t)=>{t.exports=l;let{messageWithCauses:n,stackWithCauses:r,isErrorLike:i}=L(),{pinoErrProto:a,pinoErrorSymbols:o}=se(),{seen:s}=o,{toString:c}=Object.prototype;function l(e){if(!i(e))return e;e[s]=void 0;let t=Object.create(a);t.type=c.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=n(e),t.stack=r(e),Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>l(e)));for(let n in e)if(t[n]===void 0){let r=e[n];i(r)?n!==`cause`&&!Object.prototype.hasOwnProperty.call(r,s)&&(t[n]=l(r)):t[n]=r}return delete e[s],t.raw=e,t}})),R=/* @__PURE__ */ n(((e,t)=>{t.exports=s;let{isErrorLike:n}=L(),{pinoErrProto:r,pinoErrorSymbols:i}=se(),{seen:a}=i,{toString:o}=Object.prototype;function s(e){if(!n(e))return e;e[a]=void 0;let t=Object.create(r);t.type=o.call(e.constructor)===`[object Function]`?e.constructor.name:e.name,t.message=e.message,t.stack=e.stack,Array.isArray(e.errors)&&(t.aggregateErrors=e.errors.map(e=>s(e))),n(e.cause)&&!Object.prototype.hasOwnProperty.call(e.cause,a)&&(t.cause=s(e.cause));for(let r in e)if(t[r]===void 0){let i=e[r];n(i)?Object.prototype.hasOwnProperty.call(i,a)||(t[r]=s(i)):t[r]=i}return delete e[a],t.raw=e,t}})),le=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpRequest:a,reqSerializer:i};let n=Symbol(`pino-raw-req-ref`),r=Object.create({},{id:{enumerable:!0,writable:!0,value:``},method:{enumerable:!0,writable:!0,value:``},url:{enumerable:!0,writable:!0,value:``},query:{enumerable:!0,writable:!0,value:``},params:{enumerable:!0,writable:!0,value:``},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:``},remotePort:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=e.info||e.socket,n=Object.create(r);if(n.id=typeof e.id==`function`?e.id():e.id||(e.info?e.info.id:void 0),n.method=e.method,e.originalUrl)n.url=e.originalUrl;else{let t=e.path;n.url=typeof t==`string`?t:e.url?e.url.path||e.url:void 0}return e.query&&(n.query=e.query),e.params&&(n.params=e.params),n.headers=e.headers,n.remoteAddress=t&&t.remoteAddress,n.remotePort=t&&t.remotePort,n.raw=e.raw||e,n}function a(e){return{req:i(e)}}})),ue=/* @__PURE__ */ n(((e,t)=>{t.exports={mapHttpResponse:a,resSerializer:i};let n=Symbol(`pino-raw-res-ref`),r=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:``},raw:{enumerable:!1,get:function(){return this[n]},set:function(e){this[n]=e}}});Object.defineProperty(r,n,{writable:!0,value:{}});function i(e){let t=Object.create(r);return t.statusCode=e.headersSent?e.statusCode:null,t.headers=e.getHeaders?e.getHeaders():e._headers,t.raw=e,t}function a(e){return{res:i(e)}}})),de=/* @__PURE__ */ n(((e,t)=>{let n=ce(),r=R(),i=le(),a=ue();t.exports={err:n,errWithCause:r,mapHttpRequest:i.mapHttpRequest,mapHttpResponse:a.mapHttpResponse,req:i.reqSerializer,res:a.resSerializer,wrapErrorSerializer:function(e){return e===n?e:function(t){return e(n(t))}},wrapRequestSerializer:function(e){return e===i.reqSerializer?e:function(t){return e(i.reqSerializer(t))}},wrapResponseSerializer:function(e){return e===a.resSerializer?e:function(t){return e(a.resSerializer(t))}}}})),fe=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:util`),r=n.getCallSites??n.getCallSite;function i(e,t){return t}t.exports=function(){if(r)return r().slice(2).map(e=>e.scriptName);let e=Error.prepareStackTrace;Error.prepareStackTrace=i;let t=(/* @__PURE__ */ Error()).stack;if(Error.prepareStackTrace=e,!Array.isArray(t))return;let n=t.slice(2),a=[];for(let e of n)e&&a.push(e.getFileName());return a}})),z=/* @__PURE__ */ n(((e,t)=>{function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t[r]=n(e[r]);return t}if(typeof e==`object`){let t=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=n(e[r]));return t}return e}function r(e){let t=[],n=``,r=!1,i=!1,a=``;for(let o=0;o<e.length;o++){let s=e[o];!r&&s===`.`?n&&=(t.push(n),``):s===`[`?(n&&=(t.push(n),``),r=!0):s===`]`&&r?(t.push(n),n=``,r=!1,i=!1):(s===`"`||s===`'`)&&r?i?s===a?(i=!1,a=``):n+=s:(i=!0,a=s):n+=s}return n&&t.push(n),t}function i(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(typeof r!=`object`||!r||!(n in r)||typeof r[n]!=`object`||r[n]===null)return!1;r=r[n]}let i=t[t.length-1];if(i===`*`){if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=n;else if(typeof r==`object`&&r)for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=n)}else typeof r==`object`&&r&&i in r&&Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n);return!0}function a(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(typeof n!=`object`||!n||!(r in n)||typeof n[r]!=`object`||n[r]===null)return!1;n=n[r]}let r=t[t.length-1];if(r===`*`){if(Array.isArray(n))for(let e=0;e<n.length;e++)n[e]=void 0;else if(typeof n==`object`&&n)for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&delete n[e]}else typeof n==`object`&&n&&r in n&&Object.prototype.hasOwnProperty.call(n,r)&&delete n[r];return!0}let o=Symbol(`PATH_NOT_FOUND`);function s(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n||!(e in n))return o;n=n[e]}return n}function c(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||!n)return;n=n[e]}return n}function l(e,t,n,c=!1){for(let l of t){let t=r(l);if(t.includes(`*`))u(e,t,n,l,c);else if(c)a(e,t);else{let r=s(e,t);if(r===o)continue;i(e,t,typeof n==`function`?n(r,t):n)}}}function u(e,t,n,r,i=!1){let a=t.indexOf(`*`);if(a===t.length-1){let r=t.slice(0,-1),a=e;for(let e of r){if(typeof a!=`object`||!a||!a)return;a=a[e]}if(Array.isArray(a)){if(i)for(let e=0;e<a.length;e++)a[e]=void 0;else for(let e=0;e<a.length;e++){let t=[...r,e.toString()],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}else if(typeof a==`object`&&a){if(i){let e=[];for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.push(t);for(let t of e)delete a[t]}else for(let e in a){let t=[...r,e],i=typeof n==`function`?n(a[e],t):n;a[e]=i}}}else d(e,t,n,a,r,i)}function d(e,t,n,r,o,s=!1){let l=t.slice(0,r),d=t.slice(r+1),f=[];function p(e,t){if(t===l.length){if(Array.isArray(e))for(let n=0;n<e.length;n++)f[t]=n.toString(),p(e[n],t+1);else if(typeof e==`object`&&e)for(let n in e)f[t]=n,p(e[n],t+1)}else if(t<l.length){let n=l[t];e&&typeof e==`object`&&e&&n in e&&(f[t]=n,p(e[n],t+1))}else if(d.includes(`*`))u(e,d,typeof n==`function`?(e,r)=>n(e,[...f.slice(0,t),...r]):n,o,s);else if(s)a(e,d);else{let r=typeof n==`function`?n(c(e,d),[...f.slice(0,t),...d]):n;i(e,d,r)}}if(l.length===0)p(e,0);else{let t=e;for(let e=0;e<l.length;e++){let n=l[e];if(typeof t!=`object`||!t||!t)return;t=t[n],f[e]=n}t!=null&&p(t,l.length)}}function f(e){if(e.length===0)return null;let t=/* @__PURE__ */ new Map;for(let n of e){let e=r(n),i=t;for(let t=0;t<e.length;t++){let n=e[t];i.has(n)||i.set(n,/* @__PURE__ */ new Map),i=i.get(n)}}return t}function p(e,t){if(!t)return e;function n(e,t,r=0){if(!t||t.size===0||typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){let r=[];for(let i=0;i<e.length;i++){let a=i.toString();t.has(a)||t.has(`*`)?r[i]=n(e[i],t.get(a)||t.get(`*`)):r[i]=e[i]}return r}let i=Object.create(Object.getPrototypeOf(e));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=t.has(r)||t.has(`*`)?n(e[r],t.get(r)||t.get(`*`)):e[r]);return i}return n(e,t)}function m(e){if(typeof e!=`string`)throw Error(`Paths must be (non-empty) strings`);if(e===``)throw Error(`Invalid redaction path ()`);if(e.includes(`..`)||e.includes(`,`))throw Error(`Invalid redaction path (${e})`);let t=0,n=!1,r=``;for(let i=0;i<e.length;i++){let a=e[i];if((a===`"`||a===`'`)&&t>0)n?a===r&&(n=!1,r=``):(n=!0,r=a);else if(a===`[`&&!n)t++;else if(a===`]`&&!n&&(t--,t<0))throw Error(`Invalid redaction path (${e})`)}if(t!==0)throw Error(`Invalid redaction path (${e})`)}function h(e){if(!Array.isArray(e))throw TypeError(`paths must be an array`);for(let t of e)m(t)}function g(e={}){let{paths:t=[],censor:r=`[REDACTED]`,serialize:i=JSON.stringify,strict:a=!0,remove:o=!1}=e;h(t);let s=f(t);return function(e){if(a&&(typeof e!=`object`||!e)&&(typeof e!=`object`||!e))return i?i(e):e;let c=p(e,s),u=e,d=r;return typeof r==`function`&&(d=r),l(c,t,d,o),i===!1?(c.restore=function(){return n(u)},c):typeof i==`function`?i(c):JSON.stringify(c)}}t.exports=g})),pe=/* @__PURE__ */ n(((e,t)=>{let n=Symbol(`pino.setLevel`),r=Symbol(`pino.getLevel`),i=Symbol(`pino.levelVal`),a=Symbol(`pino.levelComp`),o=Symbol(`pino.useLevelLabels`),s=Symbol(`pino.useOnlyCustomLevels`),c=Symbol(`pino.mixin`),l=Symbol(`pino.lsCache`),u=Symbol(`pino.chindings`),d=Symbol(`pino.asJson`),f=Symbol(`pino.write`),p=Symbol(`pino.redactFmt`),m=Symbol(`pino.time`),h=Symbol(`pino.timeSliceIndex`),g=Symbol(`pino.stream`),_=Symbol(`pino.stringify`),v=Symbol(`pino.stringifySafe`),y=Symbol(`pino.stringifiers`),b=Symbol(`pino.end`),x=Symbol(`pino.formatOpts`),S=Symbol(`pino.messageKey`),C=Symbol(`pino.errorKey`),w=Symbol(`pino.nestedKey`),T=Symbol(`pino.nestedKeyStr`),E=Symbol(`pino.mixinMergeStrategy`),D=Symbol(`pino.msgPrefix`),O=Symbol(`pino.wildcardFirst`),ee=Symbol.for(`pino.serializers`),k=Symbol.for(`pino.formatters`),te=Symbol.for(`pino.hooks`);t.exports={setLevelSym:n,getLevelSym:r,levelValSym:i,levelCompSym:a,useLevelLabelsSym:o,mixinSym:c,lsCacheSym:l,chindingsSym:u,asJsonSym:d,writeSym:f,serializersSym:ee,redactFmtSym:p,timeSym:m,timeSliceIndexSym:h,streamSym:g,stringifySym:_,stringifySafeSym:v,stringifiersSym:y,endSym:b,formatOptsSym:x,messageKeySym:S,errorKeySym:C,nestedKeySym:w,wildcardFirstSym:O,needsMetadataGsym:Symbol.for(`pino.metadata`),useOnlyCustomLevelsSym:s,formattersSym:k,hooksSym:te,nestedKeyStrSym:T,mixinMergeStrategySym:E,msgPrefixSym:D,transportUsesMultistreamSym:Symbol.for(`pino.transport.usesMultistream`)}})),me=/* @__PURE__ */ n(((e,t)=>{let n=z(),{redactFmtSym:r,wildcardFirstSym:i}=pe(),a=/[^.[\]]+|\[([^[\]]*?)\]/g,o=`[Redacted]`;function s(e,t){let{paths:o,censor:s,remove:l}=c(e),u=o.reduce((e,t)=>{a.lastIndex=0;let n=a.exec(t),r=a.exec(t),o=n[1]===void 0?n[0]:n[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,`$1`);if(o===`*`&&(o=i),r===null)return e[o]=null,e;if(e[o]===null)return e;let{index:s}=r,c=`${t.substr(s,t.length-1)}`;return e[o]=e[o]||[],o!==i&&e[o].length===0&&e[o].push(...e[i]||[]),o===i&&Object.keys(e).forEach(function(t){e[t]&&e[t].push(c)}),e[o].push(c),e},Object.create(null)),d=Object.assign(Object.create(null),{[r]:n({paths:o,censor:s,serialize:t,strict:!1,remove:l})}),f=(...e)=>t(typeof s==`function`?s(...e):s);return[...Object.keys(u),...Object.getOwnPropertySymbols(u)].reduce((e,r)=>{if(u[r]===null)e[r]=e=>f(e,[r]);else{let i=typeof s==`function`?(e,t)=>s(e,[r,...t]):s;e[r]=n({paths:u[r],censor:i,serialize:t,strict:!1,remove:l})}return e},d)}function c(e){if(Array.isArray(e))return e={paths:e,censor:o},e;let{paths:t,censor:n=o,remove:r}=e;if(Array.isArray(t)===!1)throw Error(`pino – redact must contain an array of strings`);return r===!0&&(n=void 0),{paths:t,censor:n,remove:r}}t.exports=s})),he=/* @__PURE__ */ n(((e,t)=>{let n=()=>``,r=()=>`,"time":${Date.now()}`,i=()=>`,"time":${Math.round(Date.now()/1e3)}`,a=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,o=1000000000n,s=BigInt(Date.now())*1000000n,c=process.hrtime.bigint();t.exports={nullTime:n,epochTime:r,unixTime:i,isoTime:a,isoTimeNano:()=>{let e=process.hrtime.bigint()-c,t=s+e,n=t/o,r=t%o,i=Number(n*1000n+r/1000000n),a=new Date(i);return`,"time":"${a.getUTCFullYear()}-${(a.getUTCMonth()+1).toString().padStart(2,`0`)}-${a.getUTCDate().toString().padStart(2,`0`)}T${a.getUTCHours().toString().padStart(2,`0`)}:${a.getUTCMinutes().toString().padStart(2,`0`)}:${a.getUTCSeconds().toString().padStart(2,`0`)}.${r.toString().padStart(9,`0`)}Z"`}}})),ge=/* @__PURE__ */ n(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),_e=/* @__PURE__ */ n(((e,t)=>{if(typeof SharedArrayBuffer<`u`&&typeof Atomics<`u`){let e=new Int32Array(new SharedArrayBuffer(4));function n(t){if(!(t>0&&t<1/0))throw typeof t!=`number`&&typeof t!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);Atomics.wait(e,0,0,Number(t))}t.exports=n}else{function e(e){if(!(e>0&&e<1/0))throw typeof e!=`number`&&typeof e!=`bigint`?TypeError(`sleep: ms must be a number`):RangeError(`sleep: ms must be a number that is greater than 0 but less than Infinity`);let t=Date.now()+Number(e);for(;t>Date.now(););}t.exports=e}})),ve=/* @__PURE__ */ n(((e,t)=>{let n=a(`fs`),r=a(`events`),i=a(`util`).inherits,o=a(`path`),s=_e(),c=a(`assert`),l=Buffer.allocUnsafe(0),u=`buffer`,d=`utf8`,[f,p]=(process.versions.node||`0.0`).split(`.`).map(Number),m=f>=22&&p>=7;function h(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&&process.nextTick(()=>t.emit(`drain`)))}let i=t.append?`a`:`w`,a=t.mode;if(t.sync)try{t.mkdir&&n.mkdirSync(o.dirname(e),{recursive:!0}),r(null,n.openSync(e,i,a))}catch(e){throw r(e),e}else t.mkdir?n.mkdir(o.dirname(e),{recursive:!0},t=>{if(t)return r(t);n.open(e,i,a,r)}):n.open(e,i,a,r)}function g(e){if(!(this instanceof g))return new g(e);let{fd:t,dest:r,minLength:i,maxLength:a,maxWrite:o,periodicFlush:c,sync:f,append:p=!0,mkdir:m,retryEAGAIN:y,fsync:S,contentMode:k,mode:te}=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=!1,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=c||0,this._periodicFlushTimer=void 0,this.sync=f||!1,this.writable=!0,this._fsync=S||!1,this.append=p||!1,this.mode=te,this.retryEAGAIN=y||(()=>!0),this.mkdir=m||!1;let A,ne;if(k===u)this._writingBuf=l,this.write=x,this.flush=w,this.flushSync=E,this._actualWrite=O,A=()=>n.writeSync(this.fd,this._writingBuf),ne=()=>n.write(this.fd,this._writingBuf,this.release);else if(k===void 0||k===d)this._writingBuf=``,this.write=b,this.flush=C,this.flushSync=T,this._actualWrite=D,A=()=>Buffer.isBuffer(this._writingBuf)?n.writeSync(this.fd,this._writingBuf):n.writeSync(this.fd,this._writingBuf,`utf8`),ne=()=>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 "${d}" and "${u}", but passed ${k}`);if(typeof t==`number`)this.fd=t,process.nextTick(()=>this.emit(`ready`));else if(typeof t==`string`)h(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){if((e.code===`EAGAIN`||e.code===`EBUSY`)&&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 setTimeout(ne,100)}else this._writing=!1,this.emit(`error`,e);return}this.emit(`write`,t);let r=_(this._writingBuf,this._len,t);if(this._len=r.len,this._writingBuf=r.writingBuf,this._writingBuf.length){if(!this.sync){ne();return}try{do{let e=A(),t=_(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>this.minLength?this._actualWrite():this._ending?i>0?this._actualWrite():(this._writing=!1,ee(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(v,this)):this.emit(`drain`))},this.on(`newListener`,function(e){e===`drain`&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function _(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 v(e){e.listenerCount(`drain`)>0&&(e._asyncDrainScheduled=!1,e.emit(`drain`))}i(g,r);function y(e,t){return e.length===0?l:e.length===1?e[0]:Buffer.concat(e,t)}function b(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 x(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 S(e){this._flushPending=!0;let t=()=>{if(this._fsync)this._flushPending=!1,e();else try{n.fsync(this.fd,t=>{this._flushPending=!1,e(t)})}catch(t){e(t)}this.off(`error`,r)},r=n=>{this._flushPending=!1,e(n),this.off(`drain`,t)};this.once(`drain`,t),this.once(`error`,r)}function C(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?e?.():(e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&this._bufs.push(``),this._actualWrite()))}function w(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?e?.():(e&&S.call(this,e),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite()))}g.prototype.reopen=function(e){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this._opening){this.once(`ready`,()=>{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)})}),h(this.file,this)},g.prototype.end=function(){if(this.destroyed)throw Error(`SonicBoom destroyed`);this._opening?this.once(`ready`,()=>{this.end()}):this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():ee(this)))};function T(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf=``);let e=``;for(;this._bufs.length||e.length;){e.length<=0&&(e=this._bufs[0]);try{let t=Buffer.isBuffer(e)?n.writeSync(this.fd,e):n.writeSync(this.fd,e,`utf8`),r=_(e,this._len,t);e=r.writingBuf,this._len=r.len,e.length<=0&&this._bufs.shift()}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}try{n.fsyncSync(this.fd)}catch{}}function E(){if(this.destroyed)throw Error(`SonicBoom destroyed`);if(this.fd<0)throw Error(`sonic boom is not ready yet`);!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=l);let e=l;for(;this._bufs.length||e.length;){e.length<=0&&(e=y(this._bufs[0],this._lens[0]));try{let t=n.writeSync(this.fd,e);e=e.subarray(t),this._len=Math.max(this._len-t,0),e.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code===`EAGAIN`||t.code===`EBUSY`)&&!this.retryEAGAIN(t,e.length,this._len-e.length))throw t;s(100)}}}g.prototype.destroy=function(){this.destroyed||ee(this)};function D(){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 O(){let e=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:y(this._bufs.shift(),this._lens.shift()),this.sync)try{e(null,n.writeSync(this.fd,this._writingBuf))}catch(t){e(t)}else m&&(this._writingBuf=Buffer.from(this._writingBuf)),n.write(this.fd,this._writingBuf,e)}function ee(e){if(e.fd===-1){e.once(`ready`,ee.bind(null,e));return}e._periodicFlushTimer!==void 0&&clearInterval(e._periodicFlushTimer),e.destroyed=!0,e._bufs=[],e._lens=[],c(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`))}}g.SonicBoom=g,g.default=g,t.exports=g})),ye=/* @__PURE__ */ n(((e,t)=>{let n={exit:[],beforeExit:[]},r={exit:c,beforeExit:l},i;function a(){i===void 0&&(i=new FinalizationRegistry(d))}function o(e){n[e].length>0||process.on(e,r[e])}function s(e){n[e].length>0||(process.removeListener(e,r[e]),n.exit.length===0&&n.beforeExit.length===0&&(i=void 0))}function c(){u(`exit`)}function l(){u(`beforeExit`)}function u(e){for(let t of n[e]){let n=t.deref(),r=t.fn;
5
5
  /* istanbul ignore else */
6
- n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),be=/* @__PURE__ */ n(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},repository:{type:`git`,url:`git+https://github.com/mcollina/thread-stream.git`},keywords:[`worker`,`thread`,`threads`,`stream`],author:`Matteo Collina <hello@matteocollina.com>`,license:`MIT`,bugs:{url:`https://github.com/mcollina/thread-stream/issues`},homepage:`https://github.com/mcollina/thread-stream#readme`}})),xe=/* @__PURE__ */ n(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{if(e===`ok`){a(null,`ok`);return}s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),Se=/* @__PURE__ */ n(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),Ce=/* @__PURE__ */ n(((e,t)=>{let{version:n}=be(),{EventEmitter:r}=a(`events`),{Worker:i}=a(`worker_threads`),{join:o}=a(`path`),{pathToFileURL:s}=a(`url`),{wait:c}=xe(),{WRITE_INDEX:l,READ_INDEX:u,SEQ_INDEX:d}=Se(),f=a(`buffer`),p=a(`assert`),m=Symbol(`kImpl`),h=f.constants.MAX_STRING_LENGTH;function g(){}function _(e,t){Atomics.add(e[m].state,d,1),t(),Atomics.add(e[m].state,d,1),Atomics.notify(e[m].state,d)}function v(e){_(e,()=>{Atomics.store(e[m].state,u,0),Atomics.store(e[m].state,l,0)})}var y=class{constructor(e){this._value=e}deref(){return this._value}},b=class{register(){}unregister(){}};let x=process.env.NODE_V8_COVERAGE?b:global.FinalizationRegistry||b,S=process.env.NODE_V8_COVERAGE?y:global.WeakRef||y,C=new x(e=>{e.exited||e.terminate()});function w(e,t){let{filename:r,workerData:a}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||o(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:s(r).href,dataBuf:e[m].dataBuf,stateBuf:e[m].stateBuf,workerData:{$context:{threadStreamVersion:n},...a}}});return l.stream=new y(e),l.on(`message`,D),l.on(`exit`,O),C.register(e,l),l}function T(e){p(!e[m].sync),e[m].needDrain&&(e[m].needDrain=!1,e.emit(`drain`))}function E(e){for(;;){let t=Atomics.load(e[m].state,l),n=e[m].data.length-t;if(n>0){if(e[m].bufLen===0){e[m].flushing=!1,e[m].ending?j(e):e[m].needDrain&&process.nextTick(T,e);return}ae(e,n,g);continue}if(n===0){if(t===0&&e[m].bufLen===0)return;te(e,()=>{e.destroyed||(v(e),E(e))});return}ie(e,/* @__PURE__ */ Error(`overwritten`));return}}function D(e){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(e?.code!=null)switch(e.code){case`READY`:this.stream=new S(t),te(t,()=>{t[m].ready=!0,t.emit(`ready`)});break;case`ERROR`:ie(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){ie(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[m].flushCallbacks.get(e.id);n&&(t[m].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:ie(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function O(e){let t=this.stream.deref();t!==void 0&&(C.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,O),ie(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var ee=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[m]={},this[m].stateBuf=new SharedArrayBuffer(128),this[m].state=new Int32Array(this[m].stateBuf),this[m].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[m].data=Buffer.from(this[m].dataBuf),this[m].sync=e.sync||!1,this[m].ending=!1,this[m].ended=!1,this[m].needDrain=!1,this[m].destroyed=!1,this[m].flushing=!1,this[m].ready=!1,this[m].finished=!1,this[m].errored=null,this[m].closed=!1,this[m].buf=[],this[m].bufHead=0,this[m].bufLen=0,this[m].flushCallbacks=/* @__PURE__ */ new Map,this[m].nextFlushId=0,this.worker=w(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[m].destroyed)return re(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[m].ending)return re(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[m].flushing&&this[m].bufLen+t.length>=h)try{M(this),this[m].flushing=!0}catch(e){return ie(this,e),!1}if(this[m].buf.push(t),this[m].bufLen+=t.length,this[m].sync)try{return M(this),!0}catch(e){return ie(this,e),!1}return this[m].flushing||(this[m].flushing=!0,setImmediate(E,this)),this[m].needDrain=this[m].data.length-this[m].bufLen-Atomics.load(this[m].state,l)<=0,!this[m].needDrain}end(){this[m].destroyed||(this[m].ending=!0,j(this))}flush(e){e=typeof e==`function`?e:g,k(this,t=>{if(t){process.nextTick(e,t);return}A(this,e)})}flushSync(){this[m].destroyed||(M(this),N(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[m].ready}get destroyed(){return this[m].destroyed}get closed(){return this[m].closed}get writable(){return!this[m].destroyed&&!this[m].ending}get writableEnded(){return this[m].ending}get writableFinished(){return this[m].finished}get writableNeedDrain(){return this[m].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[m].errored}};function k(e,t){if(e[m].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[m].sync&&(e[m].flushing||e[m].bufLen>0)){setImmediate(k,e,t);return}te(e,t)}function te(e,t){let n=Atomics.load(e[m].state,l);c(e[m].state,u,n,1/0,(n,r)=>{if(n){ie(e,n),t(n);return}if(r!==`ok`){te(e,t);return}t()})}function A(e,t){if(e[m].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[m].ready){let n=()=>{i(),A(e,t)},r=()=>{i(),process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[m].nextFlushId;e[m].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[m].flushCallbacks.delete(n),ie(e,r),process.nextTick(t,r)}}function ne(e,t){let n=e[m].flushCallbacks;if(n.size===0)return;let r=t||/* @__PURE__ */ Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function re(e,t){setImmediate(()=>{e.emit(`error`,t)})}function ie(e,t){e[m].destroyed||(e[m].destroyed=!0,ne(e,t),t&&(e[m].errored=t,re(e,t)),e.worker.exited?setImmediate(()=>{e[m].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[m].closed=!0,e.emit(`close`)}))}function ae(e,t,n){let r=Atomics.load(e[m].state,l),i=t;for(;i>0&&e[m].bufLen!==0;){let t=e[m].bufHead,n=e[m].buf[t];if(n.length<=i){n.copy(e[m].data,r),r+=n.length,i-=n.length,e[m].bufLen-=n.length,e[m].bufHead=t+1,e[m].bufHead===e[m].buf.length?(e[m].buf.length=0,e[m].bufHead=0):e[m].bufHead>=1024&&e[m].bufHead*2>=e[m].buf.length&&(e[m].buf.splice(0,e[m].bufHead),e[m].bufHead=0);continue}n.copy(e[m].data,r,0,i),e[m].buf[t]=n.subarray(i),e[m].bufLen-=i,r+=i,i=0}return _(e,()=>{Atomics.store(e[m].state,l,r)}),n(),!0}function j(e){if(!(e[m].ended||!e[m].ending||e[m].flushing)){e[m].ended=!0;try{e.flushSync();let t=Atomics.load(e[m].state,u);_(e,()=>{Atomics.store(e[m].state,l,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[m].state,u,t,1e3),t=Atomics.load(e[m].state,u),t===-2){ie(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){ie(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[m].finished=!0,e.emit(`finish`)})}catch(t){ie(e,t)}}}function M(e){let t=()=>{e[m].ending?j(e):e[m].needDrain&&process.nextTick(T,e)};for(e[m].flushing=!1;e[m].bufLen!==0;){let n=Atomics.load(e[m].state,l),r=e[m].data.length-n;if(r===0){N(e),v(e);continue}if(r<0)throw Error(`overwritten`);ae(e,r,t)}}function N(e){if(e[m].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[m].state,l),n=0;for(;;){let r=Atomics.load(e[m].state,u);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[m].state,u,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=ee})),we=/* @__PURE__ */ n(((e,t)=>{let{createRequire:n}=a(`module`),{existsSync:r}=a(`node:fs`),i=fe(),{join:o,isAbsolute:s,sep:c}=a(`node:path`),{fileURLToPath:l}=a(`node:url`),u=_e(),d=ye(),f=Ce(),{transportUsesMultistreamSym:p}=pe();function m(e){d.register(e,b),d.registerBeforeExit(e,x),e.on(`close`,function(){d.unregister(e)})}function h(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function g(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&_(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++);continue}if((i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&_(i.slice(i.indexOf(`=`)+1))){r=!0;continue}n.push(i)}return r?n.join(` `):e}function _(e){let t=v(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=l(n)}catch{return!1}return s(n)&&!r(n)}function v(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function y(e,t,n,r,i){if(!n.execArgv&&h()&&a.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=g(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let o=new f({filename:e,workerData:t,workerOpts:n,sync:r});o.on(`ready`,s),o.on(`close`,function(){process.removeListener(`exit`,c)}),process.on(`exit`,c);function s(){process.removeListener(`exit`,c),o.unref(),n.autoEnd!==!1&&m(o)}function c(){
6
+ n!==void 0&&r(n,e)}n[e]=[]}function d(e){for(let t of[`exit`,`beforeExit`]){let r=n[t].indexOf(e);n[t].splice(r,r+1),s(t)}}function f(e,t,r){if(t===void 0)throw Error(`the object can't be undefined`);o(e);let s=new WeakRef(t);s.fn=r,a(),i.register(t,s),n[e].push(s)}function p(e,t){f(`exit`,e,t)}function m(e,t){f(`beforeExit`,e,t)}function h(e){if(i!==void 0){i.unregister(e);for(let t of[`exit`,`beforeExit`])n[t]=n[t].filter(t=>{let n=t.deref();return n&&n!==e}),s(t)}}t.exports={register:p,registerBeforeExit:m,unregister:h}})),be=/* @__PURE__ */ n(((e,t)=>{t.exports={name:`thread-stream`,version:`4.2.0`,description:`A streaming way to send data to a Node.js Worker Thread`,main:`index.js`,types:`index.d.ts`,engines:{node:`>=20`},dependencies:{"real-require":`^1.0.0`},devDependencies:{"@types/node":`^25.0.2`,"@yao-pkg/pkg":`^6.0.0`,borp:`^1.0.0`,desm:`^1.3.0`,eslint:`^9.39.1`,fastbench:`^1.0.1`,neostandard:`^0.13.0`,"pino-elasticsearch":`^9.0.0`,"sonic-boom":`^5.0.0`,"ts-node":`^10.8.0`,typescript:`~5.7.3`},scripts:{build:`tsc --noEmit`,lint:`eslint`,test:`npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:ci":`npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"`,"test:yarn":`npm run transpile && borp --pattern "test/*.test.js"`,transpile:`sh ./test/ts/transpile.sh`},repository:{type:`git`,url:`git+https://github.com/mcollina/thread-stream.git`},keywords:[`worker`,`thread`,`threads`,`stream`],author:`Matteo Collina <hello@matteocollina.com>`,license:`MIT`,bugs:{url:`https://github.com/mcollina/thread-stream/issues`},homepage:`https://github.com/mcollina/thread-stream#readme`}})),xe=/* @__PURE__ */ n(((e,t)=>{let n=1e4;function r(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{let i=Atomics.load(e,t);if(i===r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let c=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),l=Atomics.waitAsync(e,t,i,c);l.async?l.value.then(s):setImmediate(s)};s()}function i(e,t,r,i,a){let o=i===1/0?1/0:Date.now()+i,s=()=>{if(Atomics.load(e,t)!==r){a(null,`ok`);return}if(o!==1/0&&Date.now()>o){a(null,`timed-out`);return}let i=o===1/0?n:Math.min(n,Math.max(1,o-Date.now())),c=Atomics.waitAsync(e,t,r,i);c.async?c.value.then(e=>{e===`ok`?a(null,`ok`):s()}):setImmediate(s)};s()}t.exports={wait:r,waitDiff:i}})),Se=/* @__PURE__ */ n(((e,t)=>{t.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}})),Ce=/* @__PURE__ */ n(((e,t)=>{let{version:n}=be(),{EventEmitter:r}=a(`events`),{Worker:i}=a(`worker_threads`),{join:o}=a(`path`),{pathToFileURL:s}=a(`url`),{wait:c}=xe(),{WRITE_INDEX:l,READ_INDEX:u,SEQ_INDEX:d}=Se(),f=a(`buffer`),p=a(`assert`),m=Symbol(`kImpl`),h=f.constants.MAX_STRING_LENGTH;function g(){}function _(e,t){Atomics.add(e[m].state,d,1),t(),Atomics.add(e[m].state,d,1),Atomics.notify(e[m].state,d)}function v(e){_(e,()=>{Atomics.store(e[m].state,u,0),Atomics.store(e[m].state,l,0)})}var y=class{constructor(e){this._value=e}deref(){return this._value}},b=class{register(){}unregister(){}};let x=process.env.NODE_V8_COVERAGE?b:global.FinalizationRegistry||b,S=process.env.NODE_V8_COVERAGE?y:global.WeakRef||y,C=new x(e=>{e.exited||e.terminate()});function w(e,t){let{filename:r,workerData:a}=t,c=(`__bundlerPathsOverrides`in globalThis?globalThis.__bundlerPathsOverrides:{})[`thread-stream-worker`]||o(__dirname,`lib`,`worker.js`),l=new i(c,{...t.workerOpts,name:t.workerOpts?.name||`thread-stream`,trackUnmanagedFds:!1,workerData:{filename:r.indexOf(`file://`)===0?r:s(r).href,dataBuf:e[m].dataBuf,stateBuf:e[m].stateBuf,workerData:{$context:{threadStreamVersion:n},...a}}});return l.stream=new y(e),l.on(`message`,D),l.on(`exit`,O),C.register(e,l),l}function T(e){p(!e[m].sync),e[m].needDrain&&(e[m].needDrain=!1,e.emit(`drain`))}function E(e){for(;;){let t=Atomics.load(e[m].state,l),n=e[m].data.length-t;if(n>0){if(e[m].bufLen===0){e[m].flushing=!1,e[m].ending?j(e):e[m].needDrain&&process.nextTick(T,e);return}ae(e,n,g)}else{if(n===0){if(t===0&&e[m].bufLen===0)return;te(e,()=>{e.destroyed||(v(e),E(e))});return}ie(e,/* @__PURE__ */ Error(`overwritten`));return}}}function D(e){let t=this.stream.deref();if(t===void 0)this.exited=!0,this.terminate();else if(e?.code!=null)switch(e.code){case`READY`:this.stream=new S(t),te(t,()=>{t[m].ready=!0,t.emit(`ready`)});break;case`ERROR`:ie(t,e.err);break;case`EVENT`:Array.isArray(e.args)?t.emit(e.name,...e.args):t.emit(e.name,e.args);break;case`FLUSHED`:{if(e.context!==`thread-stream`){ie(t,/* @__PURE__ */ Error(`this should not happen: `+e.code));break}let n=t[m].flushCallbacks.get(e.id);n&&(t[m].flushCallbacks.delete(e.id),process.nextTick(n));break}case`WARNING`:process.emitWarning(e.err);break;default:ie(t,/* @__PURE__ */ Error(`this should not happen: `+e.code))}}function O(e){let t=this.stream.deref();t!==void 0&&(C.unregister(t),t.worker.exited=!0,t.worker.off(`exit`,O),ie(t,e===0?null:/* @__PURE__ */ Error(`the worker thread exited`)))}var ee=class extends r{constructor(e={}){if(super(),e.bufferSize<4)throw Error(`bufferSize must at least fit a 4-byte utf-8 char`);this[m]={},this[m].stateBuf=new SharedArrayBuffer(128),this[m].state=new Int32Array(this[m].stateBuf),this[m].dataBuf=new SharedArrayBuffer(e.bufferSize||4194304),this[m].data=Buffer.from(this[m].dataBuf),this[m].sync=e.sync||!1,this[m].ending=!1,this[m].ended=!1,this[m].needDrain=!1,this[m].destroyed=!1,this[m].flushing=!1,this[m].ready=!1,this[m].finished=!1,this[m].errored=null,this[m].closed=!1,this[m].buf=[],this[m].bufHead=0,this[m].bufLen=0,this[m].flushCallbacks=/* @__PURE__ */ new Map,this[m].nextFlushId=0,this.worker=w(this,e),this.on(`message`,(e,t)=>{this.worker.postMessage(e,t)})}write(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[m].destroyed)return re(this,/* @__PURE__ */ Error(`the worker has exited`)),!1;if(this[m].ending)return re(this,/* @__PURE__ */ Error(`the worker is ending`)),!1;if(this[m].flushing&&this[m].bufLen+t.length>=h)try{M(this),this[m].flushing=!0}catch(e){return ie(this,e),!1}if(this[m].buf.push(t),this[m].bufLen+=t.length,this[m].sync)try{return M(this),!0}catch(e){return ie(this,e),!1}return this[m].flushing||(this[m].flushing=!0,setImmediate(E,this)),this[m].needDrain=this[m].data.length-this[m].bufLen-Atomics.load(this[m].state,l)<=0,!this[m].needDrain}end(){this[m].destroyed||(this[m].ending=!0,j(this))}flush(e){e=typeof e==`function`?e:g,k(this,t=>{t?process.nextTick(e,t):A(this,e)})}flushSync(){this[m].destroyed||(M(this),N(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[m].ready}get destroyed(){return this[m].destroyed}get closed(){return this[m].closed}get writable(){return!this[m].destroyed&&!this[m].ending}get writableEnded(){return this[m].ending}get writableFinished(){return this[m].finished}get writableNeedDrain(){return this[m].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[m].errored}};function k(e,t){e[m].destroyed?process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`)):!e[m].sync&&(e[m].flushing||e[m].bufLen>0)?setImmediate(k,e,t):te(e,t)}function te(e,t){let n=Atomics.load(e[m].state,l);c(e[m].state,u,n,1/0,(n,r)=>{n?(ie(e,n),t(n)):r===`ok`?t():te(e,t)})}function A(e,t){if(e[m].destroyed){process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`));return}if(!e[m].ready){let n=()=>{i(),A(e,t)},r=()=>{i(),process.nextTick(t,/* @__PURE__ */ Error(`the worker has exited`))},i=()=>{e.off(`ready`,n),e.off(`close`,r)};e.once(`ready`,n),e.once(`close`,r);return}let n=++e[m].nextFlushId;e[m].flushCallbacks.set(n,t);try{e.worker.postMessage({code:`FLUSH`,context:`thread-stream`,id:n})}catch(r){e[m].flushCallbacks.delete(n),ie(e,r),process.nextTick(t,r)}}function ne(e,t){let n=e[m].flushCallbacks;if(n.size===0)return;let r=t||/* @__PURE__ */ Error(`the worker has exited`);for(let e of n.values())process.nextTick(e,r);n.clear()}function re(e,t){setImmediate(()=>{e.emit(`error`,t)})}function ie(e,t){e[m].destroyed||(e[m].destroyed=!0,ne(e,t),t&&(e[m].errored=t,re(e,t)),e.worker.exited?setImmediate(()=>{e[m].closed=!0,e.emit(`close`)}):e.worker.terminate().catch(()=>{}).then(()=>{e[m].closed=!0,e.emit(`close`)}))}function ae(e,t,n){let r=Atomics.load(e[m].state,l),i=t;for(;i>0&&e[m].bufLen!==0;){let t=e[m].bufHead,n=e[m].buf[t];n.length<=i?(n.copy(e[m].data,r),r+=n.length,i-=n.length,e[m].bufLen-=n.length,e[m].bufHead=t+1,e[m].bufHead===e[m].buf.length?(e[m].buf.length=0,e[m].bufHead=0):e[m].bufHead>=1024&&e[m].bufHead*2>=e[m].buf.length&&(e[m].buf.splice(0,e[m].bufHead),e[m].bufHead=0)):(n.copy(e[m].data,r,0,i),e[m].buf[t]=n.subarray(i),e[m].bufLen-=i,r+=i,i=0)}return _(e,()=>{Atomics.store(e[m].state,l,r)}),n(),!0}function j(e){if(!(e[m].ended||!e[m].ending||e[m].flushing)){e[m].ended=!0;try{e.flushSync();let t=Atomics.load(e[m].state,u);_(e,()=>{Atomics.store(e[m].state,l,-1)});let n=0;for(;t!==-1;){if(Atomics.wait(e[m].state,u,t,1e3),t=Atomics.load(e[m].state,u),t===-2){ie(e,/* @__PURE__ */ Error(`end() failed`));return}if(++n===10){ie(e,/* @__PURE__ */ Error(`end() took too long (10s)`));return}}process.nextTick(()=>{e[m].finished=!0,e.emit(`finish`)})}catch(t){ie(e,t)}}}function M(e){let t=()=>{e[m].ending?j(e):e[m].needDrain&&process.nextTick(T,e)};for(e[m].flushing=!1;e[m].bufLen!==0;){let n=Atomics.load(e[m].state,l),r=e[m].data.length-n;if(r===0)N(e),v(e);else{if(r<0)throw Error(`overwritten`);ae(e,r,t)}}}function N(e){if(e[m].flushing)throw Error(`unable to flush while flushing`);let t=Atomics.load(e[m].state,l),n=0;for(;;){let r=Atomics.load(e[m].state,u);if(r===-2)throw Error(`_flushSync failed`);if(r!==t)Atomics.wait(e[m].state,u,r,1e3);else break;if(++n===10)throw Error(`_flushSync took too long (10s)`)}}t.exports=ee})),we=/* @__PURE__ */ n(((e,t)=>{let{createRequire:n}=a(`module`),{existsSync:r}=a(`node:fs`),i=fe(),{join:o,isAbsolute:s,sep:c}=a(`node:path`),{fileURLToPath:l}=a(`node:url`),u=_e(),d=ye(),f=Ce(),{transportUsesMultistreamSym:p}=pe();function m(e){d.register(e,b),d.registerBeforeExit(e,x),e.on(`close`,function(){d.unregister(e)})}function h(){let e=process.execArgv;for(let t=0;t<e.length;t++){let n=e[t];if(n===`--import`||n===`--require`||n===`-r`||n.startsWith(`--import=`)||n.startsWith(`--require=`)||n.startsWith(`-r=`))return!0}return!1}function g(e){let t=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!t)return e;let n=[],r=!1;for(let e=0;e<t.length;e++){let i=t[e];if(i===`--require`||i===`-r`||i===`--import`){let a=t[e+1];if(a&&_(a)){r=!0,e++;continue}n.push(i),a&&(n.push(a),e++)}else(i.startsWith(`--require=`)||i.startsWith(`-r=`)||i.startsWith(`--import=`))&&_(i.slice(i.indexOf(`=`)+1))?r=!0:n.push(i)}return r?n.join(` `):e}function _(e){let t=v(e);if(!t)return!1;let n=t;if(n.startsWith(`file://`))try{n=l(n)}catch{return!1}return s(n)&&!r(n)}function v(e){let t=e[0],n=e[e.length-1];return t===`"`&&n===`"`||t===`'`&&n===`'`?e.slice(1,-1):e}function y(e,t,n,r,i){if(!n.execArgv&&h()&&a.main===void 0&&(n={...n,execArgv:[]}),!n.env&&process.env.NODE_OPTIONS){let e=g(process.env.NODE_OPTIONS);e!==process.env.NODE_OPTIONS&&(n={...n,env:{...process.env,NODE_OPTIONS:e}})}n={...n,name:i};let o=new f({filename:e,workerData:t,workerOpts:n,sync:r});o.on(`ready`,s),o.on(`close`,function(){process.removeListener(`exit`,c)}),process.on(`exit`,c);function s(){process.removeListener(`exit`,c),o.unref(),n.autoEnd!==!1&&m(o)}function c(){
7
7
  /* istanbul ignore next */
8
8
  o.closed||(o.flushSync(),u(100),o.end())}return o}function b(e){e.ref(),e.flushSync(),e.end(),e.once(`close`,function(){e.unref()})}function x(e){e.flushSync()}function S(e){let{pipeline:t,targets:r,levels:a,dedupe:l,worker:u={},caller:d=i(),sync:f=!1}=e,m={...e.options},h=!1,g=typeof d==`string`?[d]:d,_=typeof globalThis==`object`&&Object.prototype.hasOwnProperty.call(globalThis,`__bundlerPathsOverrides`)&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides==`object`?globalThis.__bundlerPathsOverrides:Object.create(null),v=e.target;if(v&&r)throw Error(`only one of target or targets can be specified`);if(r){v=_[`pino-worker`]||o(__dirname,`worker.js`),m.targets=r.filter(e=>e.target).map(e=>({...e,target:S(e.target)})),m.pipelines=r.filter(e=>e.pipeline).map(e=>e.pipeline.map(t=>({...t,level:e.level,target:S(t.target)})));let e=m.targets.some(e=>e.level!=null),t=m.pipelines.some(e=>e.some(e=>e.level!=null));h=m.targets.length+m.pipelines.length>1||e||t}else t&&(v=_[`pino-worker`]||o(__dirname,`worker.js`),m.pipelines=[t.map(e=>({...e,target:S(e.target)}))]);a&&(m.levels=a),l&&(m.dedupe=l),m.pinoWillSendConfig=!0;let b=r||t?`pino.transport`:v,x=y(S(v),m,u,f,b);return h&&(x[p]=!0),x;function S(e){if(e=_[e]||e,s(e)||e.indexOf(`file://`)===0)return e;if(e===`pino/file`)return o(__dirname,`..`,`file.js`);let t;for(let r of g)try{let i=r===`node:repl`?process.cwd()+c:r;t=n(i).resolve(e);break}catch{continue}if(!t)throw Error(`unable to determine transport target for "${e}"`);return t}}t.exports=S})),Te=/* @__PURE__ */ n(((e,t)=>{let n=a(`node:diagnostics_channel`),r=ge(),{mapHttpRequest:i,mapHttpResponse:o}=de(),s=ve(),c=ye(),{lsCacheSym:l,chindingsSym:u,writeSym:d,serializersSym:f,formatOptsSym:p,endSym:m,stringifiersSym:h,stringifySym:g,stringifySafeSym:_,wildcardFirstSym:v,nestedKeySym:y,formattersSym:b,messageKeySym:x,errorKeySym:S,nestedKeyStrSym:C,msgPrefixSym:w}=pe(),{isMainThread:T}=a(`worker_threads`),E=we(),[D]=process.versions.node.split(`.`).map(e=>Number(e)),O=n.tracingChannel(`pino_asJson`),ee=D>=25?e=>JSON.stringify(e):A;function k(){}function te(e,t){return t?function(...r){t.call(this,r,n,e)}:n;function n(t,...n){if(typeof t==`object`){let a=t;t!==null&&(t.method&&t.headers&&t.socket?t=i(t):typeof t.setHeader==`function`&&(t=o(t)));let s;a===null&&n.length===0?s=[null]:(a=n.shift(),s=n),typeof this[w]==`string`&&a!=null&&(a=this[w]+a),this[d](t,r(a,s,this[p]),e)}else{let i=t===void 0?n.shift():t;typeof this[w]==`string`&&i!=null&&(i=this[w]+i),this[d](null,r(i,n,this[p]),e)}}}function A(e){let t=``,n=0,r=!1,i=255,a=e.length;if(a>100)return JSON.stringify(e);for(var o=0;o<a&&i>=32;o++)i=e.charCodeAt(o),(i===34||i===92)&&(t+=e.slice(n,o)+`\\`,n=o,r=!0);return r?t+=e.slice(n):t=e,i<32?JSON.stringify(e):`"`+t+`"`}function ne(e,t,n,r){if(O.hasSubscribers===!1)return re.call(this,e,t,n,r);let i={instance:this,arguments};return O.traceSync(re,i,this,e,t,n,r)}function re(e,t,n,r){let i=this[g],a=this[_],o=this[h],s=this[m],c=this[u],d=this[f],p=this[b],w=this[x],T=this[S],E=this[l][n]+r;E+=c;let D;p.log&&(e=p.log(e));let O=o[v],k=``;for(let t in e)if(D=e[t],Object.prototype.hasOwnProperty.call(e,t)&&D!==void 0){d[t]?D=d[t](D):t===T&&d.err&&(D=d.err(D));let e=o[t]||O;switch(typeof D){case`undefined`:case`function`:continue;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D));break;case`string`:D=(e||ee)(D);break;default:D=(e||i)(D,a)}if(D===void 0)continue;let n=ee(t);k+=`,`+n+`:`+D}let te=``;if(t!==void 0){D=d[w]?d[w](t):t;let e=o[w]||O;switch(typeof D){case`function`:break;case`number`:Number.isFinite(D)===!1&&(D=null);case`boolean`:e&&(D=e(D)),te=`,"`+w+`":`+D;break;case`string`:D=(e||ee)(D),te=`,"`+w+`":`+D;break;default:D=(e||i)(D,a),te=`,"`+w+`":`+D}}return this[y]&&k?E+this[C]+k.slice(1)+`}`+te+s:E+k+te+s}function ie(e,t){let n,r=e[u],i=e[g],a=e[_],o=e[h],s=o[v],c=e[f],l=e[b].bindings;t=l(t);for(let e in t)if(n=t[e],((e.length<5||e!==`level`&&e!==`serializers`&&e!==`formatters`&&e!==`customLevels`)&&t.hasOwnProperty(e)&&n!==void 0)===!0){if(n=c[e]?c[e](n):n,n=(o[e]||s||i)(n,a),n===void 0)continue;r+=`,`+ee(e)+`:`+n}return r}function ae(e){return e.write!==e.constructor.prototype.write}function j(e){let t=new s(e);return t.on(`error`,n),!e.sync&&T&&(c.register(t,M),t.on(`close`,function(){c.unregister(t)})),t;function n(e){
9
9
  /* istanbul ignore next */
10
- if(e.code===`EPIPE`){t.write=k,t.end=k,t.flushSync=k,t.destroy=k;return}t.removeListener(`error`,n),t.emit(`error`,e)}}function M(e,t){
10
+ e.code===`EPIPE`?(t.write=k,t.end=k,t.flushSync=k,t.destroy=k):(t.removeListener(`error`,n),t.emit(`error`,e))}}function M(e,t){
11
11
  /* istanbul ignore next */
12
12
  e.destroyed||(t===`beforeExit`?(e.flush(),e.on(`drain`,function(){e.end()})):
13
13
  /* istanbul ignore next */
14
- e.flushSync())}function N(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 s||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof s||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=E({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:o}=r;return a===!1&&(r.level=`silent`),o||(r.onChild=k),i||=ae(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[_])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function P(e,t,n){return{level:e,bindings:t,log:n}}function F(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:ie,asJson:ne,genLog:te,createArgsNormalizer:N,stringify:oe,buildFormatters:P,normalizeDestFileDescriptor:F}})),Ee=/* @__PURE__ */ n(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),De=/* @__PURE__ */ n(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=pe(),{noop:l,genLog:u}=Te(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=Ee(),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){if(f(n[e],o)===!1){this[e]=l;continue}this[e]=_(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`);return}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}})),Oe=/* @__PURE__ */ n(((e,t)=>{t.exports={version:`10.4.0`}})),ke=/* @__PURE__ */ n(((e,t)=>{let{EventEmitter:n}=a(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:o,getLevelSym:s,chindingsSym:c,mixinSym:l,asJsonSym:u,writeSym:d,mixinMergeStrategySym:f,timeSym:p,timeSliceIndexSym:m,streamSym:h,serializersSym:g,formattersSym:_,errorKeySym:v,messageKeySym:y,useOnlyCustomLevelsSym:b,needsMetadataGsym:x,redactFmtSym:S,stringifySym:C,formatOptsSym:w,stringifiersSym:T,msgPrefixSym:E,hooksSym:D}=pe(),{getLevel:O,setLevel:ee,isLevelEnabled:k,mappings:te,initialLsCache:A,genLsCache:ne,assertNoLevelCollisions:re}=De(),{asChindings:ie,asJson:ae,buildFormatters:j,stringify:M,noop:N}=Te(),{version:oe}=Oe(),P=me(),F={constructor:class{},child:L,bindings:se,setBindings:ce,flush:ue,isLevelEnabled:k,version:oe,get level(){return this[s]()},set level(e){this[o](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[E]},get[Symbol.toStringTag](){return`Pino`},[r]:A,[d]:le,[u]:ae,[s]:O,[o]:ee};Object.setPrototypeOf(F,n.prototype),t.exports=function(){return Object.create(F)};let I=e=>e;function L(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[g],r=this[_],i=Object.create(this);if(t==null)return i[_].bindings!==I&&(i[_]=j(r.level,I,r.log)),i[c]=ie(i,e),this.onChild!==N&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[g]=Object.create(null);for(let e in n)i[g][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var a=0;a<e.length;a++){let t=e[a];i[g][t]=n[t]}for(let e in t.serializers)i[g][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var s=0;s<r.length;s++){let e=r[s];i[g][e]=t.serializers[e]}}else i[g]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[_]=j(e||r.level,n||I,a||r.log)}else i[_]=j(r.level,I,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(re(this.levels,t.customLevels),i.levels=te(t.customLevels,i[b]),ne(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=P(i.redact,M),n={stringify:e[S]};i[C]=M,i[T]=e,i[w]=n}if(typeof t.msgPrefix==`string`&&(i[E]=(this[E]||``)+t.msgPrefix),i[c]=ie(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[o](e)}return this.onChild(i),i}function se(){let e=`{${this[c].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function ce(e){let t=ie(this,e);this[c]=t}function R(e,t){return Object.assign(t,e)}function le(e,t,n){let r=this[p](),i=this[l],a=this[v],o=this[y],s=this[f]||R,c,d=this[D].streamWrite;e==null?c={}:e instanceof Error?(c={[a]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(c=s(c,i(c,n,this)));let g=this[u](c,t,n,r),_=this[h];_[x]===!0&&(_.lastLevel=n,_.lastObj=c,_.lastMsg=t,_.lastTime=r.slice(this[m]),_.lastLogger=this),_.write(d?d(g):g)}function ue(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[h];typeof t.flush==`function`?t.flush(e||N):e&&e()}})),Ae=/* @__PURE__ */ n(((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}})),je=/* @__PURE__ */ n(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=Ee(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[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:a};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||a)[this.lastLevel]:this.lastLevel,{streams:o}=this,u=0,d;for(let a=s(o.length,t.dedupe);l(a,o.length,t.dedupe);a=c(a,t.dedupe))if(r=o[a],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:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[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(o),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(o),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:a}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),Me=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=a(`node:os`),r=de(),i=fe(),o=me(),s=he(),c=ke(),l=pe(),{configure:u}=Ae(),{assertDefaultLevelFound:d,mappings:f,genLsCache:p,genLevelComparison:m,assertLevelComparison:h}=De(),{DEFAULT_LEVELS:g,SORTING_ORDER:_}=Ee(),{createArgsNormalizer:v,asChindings:y,buildSafeSonicBoom:b,buildFormatters:x,stringify:S,normalizeDestFileDescriptor:C,noop:w}=Te(),{version:T}=Oe(),{chindingsSym:E,redactFmtSym:D,serializersSym:O,timeSym:ee,timeSliceIndexSym:k,streamSym:te,stringifySym:A,stringifySafeSym:ne,stringifiersSym:re,setLevelSym:ie,endSym:ae,formatOptsSym:j,messageKeySym:M,errorKeySym:N,nestedKeySym:oe,mixinSym:P,levelCompSym:F,useOnlyCustomLevelsSym:I,formattersSym:L,hooksSym:se,nestedKeyStrSym:ce,mixinMergeStrategySym:R,msgPrefixSym:le,transportUsesMultistreamSym:ue}=l,{epochTime:z,nullTime:ge}=s,{pid:_e}=process,ve=n.hostname(),ye=r.err,be=v({level:`info`,levelComparison:_.ASC,levels:g,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:_e,hostname:ve},serializers:Object.assign(Object.create(null),{err:ye}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:z,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),xe=Object.assign(Object.create(null),r);function Se(...e){let t={},{opts:n,stream:r}=be(t,i(),...e);n.level&&typeof n.level==`string`&&g[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:a,crlf:s,serializers:l,timestamp:_,messageKey:v,errorKey:b,nestedKey:C,base:T,name:de,level:fe,customLevels:pe,levelComparison:me,mixin:he,mixinMergeStrategy:_e,useOnlyCustomLevels:ve,formatters:ye,hooks:xe,depthLimit:Se,edgeLimit:Ce,onChild:we,msgPrefix:Te}=n,Ee=u({maximumDepth:Se,maximumBreadth:Ce}),De=x(ye.level,ye.bindings,ye.log),Oe=S.bind({[ne]:Ee}),ke=a?Object.assign(Object.create(null),o(a,Oe)):Object.create(null),Ae=a?{stringify:ke[D]}:{stringify:Oe},je=`}`+(s?`\r
14
+ e.flushSync())}function N(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 s||r.writable||r._writableState)i=r,r={};else if(r.transport){if(r.transport instanceof s||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=E({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:o}=r;return a===!1&&(r.level=`silent`),o||(r.onChild=k),i||=ae(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[_])(e)}catch{return`"[unable to serialize, circular reference is too complex to analyze]"`}}}function P(e,t,n){return{level:e,bindings:t,log:n}}function F(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:ie,asJson:ne,genLog:te,createArgsNormalizer:N,stringify:oe,buildFormatters:P,normalizeDestFileDescriptor:F}})),Ee=/* @__PURE__ */ n(((e,t)=>{t.exports={DEFAULT_LEVELS:{trace:10,debug:20,info:30,warn:40,error:50,fatal:60},SORTING_ORDER:{ASC:`ASC`,DESC:`DESC`}}})),De=/* @__PURE__ */ n(((e,t)=>{let{lsCacheSym:n,levelValSym:r,useOnlyCustomLevelsSym:i,streamSym:a,formattersSym:o,hooksSym:s,levelCompSym:c}=pe(),{noop:l,genLog:u}=Te(),{DEFAULT_LEVELS:d,SORTING_ORDER:f}=Ee(),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}})),Oe=/* @__PURE__ */ n(((e,t)=>{t.exports={version:`10.4.0`}})),ke=/* @__PURE__ */ n(((e,t)=>{let{EventEmitter:n}=a(`node:events`),{lsCacheSym:r,levelValSym:i,setLevelSym:o,getLevelSym:s,chindingsSym:c,mixinSym:l,asJsonSym:u,writeSym:d,mixinMergeStrategySym:f,timeSym:p,timeSliceIndexSym:m,streamSym:h,serializersSym:g,formattersSym:_,errorKeySym:v,messageKeySym:y,useOnlyCustomLevelsSym:b,needsMetadataGsym:x,redactFmtSym:S,stringifySym:C,formatOptsSym:w,stringifiersSym:T,msgPrefixSym:E,hooksSym:D}=pe(),{getLevel:O,setLevel:ee,isLevelEnabled:k,mappings:te,initialLsCache:A,genLsCache:ne,assertNoLevelCollisions:re}=De(),{asChindings:ie,asJson:ae,buildFormatters:j,stringify:M,noop:N}=Te(),{version:oe}=Oe(),P=me(),F={constructor:class{},child:L,bindings:se,setBindings:ce,flush:ue,isLevelEnabled:k,version:oe,get level(){return this[s]()},set level(e){this[o](e)},get levelVal(){return this[i]},set levelVal(e){throw Error(`levelVal is read-only`)},get msgPrefix(){return this[E]},get[Symbol.toStringTag](){return`Pino`},[r]:A,[d]:le,[u]:ae,[s]:O,[o]:ee};Object.setPrototypeOf(F,n.prototype),t.exports=function(){return Object.create(F)};let I=e=>e;function L(e,t){if(!e)throw Error(`missing bindings for child Pino`);let n=this[g],r=this[_],i=Object.create(this);if(t==null)return i[_].bindings!==I&&(i[_]=j(r.level,I,r.log)),i[c]=ie(i,e),this.onChild!==N&&this.onChild(i),i;if(t.hasOwnProperty(`serializers`)===!0){i[g]=Object.create(null);for(let e in n)i[g][e]=n[e];let e=Object.getOwnPropertySymbols(n);for(var a=0;a<e.length;a++){let t=e[a];i[g][t]=n[t]}for(let e in t.serializers)i[g][e]=t.serializers[e];let r=Object.getOwnPropertySymbols(t.serializers);for(var s=0;s<r.length;s++){let e=r[s];i[g][e]=t.serializers[e]}}else i[g]=n;if(t.hasOwnProperty(`formatters`)){let{level:e,bindings:n,log:a}=t.formatters;i[_]=j(e||r.level,n||I,a||r.log)}else i[_]=j(r.level,I,r.log);if(t.hasOwnProperty(`customLevels`)===!0&&(re(this.levels,t.customLevels),i.levels=te(t.customLevels,i[b]),ne(i)),typeof t.redact==`object`&&t.redact!==null||Array.isArray(t.redact)){i.redact=t.redact;let e=P(i.redact,M),n={stringify:e[S]};i[C]=M,i[T]=e,i[w]=n}if(typeof t.msgPrefix==`string`&&(i[E]=(this[E]||``)+t.msgPrefix),i[c]=ie(i,e),t.level!==void 0&&t.level!==this.level||t.hasOwnProperty(`customLevels`)){let e=t.level||this.level;i[o](e)}return this.onChild(i),i}function se(){let e=`{${this[c].substr(1)}}`,t=JSON.parse(e);return delete t.pid,delete t.hostname,t}function ce(e){let t=ie(this,e);this[c]=t}function R(e,t){return Object.assign(t,e)}function le(e,t,n){let r=this[p](),i=this[l],a=this[v],o=this[y],s=this[f]||R,c,d=this[D].streamWrite;e==null?c={}:e instanceof Error?(c={[a]:e},t===void 0&&(t=e.message)):(c=e,t===void 0&&e[o]===void 0&&e[a]&&(t=e[a].message)),i&&(c=s(c,i(c,n,this)));let g=this[u](c,t,n,r),_=this[h];_[x]===!0&&(_.lastLevel=n,_.lastObj=c,_.lastMsg=t,_.lastTime=r.slice(this[m]),_.lastLogger=this),_.write(d?d(g):g)}function ue(e){if(e!=null&&typeof e!=`function`)throw Error(`callback must be a function`);let t=this[h];typeof t.flush==`function`?t.flush(e||N):e&&e()}})),Ae=/* @__PURE__ */ n(((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}})),je=/* @__PURE__ */ n(((e,t)=>{let n=Symbol.for(`pino.metadata`),{DEFAULT_LEVELS:r}=Ee(),i=r.info;function a(e,t){e||=[],t||={dedupe:!1};let a=Object.create(r);a.silent=1/0,t.levels&&typeof t.levels==`object`&&Object.keys(t.levels).forEach(e=>{a[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:a};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||a)[this.lastLevel]:this.lastLevel,{streams:o}=this,u=0,d;for(let a=s(o.length,t.dedupe);l(a,o.length,t.dedupe);a=c(a,t.dedupe))if(r=o[a],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:a}=this,s;s=typeof e.levelVal==`number`?e.levelVal:typeof e.level==`string`?a[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(o),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(o),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:a}}}function o(e,t){return e.level-t.level}function s(e,t){return t?e-1:0}function c(e,t){return t?e-1:e+1}function l(e,t,n){return n?e>=0:e<t}t.exports=a})),Me=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=a(`node:os`),r=de(),i=fe(),o=me(),s=he(),c=ke(),l=pe(),{configure:u}=Ae(),{assertDefaultLevelFound:d,mappings:f,genLsCache:p,genLevelComparison:m,assertLevelComparison:h}=De(),{DEFAULT_LEVELS:g,SORTING_ORDER:_}=Ee(),{createArgsNormalizer:v,asChindings:y,buildSafeSonicBoom:b,buildFormatters:x,stringify:S,normalizeDestFileDescriptor:C,noop:w}=Te(),{version:T}=Oe(),{chindingsSym:E,redactFmtSym:D,serializersSym:O,timeSym:ee,timeSliceIndexSym:k,streamSym:te,stringifySym:A,stringifySafeSym:ne,stringifiersSym:re,setLevelSym:ie,endSym:ae,formatOptsSym:j,messageKeySym:M,errorKeySym:N,nestedKeySym:oe,mixinSym:P,levelCompSym:F,useOnlyCustomLevelsSym:I,formattersSym:L,hooksSym:se,nestedKeyStrSym:ce,mixinMergeStrategySym:R,msgPrefixSym:le,transportUsesMultistreamSym:ue}=l,{epochTime:z,nullTime:ge}=s,{pid:_e}=process,ve=n.hostname(),ye=r.err,be=v({level:`info`,levelComparison:_.ASC,levels:g,messageKey:`msg`,errorKey:`err`,nestedKey:null,enabled:!0,base:{pid:_e,hostname:ve},serializers:Object.assign(Object.create(null),{err:ye}),formatters:Object.assign(Object.create(null),{bindings(e){return e},level(e,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:z,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100}),xe=Object.assign(Object.create(null),r);function Se(...e){let t={},{opts:n,stream:r}=be(t,i(),...e);n.level&&typeof n.level==`string`&&g[n.level.toLowerCase()]!==void 0&&(n.level=n.level.toLowerCase());let{redact:a,crlf:s,serializers:l,timestamp:_,messageKey:v,errorKey:b,nestedKey:C,base:T,name:de,level:fe,customLevels:pe,levelComparison:me,mixin:he,mixinMergeStrategy:_e,useOnlyCustomLevels:ve,formatters:ye,hooks:xe,depthLimit:Se,edgeLimit:Ce,onChild:we,msgPrefix:Te}=n,Ee=u({maximumDepth:Se,maximumBreadth:Ce}),De=x(ye.level,ye.bindings,ye.log),Oe=S.bind({[ne]:Ee}),ke=a?Object.assign(Object.create(null),o(a,Oe)):Object.create(null),Ae=a?{stringify:ke[D]}:{stringify:Oe},je=`}`+(s?`\r
15
15
  `:`
16
16
  `),Me=y.bind(null,{[E]:``,[O]:l,[re]:ke,[A]:S,[ne]:Ee,[L]:De}),Ne=``;T!==null&&(Ne=Me(de===void 0?T:Object.assign({},T,{name:de})));let Pe=_ instanceof Function?_:_?z:ge,Fe=Pe().indexOf(`:`)+1;if(ve&&!pe)throw Error(`customLevels is required if useOnlyCustomLevels is set true`);if(he&&typeof he!=`function`)throw Error(`Unknown mixin type "${typeof he}" - expected "function"`);if(Te&&typeof Te!=`string`)throw Error(`Unknown msgPrefix type "${typeof Te}" - expected "string"`);d(fe,pe,ve);let Ie=f(pe,ve);if(r&&r[ue]===!0){let e=typeof fe==`string`?fe:void 0;(!e||Ie[e]===void 0)&&(e=Object.keys(Ie)[0]);let t=Ie[e],n=!1;try{let r=ye.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:v,errorKey:b}}),h(me);let Le=m(me);return Object.assign(t,{levels:Ie,[F]:Le,[I]:ve,[te]:r,[ee]:Pe,[k]:Fe,[A]:S,[ne]:Ee,[re]:ke,[ae]:je,[j]:Ae,[M]:v,[N]:b,[oe]:C,[ce]:C?`,${JSON.stringify(C)}:{`:``,[O]:l,[P]:he,[R]:_e,[E]:Ne,[L]:De,[se]:xe,silent:w,onChild:we,[le]:Te}),Object.setPrototypeOf(t,c()),p(t),t[ie](fe),t}t.exports=Se,t.exports.destination=(e=process.stdout.fd)=>typeof e==`object`?(e.dest=C(e.dest||process.stdout.fd),b(e)):b({dest:C(e),minLength:0}),t.exports.transport=we(),t.exports.multistream=je(),t.exports.levels=f(),t.exports.stdSerializers=xe,t.exports.stdTimeFunctions=Object.assign({},s),t.exports.symbols=l,t.exports.version=T,t.exports.default=Se,t.exports.pino=Se})))(),1);const Ne={debug:0,info:1,warn:2,error:3};function Pe(e){return{level:e}}function Fe(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}let Ie={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,base:{},formatters:{level:Pe},timestamp:Fe}};function Le(){return Ie}function Re(){return 0}const ze={debug:`debug`,info:`info`,warn:`warn`,error:`error`};function Be(e){return{level:e}}function Ve(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function He(){return`,"time":"${(/* @__PURE__ */ new Date()).toISOString()}"`}const Ue={minLevel:`info`,enableConsole:!0,autoTracing:!1,pinoOptions:{level:`info`,formatters:{level:Be},timestamp:He}};var We=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===Le();this.hasExplicitConfig=!i&&!a,this.config=this.hasExplicitConfig?{...Ue,...t}:{...Ue,...Le()},this.builtConfigVersion=Re(),this.pinoLogger=this.buildPinoLogger(this.config)}buildPinoLogger(e){let t={...e.pinoOptions,level:e.minLevel},n=e.pinoOptions?.base;return t.base={...Ve(n)?n:{},module:this.context.module},e.transport&&(t.transport=e.transport),(0,Me.default)(t)}getActivePinoLogger(){if(this.hasExplicitConfig)return this.pinoLogger;let e=Re();return e!==this.builtConfigVersion&&(this.config.minLevel=Le().minLevel??Ue.minLevel,this.config.transport=Le().transport,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){this.log(`error`,e,n,t)}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;o&&(i.traceId=o.traceId,i.spanId=o.spanId),r&&(i.error={name:r.name,message:r.message,stack:r.stack});let s=ze[e],c=`[${this.context.module}${a?`:${a}`:``}] ${t}`;Object.keys(i).length>0?this.getActivePinoLogger()[s](i,c):this.getActivePinoLogger()[s](c)}shouldLog(e){return Ne[e]>=Ne[this.hasExplicitConfig?this.config.minLevel:Le().minLevel??Ue.minLevel]}getPinoLogger(){return this.getActivePinoLogger()}};function Ge(e){return new We(e,Le())}Ge(`App`),new ae;var Ke=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 qe(e=`Noop`){return new Ke(e)}qe(`App`);function Je(e){return Ge(e)}Je(`App`);var Ye=/* @__PURE__ */ n((e=>{var t=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}},n=class extends t{constructor(e){super(1,`commander.invalidArgument`,e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=t,e.InvalidArgumentError=n})),Xe=/* @__PURE__ */ n((e=>{let{InvalidArgumentError:t}=Ye();var n=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,n)=>{if(!this.argChoices.includes(e))throw new t(`Allowed choices are ${this.argChoices.join(`, `)}.`);return this.variadic?this._collectValue(e,n):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function r(e){let t=e.name()+(e.variadic===!0?`...`:``);return e.required?`<`+t+`>`:`[`+t+`]`}e.Argument=n,e.humanReadableArgName=r})),Ze=/* @__PURE__ */ n((e=>{let{humanReadableArgName:t}=Xe();var n=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)):n.short&&!r&&t.push(e.createOption(n.short,n.description))}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 n=e.registeredArguments.map(e=>t(e)).join(` `);return e._name+(e._aliases[0]?`|`+e._aliases[0]:``)+(e.options.length?` [options]`:``)+(n?` `+n:``)}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(`
17
17
  `)}displayWidth(e){return r(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,`
@@ -29,11 +29,13 @@ Expecting one of '${n.join(`', '`)}'`);return this._lifeCycleHooks[e]?this._life
29
29
  - 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(i.existsSync(e))return;let r=`'${e}' does not exist
30
30
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
31
31
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
32
- - ${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 a=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=r.resolve(e,t);if(i.existsSync(n))return n;if(s.includes(r.extname(t)))return;let a=s.find(e=>i.existsSync(`${n}${e}`));if(a)return`${n}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}a=s.includes(r.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=g(o.execArgv).concat(t),f=n.spawn(o.execPath,t,{stdio:`inherit`})):a?(t.unshift(u),t=g(o.execArgv).concat(t),f=n.spawn(o.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_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+)(e[+-]?\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);continue}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(`
32
+ - ${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 a=!1,s=[`.js`,`.ts`,`.tsx`,`.mjs`,`.cjs`];function c(e,t){let n=r.resolve(e,t);if(i.existsSync(n))return n;if(s.includes(r.extname(t)))return;let a=s.find(e=>i.existsSync(`${n}${e}`));if(a)return`${n}${a}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let u=e._executableFile||`${this._name}-${e._name}`,d=this._executableDir||``;if(this._scriptPath){let e;try{e=i.realpathSync(this._scriptPath)}catch{e=this._scriptPath}d=r.resolve(r.dirname(e),d)}if(d){let t=c(d,u);if(!t&&!e._executableFile&&this._scriptPath){let n=r.basename(this._scriptPath,r.extname(this._scriptPath));n!==this._name&&(t=c(d,`${n}-${e._name}`))}u=t||u}a=s.includes(r.extname(u));let f;o.platform===`win32`?(this._checkForMissingExecutable(u,d,e._name),t.unshift(u),t=g(o.execArgv).concat(t),f=n.spawn(o.execPath,t,{stdio:`inherit`})):a?(t.unshift(u),t=g(o.execArgv).concat(t),f=n.spawn(o.argv[0],t,{stdio:`inherit`})):f=n.spawn(u,t,{stdio:`inherit`}),f.killed||[`SIGUSR1`,`SIGUSR2`,`SIGTERM`,`SIGINT`,`SIGHUP`].forEach(e=>{o.on(e,()=>{f.killed===!1&&f.exitCode===null&&f.kill(e)})});let p=this._exitCallback;f.on(`close`,e=>{e??=1,p?p(new l(e,`commander.executeSubCommandAsync`,`(close)`)):o.exit(e)}),f.on(`error`,t=>{if(t.code===`ENOENT`)this._checkForMissingExecutable(u,d,e._name);else if(t.code===`EACCES`)throw Error(`'${u}' not executable`);if(!p)o.exit(1);else{let e=new l(1,`commander.executeSubCommandAsync`,`(error)`);e.nestedError=t,p(e)}}),this.runningCommand=f}_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+)(e[+-]?\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(`
33
33
  `),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 o.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()}`,o.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new p(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=m(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=`error: too many arguments${this.parent?` for '${this.name()}'`:``}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{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=m(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=>c(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=r.basename(e,r.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(o.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.
34
- 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 g(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)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\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 _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=h,e.useColor=_}));const{program:tt,createCommand:nt,createArgument:rt,createOption:it,CommanderError:at,InvalidArgumentError:ot,InvalidOptionArgumentError:st,Command:ct,Argument:lt,Option:ut,Help:dt}=(/* @__PURE__ */ t((/* @__PURE__ */ n((e=>{let{Argument:t}=Xe(),{Command:n}=et(),{CommanderError:r,InvalidArgumentError:i}=Ye(),{Help:a}=Ze(),{Option:o}=Qe();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})))(),1)).default;function ft(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function pt(e,t=`|`){return e.map(e=>Rt(e)).join(t)}function mt(e,t){return typeof t==`bigint`?t.toString():t}var ht=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function gt(e){return new ht(e)}function _t(e){return e==null}function vt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function yt(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function bt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xt(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function St(e){return xt(e._zod.def)??e._zod.def.shape}function Ct(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return bt(this,t,e),e},enumerable:!0,configurable:!0})}function wt(e,t,n){t in e?bt(e,t,n):e[t]=n}function Tt(e,t,n,r){let i=St(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Ct(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):wt(e,a,r?r(n.value,a):n.value))}}function Et(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ct(e,n,()=>t[n]):wt(e,n,r.value))}}function Dt(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ot(e){return JSON.stringify(e)}function kt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const At=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function jt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Mt=/* @__PURE__*/ gt(()=>{if(En.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Nt(e){if(jt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return jt(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Pt(e){return Nt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Ft=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function It(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Lt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function B(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Rt(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function zt(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const Bt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vt={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Ht(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Tt(i,e,Ut(e,t)),Lt(e,Dt(n,{shape:i,checks:[]}))}function Ut(e,t){let n=St(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Wt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Ut(e,t)),a={};return Tt(a,e,Reflect.ownKeys(St(e)).filter(e=>!i.has(e))),Lt(e,Dt(n,{shape:a,checks:[]}))}function Gt(e,t){if(!Nt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=St(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Lt(e,Dt(e._zod.def,{shape:Kt(e,t)}))}function Kt(e,t){let n={};return Tt(n,e,Reflect.ownKeys(St(e))),Et(n,t),n}function qt(e,t){if(!Nt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Lt(e,Dt(e._zod.def,{shape:Kt(e,t)}))}function Jt(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Tt(n,e,Reflect.ownKeys(St(e))),Tt(n,t,Reflect.ownKeys(St(t))),Lt(e,Dt(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Yt(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ut(t,n)):void 0,o={};return Tt(o,t,Reflect.ownKeys(St(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Lt(t,Dt(t._zod.def,{shape:o,checks:[]}))}function Xt(e,t,n){let r=n?new Set(Ut(t,n)):void 0,i={};return Tt(i,t,Reflect.ownKeys(St(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Lt(t,Dt(t._zod.def,{shape:i}))}function Zt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Qt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function $t(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function en(e){return typeof e==`string`?e:e?.message}function tn(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function nn(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:en(e.inst?._zod.def?.error?.(e))??en(a?.(e))??en(t?.error?.(e))??en(n.customError?.(e))??en(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const rn=/[\uD800-\uDBFF]/;function an(e){let t=e.length;if(!rn.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function on(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function sn(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function cn(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function ln(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):pn(e,n,r.value)}}function un(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function dn(e,t,n){return un(e,t,n,!1)}function fn(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return un(this,n,r(this))},set(e){un(this,n,e)}})}return t}function pn(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:un(this,t,n.bind(this))},set(e){un(this,t,e)}})}function mn(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let hn,gn=!1;const _n={configurable:!0,get(){gn=!0}};function V(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&hn!==e._zod){hn=void 0;return}hn=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,_n);let e=gn;gn=!1;try{let r=n(this);return gn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),gn||=e,r}catch(n){throw delete this[t],gn||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function vn(e,t,n,r){let i=mn(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function yn(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var bn;const xn={value:void 0,enumerable:!1};let Sn=`captureStackTrace`in Error?Error:null;function Cn(e){let t=Sn;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Sn=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function H(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){xn.value=new a(r);try{Object.defineProperty(n,"_zod",xn)}finally{xn.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),ln(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Cn(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var wn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Tn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(bn=globalThis).__zod_globalConfig??(bn.__zod_globalConfig={});const En=globalThis.__zod_globalConfig;function Dn(e){return e&&Object.assign(En,e),En}function On(){let e=this._zod;return e.message??=JSON.stringify(e.def,mt,2),e.message}function kn(e){this._zod.message=e}const An={get:On,set:kn,enumerable:!0,configurable:!0},jn={value:void 0,enumerable:!1},Mn=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Nn=(e,t)=>{e.name=`$ZodError`,jn.value=t,Object.defineProperty(e,"issues",jn),jn.value=void 0,Object.defineProperty(e,"message",An);let n=Object.getPrototypeOf(e);Mn.has(n)||(Mn.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Pn=H(`$ZodError`,Nn);H(`$ZodError`,Nn,void 0,{Parent:Error});function Fn(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function In(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Fn(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ln(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Rn(e,t){return{callee:t?.callee??e,Err:t?.Err}}const zn=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new wn;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>nn(e,o,Dn())));throw At(n,a?.callee??t),n}return s.value};return t},Bn=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>nn(e,o,Dn())));throw At(n,a?.callee??t),n}return s.value};return t},Vn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new wn;return a.issues.length?Hn(e,a.issues,i):{success:!0,data:a.value}};function Hn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>nn(e,n,Dn()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Un=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Hn(e,a.issues,i):{success:!0,data:a.value}},Wn=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Gn=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Kn=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Wn)return!0;if(r.definite===!0&&n===void 0)return!1}return qn(e,t,n)});function qn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Gn]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new wn;return a.issues.length===0}const Jn=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Yn=e=>{let t=zn(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Rn(n,a))};return n},Xn=e=>{let t=zn(e),n=(e,r,i,a)=>t(e,r,i,Rn(n,a));return n},Zn=e=>{let t=Bn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Rn(n,a))};return n},Qn=e=>{let t=Bn(e),n=async(e,r,i,a)=>await t(e,r,i,Rn(n,a));return n},$n=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Vn(e)(t,n,i)},er=e=>(t,n,r)=>Vn(e)(t,n,r),tr=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Un(e)(t,n,i)},nr=e=>async(t,n,r)=>Un(e)(t,n,r),rr=/^[cC][0-9a-z]{6,}$/,ir=/^[0-9a-z]+$/,ar=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,or=/^[0-9a-vA-V]{20}$/,sr=/^[A-Za-z0-9]{27}$/,cr=/^[a-zA-Z0-9_-]{21}$/;function lr(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const ur=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fr=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,pr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function mr(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const hr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_r=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,br=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,xr=/^https?$/,Sr=/^\+[1-9]\d{6,14}$/,Cr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function wr(e){return RegExp(`^${e}$`)}const Tr=/*@__PURE__*/ wr(Cr);function Er(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dr(e){return RegExp(`^${Er(e)}$`)}function Or(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Er({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Er({precision:e.precision})}`:n;return RegExp(`^${Cr}T(?:${r})$`)}const kr=/^[\s\S]{0,}$/,Ar=/^-?\d+$/,jr=/^-?\d+(?:\.\d+)?$/,Mr=/^(?:true|false)$/i,Nr=/^[^A-Z]*$/,Pr=/^[^a-z]*$/,Fr=/*@__PURE__*/ H(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ir=e=>{let t=e.value;return!_t(t)&&t.length!==void 0},Lr={number:`number`,bigint:`bigint`,object:`date`},Rr=/*@__PURE__*/ H(`$ZodCheckLessThan`,(e,t)=>{Fr.init(e,t);let n=Lr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Lr[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zr=/*@__PURE__*/ H(`$ZodCheckGreaterThan`,(e,t)=>{Fr.init(e,t);let n=Lr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Lr[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Br=/*@__PURE__*/ H(`$ZodCheckMultipleOf`,(e,t)=>{Fr.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):yt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Vr=/*@__PURE__*/ H(`$ZodCheckNumberFormat`,(e,t)=>{Fr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Bt[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Hr=/*@__PURE__*/ H(`$ZodCheckMaxLength`,(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?an(r):i)<=t.maximum)return;let a=on(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ur=/*@__PURE__*/ H(`$ZodCheckMinLength`,(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?an(r):i)>=t.minimum)return;let a=on(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wr=/*@__PURE__*/ H(`$ZodCheckLengthEquals`,(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?an(r):i;if(a===t.length)return;let o=on(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Gr=/*@__PURE__*/ H(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Fr.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Kr=/*@__PURE__*/ H(`$ZodCheckRegex`,(e,t)=>{Gr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qr=/*@__PURE__*/ H(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Nr,Gr.init(e,t)}),Jr=/*@__PURE__*/ H(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Pr,Gr.init(e,t)}),Yr=/*@__PURE__*/ H(`$ZodCheckIncludes`,(e,t)=>{Fr.init(e,t);let n=It(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xr=/*@__PURE__*/ H(`$ZodCheckStartsWith`,(e,t)=>{Fr.init(e,t);let n=RegExp(`^${It(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Zr=/*@__PURE__*/ H(`$ZodCheckEndsWith`,(e,t)=>{Fr.init(e,t);let n=RegExp(`.*${It(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Qr=/*@__PURE__*/ H(`$ZodCheckOverwrite`,(e,t)=>{Fr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var $r=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
34
+ 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 g(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)?)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))===null?(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\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 _(){if(o.env.NO_COLOR||o.env.FORCE_COLOR===`0`||o.env.FORCE_COLOR===`false`)return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=h,e.useColor=_}));const{program:tt,createCommand:nt,createArgument:rt,createOption:it,CommanderError:at,InvalidArgumentError:ot,InvalidOptionArgumentError:st,Command:ct,Argument:lt,Option:ut,Help:dt}=(/* @__PURE__ */ t((/* @__PURE__ */ n((e=>{let{Argument:t}=Xe(),{Command:n}=et(),{CommanderError:r,InvalidArgumentError:i}=Ye(),{Help:a}=Ze(),{Option:o}=Qe();e.program=new n,e.createCommand=e=>new n(e),e.createOption=(e,t)=>new o(e,t),e.createArgument=(e,n)=>new t(e,n),e.Command=n,e.Option=o,e.Argument=t,e.Help=a,e.CommanderError=r,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})))(),1)).default;function ft(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function pt(e,t=`|`){return e.map(e=>Rt(e)).join(t)}function mt(e,t){return typeof t==`bigint`?t.toString():t}var ht=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function gt(e){return new ht(e)}function _t(e){return e==null}function vt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function yt(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function bt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xt(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function St(e){return xt(e._zod.def)??e._zod.def.shape}function Ct(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return bt(this,t,e),e},enumerable:!0,configurable:!0})}function wt(e,t,n){t in e?bt(e,t,n):e[t]=n}function Tt(e,t,n,r){let i=St(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Ct(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):wt(e,a,r?r(n.value,a):n.value))}}function Et(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ct(e,n,()=>t[n]):wt(e,n,r.value))}}function Dt(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ot(e){return JSON.stringify(e)}function kt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const At=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function jt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Mt=/* @__PURE__*/ gt(()=>{if(Dn.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Nt(e){if(jt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return jt(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Pt(e){return Nt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Ft=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function It(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Lt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function B(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Rt(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function zt(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const Bt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vt={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function Ht(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Tt(i,e,Ut(e,t)),Lt(e,Dt(n,{shape:i,checks:[]}))}function Ut(e,t){let n=St(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Wt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Ut(e,t)),a={};return Tt(a,e,Reflect.ownKeys(St(e)).filter(e=>!i.has(e))),Lt(e,Dt(n,{shape:a,checks:[]}))}function Gt(e,t){if(!Nt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=St(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Lt(e,Dt(e._zod.def,{shape:Kt(e,t)}))}function Kt(e,t){let n={};return Tt(n,e,Reflect.ownKeys(St(e))),Et(n,t),n}function qt(e,t){if(!Nt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Lt(e,Dt(e._zod.def,{shape:Kt(e,t)}))}function Jt(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Tt(n,e,Reflect.ownKeys(St(e))),Tt(n,t,Reflect.ownKeys(St(t))),Lt(e,Dt(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Yt(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ut(t,n)):void 0,o={};return Tt(o,t,Reflect.ownKeys(St(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Lt(t,Dt(t._zod.def,{shape:o,checks:[]}))}function Xt(e,t,n){let r=n?new Set(Ut(t,n)):void 0,i={};return Tt(i,t,Reflect.ownKeys(St(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Lt(t,Dt(t._zod.def,{shape:i}))}function Zt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Qt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function $t(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function en(e){return typeof e==`string`?e:e?.message}function tn(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function nn(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function rn(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:en(e.inst?._zod.def?.error?.(e))??en(a?.(e))??en(t?.error?.(e))??en(n.customError?.(e))??en(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const an=/[\uD800-\uDBFF]/;function on(e){let t=e.length;if(!an.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function sn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function cn(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function ln(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function un(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):mn(e,n,r.value)}}function dn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function fn(e,t,n){return dn(e,t,n,!1)}/* @__NO_SIDE_EFFECTS__ */
35
+ function pn(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return dn(this,n,r(this))},set(e){dn(this,n,e)}})}return t}function mn(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:dn(this,t,n.bind(this))},set(e){dn(this,t,e)}})}function hn(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let gn,_n=!1;const vn={configurable:!0,get(){_n=!0}};function V(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&gn!==e._zod?gn=void 0:(gn=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,vn);let e=_n;_n=!1;try{let r=n(this);return _n?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),_n||=e,r}catch(n){throw delete this[t],_n||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function yn(e,t,n,r){let i=hn(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function bn(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var xn;const Sn={value:void 0,enumerable:!1};let Cn=`captureStackTrace`in Error?Error:null;function wn(e){let t=Cn;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Cn=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
36
+ function H(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Sn.value=new a(r);try{Object.defineProperty(n,"_zod",Sn)}finally{Sn.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),un(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?wn(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Tn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},En=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(xn=globalThis).__zod_globalConfig??(xn.__zod_globalConfig={});const Dn=globalThis.__zod_globalConfig;function On(e){return e&&Object.assign(Dn,e),Dn}function kn(){let e=this._zod;return e.message??=JSON.stringify(e.def,mt,2),e.message}function An(e){this._zod.message=e}const jn={get:kn,set:An,enumerable:!0,configurable:!0},Mn={value:void 0,enumerable:!1},Nn=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),Pn=/* @__PURE__ */ H(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Mn.value=t,Object.defineProperty(e,"issues",Mn),Mn.value=void 0,Object.defineProperty(e,"message",jn);let n=Object.getPrototypeOf(e);Nn.has(n)||(Nn.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Fn(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function In(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Fn(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ln(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Rn(e,t){return{callee:t?.callee??e,Err:t?.Err}}const zn=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Tn;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>rn(e,o,On())));throw At(n,a?.callee??t),n}return s.value};return t},Bn=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>rn(e,o,On())));throw At(n,a?.callee??t),n}return s.value};return t},Vn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Tn;return a.issues.length?Hn(e,a.issues,i):{success:!0,data:a.value}};function Hn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>rn(e,n,On()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Un=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Hn(e,a.issues,i):{success:!0,data:a.value}},Wn=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),Gn=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),Kn=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Wn)return!0;if(r.definite===!0&&n===void 0)return!1}return qn(e,t,n)});function qn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Gn]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Tn;return a.issues.length===0}const Jn=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Yn=e=>{let t=zn(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Rn(n,a))};return n},Xn=e=>{let t=zn(e),n=(e,r,i,a)=>t(e,r,i,Rn(n,a));return n},Zn=e=>{let t=Bn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Rn(n,a))};return n},Qn=e=>{let t=Bn(e),n=async(e,r,i,a)=>await t(e,r,i,Rn(n,a));return n},$n=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Vn(e)(t,n,i)},er=e=>(t,n,r)=>Vn(e)(t,n,r),tr=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Un(e)(t,n,i)},nr=e=>async(t,n,r)=>Un(e)(t,n,r),rr=/^[cC][0-9a-z]{6,}$/,ir=/^[0-9a-z]+$/,ar=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,or=/^[0-9a-vA-V]{20}$/,sr=/^[A-Za-z0-9]{27}$/,cr=/^[a-zA-Z0-9_-]{21}$/;function lr(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const ur=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fr=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,pr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function mr(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const hr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_r=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,br=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,xr=/^https?$/,Sr=/^\+[1-9]\d{6,14}$/,Cr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function wr(e){return RegExp(`^${e}$`)}const Tr=/*@__PURE__*/ wr(Cr);function Er(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dr(e){return RegExp(`^${Er(e)}$`)}function Or(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Er({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Er({precision:e.precision})}`:n;return RegExp(`^${Cr}T(?:${r})$`)}const kr=/^[\s\S]{0,}$/,Ar=/^-?\d+$/,jr=/^-?\d+(?:\.\d+)?$/,Mr=/^(?:true|false)$/i,Nr=/^[^A-Z]*$/,Pr=/^[^a-z]*$/,Fr=/*@__PURE__*/ H(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ir=e=>{let t=e.value;return!_t(t)&&t.length!==void 0},Lr={number:`number`,bigint:`bigint`,object:`date`},Rr=/*@__PURE__*/ H(`$ZodCheckLessThan`,(e,t)=>{Fr.init(e,t);let n=Lr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Lr[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zr=/*@__PURE__*/ H(`$ZodCheckGreaterThan`,(e,t)=>{Fr.init(e,t);let n=Lr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Lr[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Br=/*@__PURE__*/ H(`$ZodCheckMultipleOf`,(e,t)=>{Fr.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):yt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Vr=/*@__PURE__*/ H(`$ZodCheckNumberFormat`,(e,t)=>{Fr.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Bt[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Hr=/*@__PURE__*/ H(`$ZodCheckMaxLength`,(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?on(r):i)<=t.maximum)return;let a=sn(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ur=/*@__PURE__*/ H(`$ZodCheckMinLength`,(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?on(r):i)>=t.minimum)return;let a=sn(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wr=/*@__PURE__*/ H(`$ZodCheckLengthEquals`,(e,t)=>{var n;Fr.init(e,t),(n=e._zod.def).when??(n.when=Ir),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?on(r):i;if(a===t.length)return;let o=sn(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Gr=/*@__PURE__*/ H(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Fr.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Kr=/*@__PURE__*/ H(`$ZodCheckRegex`,(e,t)=>{Gr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),qr=/*@__PURE__*/ H(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Nr,Gr.init(e,t)}),Jr=/*@__PURE__*/ H(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Pr,Gr.init(e,t)}),Yr=/*@__PURE__*/ H(`$ZodCheckIncludes`,(e,t)=>{Fr.init(e,t);let n=It(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xr=/*@__PURE__*/ H(`$ZodCheckStartsWith`,(e,t)=>{Fr.init(e,t);let n=RegExp(`^${It(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Zr=/*@__PURE__*/ H(`$ZodCheckEndsWith`,(e,t)=>{Fr.init(e,t);let n=RegExp(`.*${It(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Qr=/*@__PURE__*/ H(`$ZodCheckOverwrite`,(e,t)=>{Fr.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var $r=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
35
37
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
36
- `)}\n};`)(...Object.values(this.closed))}};const ei={major:4,minor:6,patch:5},ti=/*@__PURE__*/ H(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ei;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Zt(t),a;for(let o of n){if(o._zod.def.when){if(Qt(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new wn;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(tn(t.issues,n,e),i||=Zt(t,n))});else{if(t.issues.length===n)continue;tn(t.issues,n,e),i||=Zt(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Zt(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new wn;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new wn;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return dn(this,`~standard`,ii(this))},set"~standard"(e){un(this,`~standard`,e)}}),ni=(e,t)=>e.issues.length?{issues:e.issues.map(e=>nn(e,t,Dn()))}:{value:e.value};async function ri(e,t){let n={async:!0};return ni(await e._zod.run({value:t,issues:[]},n),n)}function ii(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ni(r,n)}catch{}return ri(e,t)},vendor:`zod`,version:1}}const ai=/*@__PURE__*/ H(`$ZodString`,(e,t)=>{ti.init(e,t),e._zod.pattern=t.pattern??kr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),U=/*@__PURE__*/ H(`$ZodStringFormat`,(e,t)=>{Gr.init(e,t),ai.init(e,t)}),oi=/*@__PURE__*/ H(`$ZodGUID`,(e,t)=>{t.pattern??=dr,U.init(e,t)}),si=/*@__PURE__*/ H(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=fr(e)}else t.pattern??=fr();U.init(e,t)}),ci=/*@__PURE__*/ H(`$ZodEmail`,(e,t)=>{t.pattern??=pr,U.init(e,t)});function li(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ui(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?li(e)||2:di(e,t)}function di(e,t){if(!t.normalize&&t.protocol?.source===xr.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const fi=/[\t\n\r]/g;function pi(e){return e.replace(fi,``)}function mi(e,t){return t.lastIndex=0,t.test(e.hostname)}function hi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const gi=/*@__PURE__*/ H(`$ZodURL`,(e,t)=>{U.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=ui(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=pi(r);return}t.hostname&&!mi(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!hi(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:pi(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),_i=/*@__PURE__*/ H(`$ZodEmoji`,(e,t)=>{t.pattern??=mr(),U.init(e,t)}),vi=/*@__PURE__*/ H(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?cr:lr(t.length),U.init(e,t)}),yi=/*@__PURE__*/ H(`$ZodCUID`,(e,t)=>{t.pattern??=rr,U.init(e,t)}),bi=/*@__PURE__*/ H(`$ZodCUID2`,(e,t)=>{t.pattern??=ir,U.init(e,t)}),xi=/*@__PURE__*/ H(`$ZodULID`,(e,t)=>{t.pattern??=ar,U.init(e,t)}),Si=/*@__PURE__*/ H(`$ZodXID`,(e,t)=>{t.pattern??=or,U.init(e,t)}),Ci=/*@__PURE__*/ H(`$ZodKSUID`,(e,t)=>{t.pattern??=sr,U.init(e,t)}),wi=/*@__PURE__*/ H(`$ZodISODateTime`,(e,t)=>{t.pattern??=Or(t),U.init(e,t)}),Ti=/*@__PURE__*/ H(`$ZodISODate`,(e,t)=>{t.pattern??=Tr,U.init(e,t)}),Ei=/*@__PURE__*/ H(`$ZodISOTime`,(e,t)=>{t.pattern??=Dr(t),U.init(e,t)}),Di=/*@__PURE__*/ H(`$ZodISODuration`,(e,t)=>{t.pattern??=ur,U.init(e,t)}),Oi=/*@__PURE__*/ H(`$ZodIPv4`,(e,t)=>{t.pattern??=hr,U.init(e,t)}),ki=/^[0-9a-fA-F:.]+$/;function Ai(e){return ki.test(e)?li(`http://[${e}]`):!1}const ji=/*@__PURE__*/ H(`$ZodIPv6`,(e,t)=>{t.pattern??=gr,U.init(e,t),e._zod.check=n=>{Ai(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Mi=/*@__PURE__*/ H(`$ZodCIDRv4`,(e,t)=>{t.pattern??=_r,U.init(e,t)});function Ni(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ai(n)}const Pi=/*@__PURE__*/ H(`$ZodCIDRv6`,(e,t)=>{t.pattern??=vr,U.init(e,t),e._zod.check=n=>{Ni(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Fi(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ii=/^[0-9a-zA-Z+/]*={0,2}$/,Li=/*@__PURE__*/ H(`$ZodBase64`,(e,t)=>{t.pattern??=Ii,U.init(e,t),e._zod.check=n=>{Fi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Ri=/^[A-Za-z0-9_-]*$/;function zi(e){if(!Ri.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Fi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Bi=/*@__PURE__*/ H(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ri,U.init(e,t),e._zod.check=n=>{zi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Vi=/*@__PURE__*/ H(`$ZodE164`,(e,t)=>{t.pattern??=Sr,U.init(e,t)});function Hi(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Ui=/*@__PURE__*/ H(`$ZodJWT`,(e,t)=>{U.init(e,t),e._zod.check=n=>{Hi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Wi=/*@__PURE__*/ H(`$ZodNumber`,(e,t)=>{ti.init(e,t),e._zod.pattern=jr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Gi=/*@__PURE__*/ H(`$ZodNumberFormat`,(e,t)=>{Vr.init(e,t),Wi.init(e,t)}),Ki=/*@__PURE__*/ H(`$ZodBoolean`,(e,t)=>{ti.init(e,t),e._zod.pattern=Mr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),qi=/*@__PURE__*/ H(`$ZodUnknown`,(e,t)=>{ti.init(e,t),e._zod.parse=e=>e}),Ji=/*@__PURE__*/ H(`$ZodNever`,(e,t)=>{ti.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Yi(e,t,n){e.issues.length&&t.issues.push(...$t(n,e.issues)),t.value[n]=e.value}const Xi=/*@__PURE__*/ H(`$ZodArray`,(e,t)=>{ti.init(e,t);let n=En.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Yi(t,r,e)));else if(Yi(c,r,e),s&&c.issues.length!==0&&Zt(c))break}return o.length?Promise.all(o).then(()=>r):r}});function Zi(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...$t(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const Qi=[];function $i(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Qi,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=zt(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ea(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Zt(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Zi(e,n,i,t,d,f))):Zi(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const ta=/*@__PURE__*/ H(`$ZodObject`,(e,t)=>{ti.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=gt(()=>$i(t));V(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||bt(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=jt,o=t.catchall,s,c=En.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Zt(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Zi(n,t,e,r,a,o))):Zi(s,t,e,r,a,o)}return o?ea(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),na=/*@__PURE__*/ H(`$ZodObjectJIT`,(e,t)=>{ta.init(e,t);let n=e._zod.parse,r=gt(()=>$i(t)),i=En.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new $r([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
38
+ `)}\n};`)(...Object.values(this.closed))}};const ei={major:4,minor:6,patch:7},ti=/*@__PURE__*/ H(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ei;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Zt(t),a;for(let o of n){if(o._zod.def.when){if(Qt(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Tn;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(nn(t.issues,n,e),i||=Zt(t,n))});else{if(t.issues.length===n)continue;nn(t.issues,n,e),i||=Zt(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Zt(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Tn;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Tn;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return fn(this,`~standard`,ii(this))},set"~standard"(e){dn(this,`~standard`,e)}}),ni=(e,t)=>e.issues.length?{issues:e.issues.map(e=>rn(e,t,On()))}:{value:e.value};async function ri(e,t){let n={async:!0};return ni(await e._zod.run({value:t,issues:[]},n),n)}function ii(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ni(r,n)}catch{}return ri(e,t)},vendor:`zod`,version:1}}const ai=/*@__PURE__*/ H(`$ZodString`,(e,t)=>{ti.init(e,t),e._zod.pattern=t.pattern??kr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),U=/*@__PURE__*/ H(`$ZodStringFormat`,(e,t)=>{Gr.init(e,t),ai.init(e,t)}),oi=/*@__PURE__*/ H(`$ZodGUID`,(e,t)=>{t.pattern??=dr,U.init(e,t)}),si=/*@__PURE__*/ H(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=fr(e)}else t.pattern??=fr();U.init(e,t)}),ci=/*@__PURE__*/ H(`$ZodEmail`,(e,t)=>{t.pattern??=pr,U.init(e,t)});function li(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function ui(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?li(e)||2:di(e,t)}function di(e,t){if(!t.normalize&&t.protocol?.source===xr.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const fi=/[\t\n\r]/g;function pi(e){return e.replace(fi,``)}function mi(e,t){return t.lastIndex=0,t.test(e.hostname)}function hi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const gi=/*@__PURE__*/ H(`$ZodURL`,(e,t)=>{U.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=ui(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=pi(r);return}t.hostname&&!mi(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!hi(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:pi(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),_i=/*@__PURE__*/ H(`$ZodEmoji`,(e,t)=>{t.pattern??=mr(),U.init(e,t)}),vi=/*@__PURE__*/ H(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?cr:lr(t.length),U.init(e,t)}),yi=/*@__PURE__*/ H(`$ZodCUID`,(e,t)=>{t.pattern??=rr,U.init(e,t)}),bi=/*@__PURE__*/ H(`$ZodCUID2`,(e,t)=>{t.pattern??=ir,U.init(e,t)}),xi=/*@__PURE__*/ H(`$ZodULID`,(e,t)=>{t.pattern??=ar,U.init(e,t)}),Si=/*@__PURE__*/ H(`$ZodXID`,(e,t)=>{t.pattern??=or,U.init(e,t)}),Ci=/*@__PURE__*/ H(`$ZodKSUID`,(e,t)=>{t.pattern??=sr,U.init(e,t)}),wi=/*@__PURE__*/ H(`$ZodISODateTime`,(e,t)=>{t.pattern??=Or(t),U.init(e,t)}),Ti=/*@__PURE__*/ H(`$ZodISODate`,(e,t)=>{t.pattern??=Tr,U.init(e,t)}),Ei=/*@__PURE__*/ H(`$ZodISOTime`,(e,t)=>{t.pattern??=Dr(t),U.init(e,t)}),Di=/*@__PURE__*/ H(`$ZodISODuration`,(e,t)=>{t.pattern??=ur,U.init(e,t)}),Oi=/*@__PURE__*/ H(`$ZodIPv4`,(e,t)=>{t.pattern??=hr,U.init(e,t)}),ki=/^[0-9a-fA-F:.]+$/;function Ai(e){return ki.test(e)?li(`http://[${e}]`):!1}const ji=/*@__PURE__*/ H(`$ZodIPv6`,(e,t)=>{t.pattern??=gr,U.init(e,t),e._zod.check=n=>{Ai(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Mi=/*@__PURE__*/ H(`$ZodCIDRv4`,(e,t)=>{t.pattern??=_r,U.init(e,t)});function Ni(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ai(n)}const Pi=/*@__PURE__*/ H(`$ZodCIDRv6`,(e,t)=>{t.pattern??=vr,U.init(e,t),e._zod.check=n=>{Ni(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Fi(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ii=/^[0-9a-zA-Z+/]*={0,2}$/,Li=/*@__PURE__*/ H(`$ZodBase64`,(e,t)=>{t.pattern??=Ii,U.init(e,t),e._zod.check=n=>{Fi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Ri=/^[A-Za-z0-9_-]*$/;function zi(e){if(!Ri.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Fi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Bi=/*@__PURE__*/ H(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ri,U.init(e,t),e._zod.check=n=>{zi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Vi=/*@__PURE__*/ H(`$ZodE164`,(e,t)=>{t.pattern??=Sr,U.init(e,t)});function Hi(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Ui=/*@__PURE__*/ H(`$ZodJWT`,(e,t)=>{U.init(e,t),e._zod.check=n=>{Hi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Wi=/*@__PURE__*/ H(`$ZodNumber`,(e,t)=>{ti.init(e,t),e._zod.pattern=jr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Gi=/*@__PURE__*/ H(`$ZodNumberFormat`,(e,t)=>{Vr.init(e,t),Wi.init(e,t)}),Ki=/*@__PURE__*/ H(`$ZodBoolean`,(e,t)=>{ti.init(e,t),e._zod.pattern=Mr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),qi=/*@__PURE__*/ H(`$ZodUnknown`,(e,t)=>{ti.init(e,t),e._zod.parse=e=>e}),Ji=/*@__PURE__*/ H(`$ZodNever`,(e,t)=>{ti.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Yi(e,t){let n=tn(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of tn(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,nn(n.issues,t,e),n}}return i(n,a)}}const Xi=e=>Array.isArray(e)?e.length:-1;function Zi(e,t,n){e.issues.length&&t.issues.push(...$t(n,e.issues)),t.value[n]=e.value}const Qi=/*@__PURE__*/ H(`$ZodArray`,(e,t)=>{ti.init(e,t);let n=Dn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Zi(t,r,e)));else if(Zi(c,r,e),s&&c.issues.length!==0&&Zt(c))break}return o.length?Promise.all(o).then(()=>r):r},Yi(e,Xi)});function $i(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...$t(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const ea=[];function ta(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ea,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=zt(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function na(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Zt(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>$i(e,n,i,t,d,f))):$i(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const ra=/*@__PURE__*/ H(`$ZodObject`,(e,t)=>{ti.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=gt(()=>ta(t));V(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||bt(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=jt,o=t.catchall,s,c=Dn.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Zt(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>$i(n,t,e,r,a,o))):$i(s,t,e,r,a,o)}return o?na(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),ia=/*@__PURE__*/ H(`$ZodObjectJIT`,(e,t)=>{ra.init(e,t);let n=e._zod.parse,r=gt(()=>ta(t)),i=Dn.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new $r([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
37
39
  let ${e}_ab = false;
38
40
  for (let i = 0; i < ${e}.issues.length; i++) {
39
41
  const iss = ${e}.issues[i];
@@ -83,95 +85,95 @@ Expecting one of '${n.join(`', '`)}'`);let r=`${e}Help`;return this.on(r,e=>{let
83
85
  newResult[${r}] = ${n}.value;
84
86
  }
85
87
 
86
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=jt,c=!En.jitless,l=c&&Mt.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ea([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ra(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Zt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>nn(e,r,Dn())))}),t)}const ia=/*@__PURE__*/ H(`$ZodUnion`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),V(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),V(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),V(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>vt(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ra(t,r,e,i)):ra(o,r,e,i)}}),aa=/*@__PURE__*/ H(`$ZodIntersection`,(e,t)=>{ti.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>sa(e,t,n)):sa(e,i,a)}});function oa(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nt(e)&&Nt(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=oa(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=oa(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function sa(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=oa(t.value,n.value);if(!c.valid){if(Zt(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const ca=/*@__PURE__*/ H(`$ZodRecord`,(e,t)=>{ti.init(e,t);let n=En.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Nt(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>nn(e,i,Dn())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...$t(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...$t(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&jr.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>nn(e,i,Dn())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...$t(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...$t(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),la=/*@__PURE__*/ H(`$ZodEnum`,(e,t)=>{ti.init(e,t);let n=ft(t.entries),r=new Set(n);e._zod.values=r,V(e,`pattern`,e=>{let t=ft(e.def.entries).filter(e=>Ft.has(typeof e));return RegExp(t.length?`^(${t.map(e=>It(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ua=/*@__PURE__*/ H(`$ZodTransform`,(e,t)=>{ti.init(e,t),e._zod.optin=`optional`,En.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Tn(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new wn;return n.value=i,n}});function da(e,t){return e.value=t.issues.length?void 0:t.value,e}const fa=/*@__PURE__*/ H(`$ZodOptional`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${vt(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>da(e,t)):da(e,r)}return t.innerType._zod.run(e,n)}}),pa=/*@__PURE__*/ H(`$ZodExactOptional`,(e,t)=>{fa.init(e,t),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ma=/*@__PURE__*/ H(`$ZodNullable`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${vt(t.source)}|null)$`):void 0}),V(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ha=/*@__PURE__*/ H(`$ZodDefault`,(e,t)=>{ti.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ga(e,t)):ga(r,t)}});function ga(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _a=/*@__PURE__*/ H(`$ZodPrefault`,(e,t)=>{ti.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),va=/*@__PURE__*/ H(`$ZodNonOptional`,(e,t)=>{ti.init(e,t),V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ya(t,e)):ya(i,e)}});function ya(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ba(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>nn(e,r,Dn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const xa=/*@__PURE__*/ H(`$ZodCatch`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ba(e,r,t,n)):ba(e,r,t,n)}}),Sa=/*@__PURE__*/ H(`$ZodPipe`,(e,t)=>{ti.init(e,t),V(e,`values`,e=>e.def.in._zod.values),V(e,`optin`,e=>e.def.in._zod.optin),V(e,`optout`,e=>e.def.out._zod.optout),V(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ca(e,t.in,n)):Ca(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ca(e,t.out,n)):Ca(r,t.out,n)}});function Ca(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const wa=/*@__PURE__*/ H(`$ZodReadonly`,(e,t)=>{ti.init(e,t),V(e,`propValues`,e=>e.def.innerType._zod.propValues),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`optin`,e=>e.def.innerType?._zod?.optin),V(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Ta):Ta(r)}});function Ta(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Ea=/*@__PURE__*/ H(`$ZodCustom`,(e,t)=>{Fr.init(e,t),ti.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Da(t,n,r,e));Da(i,n,r,e)}});function Da(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(cn(e))}}var Oa=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const ka=`~memo`,Aa=[];function ja(e){return typeof e==`object`&&!!e}function Ma(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Na=/*@__PURE__*/ new WeakMap;function Pa(e,t,n){let r=Na.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=Pa(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?Pa(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=xt(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Pa(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Fa(e,i)}function Fa(e,t){return t!==1&&Na.set(e,t===2),t}function Ia(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let La;const Ra=[],za={alloc(e,t,n){let r=La;if(!r)return n;La=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ra.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Va(n,e.value))throw new Oa;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Pa(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!ja(l))return t(s,c);let u=c[ka];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[ka]=u);let d;i===c?d=a:(d=Ia(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Ma(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;La=d;let p=Ra.length,m=t(s,c);La=void 0;let h=Ra.length>p?Ra.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ma(e.issues):Aa),e)):(h&&(h.issues=m.issues.length?Ma(m.issues):Aa),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ba(){return za}function Va(e,t){let n=e[ka]?.backEdges;return n!==void 0&&ja(t)&&n.has(t)}const Ha=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(sn(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Rt(e.values[0])}`:`Invalid option: expected one of ${pt(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${pt(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ua(){return{localeError:Ha()}}var Wa,Ga=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ka(){return new Ga}(Wa=globalThis).__zod_globalRegistry??(Wa.__zod_globalRegistry=Ka());const qa=globalThis.__zod_globalRegistry;function Ja(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
87
- function Ya(e,t){return new e(Ja({type:`string`,...B(t)}))}// @__NO_SIDE_EFFECTS__
88
- function Xa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
89
- function Za(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
90
- function Qa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
91
- function $a(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...B(t)})}// @__NO_SIDE_EFFECTS__
92
- function eo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...B(t)})}// @__NO_SIDE_EFFECTS__
93
- function to(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...B(t)})}// @__NO_SIDE_EFFECTS__
94
- function no(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
95
- function ro(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
96
- function io(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
97
- function ao(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
98
- function oo(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
99
- function so(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
100
- function co(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
101
- function lo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
102
- function uo(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
103
- function fo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
104
- function po(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
105
- function mo(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
106
- function ho(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
107
- function go(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
108
- function _o(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
109
- function vo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
110
- function yo(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...B(t)})}// @__NO_SIDE_EFFECTS__
111
- function bo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...B(t)})}// @__NO_SIDE_EFFECTS__
112
- function xo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...B(t)})}// @__NO_SIDE_EFFECTS__
113
- function So(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...B(t)})}// @__NO_SIDE_EFFECTS__
114
- function Co(e,t){return new e(Ja({type:`number`,coerce:!0,checks:[],...B(t)}))}// @__NO_SIDE_EFFECTS__
115
- function wo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...B(t)})}// @__NO_SIDE_EFFECTS__
116
- function To(e,t){return new e({type:`boolean`,...B(t)})}// @__NO_SIDE_EFFECTS__
117
- function Eo(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
118
- function Do(e,t){return new e({type:`never`,...B(t)})}// @__NO_SIDE_EFFECTS__
119
- function Oo(e,t){return new Rr({check:`less_than`,...B(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
120
- function ko(e,t){return new Rr({check:`less_than`,...B(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
121
- function Ao(e,t){return new zr({check:`greater_than`,...B(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
122
- function jo(e,t){return new zr({check:`greater_than`,...B(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
123
- function Mo(e,t){return new Br({check:`multiple_of`,...B(t),value:e})}// @__NO_SIDE_EFFECTS__
124
- function No(e,t){return new Hr({check:`max_length`,...B(t),maximum:e})}// @__NO_SIDE_EFFECTS__
125
- function Po(e,t){return new Ur({check:`min_length`,...B(t),minimum:e})}// @__NO_SIDE_EFFECTS__
126
- function Fo(e,t){return new Wr({check:`length_equals`,...B(t),length:e})}// @__NO_SIDE_EFFECTS__
127
- function Io(e,t){return new Kr({check:`string_format`,format:`regex`,...B(t),pattern:e})}// @__NO_SIDE_EFFECTS__
128
- function Lo(e){return new qr({check:`string_format`,format:`lowercase`,...B(e)})}// @__NO_SIDE_EFFECTS__
129
- function Ro(e){return new Jr({check:`string_format`,format:`uppercase`,...B(e)})}// @__NO_SIDE_EFFECTS__
130
- function zo(e,t){return new Yr({check:`string_format`,format:`includes`,...B(t),includes:e})}// @__NO_SIDE_EFFECTS__
131
- function Bo(e,t){return new Xr({check:`string_format`,format:`starts_with`,...B(t),prefix:e})}// @__NO_SIDE_EFFECTS__
132
- function Vo(e,t){return new Zr({check:`string_format`,format:`ends_with`,...B(t),suffix:e})}// @__NO_SIDE_EFFECTS__
133
- function Ho(e){return new Qr({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
134
- function Uo(e){return/* @__PURE__ */ Ho(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
135
- function Wo(){return/* @__PURE__ */ Ho(e=>e.trim())}// @__NO_SIDE_EFFECTS__
136
- function Go(){return/* @__PURE__ */ Ho(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
137
- function Ko(){return/* @__PURE__ */ Ho(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
138
- function qo(){return/* @__PURE__ */ Ho(e=>kt(e))}// @__NO_SIDE_EFFECTS__
139
- function Jo(e,t,n){return new e({type:`array`,element:t,...B(n)})}// @__NO_SIDE_EFFECTS__
140
- function Yo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...B(n)})}// @__NO_SIDE_EFFECTS__
141
- function Xo(e,t){let n=/* @__PURE__ */ Zo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(cn(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(cn(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
142
- function Zo(e,t){let n=new Fr({check:`custom`,...B(t)});return n._zod.check=e,n}function Qo(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&bt(e,t,n[t]);return e}function $o(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??qa,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function es(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function ts(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,ts(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Qo(o.schema,c),t.io===`input`&&ds(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ns(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function rs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ns(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ns(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
88
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=jt,c=!Dn.jitless,l=c&&Mt.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?na([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function aa(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Zt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>rn(e,r,On())))}),t)}const oa=/*@__PURE__*/ H(`$ZodUnion`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),V(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),V(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),V(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>vt(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>aa(t,r,e,i)):aa(o,r,e,i)}}),sa=/*@__PURE__*/ H(`$ZodIntersection`,(e,t)=>{ti.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>la(e,t,n)):la(e,i,a)}});function ca(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nt(e)&&Nt(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=ca(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ca(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function la(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=ca(t.value,n.value);if(!c.valid){if(Zt(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const ua=/*@__PURE__*/ H(`$ZodRecord`,(e,t)=>{ti.init(e,t);let n=Dn.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Nt(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>rn(e,i,On())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...$t(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...$t(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&jr.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>rn(e,i,On())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...$t(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...$t(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),da=/*@__PURE__*/ H(`$ZodEnum`,(e,t)=>{ti.init(e,t);let n=ft(t.entries),r=new Set(n);e._zod.values=r,V(e,`pattern`,e=>{let t=ft(e.def.entries).filter(e=>Ft.has(typeof e));return RegExp(t.length?`^(${t.map(e=>It(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),fa=/*@__PURE__*/ H(`$ZodTransform`,(e,t)=>{ti.init(e,t),e._zod.optin=`optional`,Dn.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new En(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Tn;return n.value=i,n}});function pa(e,t){return e.value=t.issues.length?void 0:t.value,e}const ma=/*@__PURE__*/ H(`$ZodOptional`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${vt(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>pa(e,t)):pa(e,r)}return t.innerType._zod.run(e,n)}}),ha=/*@__PURE__*/ H(`$ZodExactOptional`,(e,t)=>{ma.init(e,t),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ga=/*@__PURE__*/ H(`$ZodNullable`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${vt(t.source)}|null)$`):void 0}),V(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),_a=/*@__PURE__*/ H(`$ZodDefault`,(e,t)=>{ti.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>va(e,t)):va(r,t)}});function va(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ya=/*@__PURE__*/ H(`$ZodPrefault`,(e,t)=>{ti.init(e,t),e._zod.optin=`defaulted`,V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ba=/*@__PURE__*/ H(`$ZodNonOptional`,(e,t)=>{ti.init(e,t),V(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>xa(t,e)):xa(i,e)}});function xa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Sa(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>rn(e,r,On()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Ca=/*@__PURE__*/ H(`$ZodCatch`,(e,t)=>{ti.init(e,t),V(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),V(e,`optout`,e=>e.def.innerType._zod.optout),V(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Sa(e,r,t,n)):Sa(e,r,t,n)}}),wa=/*@__PURE__*/ H(`$ZodPipe`,(e,t)=>{ti.init(e,t),V(e,`values`,e=>e.def.in._zod.values),V(e,`optin`,e=>e.def.in._zod.optin),V(e,`optout`,e=>e.def.out._zod.optout),V(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ta(e,t.in,n)):Ta(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ta(e,t.out,n)):Ta(r,t.out,n)}});function Ta(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ea=/*@__PURE__*/ H(`$ZodReadonly`,(e,t)=>{ti.init(e,t),V(e,`propValues`,e=>e.def.innerType._zod.propValues),V(e,`values`,e=>e.def.innerType._zod.values),V(e,`optin`,e=>e.def.innerType?._zod?.optin),V(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Da):Da(r)}});function Da(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Oa=/*@__PURE__*/ H(`$ZodCustom`,(e,t)=>{Fr.init(e,t),ti.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ka(t,n,r,e));ka(i,n,r,e)}});function ka(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ln(e))}}var Aa=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const ja=`~memo`,Ma=[];function Na(e){return typeof e==`object`&&!!e}function Pa(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Fa=/*@__PURE__*/ new WeakMap;function Ia(e,t,n){let r=Fa.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=Ia(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?Ia(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=xt(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ia(r,t,!1):1);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),La(e,i)}function La(e,t){return t!==1&&Fa.set(e,t===2),t}function Ra(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let za;const Ba=[],Va={alloc(e,t,n){let r=za;if(!r)return n;za=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ba.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ua(n,e.value))throw new Aa;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ia(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Na(l))return t(s,c);let u=c[ja];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[ja]=u);let d;i===c?d=a:(d=Ra(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Pa(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;za=d;let p=Ba.length,m=t(s,c);za=void 0;let h=Ba.length>p?Ba.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Pa(e.issues):Ma),e)):(h&&(h.issues=m.issues.length?Pa(m.issues):Ma),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ha(){return Va}function Ua(e,t){let n=e[ja]?.backEdges;return n!==void 0&&Na(t)&&n.has(t)}const Wa=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(cn(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Rt(e.values[0])}`:`Invalid option: expected one of ${pt(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${pt(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ga(){return{localeError:Wa()}}var Ka,qa=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ja(){return new qa}(Ka=globalThis).__zod_globalRegistry??(Ka.__zod_globalRegistry=Ja());const Ya=globalThis.__zod_globalRegistry;function Xa(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
89
+ function Za(e,t){return new e(Xa({type:`string`,...B(t)}))}// @__NO_SIDE_EFFECTS__
90
+ function Qa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
91
+ function $a(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
92
+ function eo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
93
+ function to(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...B(t)})}// @__NO_SIDE_EFFECTS__
94
+ function no(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...B(t)})}// @__NO_SIDE_EFFECTS__
95
+ function ro(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...B(t)})}// @__NO_SIDE_EFFECTS__
96
+ function io(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
97
+ function ao(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
98
+ function oo(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
99
+ function so(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
100
+ function co(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
101
+ function lo(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
102
+ function uo(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
103
+ function fo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
104
+ function po(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
105
+ function mo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
106
+ function ho(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
107
+ function go(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
108
+ function _o(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
109
+ function vo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
110
+ function yo(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
111
+ function bo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...B(t)})}// @__NO_SIDE_EFFECTS__
112
+ function xo(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...B(t)})}// @__NO_SIDE_EFFECTS__
113
+ function So(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...B(t)})}// @__NO_SIDE_EFFECTS__
114
+ function Co(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...B(t)})}// @__NO_SIDE_EFFECTS__
115
+ function wo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...B(t)})}// @__NO_SIDE_EFFECTS__
116
+ function To(e,t){return new e(Xa({type:`number`,coerce:!0,checks:[],...B(t)}))}// @__NO_SIDE_EFFECTS__
117
+ function Eo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...B(t)})}// @__NO_SIDE_EFFECTS__
118
+ function Do(e,t){return new e({type:`boolean`,...B(t)})}// @__NO_SIDE_EFFECTS__
119
+ function Oo(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
120
+ function ko(e,t){return new e({type:`never`,...B(t)})}// @__NO_SIDE_EFFECTS__
121
+ function Ao(e,t){return new Rr({check:`less_than`,...B(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
122
+ function jo(e,t){return new Rr({check:`less_than`,...B(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
123
+ function Mo(e,t){return new zr({check:`greater_than`,...B(t),value:e,inclusive:!1})}// @__NO_SIDE_EFFECTS__
124
+ function No(e,t){return new zr({check:`greater_than`,...B(t),value:e,inclusive:!0})}// @__NO_SIDE_EFFECTS__
125
+ function Po(e,t){return new Br({check:`multiple_of`,...B(t),value:e})}// @__NO_SIDE_EFFECTS__
126
+ function Fo(e,t){return new Hr({check:`max_length`,...B(t),maximum:e})}// @__NO_SIDE_EFFECTS__
127
+ function Io(e,t){return new Ur({check:`min_length`,...B(t),minimum:e})}// @__NO_SIDE_EFFECTS__
128
+ function Lo(e,t){return new Wr({check:`length_equals`,...B(t),length:e})}// @__NO_SIDE_EFFECTS__
129
+ function Ro(e,t){return new Kr({check:`string_format`,format:`regex`,...B(t),pattern:e})}// @__NO_SIDE_EFFECTS__
130
+ function zo(e){return new qr({check:`string_format`,format:`lowercase`,...B(e)})}// @__NO_SIDE_EFFECTS__
131
+ function Bo(e){return new Jr({check:`string_format`,format:`uppercase`,...B(e)})}// @__NO_SIDE_EFFECTS__
132
+ function Vo(e,t){return new Yr({check:`string_format`,format:`includes`,...B(t),includes:e})}// @__NO_SIDE_EFFECTS__
133
+ function Ho(e,t){return new Xr({check:`string_format`,format:`starts_with`,...B(t),prefix:e})}// @__NO_SIDE_EFFECTS__
134
+ function Uo(e,t){return new Zr({check:`string_format`,format:`ends_with`,...B(t),suffix:e})}// @__NO_SIDE_EFFECTS__
135
+ function Wo(e){return new Qr({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
136
+ function Go(e){return/* @__PURE__ */ Wo(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
137
+ function Ko(){return/* @__PURE__ */ Wo(e=>e.trim())}// @__NO_SIDE_EFFECTS__
138
+ function qo(){return/* @__PURE__ */ Wo(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
139
+ function Jo(){return/* @__PURE__ */ Wo(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
140
+ function Yo(){return/* @__PURE__ */ Wo(e=>kt(e))}// @__NO_SIDE_EFFECTS__
141
+ function Xo(e,t,n){return new e({type:`array`,element:t,...B(n)})}// @__NO_SIDE_EFFECTS__
142
+ function Zo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...B(n)})}// @__NO_SIDE_EFFECTS__
143
+ function Qo(e,t){let n=/* @__PURE__ */ $o(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ln(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ln(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
144
+ function $o(e,t){let n=new Fr({check:`custom`,...B(t)});return n._zod.check=e,n}function es(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&bt(e,t,n[t]);return e}function ts(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ya,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function ns(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function rs(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,rs(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&es(o.schema,c),t.io===`input`&&ps(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function is(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function as(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${is(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+is(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
143
145
 
144
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function is(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;is(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const as=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),os=[`oneOf`,`anyOf`];function ss(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function cs(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!as.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ss(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}bt(n,r,e.length===1?e[0]:cs(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ss(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function ls(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of as)if(t in e)return;let n=t.filter(e=>os.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=cs(t);else{let e=n[0],i=os.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>cs([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Qo(e,r))}function us(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Qo(i,s),Qo(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())is(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])ls(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Qo(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,bt(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ps(t,`input`,e.processors),output:ps(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ds(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ds(r.element,n);if(r.type===`set`)return ds(r.valueType,n);if(r.type===`lazy`)return ds(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return ds(r.innerType,n);if(r.type===`intersection`)return ds(r.left,n)||ds(r.right,n);if(r.type===`record`||r.type===`map`)return ds(r.keyType,n)||ds(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ds(r.in,n)||ds(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ds(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ds(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ds(e,n))return!0;return!!(r.rest&&ds(r.rest,n))}return!1}const fs=(e,t={})=>n=>{let r=$o({...n,processors:t});return ts(e,r),rs(r,e),us(r,e)},ps=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$o({...i??{},target:a,io:t,processors:n});return ts(e,o),rs(o,e),us(o,e)},ms=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},hs=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},gs=(e,t)=>{ms(e,`minimum`,t),hs(e,`maximum`,t)},_s=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},vs=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},ys=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},bs=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},xs=(e,t)=>ms(e,`minimum`,t.minimum),Ss=(e,t)=>hs(e,`maximum`,t.maximum),Cs=e=>(t,n)=>{bs(t,n.format);let[r,i]=e[n.format];ms(t,`minimum`,r),hs(t,`maximum`,i)},ws={greater_than:(e,t)=>ms(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>hs(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>_s(e,t.value),number_format:Cs(Bt),bigint_format:Cs(Vt),min_length:xs,max_length:Ss,length_equals:(e,t)=>gs(e,t.length),min_size:xs,max_size:Ss,size_equals:(e,t)=>gs(e,t.size),string_format:(e,t)=>{bs(e,t.format),t.pattern&&vs(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ys(e,t.mime)};function Ts(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ws[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ms(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ms(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&hs(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&hs(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&_s(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ys(t,i.mime);for(let e of i.patterns??[])vs(t,e);return t}const Es={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ds=/* @__PURE__ */ new Map([[Ii,yr],[Ri,br]]),Os=e=>Ds.get(e)??e,ks=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Ts(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Es[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Os);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},As=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Ts(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):es(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},js=(e,t,n,r)=>{n.type=`boolean`},Ms=(e,t,n,r)=>{n.not={}},Ns=(e,t,n,r)=>{let i=e._zod.def,a=ft(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ps=(e,t,n,r)=>{es(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Fs=(e,t,n,r)=>{es(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Is=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Ts(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=ts(a.element,t,{...r,path:[...r.path,`items`]})};function Ls(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ls(t.out):t.type===`catch`?Ls(t.innerType):e._zod.optin}const Rs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&es(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)bt(i.properties,e,ts(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Ls(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ts(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},zs=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>ts(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Bs=(e,t,n,r)=>{let i=e._zod.def,a=ts(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=ts(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Vs(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Vs(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Vs(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?jr:Ar).source),p):p}const Hs=/* @__PURE__ */ new WeakMap;function Us(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Hs.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Vs(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Ws=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Ts(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=ts(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)bt(i.patternProperties,Os(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=ts(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Hs.get(t);n||(n=[],Hs.set(t,n),t.deferred.push(()=>Us(t))),n.push(e)}i.additionalProperties=ts(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ls(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Gs=(e,t,n,r)=>{let i=e._zod.def,a=ts(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ks=(e,t,n,r)=>{let i=e._zod.def;ts(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qs=Symbol();function Js(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(es(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),qs):JSON.parse(o)}const Ys=(e,t,n,r)=>{let i=e._zod.def;ts(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Js(i.defaultValue,e,t,n,r);o!==qs&&(n.default=o)},Xs=(e,t,n,r)=>{let i=e._zod.def;ts(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Js(i.defaultValue,e,t,n,r);o!==qs&&(n._prefault=o)},Zs=(e,t,n,r)=>{let i=e._zod.def;ts(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{es(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Qs=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;ts(o,t,r);let s=t.seen.get(e);s.ref=o},$s=(e,t,n,r)=>{let i=e._zod.def;ts(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},ec=(e,t,n,r)=>{let i=e._zod.def;ts(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function nc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const rc=/*@__PURE__*/ H(`ZodError`,(e,t)=>{Pn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);tc.has(n)||(tc.add(n),nc(n,`format`,e=>t=>Ln(e,t)),nc(n,`flatten`,e=>t=>In(e,t)),nc(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,mt,2)}),nc(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,mt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ic=/* @__PURE__ */ zn(rc),ac=/* @__PURE__ */ Bn(rc),oc=/* @__PURE__ */ Vn(rc),sc=/* @__PURE__ */ Un(rc),cc=/* @__PURE__ */ Yn(rc),lc=/* @__PURE__ */ Xn(rc),uc=/* @__PURE__ */ Zn(rc),dc=/* @__PURE__ */ Qn(rc),fc=/* @__PURE__ */ $n(rc),pc=/* @__PURE__ */ er(rc),mc=/* @__PURE__ */ tr(rc),hc=/* @__PURE__ */ nr(rc);function gc(){En.localeError||Dn(Ua())}function _c(){En.memoizer||Dn({memoizer:Ba()})}const vc=/*@__PURE__*/ H(`ZodType`,(e,t)=>(gc(),ti.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Dt(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Lt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Fl(e,t))},superRefine(e,t){return this.check(Il(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Ho(e))},optional(){return _l(this)},exactOptional(){return yl(this)},nullable(){return xl(this)},nullish(){return _l(xl(this))},nonoptional(e){return Dl(this,e)},array(){return nl(this)},or(e){return sl([this,e])},and(e){return ll(this,e)},transform(e){return jl(this,hl(e))},default(e){return Cl(this,e)},prefault(e){return Tl(this,e)},catch(e){return kl(this,e)},pipe(e){return jl(this,e)},readonly(){return Nl(this)},describe(e){let t=this.clone();return qa.add(t,{description:e}),t},meta(...e){if(e.length===0)return qa.get(this);let t=this.clone();return qa.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return dn(this,`~standard`,{...ii(this),jsonSchema:{input:ps(this,`input`),output:ps(this,`output`)}})},set"~standard"(e){un(this,`~standard`,e)},parse:function e(t,n){return ic(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ac(this,t,n,{callee:e})},safeParse(e,t){return oc(this,e,t)},async safeParseAsync(e,t){return sc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){un(this,`spa`,e)},validate(e,t){return Kn(this,e,t)},validateAsync(e,t){return Jn(this,e,t)},encode:function e(t,n){return cc(this,t,n,{callee:e})},decode:function e(t,n){return lc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await uc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await dc(this,t,n,{callee:e})},safeEncode(e,t){return fc(this,e,t)},safeDecode(e,t){return pc(this,e,t)},async safeEncodeAsync(e,t){return mc(this,e,t)},async safeDecodeAsync(e,t){return hc(this,e,t)},toJSONSchema(e){return fs(this,{})(e)},get description(){return qa.get(this)?.description},get _def(){return this._zod.def}}),yc=/*@__PURE__*/ H(`_ZodString`,(e,t)=>{ai.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r)},/*@__PURE__*/ fn({format:e=>Ts(e).format??null,minLength:e=>Ts(e).minimum??null,maxLength:e=>Ts(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Io(...e))},includes(...e){return this.check(/* @__PURE__ */ zo(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Bo(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Vo(...e))},min(...e){return this.check(/* @__PURE__ */ Po(...e))},max(...e){return this.check(/* @__PURE__ */ No(...e))},length(...e){return this.check(/* @__PURE__ */ Fo(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Po(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Lo(e))},uppercase(e){return this.check(/* @__PURE__ */ Ro(e))},trim(){return this.check(/* @__PURE__ */ Wo())},normalize(...e){return this.check(/* @__PURE__ */ Uo(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Go())},toUpperCase(){return this.check(/* @__PURE__ */ Ko())},slugify(){return this.check(/* @__PURE__ */ qo())}})),bc=/*@__PURE__*/ H(`ZodString`,(e,t)=>{ai.init(e,t),yc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Xa(Dc,e))},url(e){return this.check(/* @__PURE__ */ no(Ac,e))},jwt(e){return this.check(/* @__PURE__ */ vo(Gc,e))},emoji(e){return this.check(/* @__PURE__ */ ro(jc,e))},guid(e){return this.check(/* @__PURE__ */ Za(Oc,e))},uuid(e){return this.check(/* @__PURE__ */ Qa(kc,e))},uuidv4(e){return this.check(/* @__PURE__ */ $a(kc,e))},uuidv6(e){return this.check(/* @__PURE__ */ eo(kc,e))},uuidv7(e){return this.check(/* @__PURE__ */ to(kc,e))},nanoid(e){return this.check(/* @__PURE__ */ io(Mc,e))},cuid(e){return this.check(/* @__PURE__ */ ao(Nc,e))},cuid2(e){return this.check(/* @__PURE__ */ oo(Pc,e))},ulid(e){return this.check(/* @__PURE__ */ so(Fc,e))},base64(e){return this.check(/* @__PURE__ */ ho(Hc,e))},base64url(e){return this.check(/* @__PURE__ */ go(Uc,e))},xid(e){return this.check(/* @__PURE__ */ co(Ic,e))},ksuid(e){return this.check(/* @__PURE__ */ lo(Lc,e))},ipv4(e){return this.check(/* @__PURE__ */ uo(Rc,e))},ipv6(e){return this.check(/* @__PURE__ */ fo(zc,e))},cidrv4(e){return this.check(/* @__PURE__ */ po(Bc,e))},cidrv6(e){return this.check(/* @__PURE__ */ mo(Vc,e))},e164(e){return this.check(/* @__PURE__ */ _o(Wc,e))},datetime(e){return this.check(/* @__PURE__ */ yo(Cc,e))},date(e){return this.check(/* @__PURE__ */ bo(wc,e))},time(e){return this.check(/* @__PURE__ */ xo(Tc,e))},duration(e){return this.check(/* @__PURE__ */ So(Ec,e))}});function xc(e){return/* @__PURE__ */ Ya(bc,e)}const Sc=/*@__PURE__*/ H(`ZodStringFormat`,(e,t)=>{U.init(e,t),yc.init(e,t)}),Cc=/*@__PURE__*/ H(`ZodISODateTime`,(e,t)=>{wi.init(e,t),Sc.init(e,t)}),wc=/*@__PURE__*/ H(`ZodISODate`,(e,t)=>{Ti.init(e,t),Sc.init(e,t)}),Tc=/*@__PURE__*/ H(`ZodISOTime`,(e,t)=>{Ei.init(e,t),Sc.init(e,t)}),Ec=/*@__PURE__*/ H(`ZodISODuration`,(e,t)=>{Di.init(e,t),Sc.init(e,t)}),Dc=/*@__PURE__*/ H(`ZodEmail`,(e,t)=>{ci.init(e,t),Sc.init(e,t)}),Oc=/*@__PURE__*/ H(`ZodGUID`,(e,t)=>{oi.init(e,t),Sc.init(e,t)}),kc=/*@__PURE__*/ H(`ZodUUID`,(e,t)=>{si.init(e,t),Sc.init(e,t)}),Ac=/*@__PURE__*/ H(`ZodURL`,(e,t)=>{gi.init(e,t),Sc.init(e,t)}),jc=/*@__PURE__*/ H(`ZodEmoji`,(e,t)=>{_i.init(e,t),Sc.init(e,t)}),Mc=/*@__PURE__*/ H(`ZodNanoID`,(e,t)=>{vi.init(e,t),Sc.init(e,t)}),Nc=/*@__PURE__*/ H(`ZodCUID`,(e,t)=>{yi.init(e,t),Sc.init(e,t)}),Pc=/*@__PURE__*/ H(`ZodCUID2`,(e,t)=>{bi.init(e,t),Sc.init(e,t)}),Fc=/*@__PURE__*/ H(`ZodULID`,(e,t)=>{xi.init(e,t),Sc.init(e,t)}),Ic=/*@__PURE__*/ H(`ZodXID`,(e,t)=>{Si.init(e,t),Sc.init(e,t)}),Lc=/*@__PURE__*/ H(`ZodKSUID`,(e,t)=>{Ci.init(e,t),Sc.init(e,t)}),Rc=/*@__PURE__*/ H(`ZodIPv4`,(e,t)=>{Oi.init(e,t),Sc.init(e,t)}),zc=/*@__PURE__*/ H(`ZodIPv6`,(e,t)=>{ji.init(e,t),Sc.init(e,t)}),Bc=/*@__PURE__*/ H(`ZodCIDRv4`,(e,t)=>{Mi.init(e,t),Sc.init(e,t)}),Vc=/*@__PURE__*/ H(`ZodCIDRv6`,(e,t)=>{Pi.init(e,t),Sc.init(e,t)}),Hc=/*@__PURE__*/ H(`ZodBase64`,(e,t)=>{Li.init(e,t),Sc.init(e,t)}),Uc=/*@__PURE__*/ H(`ZodBase64URL`,(e,t)=>{Bi.init(e,t),Sc.init(e,t)}),Wc=/*@__PURE__*/ H(`ZodE164`,(e,t)=>{Vi.init(e,t),Sc.init(e,t)}),Gc=/*@__PURE__*/ H(`ZodJWT`,(e,t)=>{Ui.init(e,t),Sc.init(e,t)}),Kc=/*@__PURE__*/ H(`ZodNumber`,(e,t)=>{Wi.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ fn({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Ts(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Ts(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Ts(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Ts(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Ao(e,t))},gte(e,t){return this.check(/* @__PURE__ */ jo(e,t))},min(e,t){return this.check(/* @__PURE__ */ jo(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Oo(e,t))},lte(e,t){return this.check(/* @__PURE__ */ ko(e,t))},max(e,t){return this.check(/* @__PURE__ */ ko(e,t))},int(e){return this.check(Jc(e))},safe(e){return this.check(Jc(e))},positive(e){return this.check(/* @__PURE__ */ Ao(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ jo(0,e))},negative(e){return this.check(/* @__PURE__ */ Oo(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ ko(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Mo(e,t))},step(e,t){return this.check(/* @__PURE__ */ Mo(e,t))},finite(){return this}})),qc=/*@__PURE__*/ H(`ZodNumberFormat`,(e,t)=>{Gi.init(e,t),Kc.init(e,t)});function Jc(e){return/* @__PURE__ */ wo(qc,e)}const Yc=/*@__PURE__*/ H(`ZodBoolean`,(e,t)=>{Ki.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r)});function Xc(e){return/* @__PURE__ */ To(Yc,e)}const Zc=/*@__PURE__*/ H(`ZodUnknown`,(e,t)=>{qi.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Qc(){return/* @__PURE__ */ Eo(Zc)}const $c=/*@__PURE__*/ H(`ZodNever`,(e,t)=>{Ji.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r)});function el(e){return/* @__PURE__ */ Do($c,e)}const tl=/*@__PURE__*/ H(`ZodArray`,(e,t)=>{_c(),Xi.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Po(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Po(1,e))},max(e,t){return this.check(/* @__PURE__ */ No(e,t))},length(e,t){return this.check(/* @__PURE__ */ Fo(e,t))},unwrap(){return this.element}});function nl(e,t){return/* @__PURE__ */ Jo(tl,e,t)}const rl=/*@__PURE__*/ H(`ZodObject`,(e,t)=>{_c(),na.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),vn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return pl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Dt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Dt(this._zod.def,{catchall:Qc()}))},loose(){return this.clone(Dt(this._zod.def,{catchall:Qc()}))},strict(){return this.clone(Dt(this._zod.def,{catchall:el()}))},strip(){return this.clone(Dt(this._zod.def,{catchall:void 0}))},extend(e){return Gt(this,e)},safeExtend(e){return qt(this,e)},merge(e){return Jt(this,e)},pick(e){return Ht(this,e)},omit(e){return Wt(this,e)},partial(...e){return Yt(gl,this,e[0])},exactPartial(...e){return Yt(vl,this,e[0],`exactPartial`)},required(...e){return Xt(El,this,e[0])}});function il(e,t){let n={type:`object`,shape:e??{},...B(t)};return new rl(n)}function al(e,t){return new rl({type:`object`,shape:e,catchall:Qc(),...B(t)})}const ol=/*@__PURE__*/ H(`ZodUnion`,(e,t)=>{ia.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zs(e,t,n,r),e.options=t.options});function sl(e,t){return new ol({type:`union`,options:e,...B(t)})}const cl=/*@__PURE__*/ H(`ZodIntersection`,(e,t)=>{aa.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r)});function ll(e,t){return new cl({type:`intersection`,left:e,right:t})}const ul=/*@__PURE__*/ H(`ZodRecord`,(e,t)=>{_c(),ca.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ws(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function dl(e,t,n){return!t||!t._zod?new ul({type:`record`,keyType:xc(),valueType:e,...B(t)}):new ul({type:`record`,keyType:e,valueType:t,...B(n)})}const fl=/*@__PURE__*/ H(`ZodEnum`,(e,t)=>{la.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new fl({...t,checks:[],...B(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new fl({...t,checks:[],...B(r),entries:i})}});function pl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new fl({type:`enum`,entries:n,...B(t)})}const ml=/*@__PURE__*/ H(`ZodTransform`,(e,t)=>{_c(),ua.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Tn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(cn(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(cn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function hl(e){return new ml({type:`transform`,transform:e})}const gl=/*@__PURE__*/ H(`ZodOptional`,(e,t)=>{fa.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _l(e){return new gl({type:`optional`,innerType:e})}const vl=/*@__PURE__*/ H(`ZodExactOptional`,(e,t)=>{pa.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yl(e){return new vl({type:`optional`,innerType:e})}const bl=/*@__PURE__*/ H(`ZodNullable`,(e,t)=>{ma.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xl(e){return new bl({type:`nullable`,innerType:e})}const Sl=/*@__PURE__*/ H(`ZodDefault`,(e,t)=>{ha.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ys(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Cl(e,t){return new Sl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const wl=/*@__PURE__*/ H(`ZodPrefault`,(e,t)=>{_a.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tl(e,t){return new wl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const El=/*@__PURE__*/ H(`ZodNonOptional`,(e,t)=>{va.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dl(e,t){return new El({type:`nonoptional`,innerType:e,...B(t)})}const Ol=/*@__PURE__*/ H(`ZodCatch`,(e,t)=>{xa.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function kl(e,t){return new Ol({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:yn(t)})}const Al=/*@__PURE__*/ H(`ZodPipe`,(e,t)=>{Sa.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qs(e,t,n,r),e.in=t.in,e.out=t.out});function jl(e,t){return new Al({type:`pipe`,in:e,out:t})}const Ml=/*@__PURE__*/ H(`ZodReadonly`,(e,t)=>{wa.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nl(e){return new Ml({type:`readonly`,innerType:e})}const Pl=/*@__PURE__*/ H(`ZodCustom`,(e,t)=>{Ea.init(e,t),vc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r)});function Fl(e,t={}){return/* @__PURE__ */ Yo(Pl,e,t)}function Il(e,t){return/* @__PURE__ */ Xo(e,t)}function Ll(e){return/* @__PURE__ */ Co(Kc,e)}const Rl=Je(`@longzai-intelligence-cli/core/provider`),zl={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 Bl={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Rl.info(e),stop:e=>Rl.info(e)}),note:(e,t)=>{t?Rl.info(`${t}: ${e}`):Rl.info(e)},log:{info:e=>Rl.info(e),success:e=>Rl.info(e),warn:e=>Rl.warn(e),error:e=>Rl.error(e),step:e=>Rl.info(e)}},Vl=zl;function Hl(e){Bl=e}function Ul(e){Vl=e}function Wl(){return Bl}function Gl(){return Vl}const Kl=()=>`0.0.10`;function ql(e){let t=e.version??Kl();e.interaction&&Hl(e.interaction),e.color&&Ul(e.color);let n=new ct;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}Je(`@longzai-intelligence-cli/core/output`),Je(`@longzai-intelligence-cli/core/progress`);const Jl=Je(`@longzai-intelligence-cli/core/define-command`);function Yl(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Xl(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=Yl(e,n);for(let e of r)a=Yl(a,e);return a.command(i)}function Zl(e,t){let n=Xl(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(!(n instanceof ct))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(`, `);Jl.error(Gl().red(`参数校验失败: ${e}`)),Wl().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var Ql=/* @__PURE__ */ C(import.meta.url);function $l(e){let t=v(e);return t.length>1&&t[t.length-1]===S&&(t=t.substring(0,t.length-1)),t}const eu=/[\\/]/g;function tu(e,t){return e.replace(eu,t)}const nu=/^[a-z]:[\\/]$/i;function ru(e){return e===`/`||nu.test(e)}function iu(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=x(e)),(r||a)&&(e=$l(e)),e===`.`?``:tu(e[e.length-1]===i?e:e+i,i)}function au(e,t){return t+e}function ou(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:tu(b(e,r),t.pathSeparator)+t.pathSeparator+n}}function su(e){return e}function cu(e,t,n){return t+e+n}function lu(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?ou(e,t):r?au:su}function uu(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function du(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const fu=(e,t)=>{t.push(e||`.`)},pu=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},mu=()=>{};function hu(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?du(e):uu(e):r&&r.length?pu:fu:mu}const gu=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},_u=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},vu=(e,t,n,r)=>{n.files++},yu=(e,t)=>{t.push(e)},bu=()=>{};function xu(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?bu:n&&n.length?r?gu:_u:r?vu:yu}const Su=e=>e,Cu=()=>[``].slice(0,0);function wu(e){return e.group?Cu:Su}const Tu=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},Eu=()=>{};function Du(e){return e.group?Tu:Eu}const Ou=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()&&ju(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},ku=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()&&ju(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function Au(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?ku:Ou}function ju(e,t,n){if(n.options.useRealPaths)return Mu(t,n);let r=g(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=g(r)}return n.symlinks.set(e,t),i>1}function Mu(e,t){return t.visited.includes(e+t.options.pathSeparator)}const Nu=e=>e.counts,Pu=e=>e.groups,Fu=e=>e.paths,Iu=e=>e.paths.slice(0,e.options.maxFiles),Lu=(e,t,n)=>(Vu(t,n,e.counts,e.options.suppressErrors),null),Ru=(e,t,n)=>(Vu(t,n,e.paths,e.options.suppressErrors),null),zu=(e,t,n)=>(Vu(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),Bu=(e,t,n)=>(Vu(t,n,e.groups,e.options.suppressErrors),null);function Vu(e,t,n,r){t(e&&!r?e:null,n)}function Hu(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?Nu:Lu:r?t?Pu:Bu:i?t?Iu:zu:t?Fu:Ru}const Uu={withFileTypes:!0},Wu=(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||`.`,Uu,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},Gu=(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||`.`,Uu)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function Ku(e){return e?Gu:Wu}var qu=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))}},Ju=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}
146
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function os(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;os(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const ss=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),cs=[`oneOf`,`anyOf`];function ls(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function us(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!ss.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ls(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}bt(n,r,e.length===1?e[0]:us(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ls(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function ds(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of ss)if(t in e)return;let n=t.filter(e=>cs.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=us(t);else{let e=n[0],i=cs.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>us([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,es(e,r))}function fs(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):es(i,s),es(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())os(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])ds(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}es(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,bt(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:hs(t,`input`,e.processors),output:hs(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ps(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ps(r.element,n);if(r.type===`set`)return ps(r.valueType,n);if(r.type===`lazy`)return ps(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return ps(r.innerType,n);if(r.type===`intersection`)return ps(r.left,n)||ps(r.right,n);if(r.type===`record`||r.type===`map`)return ps(r.keyType,n)||ps(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ps(r.in,n)||ps(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ps(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ps(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ps(e,n))return!0;return!!(r.rest&&ps(r.rest,n))}return!1}const ms=(e,t={})=>n=>{let r=ts({...n,processors:t});return rs(e,r),as(r,e),fs(r,e)},hs=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ts({...i??{},target:a,io:t,processors:n});return rs(e,o),as(o,e),fs(o,e)},gs=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_s=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},vs=(e,t)=>{gs(e,`minimum`,t),_s(e,`maximum`,t)},ys=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},bs=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},xs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Ss=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Cs=(e,t)=>gs(e,`minimum`,t.minimum),ws=(e,t)=>_s(e,`maximum`,t.maximum),Ts=e=>(t,n)=>{Ss(t,n.format);let[r,i]=e[n.format];gs(t,`minimum`,r),_s(t,`maximum`,i)},Es={greater_than:(e,t)=>gs(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>_s(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ys(e,t.value),number_format:Ts(Bt),bigint_format:Ts(Vt),min_length:Cs,max_length:ws,length_equals:(e,t)=>vs(e,t.length),min_size:Cs,max_size:ws,size_equals:(e,t)=>vs(e,t.size),string_format:(e,t)=>{Ss(e,t.format),t.pattern&&bs(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>xs(e,t.mime)};function Ds(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Es[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&gs(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&gs(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&_s(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&_s(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ys(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&xs(t,i.mime);for(let e of i.patterns??[])bs(t,e);return t}const Os={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ks=/* @__PURE__ */ new Map([[Ii,yr],[Ri,br]]),As=e=>ks.get(e)??e,js=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Ds(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Os[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(As);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ms=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Ds(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=/* @__PURE__ */ new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):ns(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Ns=(e,t,n,r)=>{n.type=`boolean`},Ps=(e,t,n,r)=>{n.not={}},Fs=(e,t,n,r)=>{let i=e._zod.def,a=ft(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Is=(e,t,n,r)=>{ns(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ls=(e,t,n,r)=>{ns(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Rs=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Ds(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=rs(a.element,t,{...r,path:[...r.path,`items`]})};function zs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?zs(t.out):t.type===`catch`?zs(t.innerType):e._zod.optin}const Bs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&ns(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)bt(i.properties,e,rs(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?zs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=rs(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Vs=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>rs(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Hs=(e,t,n,r)=>{let i=e._zod.def,a=rs(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=rs(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Us(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Us(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Us(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?jr:Ar).source)),p}const Ws=/* @__PURE__ */ new WeakMap;function Gs(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Ws.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Us(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Ks=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Ds(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=rs(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)bt(i.patternProperties,As(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=rs(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Ws.get(t);n||(n=[],Ws.set(t,n),t.deferred.push(()=>Gs(t))),n.push(e)}i.additionalProperties=rs(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&zs(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},qs=(e,t,n,r)=>{let i=e._zod.def,a=rs(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Js=(e,t,n,r)=>{let i=e._zod.def;rs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ys=Symbol();function Xs(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(ns(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ys):JSON.parse(o)}const Zs=(e,t,n,r)=>{let i=e._zod.def;rs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Xs(i.defaultValue,e,t,n,r);o!==Ys&&(n.default=o)},Qs=(e,t,n,r)=>{let i=e._zod.def;rs(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Xs(i.defaultValue,e,t,n,r);o!==Ys&&(n._prefault=o)},$s=(e,t,n,r)=>{let i=e._zod.def;rs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{ns(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ec=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;rs(o,t,r);let s=t.seen.get(e);s.ref=o},tc=(e,t,n,r)=>{let i=e._zod.def;rs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},nc=(e,t,n,r)=>{let i=e._zod.def;rs(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},rc=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function ic(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const ac=/*@__PURE__*/ H(`ZodError`,(e,t)=>{Pn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);rc.has(n)||(rc.add(n),ic(n,`format`,e=>t=>Ln(e,t)),ic(n,`flatten`,e=>t=>In(e,t)),ic(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,mt,2)}),ic(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,mt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),oc=/* @__PURE__ */ zn(ac),sc=/* @__PURE__ */ Bn(ac),cc=/* @__PURE__ */ Vn(ac),lc=/* @__PURE__ */ Un(ac),uc=/* @__PURE__ */ Yn(ac),dc=/* @__PURE__ */ Xn(ac),fc=/* @__PURE__ */ Zn(ac),pc=/* @__PURE__ */ Qn(ac),mc=/* @__PURE__ */ $n(ac),hc=/* @__PURE__ */ er(ac),gc=/* @__PURE__ */ tr(ac),_c=/* @__PURE__ */ nr(ac);function vc(){Dn.localeError||On(Ga())}function yc(){Dn.memoizer||On({memoizer:Ha()})}const bc=/*@__PURE__*/ H(`ZodType`,(e,t)=>(vc(),ti.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Dt(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Lt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ll(e,t))},superRefine(e,t){return this.check(Rl(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Wo(e))},optional(){return yl(this)},exactOptional(){return xl(this)},nullable(){return Cl(this)},nullish(){return yl(Cl(this))},nonoptional(e){return kl(this,e)},array(){return il(this)},or(e){return ll([this,e])},and(e){return dl(this,e)},transform(e){return Nl(this,_l(e))},default(e){return Tl(this,e)},prefault(e){return Dl(this,e)},catch(e){return jl(this,e)},pipe(e){return Nl(this,e)},readonly(){return Fl(this)},describe(e){let t=this.clone();return Ya.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ya.get(this);let t=this.clone();return Ya.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return fn(this,`~standard`,{...ii(this),jsonSchema:{input:hs(this,`input`),output:hs(this,`output`)}})},set"~standard"(e){dn(this,`~standard`,e)},parse:function e(t,n){return oc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await sc(this,t,n,{callee:e})},safeParse(e,t){return cc(this,e,t)},async safeParseAsync(e,t){return lc(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){dn(this,`spa`,e)},validate(e,t){return Kn(this,e,t)},validateAsync(e,t){return Jn(this,e,t)},encode:function e(t,n){return uc(this,t,n,{callee:e})},decode:function e(t,n){return dc(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await fc(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await pc(this,t,n,{callee:e})},safeEncode(e,t){return mc(this,e,t)},safeDecode(e,t){return hc(this,e,t)},async safeEncodeAsync(e,t){return gc(this,e,t)},async safeDecodeAsync(e,t){return _c(this,e,t)},toJSONSchema(e){return ms(this,{})(e)},get description(){return Ya.get(this)?.description},get _def(){return this._zod.def}}),xc=/*@__PURE__*/ H(`_ZodString`,(e,t)=>{ai.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r)},/*@__PURE__*/ pn({format:e=>Ds(e).format??null,minLength:e=>Ds(e).minimum??null,maxLength:e=>Ds(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Ro(...e))},includes(...e){return this.check(/* @__PURE__ */ Vo(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Ho(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Uo(...e))},min(...e){return this.check(/* @__PURE__ */ Io(...e))},max(...e){return this.check(/* @__PURE__ */ Fo(...e))},length(...e){return this.check(/* @__PURE__ */ Lo(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Io(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ zo(e))},uppercase(e){return this.check(/* @__PURE__ */ Bo(e))},trim(){return this.check(/* @__PURE__ */ Ko())},normalize(...e){return this.check(/* @__PURE__ */ Go(...e))},toLowerCase(){return this.check(/* @__PURE__ */ qo())},toUpperCase(){return this.check(/* @__PURE__ */ Jo())},slugify(){return this.check(/* @__PURE__ */ Yo())}})),Sc=/*@__PURE__*/ H(`ZodString`,(e,t)=>{ai.init(e,t),xc.init(e,t)},{email(e){return this.check(/* @__PURE__ */ Qa(kc,e))},url(e){return this.check(/* @__PURE__ */ io(Mc,e))},jwt(e){return this.check(/* @__PURE__ */ bo(qc,e))},emoji(e){return this.check(/* @__PURE__ */ ao(Nc,e))},guid(e){return this.check(/* @__PURE__ */ $a(Ac,e))},uuid(e){return this.check(/* @__PURE__ */ eo(jc,e))},uuidv4(e){return this.check(/* @__PURE__ */ to(jc,e))},uuidv6(e){return this.check(/* @__PURE__ */ no(jc,e))},uuidv7(e){return this.check(/* @__PURE__ */ ro(jc,e))},nanoid(e){return this.check(/* @__PURE__ */ oo(Pc,e))},cuid(e){return this.check(/* @__PURE__ */ so(Fc,e))},cuid2(e){return this.check(/* @__PURE__ */ co(Ic,e))},ulid(e){return this.check(/* @__PURE__ */ lo(Lc,e))},base64(e){return this.check(/* @__PURE__ */ _o(Wc,e))},base64url(e){return this.check(/* @__PURE__ */ vo(Gc,e))},xid(e){return this.check(/* @__PURE__ */ uo(Rc,e))},ksuid(e){return this.check(/* @__PURE__ */ fo(zc,e))},ipv4(e){return this.check(/* @__PURE__ */ po(Bc,e))},ipv6(e){return this.check(/* @__PURE__ */ mo(Vc,e))},cidrv4(e){return this.check(/* @__PURE__ */ ho(Hc,e))},cidrv6(e){return this.check(/* @__PURE__ */ go(Uc,e))},e164(e){return this.check(/* @__PURE__ */ yo(Kc,e))},datetime(e){return this.check(/* @__PURE__ */ xo(Tc,e))},date(e){return this.check(/* @__PURE__ */ So(Ec,e))},time(e){return this.check(/* @__PURE__ */ Co(Dc,e))},duration(e){return this.check(/* @__PURE__ */ wo(Oc,e))}});function Cc(e){return/* @__PURE__ */ Za(Sc,e)}const wc=/*@__PURE__*/ H(`ZodStringFormat`,(e,t)=>{U.init(e,t),xc.init(e,t)}),Tc=/*@__PURE__*/ H(`ZodISODateTime`,(e,t)=>{wi.init(e,t),wc.init(e,t)}),Ec=/*@__PURE__*/ H(`ZodISODate`,(e,t)=>{Ti.init(e,t),wc.init(e,t)}),Dc=/*@__PURE__*/ H(`ZodISOTime`,(e,t)=>{Ei.init(e,t),wc.init(e,t)}),Oc=/*@__PURE__*/ H(`ZodISODuration`,(e,t)=>{Di.init(e,t),wc.init(e,t)}),kc=/*@__PURE__*/ H(`ZodEmail`,(e,t)=>{ci.init(e,t),wc.init(e,t)}),Ac=/*@__PURE__*/ H(`ZodGUID`,(e,t)=>{oi.init(e,t),wc.init(e,t)}),jc=/*@__PURE__*/ H(`ZodUUID`,(e,t)=>{si.init(e,t),wc.init(e,t)}),Mc=/*@__PURE__*/ H(`ZodURL`,(e,t)=>{gi.init(e,t),wc.init(e,t)}),Nc=/*@__PURE__*/ H(`ZodEmoji`,(e,t)=>{_i.init(e,t),wc.init(e,t)}),Pc=/*@__PURE__*/ H(`ZodNanoID`,(e,t)=>{vi.init(e,t),wc.init(e,t)}),Fc=/*@__PURE__*/ H(`ZodCUID`,(e,t)=>{yi.init(e,t),wc.init(e,t)}),Ic=/*@__PURE__*/ H(`ZodCUID2`,(e,t)=>{bi.init(e,t),wc.init(e,t)}),Lc=/*@__PURE__*/ H(`ZodULID`,(e,t)=>{xi.init(e,t),wc.init(e,t)}),Rc=/*@__PURE__*/ H(`ZodXID`,(e,t)=>{Si.init(e,t),wc.init(e,t)}),zc=/*@__PURE__*/ H(`ZodKSUID`,(e,t)=>{Ci.init(e,t),wc.init(e,t)}),Bc=/*@__PURE__*/ H(`ZodIPv4`,(e,t)=>{Oi.init(e,t),wc.init(e,t)}),Vc=/*@__PURE__*/ H(`ZodIPv6`,(e,t)=>{ji.init(e,t),wc.init(e,t)}),Hc=/*@__PURE__*/ H(`ZodCIDRv4`,(e,t)=>{Mi.init(e,t),wc.init(e,t)}),Uc=/*@__PURE__*/ H(`ZodCIDRv6`,(e,t)=>{Pi.init(e,t),wc.init(e,t)}),Wc=/*@__PURE__*/ H(`ZodBase64`,(e,t)=>{Li.init(e,t),wc.init(e,t)}),Gc=/*@__PURE__*/ H(`ZodBase64URL`,(e,t)=>{Bi.init(e,t),wc.init(e,t)}),Kc=/*@__PURE__*/ H(`ZodE164`,(e,t)=>{Vi.init(e,t),wc.init(e,t)}),qc=/*@__PURE__*/ H(`ZodJWT`,(e,t)=>{Ui.init(e,t),wc.init(e,t)}),Jc=/*@__PURE__*/ H(`ZodNumber`,(e,t)=>{Wi.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.isFinite=!0},/*@__PURE__*/ pn({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Ds(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Ds(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Ds(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Ds(e).format??null},{gt(e,t){return this.check(/* @__PURE__ */ Mo(e,t))},gte(e,t){return this.check(/* @__PURE__ */ No(e,t))},min(e,t){return this.check(/* @__PURE__ */ No(e,t))},lt(e,t){return this.check(/* @__PURE__ */ Ao(e,t))},lte(e,t){return this.check(/* @__PURE__ */ jo(e,t))},max(e,t){return this.check(/* @__PURE__ */ jo(e,t))},int(e){return this.check(Xc(e))},safe(e){return this.check(Xc(e))},positive(e){return this.check(/* @__PURE__ */ Mo(0,e))},nonnegative(e){return this.check(/* @__PURE__ */ No(0,e))},negative(e){return this.check(/* @__PURE__ */ Ao(0,e))},nonpositive(e){return this.check(/* @__PURE__ */ jo(0,e))},multipleOf(e,t){return this.check(/* @__PURE__ */ Po(e,t))},step(e,t){return this.check(/* @__PURE__ */ Po(e,t))},finite(){return this}})),Yc=/*@__PURE__*/ H(`ZodNumberFormat`,(e,t)=>{Gi.init(e,t),Jc.init(e,t)});function Xc(e){return/* @__PURE__ */ Eo(Yc,e)}const Zc=/*@__PURE__*/ H(`ZodBoolean`,(e,t)=>{Ki.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r)});function Qc(e){return/* @__PURE__ */ Do(Zc,e)}const $c=/*@__PURE__*/ H(`ZodUnknown`,(e,t)=>{qi.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function el(){return/* @__PURE__ */ Oo($c)}const tl=/*@__PURE__*/ H(`ZodNever`,(e,t)=>{Ji.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r)});function nl(e){return/* @__PURE__ */ ko(tl,e)}const rl=/*@__PURE__*/ H(`ZodArray`,(e,t)=>{yc(),Qi.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Io(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Io(1,e))},max(e,t){return this.check(/* @__PURE__ */ Fo(e,t))},length(e,t){return this.check(/* @__PURE__ */ Lo(e,t))},unwrap(){return this.element}});function il(e,t){return/* @__PURE__ */ Xo(rl,e,t)}const al=/*@__PURE__*/ H(`ZodObject`,(e,t)=>{yc(),ia.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bs(e,t,n,r),yn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return hl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Dt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Dt(this._zod.def,{catchall:el()}))},loose(){return this.clone(Dt(this._zod.def,{catchall:el()}))},strict(){return this.clone(Dt(this._zod.def,{catchall:nl()}))},strip(){return this.clone(Dt(this._zod.def,{catchall:void 0}))},extend(e){return Gt(this,e)},safeExtend(e){return qt(this,e)},merge(e){return Jt(this,e)},pick(e){return Ht(this,e)},omit(e){return Wt(this,e)},partial(...e){return Yt(vl,this,e[0])},exactPartial(...e){return Yt(bl,this,e[0],`exactPartial`)},required(...e){return Xt(Ol,this,e[0])}});function ol(e,t){let n={type:`object`,shape:e??{},...B(t)};return new al(n)}function sl(e,t){return new al({type:`object`,shape:e,catchall:el(),...B(t)})}const cl=/*@__PURE__*/ H(`ZodUnion`,(e,t)=>{oa.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vs(e,t,n,r),e.options=t.options});function ll(e,t){return new cl({type:`union`,options:e,...B(t)})}const ul=/*@__PURE__*/ H(`ZodIntersection`,(e,t)=>{sa.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hs(e,t,n,r)});function dl(e,t){return new ul({type:`intersection`,left:e,right:t})}const fl=/*@__PURE__*/ H(`ZodRecord`,(e,t)=>{yc(),ua.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ks(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function pl(e,t,n){return!t||!t._zod?new fl({type:`record`,keyType:Cc(),valueType:e,...B(t)}):new fl({type:`record`,keyType:e,valueType:t,...B(n)})}const ml=/*@__PURE__*/ H(`ZodEnum`,(e,t)=>{da.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ml({...t,checks:[],...B(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ml({...t,checks:[],...B(r),entries:i})}});function hl(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ml({type:`enum`,entries:n,...B(t)})}const gl=/*@__PURE__*/ H(`ZodTransform`,(e,t)=>{yc(),fa.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new En(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ln(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ln(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function _l(e){return new gl({type:`transform`,transform:e})}const vl=/*@__PURE__*/ H(`ZodOptional`,(e,t)=>{ma.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yl(e){return new vl({type:`optional`,innerType:e})}const bl=/*@__PURE__*/ H(`ZodExactOptional`,(e,t)=>{ha.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xl(e){return new bl({type:`optional`,innerType:e})}const Sl=/*@__PURE__*/ H(`ZodNullable`,(e,t)=>{ga.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cl(e){return new Sl({type:`nullable`,innerType:e})}const wl=/*@__PURE__*/ H(`ZodDefault`,(e,t)=>{_a.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Tl(e,t){return new wl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const El=/*@__PURE__*/ H(`ZodPrefault`,(e,t)=>{ya.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dl(e,t){return new El({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Pt(t)}})}const Ol=/*@__PURE__*/ H(`ZodNonOptional`,(e,t)=>{ba.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kl(e,t){return new Ol({type:`nonoptional`,innerType:e,...B(t)})}const Al=/*@__PURE__*/ H(`ZodCatch`,(e,t)=>{Ca.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$s(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jl(e,t){return new Al({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:bn(t)})}const Ml=/*@__PURE__*/ H(`ZodPipe`,(e,t)=>{wa.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ec(e,t,n,r),e.in=t.in,e.out=t.out});function Nl(e,t){return new Ml({type:`pipe`,in:e,out:t})}const Pl=/*@__PURE__*/ H(`ZodReadonly`,(e,t)=>{Ea.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fl(e){return new Pl({type:`readonly`,innerType:e})}const Il=/*@__PURE__*/ H(`ZodCustom`,(e,t)=>{Oa.init(e,t),bc.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r)});function Ll(e,t={}){return/* @__PURE__ */ Zo(Il,e,t)}function Rl(e,t){return/* @__PURE__ */ Qo(e,t)}function zl(e){return/* @__PURE__ */ To(Jc,e)}const Bl=Je(`@longzai-intelligence-cli/core/provider`),Vl={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 Hl={select:async(e,t)=>t[0]?.value??``,textInput:async(e,t)=>t?.defaultValue??``,confirm:async(e,t)=>t?.defaultValue??!1,spinner:()=>({start:e=>Bl.info(e),stop:e=>Bl.info(e)}),note:(e,t)=>{t?Bl.info(`${t}: ${e}`):Bl.info(e)},log:{info:e=>Bl.info(e),success:e=>Bl.info(e),warn:e=>Bl.warn(e),error:e=>Bl.error(e),step:e=>Bl.info(e)}},Ul=Vl;function Wl(e){Hl=e}function Gl(e){Ul=e}function Kl(){return Hl}function ql(){return Ul}const Jl=()=>`0.0.10`;function Yl(e){let t=e.version??Jl();e.interaction&&Wl(e.interaction),e.color&&Gl(e.color);let n=new ct;return n.name(e.name).version(t,`-v, --version`,`输出 ${e.name} 的版本号`),e.description&&n.description(e.description),n}Je(`@longzai-intelligence-cli/core/output`),Je(`@longzai-intelligence-cli/core/progress`);const Xl=Je(`@longzai-intelligence-cli/core/define-command`);function Zl(e,t){let n=e.commands.find(e=>e.name()===t);return n===void 0?e.command(t):n}function Ql(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=Zl(e,n);for(let e of r)a=Zl(a,e);return a.command(i)}function $l(e,t){let n=Ql(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(!(n instanceof ct))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(`, `);Xl.error(ql().red(`参数校验失败: ${e}`)),Kl().log.error(`参数校验失败: ${e}`),process.exit(1)}await t.action(a.data,i)})}var eu=/* @__PURE__ */ C(import.meta.url);function tu(e){let t=v(e);return t.length>1&&t[t.length-1]===S&&(t=t.substring(0,t.length-1)),t}const nu=/[\\/]/g;function ru(e,t){return e.replace(nu,t)}const iu=/^[a-z]:[\\/]$/i;function au(e){return e===`/`||iu.test(e)}function ou(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=x(e)),(r||a)&&(e=tu(e)),e===`.`?``:ru(e[e.length-1]===i?e:e+i,i)}function su(e,t){return t+e}function cu(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:ru(b(e,r),t.pathSeparator)+t.pathSeparator+n}}function lu(e){return e}function uu(e,t,n){return t+e+n}function du(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?cu(e,t):r?su:lu}function fu(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function pu(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const mu=(e,t)=>{t.push(e||`.`)},hu=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},gu=()=>{};function _u(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?pu(e):fu(e):r&&r.length?hu:mu:gu}const vu=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},yu=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},bu=(e,t,n,r)=>{n.files++},xu=(e,t)=>{t.push(e)},Su=()=>{};function Cu(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?Su:n&&n.length?r?vu:yu:r?bu:xu}const wu=e=>e,Tu=()=>[``].slice(0,0);function Eu(e){return e.group?Tu:wu}const Du=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},Ou=()=>{};function ku(e){return e.group?Du:Ou}const Au=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()&&Nu(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},ju=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()&&Nu(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function Mu(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?ju:Au}function Nu(e,t,n){if(n.options.useRealPaths)return Pu(t,n);let r=g(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=g(r)}return n.symlinks.set(e,t),i>1}function Pu(e,t){return t.visited.includes(e+t.options.pathSeparator)}const Fu=e=>e.counts,Iu=e=>e.groups,Lu=e=>e.paths,Ru=e=>e.paths.slice(0,e.options.maxFiles),zu=(e,t,n)=>(Uu(t,n,e.counts,e.options.suppressErrors),null),Bu=(e,t,n)=>(Uu(t,n,e.paths,e.options.suppressErrors),null),Vu=(e,t,n)=>(Uu(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),Hu=(e,t,n)=>(Uu(t,n,e.groups,e.options.suppressErrors),null);function Uu(e,t,n,r){t(e&&!r?e:null,n)}function Wu(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?Fu:zu:r?t?Iu:Hu:i?t?Ru:Vu:t?Lu:Bu}const Gu={withFileTypes:!0},Ku=(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||`.`,Gu,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},qu=(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||`.`,Gu)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function Ju(e){return e?qu:Ku}var Yu=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))}},Xu=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}
145
147
  /* c8 ignore next 3 */
146
- get dirs(){return this._directories}},Yu=class{aborted=!1;abort(){this.aborted=!0}},Xu=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=Hu(t,this.isSynchronous),this.root=iu(e,t),this.state={root:ru(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new Ju,options:t,queue:new qu((e,t)=>this.callbackInvoker(t,e,n)),symlinks:/* @__PURE__ */ new Map,visited:[``].slice(0,0),controller:new Yu,fs:t.fs||c},this.joinPath=lu(this.root,t),this.pushDirectory=hu(this.root,t),this.pushFile=xu(t),this.getArray=wu(t),this.groupFiles=Du(t),this.resolveSymlink=Au(t,this.isSynchronous),this.walkDirectory=Ku(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=cu(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=au(l.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=iu(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=h(r),n=iu(g(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 Zu(e,t){return new Promise((n,r)=>{Qu(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function Qu(e,t,n){new Xu(e,t,n).start()}function $u(e,t){return new Xu(e,t).start()}var ed=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return Zu(this.root,this.options)}withCallback(e){Qu(this.root,this.options,e)}sync(){return $u(this.root,this.options)}};let td=null;
148
+ get dirs(){return this._directories}},Zu=class{aborted=!1;abort(){this.aborted=!0}},Qu=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=Wu(t,this.isSynchronous),this.root=ou(e,t),this.state={root:au(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new Xu,options:t,queue:new Yu((e,t)=>this.callbackInvoker(t,e,n)),symlinks:/* @__PURE__ */ new Map,visited:[``].slice(0,0),controller:new Zu,fs:t.fs||c},this.joinPath=du(this.root,t),this.pushDirectory=_u(this.root,t),this.pushFile=Cu(t),this.getArray=Eu(t),this.groupFiles=ku(t),this.resolveSymlink=Mu(t,this.isSynchronous),this.walkDirectory=Ju(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=uu(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=su(l.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=ou(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=h(r),n=ou(g(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 $u(e,t){return new Promise((n,r)=>{ed(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function ed(e,t,n){new Qu(e,t,n).start()}function td(e,t){return new Qu(e,t).start()}var nd=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return $u(this.root,this.options)}withCallback(e){ed(this.root,this.options,e)}sync(){return td(this.root,this.options)}};let rd=null;
147
149
  /* c8 ignore next 6 */
148
- try{Ql.resolve(`picomatch`),td=Ql(`picomatch`)}catch{}var nd=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:S,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 ed(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}
150
+ try{eu.resolve(`picomatch`),rd=eu(`picomatch`)}catch{}var id=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:S,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 nd(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}
149
151
  /* c8 ignore next 4 */
150
- crawlWithOptions(e,t){return this.options={...this.options,...t},new ed(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||td;
152
+ crawlWithOptions(e,t){return this.options={...this.options,...t},new nd(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||rd;
151
153
  /* c8 ignore next 5 */
152
- 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}},rd=/* @__PURE__ */ n(((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}}})),id=/* @__PURE__ */ n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=rd();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}})),ad=/* @__PURE__ */ n(((e,t)=>{let n=id(),{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:_}=rd(),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,ee=0,k=!1,te=!1,A=!1,ne=!1,re=!1,ie=!1,ae=!1,j=!1,M=!1,N=!1,oe=0,P,F,I={value:``,depth:0,isGlob:!1},L=()=>D>=x,se=()=>E.charCodeAt(D+1),ce=()=>(P=F,E.charCodeAt(++D));for(;D<x;){F=ce();let e;if(F===a){ae=I.backslashes=!0,F=ce(),F===u&&(ie=!0);continue}if(ie===!0||F===u){for(oe++;L()!==!0&&(F=ce());){if(F===a){ae=I.backslashes=!0,ce();continue}if(F===u){oe++;continue}if(ie!==!0&&F===s&&(F=ce())===s){if(k=I.isBrace=!0,A=I.isGlob=!0,N=!0,S===!0)continue;break}if(ie!==!0&&F===o){if(k=I.isBrace=!0,A=I.isGlob=!0,N=!0,S===!0)continue;break}if(F===h&&(oe--,oe===0)){ie=!1,k=I.isBrace=!0,N=!0;break}}if(S===!0)continue;break}if(F===l){if(C.push(D),w.push(I),I={value:``,depth:0,isGlob:!1},N===!0)continue;if(P===s&&D===O+1){O+=2;continue}ee=D+1;continue}if(b.noext!==!0&&(F===p||F===i||F===r||F===m||F===c)&&se()===d){if(A=I.isGlob=!0,ne=I.isExtglob=!0,N=!0,F===c&&D===O&&(M=!0),S===!0){let e=0;for(;L()!==!0&&(F=ce());){if(F===a){ae=I.backslashes=!0,ce();continue}if(F===d){e++;continue}if(F===g&&--e===0){N=!0;break}}continue}break}if(F===r){if(P===r&&(re=I.isGlobstar=!0),A=I.isGlob=!0,N=!0,S===!0)continue;break}if(F===m){if(A=I.isGlob=!0,N=!0,S===!0)continue;break}if(F===f){for(;L()!==!0&&(e=ce());){if(e===a){ae=I.backslashes=!0,ce();continue}if(e===_){te=I.isBracket=!0,A=I.isGlob=!0,N=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&F===c&&D===O){j=I.negated=!0,O++;continue}if(b.noparen!==!0&&F===d){if(A=I.isGlob=!0,S===!0){let e=1;for(;L()!==!0&&(F=ce());){if(F===a){ae=I.backslashes=!0,ce();continue}if(F===d){e++;continue}if(F===g&&--e===0){N=!0;break}}continue}break}if(A===!0){if(N=!0,S===!0)continue;break}}b.noext===!0&&(ne=!1,A=!1);let R=E,le=``,ue=``;O>0&&(le=E.slice(0,O),E=E.slice(O),ee-=O),R&&A===!0&&ee>0?(R=E.slice(0,ee),ue=E.slice(ee)):A===!0?(R=``,ue=E):R=E,R&&R!==``&&R!==`/`&&R!==E&&v(R.charCodeAt(R.length-1))&&(R=R.slice(0,-1)),b.unescape===!0&&(ue&&=n.removeBackslashes(ue),R&&ae===!0&&(R=n.removeBackslashes(R)));let de={prefix:le,input:e,start:O,base:R,glob:ue,isBrace:k,isBracket:te,isGlob:A,isExtglob:ne,isGlobstar:re,negated:j,negatedExtglob:M};if(b.tokens===!0&&(de.maxDepth=0,v(F)||w.push(I),de.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=le):w[n].value=a,y(w[n]),de.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]),de.maxDepth+=w[w.length-1].depth),de.slashes=C,de.parts=T}return de}})),od=/* @__PURE__ */ n(((e,t)=>{let n=rd(),r=id(),{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;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}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;continue}if(n===`\\`){t=!0;continue}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;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}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);continue}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:ee,QMARK_NO_DOT:k,STAR:te,START_ANCHOR:A}=_,ne=e=>`(${g}(?:(?!${A}${e.dot?T:x}).)*?)`,re=d.dot?``:E,ie=d.dot?ee:k,ae=d.bash===!0?ne(d):te;d.capture&&(ae=`(${ae})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let j={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,j),p=e.length;let M=[],N=[],oe=[],P=m,F,I=()=>j.index===p-1,L=j.peek=(t=1)=>e[j.index+t],se=j.advance=()=>e[++j.index]||``,ce=()=>e.slice(j.index+1),R=(e=``,t=0)=>{j.consumed+=e,j.index+=t},le=e=>{j.output+=e.output==null?e.value:e.output,R(e.value)},ue=()=>{let e=1;for(;L()===`!`&&(L(2)!==`(`||L(3)===`?`);)se(),j.start++,e++;return e%2!=0&&(j.negated=!0,j.start++,!0)},de=e=>{j[e]++,oe.push(e)},fe=e=>{j[e]--,oe.pop()},z=e=>{if(P.type===`globstar`){let t=j.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||M.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(j.output=j.output.slice(0,-P.output.length),P.type=`star`,P.value=`*`,P.output=ae,j.output+=P.output)}if(M.length&&e.type!==`paren`&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&le(e),P&&P.type===`text`&&e.type===`text`){P.output=(P.output||P.value)+e.value,P.value+=e.value;return}e.prev=P,h.push(e),P=e},pe=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=P,n.parens=j.parens,n.output=j.output,n.startIndex=j.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;de(`parens`),z({type:e,value:t,output:j.output?``:w}),z({type:`paren`,extglob:!0,value:se(),output:r}),M.push(n)},me=n=>{let i=e.slice(n.startIndex,j.index+1),a=e.slice(n.startIndex+2,j.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;j.output=n.output+t.output,j.backtrack=!0,z({type:`paren`,extglob:!0,value:F,output:``}),fe(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=ae;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ne(d)),(e!==ae||I()||/^\)+$/.test(ce()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=ce())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(j.negatedExtglob=!0)}z({type:`paren`,extglob:!0,value:F,output:s}),fe(`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?ee.repeat(a.length):``):o===0?ie+(a?ee.repeat(a.length):``):ee.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?ae:``):ae: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?(j.output=e,j):(j.output=r.wrapOutput(i,j,t),j)}for(;!I();){if(F=se(),F===`\0`)continue;if(F===`\\`){let e=L();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){F+=`\\`,z({type:`text`,value:F});continue}let t=/^\\+/.exec(ce()),n=0;if(t&&t[0].length>2&&(n=t[0].length,j.index+=n,n%2!=0&&(F+=`\\`)),d.unescape===!0?F=se():F+=se(),j.brackets===0){z({type:`text`,value:F});continue}}if(j.brackets>0&&(F!==`]`||P.value===`[`||P.value===`[^`)){if(d.posix!==!1&&F===`:`){let e=P.value.slice(1);if(e.includes(`[`)&&(P.posix=!0,e.includes(`:`))){let e=P.value.lastIndexOf(`[`),t=P.value.slice(0,e),n=P.value.slice(e+2),r=a[n];if(r){P.value=t+r,j.backtrack=!0,se(),!m.output&&h.indexOf(P)===1&&(m.output=w);continue}}}(F===`[`&&L()!==`:`||F===`-`&&L()===`]`)&&(F=`\\${F}`),F===`]`&&(P.value===`[`||P.value===`[^`)&&(F=`\\${F}`),d.posix===!0&&F===`!`&&P.value===`[`&&(F=`^`),P.value+=F,le({value:F});continue}if(j.quotes===1&&F!==`"`){F=r.escapeRegex(F),P.value+=F,le({value:F});continue}if(F===`"`){j.quotes=j.quotes===1?0:1,d.keepQuotes===!0&&z({type:`text`,value:F});continue}if(F===`(`){de(`parens`),z({type:`paren`,value:F});continue}if(F===`)`){if(j.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=M[M.length-1];if(e&&j.parens===e.parens+1){me(M.pop());continue}z({type:`paren`,value:F,output:j.parens?`)`:`\\)`}),fe(`parens`);continue}if(F===`[`){if(d.nobracket===!0||!ce().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));F=`\\${F}`}else de(`brackets`);z({type:`bracket`,value:F});continue}if(F===`]`){if(d.nobracket===!0||P&&P.type===`bracket`&&P.value.length===1){z({type:`text`,value:F,output:`\\${F}`});continue}if(j.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));z({type:`text`,value:F,output:`\\${F}`});continue}fe(`brackets`);let e=P.value.slice(1);if(P.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(F=`/${F}`),P.value+=F,le({value:F}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(P.value);if(j.output=j.output.slice(0,-P.value.length),d.literalBrackets===!0){j.output+=t,P.value=t;continue}P.value=`(${g}${t}|${P.value})`,j.output+=P.value;continue}if(F===`{`&&d.nobrace!==!0){de(`braces`);let e={type:`brace`,value:F,output:`(`,outputIndex:j.output.length,tokensIndex:j.tokens.length};N.push(e),z(e);continue}if(F===`}`){let e=N[N.length-1];if(d.nobrace===!0||!e){z({type:`text`,value:F,output:F});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),j.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=j.output.slice(0,e.outputIndex),r=j.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,F=t=`\\}`,j.output=n;for(let e of r)j.output+=e.output||e.value}z({type:`brace`,value:F,output:t}),fe(`braces`),N.pop();continue}if(F===`|`){M.length>0&&M[M.length-1].conditions++,z({type:`text`,value:F});continue}if(F===`,`){let e=F,t=N[N.length-1];t&&oe[oe.length-1]===`braces`&&(t.comma=!0,e=`|`),z({type:`comma`,value:F,output:e});continue}if(F===`/`){if(P.type===`dot`&&j.index===j.start+1){j.start=j.index+1,j.consumed=``,j.output=``,h.pop(),P=m;continue}z({type:`slash`,value:F,output:C});continue}if(F===`.`){if(j.braces>0&&P.type===`dot`){P.value===`.`&&(P.output=x);let e=N[N.length-1];P.type=`dots`,P.output+=F,P.value+=F,e.dots=!0;continue}if(j.braces+j.parens===0&&P.type!==`bos`&&P.type!==`slash`){z({type:`text`,value:F,output:x});continue}z({type:`dot`,value:F,output:x});continue}if(F===`?`){if(!(P&&P.value===`(`)&&d.noextglob!==!0&&L()===`(`&&L(2)!==`?`){pe(`qmark`,F);continue}if(P&&P.type===`paren`){let e=L(),t=F;(P.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ce()))&&(t=`\\${F}`),z({type:`text`,value:F,output:t});continue}if(d.dot!==!0&&(P.type===`slash`||P.type===`bos`)){z({type:`qmark`,value:F,output:k});continue}z({type:`qmark`,value:F,output:ee});continue}if(F===`!`){if(d.noextglob!==!0&&L()===`(`&&(L(2)!==`?`||!/[!=<:]/.test(L(3)))){pe(`negate`,F);continue}if(d.nonegate!==!0&&j.index===0){ue();continue}}if(F===`+`){if(d.noextglob!==!0&&L()===`(`&&L(2)!==`?`){pe(`plus`,F);continue}if(P&&P.value===`(`||d.regex===!1){z({type:`plus`,value:F,output:S});continue}if(P&&(P.type===`bracket`||P.type===`paren`||P.type===`brace`)||j.parens>0){z({type:`plus`,value:F});continue}z({type:`plus`,value:S});continue}if(F===`@`){if(d.noextglob!==!0&&L()===`(`&&L(2)!==`?`){z({type:`at`,extglob:!0,value:F,output:``});continue}z({type:`text`,value:F});continue}if(F!==`*`){(F===`$`||F===`^`)&&(F=`\\${F}`);let e=o.exec(ce());e&&(F+=e[0],j.index+=e[0].length),z({type:`text`,value:F});continue}if(P&&(P.type===`globstar`||P.star===!0)){P.type=`star`,P.star=!0,P.value+=F,P.output=ae,j.backtrack=!0,j.globstar=!0,R(F);continue}let t=ce();if(d.noextglob!==!0&&/^\([^?]/.test(t)){pe(`star`,F);continue}if(P.type===`star`){if(d.noglobstar===!0){R(F);continue}let n=P.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]!==`/`)){z({type:`star`,value:F,output:``});continue}let o=j.braces>0&&(n.type===`comma`||n.type===`brace`),s=M.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){z({type:`star`,value:F,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[j.index+4];if(n&&n!==`/`)break;t=t.slice(3),R(`/**`,3)}let c=I()||j.parens>0&&t===`)`.repeat(j.parens)&&!M.some(e=>e.type===`negate`);if(n.type===`bos`&&I()){P.type=`globstar`,P.value+=F,P.output=ne(d),j.output=P.output,j.globstar=!0,R(F);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){j.output=j.output.slice(0,-(n.output+P.output).length),n.output=`(?:${n.output}`,P.type=`globstar`,P.output=ne(d)+(d.strictSlashes?`)`:`|$)`),P.value+=F,j.globstar=!0,j.output+=n.output+P.output,R(F);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;j.output=j.output.slice(0,-(n.output+P.output).length),n.output=`(?:${n.output}`,P.type=`globstar`,P.output=`${ne(d)}${C}|${C}${e})`,P.value+=F,j.output+=n.output+P.output,j.globstar=!0,R(F+se()),z({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){P.type=`globstar`,P.value+=F,P.output=`(?:^|${C}|${ne(d)}${C})`,j.output=P.output,j.globstar=!0,R(F+se()),z({type:`slash`,value:`/`,output:``});continue}j.output=j.output.slice(0,-P.output.length),P.type=`globstar`,P.output=ne(d),P.value+=F,j.output+=P.output,j.globstar=!0,R(F);continue}let n={type:`star`,value:F,output:ae};if(d.bash===!0){n.output=`.*?`,(P.type===`bos`||P.type===`slash`)&&(n.output=re+n.output),z(n);continue}if(P&&(P.type===`bracket`||P.type===`paren`)&&d.regex===!0){n.output=F,z(n);continue}(j.index===j.start||P.type===`slash`||P.type===`dot`)&&(P.type===`dot`?(j.output+=D,P.output+=D):d.dot===!0?(j.output+=O,P.output+=O):(j.output+=re,P.output+=re),L()!==`*`&&(j.output+=w,P.output+=w)),z(n)}for(;j.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));j.output=r.escapeLast(j.output,`[`),fe(`brackets`)}for(;j.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));j.output=r.escapeLast(j.output,`(`),fe(`parens`)}for(;j.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));j.output=r.escapeLast(j.output,`{`),fe(`braces`)}if(d.strictSlashes!==!0&&(P.type===`star`||P.type===`bracket`)&&z({type:`maybe_slash`,value:``,output:`${C}?`}),j.backtrack===!0){j.output=``;for(let e of j.tokens)j.output+=e.output==null?e.value:e.output,e.suffix&&(j.output+=e.suffix)}return j};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})),sd=/* @__PURE__ */ n(((e,t)=>{let n=ad(),r=od(),i=id(),a=rd(),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})),cd=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=sd(),r=id();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 ld=Array.isArray,ud=/\\/g,dd=/^[A-Za-z]:$/,fd=process.platform===`win32`,pd=/^(\/?\.\.)+$/;function md(e,t={}){let n=e.length,r=Array(n),i=Array(n),a,o;for(a=0;a<n;a++){let n=xd(e[a]);r[a]=n;let s=n.length,c=Array(s);for(o=0;o<s;o++)c[o]=(0,cd.default)(n[o],t);i[a]=c}return e=>{let s=e.split(`/`);if(s[0]===`..`&&pd.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}}
154
+ 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}},ad=/* @__PURE__ */ n(((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}}})),od=/* @__PURE__ */ n((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ad();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}})),sd=/* @__PURE__ */ n(((e,t)=>{let n=od(),{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:_}=ad(),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,ee=0,k=!1,te=!1,A=!1,ne=!1,re=!1,ie=!1,ae=!1,j=!1,M=!1,N=!1,oe=0,P,F,I={value:``,depth:0,isGlob:!1},L=()=>D>=x,se=()=>E.charCodeAt(D+1),ce=()=>(P=F,E.charCodeAt(++D));for(;D<x;){F=ce();let e;if(F===a)ae=I.backslashes=!0,F=ce(),F===u&&(ie=!0);else{if(ie===!0||F===u){for(oe++;L()!==!0&&(F=ce());)if(F===a)ae=I.backslashes=!0,ce();else if(F===u)oe++;else{if(ie!==!0&&F===s&&(F=ce())===s||ie!==!0&&F===o){if(k=I.isBrace=!0,A=I.isGlob=!0,N=!0,S===!0)continue;break}if(F===h&&(oe--,oe===0)){ie=!1,k=I.isBrace=!0,N=!0;break}}if(S===!0)continue;break}if(F===l){if(C.push(D),w.push(I),I={value:``,depth:0,isGlob:!1},N===!0)continue;if(P===s&&D===O+1){O+=2;continue}ee=D+1}else{if(b.noext!==!0&&(F===p||F===i||F===r||F===m||F===c)&&se()===d){if(A=I.isGlob=!0,ne=I.isExtglob=!0,N=!0,F===c&&D===O&&(M=!0),S===!0){let e=0;for(;L()!==!0&&(F=ce());)if(F===a)ae=I.backslashes=!0,ce();else if(F===d)e++;else if(F===g&&--e===0){N=!0;break}continue}break}if(F===r){if(P===r&&(re=I.isGlobstar=!0),A=I.isGlob=!0,N=!0,S===!0)continue;break}if(F===m){if(A=I.isGlob=!0,N=!0,S===!0)continue;break}if(F===f){for(;L()!==!0&&(e=ce());)if(e===a)ae=I.backslashes=!0,ce();else if(e===_){te=I.isBracket=!0,A=I.isGlob=!0,N=!0;break}if(S===!0)continue;break}if(b.nonegate!==!0&&F===c&&D===O)j=I.negated=!0,O++;else{if(b.noparen!==!0&&F===d){if(A=I.isGlob=!0,S===!0){let e=1;for(;L()!==!0&&(F=ce());)if(F===a)ae=I.backslashes=!0,ce();else if(F===d)e++;else if(F===g&&--e===0){N=!0;break}continue}break}if(A===!0){if(N=!0,S===!0)continue;break}}}}}b.noext===!0&&(ne=!1,A=!1);let R=E,le=``,ue=``;O>0&&(le=E.slice(0,O),E=E.slice(O),ee-=O),R&&A===!0&&ee>0?(R=E.slice(0,ee),ue=E.slice(ee)):A===!0?(R=``,ue=E):R=E,R&&R!==``&&R!==`/`&&R!==E&&v(R.charCodeAt(R.length-1))&&(R=R.slice(0,-1)),b.unescape===!0&&(ue&&=n.removeBackslashes(ue),R&&ae===!0&&(R=n.removeBackslashes(R)));let de={prefix:le,input:e,start:O,base:R,glob:ue,isBrace:k,isBracket:te,isGlob:A,isExtglob:ne,isGlobstar:re,negated:j,negatedExtglob:M};if(b.tokens===!0&&(de.maxDepth=0,v(F)||w.push(I),de.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=le):w[n].value=a,y(w[n]),de.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]),de.maxDepth+=w[w.length-1].depth),de.slashes=C,de.parts=T}return de}})),cd=/* @__PURE__ */ n(((e,t)=>{let n=ad(),r=od(),{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:ee,QMARK_NO_DOT:k,STAR:te,START_ANCHOR:A}=_,ne=e=>`(${g}(?:(?!${A}${e.dot?T:x}).)*?)`,re=d.dot?``:E,ie=d.dot?ee:k,ae=d.bash===!0?ne(d):te;d.capture&&(ae=`(${ae})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let j={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,j),p=e.length;let M=[],N=[],oe=[],P=m,F,I=()=>j.index===p-1,L=j.peek=(t=1)=>e[j.index+t],se=j.advance=()=>e[++j.index]||``,ce=()=>e.slice(j.index+1),R=(e=``,t=0)=>{j.consumed+=e,j.index+=t},le=e=>{j.output+=e.output==null?e.value:e.output,R(e.value)},ue=()=>{let e=1;for(;L()===`!`&&(L(2)!==`(`||L(3)===`?`);)se(),j.start++,e++;return e%2!=0&&(j.negated=!0,j.start++,!0)},de=e=>{j[e]++,oe.push(e)},fe=e=>{j[e]--,oe.pop()},z=e=>{if(P.type===`globstar`){let t=j.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||M.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(j.output=j.output.slice(0,-P.output.length),P.type=`star`,P.value=`*`,P.output=ae,j.output+=P.output)}M.length&&e.type!==`paren`&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&le(e),P&&P.type===`text`&&e.type===`text`?(P.output=(P.output||P.value)+e.value,P.value+=e.value):(e.prev=P,h.push(e),P=e)},pe=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=P,n.parens=j.parens,n.output=j.output,n.startIndex=j.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;de(`parens`),z({type:e,value:t,output:j.output?``:w}),z({type:`paren`,extglob:!0,value:se(),output:r}),M.push(n)},me=n=>{let i=e.slice(n.startIndex,j.index+1),a=e.slice(n.startIndex+2,j.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;j.output=n.output+t.output,j.backtrack=!0,z({type:`paren`,extglob:!0,value:F,output:``}),fe(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=ae;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=ne(d)),(e!==ae||I()||/^\)+$/.test(ce()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=ce())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(j.negatedExtglob=!0)}z({type:`paren`,extglob:!0,value:F,output:s}),fe(`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?ee.repeat(a.length):``):o===0?ie+(a?ee.repeat(a.length):``):ee.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?ae:``):ae: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?(j.output=e,j):(j.output=r.wrapOutput(i,j,t),j)}for(;!I();){if(F=se(),F===`\0`)continue;if(F===`\\`){let e=L();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){F+=`\\`,z({type:`text`,value:F});continue}let t=/^\\+/.exec(ce()),n=0;if(t&&t[0].length>2&&(n=t[0].length,j.index+=n,n%2!=0&&(F+=`\\`)),d.unescape===!0?F=se():F+=se(),j.brackets===0){z({type:`text`,value:F});continue}}if(j.brackets>0&&(F!==`]`||P.value===`[`||P.value===`[^`)){if(d.posix!==!1&&F===`:`){let e=P.value.slice(1);if(e.includes(`[`)&&(P.posix=!0,e.includes(`:`))){let e=P.value.lastIndexOf(`[`),t=P.value.slice(0,e),n=P.value.slice(e+2),r=a[n];if(r){P.value=t+r,j.backtrack=!0,se(),!m.output&&h.indexOf(P)===1&&(m.output=w);continue}}}(F===`[`&&L()!==`:`||F===`-`&&L()===`]`)&&(F=`\\${F}`),F===`]`&&(P.value===`[`||P.value===`[^`)&&(F=`\\${F}`),d.posix===!0&&F===`!`&&P.value===`[`&&(F=`^`),P.value+=F,le({value:F});continue}if(j.quotes===1&&F!==`"`){F=r.escapeRegex(F),P.value+=F,le({value:F});continue}if(F===`"`){j.quotes=j.quotes===1?0:1,d.keepQuotes===!0&&z({type:`text`,value:F});continue}if(F===`(`){de(`parens`),z({type:`paren`,value:F});continue}if(F===`)`){if(j.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=M[M.length-1];if(e&&j.parens===e.parens+1){me(M.pop());continue}z({type:`paren`,value:F,output:j.parens?`)`:`\\)`}),fe(`parens`);continue}if(F===`[`){if(d.nobracket===!0||!ce().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));F=`\\${F}`}else de(`brackets`);z({type:`bracket`,value:F});continue}if(F===`]`){if(d.nobracket===!0||P&&P.type===`bracket`&&P.value.length===1){z({type:`text`,value:F,output:`\\${F}`});continue}if(j.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));z({type:`text`,value:F,output:`\\${F}`});continue}fe(`brackets`);let e=P.value.slice(1);if(P.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(F=`/${F}`),P.value+=F,le({value:F}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(P.value);if(j.output=j.output.slice(0,-P.value.length),d.literalBrackets===!0){j.output+=t,P.value=t;continue}P.value=`(${g}${t}|${P.value})`,j.output+=P.value;continue}if(F===`{`&&d.nobrace!==!0){de(`braces`);let e={type:`brace`,value:F,output:`(`,outputIndex:j.output.length,tokensIndex:j.tokens.length};N.push(e),z(e);continue}if(F===`}`){let e=N[N.length-1];if(d.nobrace===!0||!e){z({type:`text`,value:F,output:F});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),j.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=j.output.slice(0,e.outputIndex),r=j.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,F=t=`\\}`,j.output=n;for(let e of r)j.output+=e.output||e.value}z({type:`brace`,value:F,output:t}),fe(`braces`),N.pop();continue}if(F===`|`){M.length>0&&M[M.length-1].conditions++,z({type:`text`,value:F});continue}if(F===`,`){let e=F,t=N[N.length-1];t&&oe[oe.length-1]===`braces`&&(t.comma=!0,e=`|`),z({type:`comma`,value:F,output:e});continue}if(F===`/`){if(P.type===`dot`&&j.index===j.start+1){j.start=j.index+1,j.consumed=``,j.output=``,h.pop(),P=m;continue}z({type:`slash`,value:F,output:C});continue}if(F===`.`){if(j.braces>0&&P.type===`dot`){P.value===`.`&&(P.output=x);let e=N[N.length-1];P.type=`dots`,P.output+=F,P.value+=F,e.dots=!0;continue}if(j.braces+j.parens===0&&P.type!==`bos`&&P.type!==`slash`){z({type:`text`,value:F,output:x});continue}z({type:`dot`,value:F,output:x});continue}if(F===`?`){if(!(P&&P.value===`(`)&&d.noextglob!==!0&&L()===`(`&&L(2)!==`?`){pe(`qmark`,F);continue}if(P&&P.type===`paren`){let e=L(),t=F;(P.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ce()))&&(t=`\\${F}`),z({type:`text`,value:F,output:t});continue}if(d.dot!==!0&&(P.type===`slash`||P.type===`bos`)){z({type:`qmark`,value:F,output:k});continue}z({type:`qmark`,value:F,output:ee});continue}if(F===`!`){if(d.noextglob!==!0&&L()===`(`&&(L(2)!==`?`||!/[!=<:]/.test(L(3)))){pe(`negate`,F);continue}if(d.nonegate!==!0&&j.index===0){ue();continue}}if(F===`+`){if(d.noextglob!==!0&&L()===`(`&&L(2)!==`?`){pe(`plus`,F);continue}if(P&&P.value===`(`||d.regex===!1){z({type:`plus`,value:F,output:S});continue}if(P&&(P.type===`bracket`||P.type===`paren`||P.type===`brace`)||j.parens>0){z({type:`plus`,value:F});continue}z({type:`plus`,value:S});continue}if(F===`@`){if(d.noextglob!==!0&&L()===`(`&&L(2)!==`?`){z({type:`at`,extglob:!0,value:F,output:``});continue}z({type:`text`,value:F});continue}if(F!==`*`){(F===`$`||F===`^`)&&(F=`\\${F}`);let e=o.exec(ce());e&&(F+=e[0],j.index+=e[0].length),z({type:`text`,value:F});continue}if(P&&(P.type===`globstar`||P.star===!0)){P.type=`star`,P.star=!0,P.value+=F,P.output=ae,j.backtrack=!0,j.globstar=!0,R(F);continue}let t=ce();if(d.noextglob!==!0&&/^\([^?]/.test(t)){pe(`star`,F);continue}if(P.type===`star`){if(d.noglobstar===!0){R(F);continue}let n=P.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]!==`/`)){z({type:`star`,value:F,output:``});continue}let o=j.braces>0&&(n.type===`comma`||n.type===`brace`),s=M.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){z({type:`star`,value:F,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[j.index+4];if(n&&n!==`/`)break;t=t.slice(3),R(`/**`,3)}let c=I()||j.parens>0&&t===`)`.repeat(j.parens)&&!M.some(e=>e.type===`negate`);if(n.type===`bos`&&I()){P.type=`globstar`,P.value+=F,P.output=ne(d),j.output=P.output,j.globstar=!0,R(F);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){j.output=j.output.slice(0,-(n.output+P.output).length),n.output=`(?:${n.output}`,P.type=`globstar`,P.output=ne(d)+(d.strictSlashes?`)`:`|$)`),P.value+=F,j.globstar=!0,j.output+=n.output+P.output,R(F);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;j.output=j.output.slice(0,-(n.output+P.output).length),n.output=`(?:${n.output}`,P.type=`globstar`,P.output=`${ne(d)}${C}|${C}${e})`,P.value+=F,j.output+=n.output+P.output,j.globstar=!0,R(F+se()),z({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){P.type=`globstar`,P.value+=F,P.output=`(?:^|${C}|${ne(d)}${C})`,j.output=P.output,j.globstar=!0,R(F+se()),z({type:`slash`,value:`/`,output:``});continue}j.output=j.output.slice(0,-P.output.length),P.type=`globstar`,P.output=ne(d),P.value+=F,j.output+=P.output,j.globstar=!0,R(F);continue}let n={type:`star`,value:F,output:ae};d.bash===!0?(n.output=`.*?`,(P.type===`bos`||P.type===`slash`)&&(n.output=re+n.output),z(n)):P&&(P.type===`bracket`||P.type===`paren`)&&d.regex===!0?(n.output=F,z(n)):((j.index===j.start||P.type===`slash`||P.type===`dot`)&&(P.type===`dot`?(j.output+=D,P.output+=D):d.dot===!0?(j.output+=O,P.output+=O):(j.output+=re,P.output+=re),L()!==`*`&&(j.output+=w,P.output+=w)),z(n))}for(;j.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));j.output=r.escapeLast(j.output,`[`),fe(`brackets`)}for(;j.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));j.output=r.escapeLast(j.output,`(`),fe(`parens`)}for(;j.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));j.output=r.escapeLast(j.output,`{`),fe(`braces`)}if(d.strictSlashes!==!0&&(P.type===`star`||P.type===`bracket`)&&z({type:`maybe_slash`,value:``,output:`${C}?`}),j.backtrack===!0){j.output=``;for(let e of j.tokens)j.output+=e.output==null?e.value:e.output,e.suffix&&(j.output+=e.suffix)}return j};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})),ld=/* @__PURE__ */ n(((e,t)=>{let n=sd(),r=cd(),i=od(),a=ad(),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})),ud=/* @__PURE__ */ t((/* @__PURE__ */ n(((e,t)=>{let n=ld(),r=od();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 dd=Array.isArray,fd=/\\/g,pd=/^[A-Za-z]:$/,md=process.platform===`win32`,hd=/^(\/?\.\.)+$/;function gd(e,t={}){let n=e.length,r=Array(n),i=Array(n),a,o;for(a=0;a<n;a++){let n=Cd(e[a]);r[a]=n;let s=n.length,c=Array(s);for(o=0;o<s;o++)c[o]=(0,ud.default)(n[o],t);i[a]=c}return e=>{let s=e.split(`/`);if(s[0]===`..`&&hd.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}}
153
155
  /* node:coverage ignore next 2 */
154
- const hd=/^[A-Z]:\/$/i,gd=fd?e=>hd.test(e):e=>e===`/`;function _d(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=e.length+ +!gd(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=>y.relative(e,t)||`.`:n=>y.relative(e,`${t}/${n}`)||`.`}function vd(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=y.relative(e,`${t}/${n}`);return n[n.length-1]===`/`&&r!==``?`${r}/`:r||`.`}}function yd(e){return e.replace(dd,e=>`${e}/`)}const bd={parts:!0};function xd(e){let t=cd.default.scan(e,bd);return t.parts?.length?t.parts:[e]}const Sd=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Cd=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,wd=fd?e=>e.replace(Cd,`\\$&`):e=>e.replace(Sd,`\\$&`);function Td(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=cd.default.scan(e);return n.isGlob||n.negated}function Ed(...e){console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString(`es`)}]`,...e)}function Dd(e){return typeof e==`string`?[e]:e??[]}const Od=/^(\/?\.\.)+/,kd=/\\(?=[()[\]{}!*+?@|])/g;function Ad(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=wd(i);a=_(a.replace(kd,``))?y.relative(o,a):y.normalize(a);let s=Od.exec(a)?.[0],c=xd(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=y.join(i,s.slice(t*3));l[0]!==`.`&&n.root.length>l.length&&(n.root=yd(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]||Td(t))break;e.push(t)}n.depthOffset=e.length,n.commonPath=e,n.root=yd(e.length>0?y.join(i,...e):i)}return a}function jd(e,t,n){let r=[],i=[];for(let t of e.ignore)t&&(t[0]!==`!`||t[1]===`(`)&&i.push(Ad(t,e,n,!0));for(let a of t)a&&(a[0]!==`!`||a[1]===`(`?r.push(Ad(a,e,n,!1)):(a[1]!==`!`||a[2]===`(`)&&i.push(Ad(a.slice(1),e,n,!0)));return{match:r,ignore:i}}function Md(e,t){let n=e.cwd,r={root:n,depthOffset:0},i=jd(e,t,r);e.debug&&Ed(`internal processing patterns:`,i);let{absolute:a,caseSensitiveMatch:o,debug:s,dot:c,followSymbolicLinks:l,onlyDirectories:u}=e,d=r.root.replace(ud,``),f={dot:c,nobrace:e.braceExpansion===!1,nocase:!o,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},p=(0,cd.default)(i.match,f),m=(0,cd.default)(i.ignore,f),h=md(i.match,f),g=_d(n,d,a),_=a?g:_d(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 nd({filters:[s?(e,t)=>{let n=g(e,t),r=p(n)&&!m(n);return r&&Ed(`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 Ed(`${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&&Ed(`internal properties:`,{...r,root:d}),[b,n!==d&&!a&&vd(n,d)]}function Nd(e,t){if(t)for(let n=e.length-1;n>=0;n--)e[n]=t(e[n]);return e}const Pd={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Fd(e){let t=Object.assign({},e);for(let e in Pd)t[e]===void 0&&Object.assign(t,{[e]:Pd[e]});return t.cwd=(t.cwd instanceof URL?ie(t.cwd):x(t.cwd||process.cwd())).replace(ud,`/`),t.ignore=Dd(t.ignore),t.fs&&={readdir:t.fs.readdir||l,readdirSync:t.fs.readdirSync||u,realpath:t.fs.realpath||d,realpathSync:t.fs.realpathSync||f,stat:t.fs.stat||p,statSync:t.fs.statSync||m},t.debug&&Ed(`globbing with options:`,t),t}function Id(e,t={}){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=ld(e)||typeof e==`string`,r=Dd((n?e:e.patterns)??`**/*`),i=Fd(n?t:e);return r.length>0?Md(i,r):[]}async function Ld(e,t){let[n,r]=Id(e,t);return n?Nd(await n.withPromise(),r):[]}var Rd=class extends Error{configPath;constructor(e,t){super(e),this.name=`SharedConfigError`,this.configPath=t}},zd=class extends Rd{cause;constructor(e,t){super(`加载配置文件 ${e} 失败`,e),this.name=`SharedConfigLoadError`,this.cause=t}},Bd=class extends Rd{searchFrom;constructor(e){super(`未在 ${e} 及其上级目录中找到 lzi.config.ts 配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}};function Vd(e=process.cwd()){let t=re(e);for(;;){let e=A(t,`lzi.config.ts`);if(w(e))return e;let n=k(t);if(n===t)return null;t=n}}async function Hd(e={}){let t=e.cwd??process.cwd(),n=Vd(t);if(n===null)throw new Bd(t);let r=re(n,`..`);try{return{config:(await import(n)).default,configPath:r,configFilePath:n}}catch(e){throw new zd(n,e)}}function Ud(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=re(t);for(;;){for(let e of n){let t=A(r,e);if(w(t))return t}let e=k(r);if(e===r)return null;r=e}}async function Wd(e={}){let t=e.cwd??re(process.cwd());if(e.standaloneFile){let n=Ud(e.standaloneFile,t);if(n)try{let e=await import(n);return{success:!0,config:e.default??e,source:`standalone`,configFilePath:n}}catch(e){throw new zd(n,e)}}if(e.unifiedField)try{let{config:n,configFilePath:r}=await Hd({cwd:t}),i=n?.[e.unifiedField];if(i!==void 0)return{success:!0,config:i,source:`unified`,configFilePath:r}}catch{}return{success:!1,configFilePath:null}}const Gd=`lzi-dependencies.config.ts`,Kd=`lzi-dev.config.ts`,qd=()=>Ud(Gd)??Ud(Kd),Jd=async e=>{let t=qd();if(!t)return null;let n=await Wd({standaloneFile:Gd,unifiedField:`dependencies`,cwd:e});if(n.success)return{config:n.config,configPath:t,source:`dependencies`};let r=await Wd({standaloneFile:Kd,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 Yd=Promise,Xd=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 Yd((e,n)=>{t.c=e,t.b=n});return i=r?i.a=t:r=t,n++,l(),a},done:()=>n?o||=new Yd(e=>a=e):Yd.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=>Yd.all(e.map(e=>s.add(typeof e==`function`?e:()=>e)))}};var Zd=/* @__PURE__ */ n(((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`:``)}})),Qd=/* @__PURE__ */ n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=Zd(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(/* @__PURE__ */ new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(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 o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){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 n.enable(n.load()),n}t.exports=n})),$d=/* @__PURE__ */ n(((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=Qd()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),ef=/* @__PURE__ */ n(((e,t)=>{let n=a(`tty`),r=a(`util`);e.init=d,e.log=c,e.formatArgs=o,e.save=l,e.load=u,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=a(`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 o(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(`
156
+ const _d=/^[A-Z]:\/$/i,vd=md?e=>_d.test(e):e=>e===`/`;function yd(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=e.length+ +!vd(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=>y.relative(e,t)||`.`:n=>y.relative(e,`${t}/${n}`)||`.`}function bd(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=y.relative(e,`${t}/${n}`);return n[n.length-1]===`/`&&r!==``?`${r}/`:r||`.`}}function xd(e){return e.replace(pd,e=>`${e}/`)}const Sd={parts:!0};function Cd(e){let t=ud.default.scan(e,Sd);return t.parts?.length?t.parts:[e]}const wd=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Td=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ed=md?e=>e.replace(Td,`\\$&`):e=>e.replace(wd,`\\$&`);function Dd(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=ud.default.scan(e);return n.isGlob||n.negated}function Od(...e){console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString(`es`)}]`,...e)}function kd(e){return typeof e==`string`?[e]:e??[]}const Ad=/^(\/?\.\.)+/,jd=/\\(?=[()[\]{}!*+?@|])/g;function Md(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=Ed(i);a=_(a.replace(jd,``))?y.relative(o,a):y.normalize(a);let s=Ad.exec(a)?.[0],c=Cd(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=y.join(i,s.slice(t*3));l[0]!==`.`&&n.root.length>l.length&&(n.root=xd(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]||Dd(t))break;e.push(t)}n.depthOffset=e.length,n.commonPath=e,n.root=xd(e.length>0?y.join(i,...e):i)}return a}function Nd(e,t,n){let r=[],i=[];for(let t of e.ignore)t&&(t[0]!==`!`||t[1]===`(`)&&i.push(Md(t,e,n,!0));for(let a of t)a&&(a[0]!==`!`||a[1]===`(`?r.push(Md(a,e,n,!1)):(a[1]!==`!`||a[2]===`(`)&&i.push(Md(a.slice(1),e,n,!0)));return{match:r,ignore:i}}function Pd(e,t){let n=e.cwd,r={root:n,depthOffset:0},i=Nd(e,t,r);e.debug&&Od(`internal processing patterns:`,i);let{absolute:a,caseSensitiveMatch:o,debug:s,dot:c,followSymbolicLinks:l,onlyDirectories:u}=e,d=r.root.replace(fd,``),f={dot:c,nobrace:e.braceExpansion===!1,nocase:!o,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},p=(0,ud.default)(i.match,f),m=(0,ud.default)(i.ignore,f),h=gd(i.match,f),g=yd(n,d,a),_=a?g:yd(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 id({filters:[s?(e,t)=>{let n=g(e,t),r=p(n)&&!m(n);return r&&Od(`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 Od(`${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&&Od(`internal properties:`,{...r,root:d}),[b,n!==d&&!a&&bd(n,d)]}function Fd(e,t){if(t)for(let n=e.length-1;n>=0;n--)e[n]=t(e[n]);return e}const Id={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ld(e){let t=Object.assign({},e);for(let e in Id)t[e]===void 0&&Object.assign(t,{[e]:Id[e]});return t.cwd=(t.cwd instanceof URL?ie(t.cwd):x(t.cwd||process.cwd())).replace(fd,`/`),t.ignore=kd(t.ignore),t.fs&&={readdir:t.fs.readdir||l,readdirSync:t.fs.readdirSync||u,realpath:t.fs.realpath||d,realpathSync:t.fs.realpathSync||f,stat:t.fs.stat||p,statSync:t.fs.statSync||m},t.debug&&Od(`globbing with options:`,t),t}function Rd(e,t={}){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=dd(e)||typeof e==`string`,r=kd((n?e:e.patterns)??`**/*`),i=Ld(n?t:e);return r.length>0?Pd(i,r):[]}async function zd(e,t){let[n,r]=Rd(e,t);return n?Fd(await n.withPromise(),r):[]}var Bd=class extends Error{configPath;constructor(e,t){super(e),this.name=`SharedConfigError`,this.configPath=t}},Vd=class extends Bd{cause;constructor(e,t){super(`加载配置文件 ${e} 失败`,e),this.name=`SharedConfigLoadError`,this.cause=t}},Hd=class extends Bd{searchFrom;constructor(e){super(`未在 ${e} 及其上级目录中找到 lzi.config.ts 配置文件`,e),this.name=`SharedConfigNotFoundError`,this.searchFrom=e}};function Ud(e=process.cwd()){let t=re(e);for(;;){let e=A(t,`lzi.config.ts`);if(w(e))return e;let n=k(t);if(n===t)return null;t=n}}async function Wd(e={}){let t=e.cwd??process.cwd(),n=Ud(t);if(n===null)throw new Hd(t);let r=re(n,`..`);try{return{config:(await import(n)).default,configPath:r,configFilePath:n}}catch(e){throw new Vd(n,e)}}function Gd(e,t=process.cwd()){let n=Array.isArray(e)?e:[e],r=re(t);for(;;){for(let e of n){let t=A(r,e);if(w(t))return t}let e=k(r);if(e===r)return null;r=e}}async function Kd(e={}){let t=e.cwd??re(process.cwd());if(e.standaloneFile){let n=Gd(e.standaloneFile,t);if(n)try{let e=await import(n);return{success:!0,config:e.default??e,source:`standalone`,configFilePath:n}}catch(e){throw new Vd(n,e)}}if(e.unifiedField)try{let{config:n,configFilePath:r}=await Wd({cwd:t}),i=n?.[e.unifiedField];if(i!==void 0)return{success:!0,config:i,source:`unified`,configFilePath:r}}catch{}return{success:!1,configFilePath:null}}const qd=`lzi-dependencies.config.ts`,Jd=`lzi-dev.config.ts`,Yd=()=>Gd(qd)??Gd(Jd),Xd=async e=>{let t=Yd();if(!t)return null;let n=await Kd({standaloneFile:qd,unifiedField:`dependencies`,cwd:e});if(n.success)return{config:n.config,configPath:t,source:`dependencies`};let r=await Kd({standaloneFile:Jd,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 Zd=Promise,Qd=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 Zd((e,n)=>{t.c=e,t.b=n});return i=r?i.a=t:r=t,n++,l(),a},done:()=>n?o||=new Zd(e=>a=e):Zd.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=>Zd.all(e.map(e=>s.add(typeof e==`function`?e:()=>e)))}};var $d=/* @__PURE__ */ n(((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`:``)}})),ef=/* @__PURE__ */ n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=$d(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(/* @__PURE__ */ new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(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 o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){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 n.enable(n.load()),n}t.exports=n})),tf=/* @__PURE__ */ n(((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=ef()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),nf=/* @__PURE__ */ n(((e,t)=>{let n=a(`tty`),r=a(`util`);e.init=d,e.log=c,e.formatArgs=o,e.save=l,e.load=u,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=a(`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 o(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(`
155
157
  `).join(`
156
158
  `+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+n+` `+e[0]}function s(){return e.inspectOpts.hideDate?``:(/* @__PURE__ */ new Date()).toISOString()+` `}function c(...t){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...t)+`
157
- `)}function l(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function u(){return process.env.DEBUG}function d(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=Qd()(e);let{formatters:f}=t.exports;f.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
158
- `).map(e=>e.trim()).join(` `)},f.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),tf=/* @__PURE__ */ n(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?$d():ef()}));const nf=/^[A-Za-z]:\//;function rf(e=``){return e&&e.replace(/\\/g,`/`).replace(nf,e=>e.toUpperCase())}const af=/^[/\\]{2}/,of=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,sf=/^[A-Za-z]:$/,cf=function(e){if(e.length===0)return`.`;e=rf(e);let t=e.match(af),n=pf(e),r=e[e.length-1]===`/`;return e=ff(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),sf.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!pf(e)?`/${e}`:e)},lf=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 cf(t)};function uf(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const df=function(...e){e=e.map(e=>rf(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:uf();i&&i.length!==0&&(t=`${i}/${t}`,n=pf(i))}return t=ff(t,!n),n&&!pf(t)?`/${t}`:t.length>0?t:`.`};function ff(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 pf=function(e){return of.test(e)},mf=function(e){let t=rf(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&sf.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(pf(e)?`/`:`.`)};var hf=/* @__PURE__ */ t(tf(),1);const gf=Object.prototype.toString,_f=e=>gf.call(e)===`[object Error]`,vf=/* @__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 yf(e){if(!(e&&_f(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:vf.has(t)}function bf(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 xf(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 Sf(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var Cf=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 wf(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 Tf(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Ef(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 Df({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 Cf)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=wf(n,i);if(Tf(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),Tf(r,s)<=0||Tf(r,s)<=0||o<=0||a instanceof TypeError&&!yf(a)||!await i.shouldRetry(f))throw a;let p=Tf(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 Ef(m,i),i.signal?.throwIfAborted(),!0}async function Of(e,t={}){if(t={...t},bf(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,Sf(`onFailedAttempt`,t.onFailedAttempt),Sf(`shouldRetry`,t.shouldRetry),Sf(`shouldConsumeRetry`,t.shouldConsumeRetry),xf(`factor`,t.factor,{min:0,allowInfinity:!1}),xf(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),xf(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),xf(`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 Df({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}const kf={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1},Af={apiEndpoint:`https://npm.antfu.dev/`};async function jf(e,t={}){let{apiEndpoint:n=Af.apiEndpoint,fetch:r=fetch,throw:i=!0,retry:a=kf}=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=Pf(await(a===!1?s():Of(s,typeof a==`number`?{...kf,retries:a}:a)));return i?Nf(c):c}async function Mf(e,t={}){let[n]=await jf([e],t);return n}function Nf(e){for(let t of Pf(e))if(t&&`error`in t)throw Error(t.message||t.error);return e}function Pf(e){return Array.isArray(e)?e:[e]}const Ff=`https://registry.npmjs.org/`;function If(e,t,n=Ff){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 Lf=Object.create,Rf=Object.defineProperty,zf=Object.getOwnPropertyDescriptor,Bf=Object.getOwnPropertyNames,Vf=Object.getPrototypeOf,Hf=Object.prototype.hasOwnProperty,Uf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wf=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Bf(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Hf.call(e,s)&&s!==n&&Rf(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=zf(t,s))||r.enumerable});return e},Gf=(e,t,n)=>(n=e==null?{}:Lf(Vf(e)),Wf(t||!e||!e.__esModule?Rf(n,`default`,{value:e,enumerable:!0}):n,e));const Kf={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};function qf(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 Jf=/(?!^)_/gu,Yf=/\r?\n/u,Xf=/\$\{([^}]+)\}/g;function Zf(e){return Qf(e,`npm_config_userconfig`)||A(e.HOME||s(),`.npmrc`)}function Qf(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 $f(e,t=j.env){if(!w(e))return{};let n={},r=D(e,`utf8`).split(Yf);for(let e of r){let r=e.trim();if(!r||r.startsWith(`#`)||r.startsWith(`;`))continue;let i=r.indexOf(`=`);i!==-1&&tp(n,r.slice(0,i).trim(),rp(r.slice(i+1).trim()).replace(Xf,(e,n)=>t[n]??``))}return n}function ep(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(Jf,`-`).toLowerCase()),tp(t,e,r)}return t}function tp(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];return}e[t]=n}function np(e,t){for(let[n,r]of Object.entries(t))e[n]=r}function rp(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 ip(e,t){let n=ap(e);return n===void 0?t:n===``||n.toLowerCase()!==`false`}function ap(e){if(typeof e==`string`)return e}function op(e){return Array.isArray(e)?e:typeof e==`string`&&e.length>0?e.split(`
159
+ `)}function l(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function u(){return process.env.DEBUG}function d(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=ef()(e);let{formatters:f}=t.exports;f.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
160
+ `).map(e=>e.trim()).join(` `)},f.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),rf=/* @__PURE__ */ n(((e,t)=>{t.exports=typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?tf():nf()}));const af=/^[A-Za-z]:\//;function of(e=``){return e&&e.replace(/\\/g,`/`).replace(af,e=>e.toUpperCase())}const sf=/^[/\\]{2}/,cf=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,lf=/^[A-Za-z]:$/,uf=function(e){if(e.length===0)return`.`;e=of(e);let t=e.match(sf),n=hf(e),r=e[e.length-1]===`/`;return e=mf(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),lf.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!hf(e)?`/${e}`:e)},df=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 uf(t)};function ff(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const pf=function(...e){e=e.map(e=>of(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:ff();i&&i.length!==0&&(t=`${i}/${t}`,n=hf(i))}return t=mf(t,!n),n&&!hf(t)?`/${t}`:t.length>0?t:`.`};function mf(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 hf=function(e){return cf.test(e)},gf=function(e){let t=of(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&lf.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(hf(e)?`/`:`.`)};var _f=/* @__PURE__ */ t(rf(),1);const vf=Object.prototype.toString,yf=e=>vf.call(e)===`[object Error]`,bf=/* @__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 xf(e){if(!(e&&yf(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:bf.has(t)}function Sf(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 Cf(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 wf(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var Tf=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 Ef(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 Df(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Of(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 kf({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 Tf)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=Ef(n,i);if(Df(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),Df(r,s)<=0||Df(r,s)<=0||o<=0||a instanceof TypeError&&!xf(a)||!await i.shouldRetry(f))throw a;let p=Df(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 Of(m,i),i.signal?.throwIfAborted(),!0}async function Af(e,t={}){if(t={...t},Sf(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,wf(`onFailedAttempt`,t.onFailedAttempt),wf(`shouldRetry`,t.shouldRetry),wf(`shouldConsumeRetry`,t.shouldConsumeRetry),Cf(`factor`,t.factor,{min:0,allowInfinity:!1}),Cf(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Cf(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Cf(`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 kf({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}const jf={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1},Mf={apiEndpoint:`https://npm.antfu.dev/`};async function Nf(e,t={}){let{apiEndpoint:n=Mf.apiEndpoint,fetch:r=fetch,throw:i=!0,retry:a=jf}=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=If(await(a===!1?s():Af(s,typeof a==`number`?{...jf,retries:a}:a)));return i?Ff(c):c}async function Pf(e,t={}){let[n]=await Nf([e],t);return n}function Ff(e){for(let t of If(e))if(t&&`error`in t)throw Error(t.message||t.error);return e}function If(e){return Array.isArray(e)?e:[e]}const Lf=`https://registry.npmjs.org/`;function Rf(e,t,n=Lf){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 zf=Object.create,Bf=Object.defineProperty,Vf=Object.getOwnPropertyDescriptor,Hf=Object.getOwnPropertyNames,Uf=Object.getPrototypeOf,Wf=Object.prototype.hasOwnProperty,Gf=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Kf=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Hf(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Wf.call(e,s)&&s!==n&&Bf(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Vf(t,s))||r.enumerable});return e},qf=(e,t,n)=>(n=e==null?{}:zf(Uf(e)),Kf(t||!e||!e.__esModule?Bf(n,`default`,{value:e,enumerable:!0}):n,e));const Jf={retries:5,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};function Yf(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 Xf=/(?!^)_/gu,Zf=/\r?\n/u,Qf=/\$\{([^}]+)\}/g;function $f(e){return ep(e,`npm_config_userconfig`)||A(e.HOME||s(),`.npmrc`)}function ep(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 tp(e,t=j.env){if(!w(e))return{};let n={},r=D(e,`utf8`).split(Zf);for(let e of r){let r=e.trim();if(!r||r.startsWith(`#`)||r.startsWith(`;`))continue;let i=r.indexOf(`=`);i!==-1&&rp(n,r.slice(0,i).trim(),ap(r.slice(i+1).trim()).replace(Qf,(e,n)=>t[n]??``))}return n}function np(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(Xf,`-`).toLowerCase()),rp(t,e,r)}return t}function rp(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 ip(e,t){for(let[n,r]of Object.entries(t))e[n]=r}function ap(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 op(e,t){let n=sp(e);return n===void 0?t:n===``||n.toLowerCase()!==`false`}function sp(e){if(typeof e==`string`)return e}function cp(e){return Array.isArray(e)?e:typeof e==`string`&&e.length>0?e.split(`
159
161
 
160
- `):[]}const sp=/^(\/\/.+):(_authToken|_auth|username|_password|certfile|keyfile)$/u,cp=/^@[^:]+:registry$/u;function lp(e){let t={};for(let[n,r]of Object.entries(e)){if(!cp.test(n))continue;let e=ap(r);e&&(t[n.slice(0,-9)]=pp(e))}return t}function up(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 dp(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.match(sp);if(!e)continue;let[,i,a]=e,o=mp(i),s=t[o]??{},c=ap(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,fp(t)]).filter(e=>Object.keys(e[1]).length>0))}function fp(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=M.from(e._password,`base64`).toString(`utf8`);t.basicAuth=M.from(`${e.username}:${n}`,`utf8`).toString(`base64`)}return e.certfile&&(t.certFile=e.certfile),e.keyfile&&(t.keyFile=e.keyfile),t}function pp(e){return e.endsWith(`/`)?e:`${e}/`}function mp(e){return e.endsWith(`/`)?e:`${e}/`}function hp(e){let t=new URL(pp(e)),n=t.pathname.endsWith(`/`)?t.pathname:`${t.pathname}/`;return`//${t.host}${n}`}function gp(e,t){let n=hp(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 _p(e={}){let t=e.env??j.env,n=e.cwd??j.cwd(),r=e.userConfigPath??Zf(t),i=e.projectConfigPath===!1?void 0:e.projectConfigPath??A(n,`.npmrc`),a={registry:Ff,"strict-ssl":`true`};np(a,$f(r,t)),i&&np(a,$f(i,t)),np(a,ep(t));let o=pp(ap(a.registry)??`https://registry.npmjs.org/`),s=ap(a.scope),c=lp(a);return{registry:o,npmConfigs:up(o,c,s),scopeRegistries:c,authByRegistry:dp(a),strictSSL:ip(a[`strict-ssl`],!0),ca:op(a.ca),caFile:ap(a.cafile),userAgent:ap(a[`user-agent`]),proxy:ap(a.proxy),httpsProxy:ap(a[`https-proxy`]),noProxy:ap(a.noproxy),userConfigPath:r,projectConfigPath:i}}var vp=/* @__PURE__ */ Uf(((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(`.`)})),yp=/* @__PURE__ */ Gf((/* @__PURE__ */ Uf(((e,t)=>{let n=vp();var r=/* @__PURE__ */ RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.startsWith(`.`)&&a.push(`name cannot start with a period`),e.startsWith(`-`)&&a.push(`name cannot start with a hyphen`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.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(`.`)&&a.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=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=a})))(),1);const bp=/^file:/iu,xp=/^npm:/iu,Sp=/^(?:git\+)?[a-z]+:/iu,Cp=/^[^@]+@[^:.]+\.[^:]+:.+$/u,wp=/^(?:\.{1,2}(?:[/\\]|$)|[/\\]|~[/\\]|[A-Za-z]:[/\\])/u;function Tp(e){let t=e.spec.trim();if(!t)throw Mp(`Package spec must be a non-empty string.`,`EINVALIDPACKAGESPEC`);Ep(t);let n=t.startsWith(`@`)?Dp(t):Op(t);return kp(n.name,t),{raw:t,name:n.name,escapedName:n.name.replace(`/`,`%2f`),scope:Ap(n.name),rawSpec:n.rawSpec}}function Ep(e){if(bp.test(e))throw jp(e,`file`);if(xp.test(e))throw jp(e,`npm alias`);if(wp.test(e))throw jp(e,`local path`);if(Cp.test(e))throw jp(e,`git`);if(Sp.test(e))throw jp(e,`url`)}function Dp(e){let t=e.indexOf(`/`);if(t<=1||t===e.length-1)throw Mp(`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 Op(e){let t=e.indexOf(`@`);return t===-1?{name:e,rawSpec:``}:{name:e.slice(0,t),rawSpec:e.slice(t+1)}}function kp(e,t){if(!e)throw Mp(`Invalid package spec "${t}".`,`EINVALIDPACKAGESPEC`);if(!e.startsWith(`@`)&&e.includes(`/`))throw jp(t,`local path`);if(!(0,yp.default)(e).validForNewPackages)throw Mp(`Invalid package name "${e}" in "${t}".`,`EINVALIDPACKAGENAME`)}function Ap(e){if(e.startsWith(`@`))return e.slice(0,e.indexOf(`/`))}function jp(e,t){return Mp(`Unsupported ${t} package spec "${e}" for get-npm-meta.`,`EUNSUPPORTEDPACKAGESPEC`)}function Mp(e,t){return Object.assign(Error(e),{code:t})}function Np(e){return pp(e)===Ff}function Pp(e,t){let n=_p(t);return e.map(e=>Fp(e,n))}function Fp(e,t){let n=Tp({spec:e}),r=pp(If(n.scope,t.npmConfigs));return{auth:gp(r,t.authByRegistry),config:t,parsed:n,registry:r}}const Ip=Object.prototype.toString,Lp=e=>Ip.call(e)===`[object Error]`,Rp=/* @__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 zp(e){if(!(e&&Lp(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:Rp.has(t)}function Bp(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 Vp(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 Hp(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var Up=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 Wp(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 Gp(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Kp(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 qp({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 Up)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=Wp(n,i);if(Gp(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),Gp(r,s)<=0||Gp(r,s)<=0||o<=0||a instanceof TypeError&&!zp(a)||!await i.shouldRetry(f))throw a;let p=Gp(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 Kp(m,i),i.signal?.throwIfAborted(),!0}async function Jp(e,t={}){if(t={...t},Bp(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,Hp(`onFailedAttempt`,t.onFailedAttempt),Hp(`shouldRetry`,t.shouldRetry),Hp(`shouldConsumeRetry`,t.shouldConsumeRetry),Vp(`factor`,t.factor,{min:0,allowInfinity:!1}),Vp(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Vp(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Vp(`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 qp({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}
162
+ `):[]}const lp=/^(\/\/.+):(_authToken|_auth|username|_password|certfile|keyfile)$/u,up=/^@[^:]+:registry$/u;function dp(e){let t={};for(let[n,r]of Object.entries(e)){if(!up.test(n))continue;let e=sp(r);e&&(t[n.slice(0,-9)]=hp(e))}return t}function fp(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 pp(e){let t={};for(let[n,r]of Object.entries(e)){let e=n.match(lp);if(!e)continue;let[,i,a]=e,o=gp(i),s=t[o]??{},c=sp(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,mp(t)]).filter(e=>Object.keys(e[1]).length>0))}function mp(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=M.from(e._password,`base64`).toString(`utf8`);t.basicAuth=M.from(`${e.username}:${n}`,`utf8`).toString(`base64`)}return e.certfile&&(t.certFile=e.certfile),e.keyfile&&(t.keyFile=e.keyfile),t}function hp(e){return e.endsWith(`/`)?e:`${e}/`}function gp(e){return e.endsWith(`/`)?e:`${e}/`}function _p(e){let t=new URL(hp(e)),n=t.pathname.endsWith(`/`)?t.pathname:`${t.pathname}/`;return`//${t.host}${n}`}function vp(e,t){let n=_p(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 yp(e={}){let t=e.env??j.env,n=e.cwd??j.cwd(),r=e.userConfigPath??$f(t),i=e.projectConfigPath===!1?void 0:e.projectConfigPath??A(n,`.npmrc`),a={registry:Lf,"strict-ssl":`true`};ip(a,tp(r,t)),i&&ip(a,tp(i,t)),ip(a,np(t));let o=hp(sp(a.registry)??`https://registry.npmjs.org/`),s=sp(a.scope),c=dp(a);return{registry:o,npmConfigs:fp(o,c,s),scopeRegistries:c,authByRegistry:pp(a),strictSSL:op(a[`strict-ssl`],!0),ca:cp(a.ca),caFile:sp(a.cafile),userAgent:sp(a[`user-agent`]),proxy:sp(a.proxy),httpsProxy:sp(a[`https-proxy`]),noProxy:sp(a.noproxy),userConfigPath:r,projectConfigPath:i}}var bp=/* @__PURE__ */ Gf(((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(`.`)})),xp=/* @__PURE__ */ qf((/* @__PURE__ */ Gf(((e,t)=>{let n=bp();var r=/* @__PURE__ */ RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),i=[`node_modules`,`favicon.ico`];function a(e){var t=[],a=[];if(e===null)return a.push(`name cannot be null`),o(t,a);if(e===void 0)return a.push(`name cannot be undefined`),o(t,a);if(typeof e!=`string`)return a.push(`name must be a string`),o(t,a);if(e.length||a.push(`name length must be greater than zero`),e.startsWith(`.`)&&a.push(`name cannot start with a period`),e.startsWith(`-`)&&a.push(`name cannot start with a hyphen`),e.match(/^_/)&&a.push(`name cannot start with an underscore`),e.trim()!==e&&a.push(`name cannot contain leading or trailing spaces`),i.forEach(function(t){e.toLowerCase()===t&&a.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(`.`)&&a.push(`name cannot start with a period`),encodeURIComponent(c)===c&&encodeURIComponent(l)===l)return o(t,a)}a.push(`name can only contain URL-friendly characters`)}return o(t,a)}var o=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=a})))(),1);const Sp=/^file:/iu,Cp=/^npm:/iu,wp=/^(?:git\+)?[a-z]+:/iu,Tp=/^[^@]+@[^:.]+\.[^:]+:.+$/u,Ep=/^(?:\.{1,2}(?:[/\\]|$)|[/\\]|~[/\\]|[A-Za-z]:[/\\])/u;function Dp(e){let t=e.spec.trim();if(!t)throw Pp(`Package spec must be a non-empty string.`,`EINVALIDPACKAGESPEC`);Op(t);let n=t.startsWith(`@`)?kp(t):Ap(t);return jp(n.name,t),{raw:t,name:n.name,escapedName:n.name.replace(`/`,`%2f`),scope:Mp(n.name),rawSpec:n.rawSpec}}function Op(e){if(Sp.test(e))throw Np(e,`file`);if(Cp.test(e))throw Np(e,`npm alias`);if(Ep.test(e))throw Np(e,`local path`);if(Tp.test(e))throw Np(e,`git`);if(wp.test(e))throw Np(e,`url`)}function kp(e){let t=e.indexOf(`/`);if(t<=1||t===e.length-1)throw Pp(`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 Ap(e){let t=e.indexOf(`@`);return t===-1?{name:e,rawSpec:``}:{name:e.slice(0,t),rawSpec:e.slice(t+1)}}function jp(e,t){if(!e)throw Pp(`Invalid package spec "${t}".`,`EINVALIDPACKAGESPEC`);if(!e.startsWith(`@`)&&e.includes(`/`))throw Np(t,`local path`);if(!(0,xp.default)(e).validForNewPackages)throw Pp(`Invalid package name "${e}" in "${t}".`,`EINVALIDPACKAGENAME`)}function Mp(e){if(e.startsWith(`@`))return e.slice(0,e.indexOf(`/`))}function Np(e,t){return Pp(`Unsupported ${t} package spec "${e}" for get-npm-meta.`,`EUNSUPPORTEDPACKAGESPEC`)}function Pp(e,t){return Object.assign(Error(e),{code:t})}function Fp(e){return hp(e)===Lf}function Ip(e,t){let n=yp(t);return e.map(e=>Lp(e,n))}function Lp(e,t){let n=Dp({spec:e}),r=hp(Rf(n.scope,t.npmConfigs));return{auth:vp(r,t.authByRegistry),config:t,parsed:n,registry:r}}const Rp=Object.prototype.toString,zp=e=>Rp.call(e)===`[object Error]`,Bp=/* @__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 Vp(e){if(!(e&&zp(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:Bp.has(t)}function Hp(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 Up(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 Wp(e,t){if(t!==void 0&&typeof t!=`function`)throw TypeError(`Expected \`${e}\` to be a function.`)}var Gp=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 Kp(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 qp(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Jp(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 Yp({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 Gp)throw a.originalError;let o=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,s=i.maxRetryTime??1/0,c=Kp(n,i);if(qp(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),qp(r,s)<=0||qp(r,s)<=0||o<=0||a instanceof TypeError&&!Vp(a)||!await i.shouldRetry(f))throw a;let p=qp(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 Jp(m,i),i.signal?.throwIfAborted(),!0}async function Xp(e,t={}){if(t={...t},Hp(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,Wp(`onFailedAttempt`,t.onFailedAttempt),Wp(`shouldRetry`,t.shouldRetry),Wp(`shouldConsumeRetry`,t.shouldConsumeRetry),Up(`factor`,t.factor,{min:0,allowInfinity:!1}),Up(`minTimeout`,t.minTimeout,{min:0,allowInfinity:!1}),Up(`maxTimeout`,t.maxTimeout,{min:0,allowInfinity:!0}),Up(`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 Yp({error:e,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw Error(`Retry attempts exhausted without throwing an error.`)}
161
163
  /* istanbul ignore next */
162
- const Yp=2**53-1||9007199254740991,Xp=/^\d+$/;function Zp(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Xp.test(String(e)),r=Xp.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 j==`object`&&j.env&&j.env.NODE_DEBUG&&/\bsemver\b/i.test(j.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Qp=[],$p=[],G=[],em=[],K={};let tm=0;const nm=`[a-zA-Z0-9-]`,rm=[[`\\s`,1],[`\\d`,256],[nm,250]];function im(e){for(let[t,n]of rm)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function q(e,t,n=!1){let r=im(t),i=tm++;W(e,i,t),K[e]=i,G[i]=t,em[i]=r,Qp[i]=new RegExp(t,n?`g`:void 0),$p[i]=new RegExp(r,n?`g`:void 0)}q(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),q(`NUMERICIDENTIFIERLOOSE`,`\\d+`),q(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${nm}*`),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`,`${nm}+`),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 am=Object.freeze({loose:!0}),om=Object.freeze({});function sm(e){return e?typeof e==`object`?e:am:om}const cm=/^\d+$/;var lm=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=sm(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?$p[K.LOOSE]:$p[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>Yp||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>Yp||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>Yp||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(cm.test(e)){let t=+e;if(t>=0&&t<Yp)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 Zp(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 Zp(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?$p[K.PRERELEASELOOSE]:$p[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]),Zp(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 um(e,t,n){return new lm(e,n).compare(new lm(t,n))}function dm(e,t,n){return um(e,t,n)===0}function fm(e,t,n){return um(e,t,n)>0}function pm(e,t,n){return um(e,t,n)>=0}function mm(e,t,n){return um(e,t,n)<0}function hm(e,t,n){return um(e,t,n)<=0}function gm(e,t,n){return um(e,t,n)!==0}function _m(e,t,n,r){let i=e=>e instanceof lm?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 dm(e,n,r);case`!=`:return gm(e,n,r);case`>`:return fm(e,n,r);case`>=`:return pm(e,n,r);case`<`:return mm(e,n,r);case`<=`:return hm(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var vm=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 ym=Symbol(`SemVer ANY`),bm=/\s+/;var xm=class e{options={};loose=!1;operator=``;semver=ym;value=``;static get ANY(){return ym}constructor(t,n){let r=sm(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(bm).join(` `);W(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===ym?``:this.operator+this.semver.version,W(`comp`,this)}parse(e){let t=this.options.loose?$p[K.COMPARATORLOOSE]:$p[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 lm(n[2],this.options.loose):ym}toString(){return this.value}test(e){if(W(`Comparator.test`,e,this.options.loose),this.semver===ym||e===ym)return!0;if(typeof e==`string`)try{e=new lm(e,this.options)}catch{return!1}return _m(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 Om(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new Om(this.value,n).test(t.semver);let r=sm(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!==ym&&t.semver!==ym&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||_m(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||_m(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const Sm=/\s+/g,Cm=/\s+/,wm=new vm,Tm=e=>e.value===`<0.0.0-0`,Em=e=>e.value===``,Dm=e=>e!==xm.ANY;var Om=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=sm(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof xm)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(Sm,` `),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=>!Tm(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&&Em(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=wm.get(t);if(n)return n;let r=this.options.loose,i=r?$p[K.HYPHENRANGELOOSE]:$p[K.HYPHENRANGE];e=e.replace(i,Bm(!!this.options.includePrerelease)),W(`hyphen replace`,e),e=e.replace($p[K.COMPARATORTRIM],`$1$2$3`),W(`comparator trim`,e),e=e.replace($p[K.TILDETRIM],`$1~`),W(`tilde trim`,e),e=e.replace($p[K.CARETTRIM],`$1^`),W(`caret trim`,e);let a=e.split(` `).map(e=>Am(e,this.options)).join(` `).split(Cm).map(e=>zm(e,this.options));r&&(a=a.filter(e=>(W(`loose invalid filter`,e,this.options),!!e.match($p[K.COMPARATORLOOSE])))),W(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new xm(e,this.options));for(let e of s){if(Tm(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return wm.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>km(e,n)&&t.set.some(t=>km(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 lm(e,this.options)}catch{return!1}else if(e instanceof lm)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(Vm(this.set[e],t,this.options))return!0;return!1}};function km(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 Am(e,t){return e=e.replace($p[K.BUILD],``),W(`comp`,e,t),e=Pm(e,t),W(`caret`,e),e=Mm(e,t),W(`tildes`,e),e=Im(e,t),W(`xrange`,e),e=Rm(e,t),W(`stars`,e),e}function jm(e){return!e||e.toLowerCase()===`x`||e===`*`}function Mm(e,t){return e.trim().split(Cm).map(e=>Nm(e,t)).join(` `)}function Nm(e,t){let n=t.loose?$p[K.TILDELOOSE]:$p[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 jm(n)?o=``:jm(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:jm(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 Pm(e,t){return e.trim().split(Cm).map(e=>Fm(e,t)).join(` `)}function Fm(e,t){W(`caret`,e,t);let n=t.loose?$p[K.CARETLOOSE]:$p[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 jm(n)?s=``:jm(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:jm(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 Im(e,t){return W(`replaceXRanges`,e,t),e.split(Cm).map(e=>Lm(e,t)).join(` `)}function Lm(e,t){e=e.trim();let n=t.loose?$p[K.XRANGELOOSE]:$p[K.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{W(`xRange`,e,n,r,i,a,o,s);let c=jm(i),l=c||jm(a),u=l||jm(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 Rm(e,t){return W(`replaceStars`,e,t),e.trim().replace($p[K.STAR],``)}function zm(e,t){return W(`replaceGTE0`,e,t),e.trim().replace($p[t.includePrerelease?K.GTE0PRE:K.GTE0],``)}function Bm(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=jm(r)?``:jm(i)?`>=${String(r)}.0.0${e?`-0`:``}`:jm(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=jm(l)?``:jm(u)?`<${Number(l)+1}.0.0-0`:jm(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 Vm(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),!Dm(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 Hm(e,t,n=!1){if(e instanceof lm)return e;try{return new lm(e,t)}catch(e){if(!n)return null;throw e}}function Um(e,t,n){try{return new Om(t,n).test(e)}catch{return!1}}function Wm(e,t){let n=Hm(e,t);return n?n.version:null}function Gm(e,t){try{return new Om(e,t).range||`*`}catch{return null}}async function Km(e,t={}){let n=await Jm(e,t);if(Zm(n)){if(t.throw===!1)return n;throw Error(n.error)}let r=n.versions??{},i=$m(n[`dist-tags`]),a=n.time??{},o=e.parsed.rawSpec||`*`,s=Date.now(),c=Ym(Xm(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,th(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 qm(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():eh(e.parsed.name,r,a.status,a.statusText)}async function Jm(e,t){let n=Qm(t.retry),r=()=>qm(e,t);return n===!1?r():Jp(r,n)}function Ym(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 Xm(e,t,n,r){if(n===`*`)return e;let i=t[n];return i?e.includes(i)?[i]:[]:Wm(n)?e:Gm(n)?e.filter(e=>Um(e,n,{includePrerelease:!0,loose:r??!1})):e}function Zm(e){return`error`in e}function Qm(e){return e===!1?!1:typeof e==`number`?{...Kf,retries:e}:e??Kf}function $m(e){return{latest:e?.latest??``,...e??{}}}function eh(e,t,n,r){return{status:n,name:e,error:`[GET] "${t}": ${n} ${r}`}}function th(e,t){return{time:t,engines:e.engines,deprecated:e.deprecated,provenance:qf(e),integrity:e.integrity??e.dist?.integrity}}async function nh(e,t={}){let[n]=Pp([e],t);return rh(n,t)}function rh(e,t){return Np(e.registry)?Mf(e.parsed.raw,ih(t)):Km(e,t)}function ih(e){let{cwd:t,env:n,userConfigPath:r,projectConfigPath:i,...a}=e;return a}const ah=!!globalThis.process?.env?.FORCE_NODE_FETCH,oh=!ah&&globalThis.fetch||i;!ah&&globalThis.Blob,!ah&&globalThis.File,!ah&&globalThis.FormData;const sh=!ah&&globalThis.Headers||e;!ah&&globalThis.Request,!ah&&globalThis.Response;const ch=!ah&&globalThis.AbortController||r,lh=/"(?:_|\\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*:/,uh=/"(?: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*:/,dh=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function fh(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){ph(e);return}return t}function ph(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function mh(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(!dh.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(lh.test(e)||uh.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,fh)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;const hh=/#/g,gh=/&/g,_h=/\//g,vh=/=/g,yh=/\+/g,bh=/%5e/gi,xh=/%60/gi,Sh=/%7c/gi,Ch=/%20/gi;function wh(e){return encodeURI(``+e).replace(Sh,`|`)}function Th(e){return wh(typeof e==`string`?e:JSON.stringify(e)).replace(yh,`%2B`).replace(Ch,`+`).replace(hh,`%23`).replace(gh,`%26`).replace(xh,"`").replace(bh,`^`).replace(_h,`%2F`)}function Eh(e){return Th(e).replace(vh,`%3D`)}function Dh(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function Oh(e){return Dh(e.replace(yh,` `))}function kh(e){return Dh(e.replace(yh,` `))}function Ah(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=Oh(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=kh(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 jh(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${Eh(e)}=${Th(t)}`).join(`&`):`${Eh(e)}=${Th(t)}`:Eh(e)}function Mh(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>jh(t,e[t])).filter(Boolean).join(`&`)}const Nh=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Ph=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Fh=/^([/\\]\s*){2,}[^/\\]/,Ih=/\/$|\/\?|\/#/,Lh=/^\.?\//;function Rh(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?Nh.test(e):Ph.test(e)||(t.acceptRelative?Fh.test(e):!1)}function zh(e=``,t){return t?Ih.test(e):e.endsWith(`/`)}function Bh(e=``,t){if(!t)return(zh(e)?e.slice(0,-1):e)||`/`;if(!zh(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 Vh(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(zh(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 Hh(e,t){if(Wh(t)||Rh(e))return e;let n=Bh(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return Kh(n,e)}function Uh(e,t){let n=Jh(e);return n.search=Mh({...Ah(n.search),...t}),Xh(n)}function Wh(e){return!e||e===`/`}function Gh(e){return e&&e!==`/`}function Kh(e,...t){let n=e||``;for(let e of t.filter(e=>Gh(e)))if(n){let t=e.replace(Lh,``);n=Vh(n)+t}else n=e;return n}const qh=Symbol.for(`ufo:protocolRelative`);function Jh(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(!Rh(e,{acceptRelative:!0}))return t?Jh(t+e):Yh(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}=Yh(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[qh]:!r}}function Yh(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function Xh(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[qh]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var Zh=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function Qh(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 Zh(`${`[${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 $h=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function eg(e=`GET`){return $h.has(e.toUpperCase())}function tg(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 ng=/* @__PURE__ */ new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),rg=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function ig(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return rg.test(t)?`json`:t===`text/event-stream`?`stream`:ng.has(t)||t.startsWith(`text/`)?`text`:`blob`}function ag(e,t,n,r){let i=og(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 og(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 sg(e,t){if(t){if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}}const cg=/* @__PURE__ */ new Set([408,409,425,429,500,502,503,504]),lg=/* @__PURE__ */ new Set([101,204,205,304]);function ug(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:+!eg(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):cg.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=Qh(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:ag(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 sg(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=Hh(s.request,s.options.baseURL)),s.options.query&&(s.request=Uh(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&&eg(s.options.method)){if(tg(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 sg(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!lg.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||ig(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||mh;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 sg(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await sg(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={})=>ug({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}function dg(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||`false`))return oh;let e={keepAlive:!0},t=new N.Agent(e),n=new oe.Agent(e),r={agent(e){return e.protocol===`http:`?t:n}};return function(e,t){return oh(e,{...r,...t})}}const fg=globalThis.fetch?(...e)=>globalThis.fetch(...e):dg();ug({fetch:fg,Headers:globalThis.Headers||sh,AbortController:globalThis.AbortController||ch});const pg=/^(?:( )+|\t+)/,mg=`space`;function hg(e,t,n){return e&&t===mg&&n===1}function gg(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(pg);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?mg:`tab`;if(hg(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(hg(t,s,e))continue;a=_g(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function _g(e,t){return(e===mg?`s`:`t`)+String(t)}function vg(e){return{type:e[0]===`s`?mg:`tab`,amount:Number(e.slice(1))}}function yg(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 bg(e,t){return(e===mg?` `:` `).repeat(t)}function xg(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=gg(e,!0);t.size===0&&(t=gg(e,!1));let n=yg(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=vg(n),a=bg(r,i)),{amount:i,type:r,indent:a}}function Sg(e,t){return te(e)?e:re(t||`.`,e)}function Cg(e,t){let{last:n,cwd:r}=t||{},i=Sg(e,r),a=Sg(n||`/`,r),o,s=[];for(;o!==a&&(s.push(i),i=k(o=i),i!==o););return s}function wg(e,t){let n,r;for(n of Cg(t&&t.cwd||``,t))if(r=A(n,e),w(r))return r}
164
+ const Zp=2**53-1||9007199254740991,Qp=/^\d+$/;function $p(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Qp.test(String(e)),r=Qp.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 j==`object`&&j.env&&j.env.NODE_DEBUG&&/\bsemver\b/i.test(j.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},em=[],tm=[],G=[],nm=[],K={};let rm=0;const im=`[a-zA-Z0-9-]`,am=[[`\\s`,1],[`\\d`,256],[im,250]];function om(e){for(let[t,n]of am)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function q(e,t,n=!1){let r=om(t),i=rm++;W(e,i,t),K[e]=i,G[i]=t,nm[i]=r,em[i]=new RegExp(t,n?`g`:void 0),tm[i]=new RegExp(r,n?`g`:void 0)}q(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),q(`NUMERICIDENTIFIERLOOSE`,`\\d+`),q(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${im}*`),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`,`${im}+`),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 sm=Object.freeze({loose:!0}),cm=Object.freeze({});function lm(e){return e?typeof e==`object`?e:sm:cm}const um=/^\d+$/;var dm=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=lm(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?tm[K.LOOSE]:tm[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>Zp||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>Zp||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>Zp||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(um.test(e)){let t=+e;if(t>=0&&t<Zp)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 $p(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 $p(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?tm[K.PRERELEASELOOSE]:tm[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]),$p(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 fm(e,t,n){return new dm(e,n).compare(new dm(t,n))}function pm(e,t,n){return fm(e,t,n)===0}function mm(e,t,n){return fm(e,t,n)>0}function hm(e,t,n){return fm(e,t,n)>=0}function gm(e,t,n){return fm(e,t,n)<0}function _m(e,t,n){return fm(e,t,n)<=0}function vm(e,t,n){return fm(e,t,n)!==0}function ym(e,t,n,r){let i=e=>e instanceof dm?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 pm(e,n,r);case`!=`:return vm(e,n,r);case`>`:return mm(e,n,r);case`>=`:return hm(e,n,r);case`<`:return gm(e,n,r);case`<=`:return _m(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var bm=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 xm=Symbol(`SemVer ANY`),Sm=/\s+/;var Cm=class e{options={};loose=!1;operator=``;semver=xm;value=``;static get ANY(){return xm}constructor(t,n){let r=lm(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(Sm).join(` `);W(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===xm?``:this.operator+this.semver.version,W(`comp`,this)}parse(e){let t=this.options.loose?tm[K.COMPARATORLOOSE]:tm[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 dm(n[2],this.options.loose):xm}toString(){return this.value}test(e){if(W(`Comparator.test`,e,this.options.loose),this.semver===xm||e===xm)return!0;if(typeof e==`string`)try{e=new dm(e,this.options)}catch{return!1}return ym(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 Am(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new Am(this.value,n).test(t.semver);let r=lm(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!==xm&&t.semver!==xm&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||ym(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||ym(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const wm=/\s+/g,Tm=/\s+/,Em=new bm,Dm=e=>e.value===`<0.0.0-0`,Om=e=>e.value===``,km=e=>e!==Cm.ANY;var Am=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=lm(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Cm)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(wm,` `),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=>!Dm(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&&Om(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=Em.get(t);if(n)return n;let r=this.options.loose,i=r?tm[K.HYPHENRANGELOOSE]:tm[K.HYPHENRANGE];e=e.replace(i,Hm(!!this.options.includePrerelease)),W(`hyphen replace`,e),e=e.replace(tm[K.COMPARATORTRIM],`$1$2$3`),W(`comparator trim`,e),e=e.replace(tm[K.TILDETRIM],`$1~`),W(`tilde trim`,e),e=e.replace(tm[K.CARETTRIM],`$1^`),W(`caret trim`,e);let a=e.split(` `).map(e=>Mm(e,this.options)).join(` `).split(Tm).map(e=>Vm(e,this.options));r&&(a=a.filter(e=>(W(`loose invalid filter`,e,this.options),!!e.match(tm[K.COMPARATORLOOSE])))),W(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new Cm(e,this.options));for(let e of s){if(Dm(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return Em.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>jm(e,n)&&t.set.some(t=>jm(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 dm(e,this.options)}catch{return!1}else if(e instanceof dm)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(Um(this.set[e],t,this.options))return!0;return!1}};function jm(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 Mm(e,t){return e=e.replace(tm[K.BUILD],``),W(`comp`,e,t),e=Im(e,t),W(`caret`,e),e=Pm(e,t),W(`tildes`,e),e=Rm(e,t),W(`xrange`,e),e=Bm(e,t),W(`stars`,e),e}function Nm(e){return!e||e.toLowerCase()===`x`||e===`*`}function Pm(e,t){return e.trim().split(Tm).map(e=>Fm(e,t)).join(` `)}function Fm(e,t){let n=t.loose?tm[K.TILDELOOSE]:tm[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 Nm(n)?o=``:Nm(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:Nm(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 Im(e,t){return e.trim().split(Tm).map(e=>Lm(e,t)).join(` `)}function Lm(e,t){W(`caret`,e,t);let n=t.loose?tm[K.CARETLOOSE]:tm[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 Nm(n)?s=``:Nm(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:Nm(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 Rm(e,t){return W(`replaceXRanges`,e,t),e.split(Tm).map(e=>zm(e,t)).join(` `)}function zm(e,t){e=e.trim();let n=t.loose?tm[K.XRANGELOOSE]:tm[K.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{W(`xRange`,e,n,r,i,a,o,s);let c=Nm(i),l=c||Nm(a),u=l||Nm(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 Bm(e,t){return W(`replaceStars`,e,t),e.trim().replace(tm[K.STAR],``)}function Vm(e,t){return W(`replaceGTE0`,e,t),e.trim().replace(tm[t.includePrerelease?K.GTE0PRE:K.GTE0],``)}function Hm(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=Nm(r)?``:Nm(i)?`>=${String(r)}.0.0${e?`-0`:``}`:Nm(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=Nm(l)?``:Nm(u)?`<${Number(l)+1}.0.0-0`:Nm(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 Um(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),!km(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 Wm(e,t,n=!1){if(e instanceof dm)return e;try{return new dm(e,t)}catch(e){if(!n)return null;throw e}}function Gm(e,t,n){try{return new Am(t,n).test(e)}catch{return!1}}function Km(e,t){let n=Wm(e,t);return n?n.version:null}function qm(e,t){try{return new Am(e,t).range||`*`}catch{return null}}async function Jm(e,t={}){let n=await Xm(e,t);if($m(n)){if(t.throw===!1)return n;throw Error(n.error)}let r=n.versions??{},i=th(n[`dist-tags`]),a=n.time??{},o=e.parsed.rawSpec||`*`,s=Date.now(),c=Zm(Qm(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,rh(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 Ym(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():nh(e.parsed.name,r,a.status,a.statusText)}async function Xm(e,t){let n=eh(t.retry),r=()=>Ym(e,t);return n===!1?r():Xp(r,n)}function Zm(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 Qm(e,t,n,r){if(n===`*`)return e;let i=t[n];return i?e.includes(i)?[i]:[]:Km(n)?e:qm(n)?e.filter(e=>Gm(e,n,{includePrerelease:!0,loose:r??!1})):e}function $m(e){return`error`in e}function eh(e){return e===!1?!1:typeof e==`number`?{...Jf,retries:e}:e??Jf}function th(e){return{latest:e?.latest??``,...e??{}}}function nh(e,t,n,r){return{status:n,name:e,error:`[GET] "${t}": ${n} ${r}`}}function rh(e,t){return{time:t,engines:e.engines,deprecated:e.deprecated,provenance:Yf(e),integrity:e.integrity??e.dist?.integrity}}async function ih(e,t={}){let[n]=Ip([e],t);return ah(n,t)}function ah(e,t){return Fp(e.registry)?Pf(e.parsed.raw,oh(t)):Jm(e,t)}function oh(e){let{cwd:t,env:n,userConfigPath:r,projectConfigPath:i,...a}=e;return a}const sh=!!globalThis.process?.env?.FORCE_NODE_FETCH,ch=!sh&&globalThis.fetch||i;!sh&&globalThis.Blob,!sh&&globalThis.File,!sh&&globalThis.FormData;const lh=!sh&&globalThis.Headers||e;!sh&&globalThis.Request,!sh&&globalThis.Response;const uh=!sh&&globalThis.AbortController||r,dh=/"(?:_|\\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*:/,fh=/"(?: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*:/,ph=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function mh(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)hh(e);else return t}function hh(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function gh(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(!ph.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(dh.test(e)||fh.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,mh)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}String.fromCharCode;const _h=/#/g,vh=/&/g,yh=/\//g,bh=/=/g,xh=/\+/g,Sh=/%5e/gi,Ch=/%60/gi,wh=/%7c/gi,Th=/%20/gi;function Eh(e){return encodeURI(``+e).replace(wh,`|`)}function Dh(e){return Eh(typeof e==`string`?e:JSON.stringify(e)).replace(xh,`%2B`).replace(Th,`+`).replace(_h,`%23`).replace(vh,`%26`).replace(Ch,"`").replace(Sh,`^`).replace(yh,`%2F`)}function Oh(e){return Dh(e).replace(bh,`%3D`)}function kh(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function Ah(e){return kh(e.replace(xh,` `))}function jh(e){return kh(e.replace(xh,` `))}function Mh(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=Ah(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=jh(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 Nh(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${Oh(e)}=${Dh(t)}`).join(`&`):`${Oh(e)}=${Dh(t)}`:Oh(e)}function Ph(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>Nh(t,e[t])).filter(Boolean).join(`&`)}const Fh=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Ih=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Lh=/^([/\\]\s*){2,}[^/\\]/,Rh=/\/$|\/\?|\/#/,zh=/^\.?\//;function Bh(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?Fh.test(e):Ih.test(e)||(t.acceptRelative?Lh.test(e):!1)}function Vh(e=``,t){return t?Rh.test(e):e.endsWith(`/`)}function Hh(e=``,t){if(!t)return(Vh(e)?e.slice(0,-1):e)||`/`;if(!Vh(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 Uh(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(Vh(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 Wh(e,t){if(Kh(t)||Bh(e))return e;let n=Hh(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return Jh(n,e)}function Gh(e,t){let n=Xh(e);return n.search=Ph({...Mh(n.search),...t}),Qh(n)}function Kh(e){return!e||e===`/`}function qh(e){return e&&e!==`/`}function Jh(e,...t){let n=e||``;for(let e of t.filter(e=>qh(e)))if(n){let t=e.replace(zh,``);n=Uh(n)+t}else n=e;return n}const Yh=Symbol.for(`ufo:protocolRelative`);function Xh(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(!Bh(e,{acceptRelative:!0}))return t?Xh(t+e):Zh(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}=Zh(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[Yh]:!r}}function Zh(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function Qh(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[Yh]?(e.protocol||``)+`//`:``)+i+a+t+n+r}var $h=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function eg(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 $h(`${`[${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 tg=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function ng(e=`GET`){return tg.has(e.toUpperCase())}function rg(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 ig=/* @__PURE__ */ new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),ag=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function og(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return ag.test(t)?`json`:t===`text/event-stream`?`stream`:ig.has(t)||t.startsWith(`text/`)?`text`:`blob`}function sg(e,t,n,r){let i=cg(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 cg(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 lg(e,t){if(t){if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}}const ug=/* @__PURE__ */ new Set([408,409,425,429,500,502,503,504]),dg=/* @__PURE__ */ new Set([101,204,205,304]);function fg(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:+!ng(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):ug.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=eg(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:sg(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 lg(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=Wh(s.request,s.options.baseURL)),s.options.query&&(s.request=Gh(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&&ng(s.options.method)){if(rg(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 lg(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!dg.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||og(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||gh;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 lg(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await lg(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={})=>fg({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}function pg(){if(!JSON.parse(process.env.FETCH_KEEP_ALIVE||`false`))return ch;let e={keepAlive:!0},t=new N.Agent(e),n=new oe.Agent(e),r={agent(e){return e.protocol===`http:`?t:n}};return function(e,t){return ch(e,{...r,...t})}}const mg=globalThis.fetch?(...e)=>globalThis.fetch(...e):pg();fg({fetch:mg,Headers:globalThis.Headers||lh,AbortController:globalThis.AbortController||uh});const hg=/^(?:( )+|\t+)/,gg=`space`;function _g(e,t,n){return e&&t===gg&&n===1}function vg(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(hg);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?gg:`tab`;if(_g(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(_g(t,s,e))continue;a=yg(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function yg(e,t){return(e===gg?`s`:`t`)+String(t)}function bg(e){return{type:e[0]===`s`?gg:`tab`,amount:Number(e.slice(1))}}function xg(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 Sg(e,t){return(e===gg?` `:` `).repeat(t)}function Cg(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=vg(e,!0);t.size===0&&(t=vg(e,!1));let n=xg(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=bg(n),a=Sg(r,i)),{amount:i,type:r,indent:a}}function wg(e,t){return te(e)?e:re(t||`.`,e)}function Tg(e,t){let{last:n,cwd:r}=t||{},i=wg(e,r),a=wg(n||`/`,r),o,s=[];for(;o!==a&&(s.push(i),i=k(o=i),i!==o););return s}function Eg(e,t){let n,r;for(n of Tg(t&&t.cwd||``,t))if(r=A(n,e),w(r))return r}
163
165
  /* istanbul ignore next */
164
- const Tg=2**53-1||9007199254740991,Eg=/^\d+$/;function Dg(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Eg.test(String(e)),r=Eg.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 j==`object`&&j.env&&j.env.NODE_DEBUG&&/\bsemver\b/i.test(j.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Og=[],kg=[],Y=[],Ag=[],X={};let jg=0;const Mg=`[a-zA-Z0-9-]`,Ng=[[`\\s`,1],[`\\d`,256],[Mg,250]];function Pg(e){for(let[t,n]of Ng)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function Z(e,t,n=!1){let r=Pg(t),i=jg++;J(e,i,t),X[e]=i,Y[i]=t,Ag[i]=r,Og[i]=new RegExp(t,n?`g`:void 0),kg[i]=new RegExp(r,n?`g`:void 0)}Z(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),Z(`NUMERICIDENTIFIERLOOSE`,`\\d+`),Z(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Mg}*`),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`,`${Mg}+`),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 Fg=Object.freeze({loose:!0}),Ig=Object.freeze({});function Lg(e){return e?typeof e==`object`?e:Fg:Ig}const Rg=/^\d+$/;var zg=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=Lg(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?kg[X.LOOSE]:kg[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>Tg||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>Tg||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>Tg||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(Rg.test(e)){let t=+e;if(t>=0&&t<Tg)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 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(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 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?kg[X.PRERELEASELOOSE]:kg[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]),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 Bg(e,t,n){return new zg(e,n).compare(new zg(t,n))}function Vg(e,t,n){return Bg(e,t,n)===0}function Hg(e,t,n){return Bg(e,t,n)>0}function Ug(e,t,n){return Bg(e,t,n)>=0}function Wg(e,t,n){return Bg(e,t,n)<0}function Gg(e,t,n){return Bg(e,t,n)<=0}function Kg(e,t,n){return Bg(e,t,n)!==0}function qg(e,t,n,r){let i=e=>e instanceof zg?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 Vg(e,n,r);case`!=`:return Kg(e,n,r);case`>`:return Hg(e,n,r);case`>=`:return Ug(e,n,r);case`<`:return Wg(e,n,r);case`<=`:return Gg(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 Yg=Symbol(`SemVer ANY`),Xg=/\s+/;var Zg=class e{options={};loose=!1;operator=``;semver=Yg;value=``;static get ANY(){return Yg}constructor(t,n){let r=Lg(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(Xg).join(` `);J(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===Yg?``:this.operator+this.semver.version,J(`comp`,this)}parse(e){let t=this.options.loose?kg[X.COMPARATORLOOSE]:kg[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 zg(n[2],this.options.loose):Yg}toString(){return this.value}test(e){if(J(`Comparator.test`,e,this.options.loose),this.semver===Yg||e===Yg)return!0;if(typeof e==`string`)try{e=new zg(e,this.options)}catch{return!1}return qg(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 i_(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new i_(this.value,n).test(t.semver);let r=Lg(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!==Yg&&t.semver!==Yg&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||qg(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||qg(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const Qg=/\s+/g,$g=/\s+/,e_=new Jg,t_=e=>e.value===`<0.0.0-0`,n_=e=>e.value===``,r_=e=>e!==Zg.ANY;var i_=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=Lg(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Zg)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(Qg,` `),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=>!t_(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&&n_(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=e_.get(t);if(n)return n;let r=this.options.loose,i=r?kg[X.HYPHENRANGELOOSE]:kg[X.HYPHENRANGE];e=e.replace(i,g_(!!this.options.includePrerelease)),J(`hyphen replace`,e),e=e.replace(kg[X.COMPARATORTRIM],`$1$2$3`),J(`comparator trim`,e),e=e.replace(kg[X.TILDETRIM],`$1~`),J(`tilde trim`,e),e=e.replace(kg[X.CARETTRIM],`$1^`),J(`caret trim`,e);let a=e.split(` `).map(e=>o_(e,this.options)).join(` `).split($g).map(e=>h_(e,this.options));r&&(a=a.filter(e=>(J(`loose invalid filter`,e,this.options),!!e.match(kg[X.COMPARATORLOOSE])))),J(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new Zg(e,this.options));for(let e of s){if(t_(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return e_.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>a_(e,n)&&t.set.some(t=>a_(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 zg(e,this.options)}catch{return!1}else if(e instanceof zg)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(__(this.set[e],t,this.options))return!0;return!1}};function a_(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 o_(e,t){return e=e.replace(kg[X.BUILD],``),J(`comp`,e,t),e=u_(e,t),J(`caret`,e),e=c_(e,t),J(`tildes`,e),e=f_(e,t),J(`xrange`,e),e=m_(e,t),J(`stars`,e),e}function s_(e){return!e||e.toLowerCase()===`x`||e===`*`}function c_(e,t){return e.trim().split($g).map(e=>l_(e,t)).join(` `)}function l_(e,t){let n=t.loose?kg[X.TILDELOOSE]:kg[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 s_(n)?o=``:s_(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:s_(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 u_(e,t){return e.trim().split($g).map(e=>d_(e,t)).join(` `)}function d_(e,t){J(`caret`,e,t);let n=t.loose?kg[X.CARETLOOSE]:kg[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 s_(n)?s=``:s_(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:s_(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 f_(e,t){return J(`replaceXRanges`,e,t),e.split($g).map(e=>p_(e,t)).join(` `)}function p_(e,t){e=e.trim();let n=t.loose?kg[X.XRANGELOOSE]:kg[X.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{J(`xRange`,e,n,r,i,a,o,s);let c=s_(i),l=c||s_(a),u=l||s_(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 m_(e,t){return J(`replaceStars`,e,t),e.trim().replace(kg[X.STAR],``)}function h_(e,t){return J(`replaceGTE0`,e,t),e.trim().replace(kg[t.includePrerelease?X.GTE0PRE:X.GTE0],``)}function g_(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=s_(r)?``:s_(i)?`>=${String(r)}.0.0${e?`-0`:``}`:s_(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=s_(l)?``:s_(u)?`<${Number(l)+1}.0.0-0`:s_(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,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),!r_(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 v_(e,t,n){try{return new i_(t,n).test(e)}catch{return!1}}function y_(e,t){let n=new i_(e,t),r=new zg(`0.0.0`);if(n.test(r)||(r=new zg(`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 zg(e.semver instanceof zg?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||Hg(t,i))&&(i=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),i&&(!r||Hg(r,i))&&(r=i)}return r&&n.test(r)?r:null}function b_(e,t){try{return new i_(e,t).range||`*`}catch{return null}}var Q=/* @__PURE__ */ n((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}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a: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=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),x_=/* @__PURE__ */ n((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})),S_=/* @__PURE__ */ n((e=>{var t=Q(),n=x_();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(`
165
- `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),C_=/* @__PURE__ */ n((e=>{var t=Q(),n=x_();function r(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}function i(e){let t=/* @__PURE__ */ new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=/* @__PURE__ */ new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){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.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),w_=/* @__PURE__ */ n((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})),T_=/* @__PURE__ */ n((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})),E_=/* @__PURE__ */ n((e=>{var t=w_(),n=Q(),r=T_();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}}})),D_=/* @__PURE__ */ n((e=>{var t=C_(),n=x_(),r=Q(),i=E_(),a=T_(),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);
166
+ const Dg=2**53-1||9007199254740991,Og=/^\d+$/;function kg(e,t){if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let n=Og.test(String(e)),r=Og.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 j==`object`&&j.env&&j.env.NODE_DEBUG&&/\bsemver\b/i.test(j.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{},Ag=[],jg=[],Y=[],Mg=[],X={};let Ng=0;const Pg=`[a-zA-Z0-9-]`,Fg=[[`\\s`,1],[`\\d`,256],[Pg,250]];function Ig(e){for(let[t,n]of Fg)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e}function Z(e,t,n=!1){let r=Ig(t),i=Ng++;J(e,i,t),X[e]=i,Y[i]=t,Mg[i]=r,Ag[i]=new RegExp(t,n?`g`:void 0),jg[i]=new RegExp(r,n?`g`:void 0)}Z(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),Z(`NUMERICIDENTIFIERLOOSE`,`\\d+`),Z(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${Pg}*`),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`,`${Pg}+`),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 Lg=Object.freeze({loose:!0}),Rg=Object.freeze({});function zg(e){return e?typeof e==`object`?e:Lg:Rg}const Bg=/^\d+$/;var Vg=class e{raw=``;loose=!1;options={};includePrerelease=!1;major=0;minor=0;patch=0;version=``;build=[];prerelease=[];constructor(t,n){let r=zg(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?jg[X.LOOSE]:jg[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>Dg||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>Dg||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>Dg||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=a[4]?a[4].split(`.`).map(e=>{if(Bg.test(e)){let t=+e;if(t>=0&&t<Dg)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 kg(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 kg(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?jg[X.PRERELEASELOOSE]:jg[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]),kg(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 Hg(e,t,n){return new Vg(e,n).compare(new Vg(t,n))}function Ug(e,t,n){return Hg(e,t,n)===0}function Wg(e,t,n){return Hg(e,t,n)>0}function Gg(e,t,n){return Hg(e,t,n)>=0}function Kg(e,t,n){return Hg(e,t,n)<0}function qg(e,t,n){return Hg(e,t,n)<=0}function Jg(e,t,n){return Hg(e,t,n)!==0}function Yg(e,t,n,r){let i=e=>e instanceof Vg?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 Ug(e,n,r);case`!=`:return Jg(e,n,r);case`>`:return Wg(e,n,r);case`>=`:return Gg(e,n,r);case`<`:return Kg(e,n,r);case`<=`:return qg(e,n,r);default:throw TypeError(`Invalid operator: ${t}`)}}var Xg=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 Zg=Symbol(`SemVer ANY`),Qg=/\s+/;var $g=class e{options={};loose=!1;operator=``;semver=Zg;value=``;static get ANY(){return Zg}constructor(t,n){let r=zg(n);if(t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}let i=String(t).trim().split(Qg).join(` `);J(`comparator`,i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.value=this.semver===Zg?``:this.operator+this.semver.version,J(`comp`,this)}parse(e){let t=this.options.loose?jg[X.COMPARATORLOOSE]:jg[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 Vg(n[2],this.options.loose):Zg}toString(){return this.value}test(e){if(J(`Comparator.test`,e,this.options.loose),this.semver===Zg||e===Zg)return!0;if(typeof e==`string`)try{e=new Vg(e,this.options)}catch{return!1}return Yg(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 o_(t.value,n).test(this.value);if(t.operator===``)return t.value===``||new o_(this.value,n).test(t.semver);let r=zg(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!==Zg&&t.semver!==Zg&&this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||Yg(this.semver,`<`,t.semver,r)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||Yg(this.semver,`>`,t.semver,r)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`))}};const e_=/\s+/g,t_=/\s+/,n_=new Xg,r_=e=>e.value===`<0.0.0-0`,i_=e=>e.value===``,a_=e=>e!==$g.ANY;var o_=class e{raw=``;loose=!1;options={};includePrerelease=!1;set=[];formatted;constructor(t,n){let r=zg(n);if(t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof $g)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(e_,` `),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=>!r_(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&&i_(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=n_.get(t);if(n)return n;let r=this.options.loose,i=r?jg[X.HYPHENRANGELOOSE]:jg[X.HYPHENRANGE];e=e.replace(i,v_(!!this.options.includePrerelease)),J(`hyphen replace`,e),e=e.replace(jg[X.COMPARATORTRIM],`$1$2$3`),J(`comparator trim`,e),e=e.replace(jg[X.TILDETRIM],`$1~`),J(`tilde trim`,e),e=e.replace(jg[X.CARETTRIM],`$1^`),J(`caret trim`,e);let a=e.split(` `).map(e=>c_(e,this.options)).join(` `).split(t_).map(e=>__(e,this.options));r&&(a=a.filter(e=>(J(`loose invalid filter`,e,this.options),!!e.match(jg[X.COMPARATORLOOSE])))),J(`range list`,a);let o=/* @__PURE__ */ new Map,s=a.map(e=>new $g(e,this.options));for(let e of s){if(r_(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let c=[...o.values()];return n_.set(t,c),c}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>s_(e,n)&&t.set.some(t=>s_(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 Vg(e,this.options)}catch{return!1}else if(e instanceof Vg)t=e;else return!1;for(let e=0;e<this.set.length;e++)if(y_(this.set[e],t,this.options))return!0;return!1}};function s_(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 c_(e,t){return e=e.replace(jg[X.BUILD],``),J(`comp`,e,t),e=f_(e,t),J(`caret`,e),e=u_(e,t),J(`tildes`,e),e=m_(e,t),J(`xrange`,e),e=g_(e,t),J(`stars`,e),e}function l_(e){return!e||e.toLowerCase()===`x`||e===`*`}function u_(e,t){return e.trim().split(t_).map(e=>d_(e,t)).join(` `)}function d_(e,t){let n=t.loose?jg[X.TILDELOOSE]:jg[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 l_(n)?o=``:l_(r)?o=`>=${s}.0.0 <${Number(s)+1}.0.0-0`:l_(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 f_(e,t){return e.trim().split(t_).map(e=>p_(e,t)).join(` `)}function p_(e,t){J(`caret`,e,t);let n=t.loose?jg[X.CARETLOOSE]:jg[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 l_(n)?s=``:l_(i)?s=`>=${c}.0.0${r} <${Number(c)+1}.0.0-0`:l_(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 m_(e,t){return J(`replaceXRanges`,e,t),e.split(t_).map(e=>h_(e,t)).join(` `)}function h_(e,t){e=e.trim();let n=t.loose?jg[X.XRANGELOOSE]:jg[X.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{J(`xRange`,e,n,r,i,a,o,s);let c=l_(i),l=c||l_(a),u=l||l_(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 g_(e,t){return J(`replaceStars`,e,t),e.trim().replace(jg[X.STAR],``)}function __(e,t){return J(`replaceGTE0`,e,t),e.trim().replace(jg[t.includePrerelease?X.GTE0PRE:X.GTE0],``)}function v_(e){return(t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=n??``,m=c??``;return p=l_(r)?``:l_(i)?`>=${String(r)}.0.0${e?`-0`:``}`:l_(a)?`>=${String(r)}.${String(i)}.0${e?`-0`:``}`:o?`>=${p}`:`>=${p}${e?`-0`:``}`,m=l_(l)?``:l_(u)?`<${Number(l)+1}.0.0-0`:l_(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 y_(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),!a_(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 b_(e,t,n){try{return new o_(t,n).test(e)}catch{return!1}}function x_(e,t){let n=new o_(e,t),r=new Vg(`0.0.0`);if(n.test(r)||(r=new Vg(`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 Vg(e.semver instanceof Vg?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||Wg(t,i))&&(i=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),i&&(!r||Wg(r,i))&&(r=i)}return r&&n.test(r)?r:null}function S_(e,t){try{return new o_(e,t).range||`*`}catch{return null}}var Q=/* @__PURE__ */ n((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}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a: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=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),C_=/* @__PURE__ */ n((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})),w_=/* @__PURE__ */ n((e=>{var t=Q(),n=C_();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(`
167
+ `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),T_=/* @__PURE__ */ n((e=>{var t=Q(),n=C_();function r(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}function i(e){let t=/* @__PURE__ */ new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=/* @__PURE__ */ new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){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.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),E_=/* @__PURE__ */ n((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})),D_=/* @__PURE__ */ n((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})),O_=/* @__PURE__ */ n((e=>{var t=E_(),n=Q(),r=D_();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}}})),k_=/* @__PURE__ */ n((e=>{var t=T_(),n=C_(),r=Q(),i=O_(),a=D_(),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);
166
168
  /* istanbul ignore if */
167
- 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})),O_=/* @__PURE__ */ n((e=>{var t=Q(),n=E_(),r=T_();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})),k_=/* @__PURE__ */ n((e=>{var t=D_(),n=Q(),r=O_();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)}function a(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}e.createNode=a})),A_=/* @__PURE__ */ n((e=>{var t=k_(),n=Q(),r=E_();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})),j_=/* @__PURE__ */ n((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(`
169
+ 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})),A_=/* @__PURE__ */ n((e=>{var t=Q(),n=O_(),r=D_();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})),j_=/* @__PURE__ */ n((e=>{var t=k_(),n=Q(),r=A_();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)}function a(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}e.createNode=a})),M_=/* @__PURE__ */ n((e=>{var t=j_(),n=Q(),r=O_();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})),N_=/* @__PURE__ */ n((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(`
168
170
  `)?n(r,t):r.includes(`
169
171
  `)?`
170
- `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),M_=/* @__PURE__ */ n((e=>{let t=`block`,n=`quoted`;function r(e,r,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-r.length);if(e.length<=d)return e;let f=[],p={},m=s-r.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=i(e,v,r.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===`
172
+ `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),P_=/* @__PURE__ */ n((e=>{let t=`block`,n=`quoted`;function r(e,r,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-r.length);if(e.length<=d)return e;let f=[],p={},m=s-r.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=i(e,v,r.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===`
171
173
  `)a===t&&(v=i(e,v,r.length)),m=v+r.length+d,h=void 0;else{if(o===` `&&g&&g!==` `&&g!==`
172
174
  `&&g!==` `){let t=e[v+1];t&&t!==` `&&t!==`
173
175
  `&&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 i=f[t],o=f[t+1]||e.length;i===0?x=`\n${r}${e.slice(0,o)}`:(a===n&&p[i]&&(x+=`${e[i]}\\`),x+=`\n${r}${e.slice(i+1,o)}`)}return x}function i(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!==`
174
- `);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=r})),N_=/* @__PURE__ */ n((e=>{var t=O_(),n=M_();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]===`
176
+ `);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=r})),F_=/* @__PURE__ */ n((e=>{var t=A_(),n=P_();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]===`
175
177
  `){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)+`
176
178
 
177
179
  `;a[e+2]===`\\`&&a[e+3]===`n`&&a[e+4]!==`"`;)l+=`
@@ -189,29 +191,29 @@ if(i||=(a.toJS(o,null,t),e.get(o)),i?.res===void 0)throw ReferenceError(`This sh
189
191
  $&`).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(`
190
192
  `)||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(`
191
193
  `)?c(d,a):u(e,a,o,s);if(!p&&!g&&l!==t.Scalar.PLAIN&&d.includes(`
192
- `))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))}function f(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}e.stringifyString=f})),P_=/* @__PURE__ */ n((e=>{var t=C_(),n=Q(),r=j_(),i=N_();function a(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}}function o(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 s(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(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);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??=o(t.doc.schema.tags,l);let u=s(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,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),F_=/* @__PURE__ */ n((e=>{var t=Q(),n=O_(),r=P_(),i=j_();function a({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?`
194
+ `))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))}function f(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}e.stringifyString=f})),I_=/* @__PURE__ */ n((e=>{var t=T_(),n=Q(),r=N_(),i=F_();function a(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}}function o(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 s(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(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);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??=o(t.doc.schema.tags,l);let u=s(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,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),L_=/* @__PURE__ */ n((e=>{var t=Q(),n=A_(),r=I_(),i=N_();function a({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?`
193
195
  `:``,S){let e=p(S);E+=`\n${i.indentComment(e,o.indent)}`}T===``&&!o.inFlow?E===`
194
196
  `&&C&&(E=`
195
197
 
196
198
  `):E+=`\n${o.indent}`}else if(!_&&t.isCollection(a)){let e=T[0],t=T.indexOf(`
197
199
  `),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]===`
198
- `)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}e.stringifyPair=a})),I_=/* @__PURE__ */ n((e=>{var t=a(`process`);function n(e,...t){e===`debug`&&console.log(...t)}function r(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}e.debug=n,e.warn=r})),L_=/* @__PURE__ */ n((e=>{var t=Q(),n=O_();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})),R_=/* @__PURE__ */ n((e=>{var t=I_(),n=L_(),r=P_(),i=Q(),a=T_();function o(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=s(r,n,e),c=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}function s(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=o})),z_=/* @__PURE__ */ n((e=>{var t=k_(),n=F_(),r=R_(),i=Q();function a(e,n,r){return new o(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var o=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=o,e.createPair=a})),B_=/* @__PURE__ */ n((e=>{var t=Q(),n=P_(),r=j_();function i(e,t,n){return(t.inFlow??e.flow?o:a)(e,t,n)}function a({comment:e,items:i},a,{blockItemPrefix:o,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(``),s(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(``),s(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(o+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}`:`
200
+ `)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}e.stringifyPair=a})),R_=/* @__PURE__ */ n((e=>{var t=a(`process`);function n(e,...t){e===`debug`&&console.log(...t)}function r(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}e.debug=n,e.warn=r})),z_=/* @__PURE__ */ n((e=>{var t=Q(),n=A_();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})),B_=/* @__PURE__ */ n((e=>{var t=R_(),n=z_(),r=I_(),i=Q(),a=D_();function o(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=s(r,n,e),c=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}function s(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=o})),V_=/* @__PURE__ */ n((e=>{var t=j_(),n=L_(),r=B_(),i=Q();function a(e,n,r){return new o(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var o=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=o,e.createPair=a})),H_=/* @__PURE__ */ n((e=>{var t=Q(),n=I_(),r=N_();function i(e,t,n){return(t.inFlow??e.flow?o:a)(e,t,n)}function a({comment:e,items:i},a,{blockItemPrefix:o,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(``),s(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(``),s(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(o+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}`:`
199
201
  `}}return e?(_+=`
200
202
  `+r.indentComment(p(e),f),d&&d()):h&&u&&u(),_}function o({items:e},i,{flowChars:a,itemIndent:o}){let{indent:c,indentStep:l,flowCollectionPadding:u,options:{commentString:d}}=i;o+=l;let f=Object.assign({},i,{indent:o,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(``),s(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(``),s(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(`
201
203
  `),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,o,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}`:`
202
- `;return`${e}\n${c}${_}`}return`${g}${u}${h.join(` `)}${u}${_}`}function s({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=i})),V_=/* @__PURE__ */ n((e=>{var t=B_(),n=R_(),r=A_(),i=Q(),a=z_(),o=O_();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})),H_=/* @__PURE__ */ n((e=>{var t=Q(),n=V_();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)}})),U_=/* @__PURE__ */ n((e=>{var t=k_(),n=B_(),r=A_(),i=Q(),a=O_(),o=T_(),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})),W_=/* @__PURE__ */ n((e=>{var t=Q(),n=U_();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)}})),G_=/* @__PURE__ */ n((e=>{var t=N_();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)}}})),K_=/* @__PURE__ */ n((e=>{var t=O_();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})),q_=/* @__PURE__ */ n((e=>{var t=O_();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})),J_=/* @__PURE__ */ n((e=>{function t({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}e.stringifyNumber=t})),Y_=/* @__PURE__ */ n((e=>{var t=O_(),n=J_();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})),X_=/* @__PURE__ */ n((e=>{var t=J_();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`)}})),Z_=/* @__PURE__ */ n((e=>{var t=H_(),n=K_(),r=W_(),i=G_(),a=q_(),o=Y_(),s=X_();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),Q_=/* @__PURE__ */ n((e=>{var t=O_(),n=H_(),r=W_();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}})})),$_=/* @__PURE__ */ n((e=>{var t=a(`buffer`),n=O_(),r=N_();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?`
203
- `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),ev=/* @__PURE__ */ n((e=>{var t=Q(),n=z_(),r=O_(),i=U_();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})),tv=/* @__PURE__ */ n((e=>{var t=Q(),n=T_(),r=V_(),i=U_(),a=ev(),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})),nv=/* @__PURE__ */ n((e=>{var t=O_();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})),rv=/* @__PURE__ */ n((e=>{var t=O_(),n=J_();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})),iv=/* @__PURE__ */ n((e=>{var t=J_();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})),av=/* @__PURE__ */ n((e=>{var t=Q(),n=z_(),r=V_(),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})),ov=/* @__PURE__ */ n((e=>{var t=J_();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})),sv=/* @__PURE__ */ n((e=>{var t=H_(),n=K_(),r=W_(),i=G_(),a=$_(),o=nv(),s=rv(),c=iv(),l=L_(),u=tv(),d=ev(),f=av(),p=ov();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]})),cv=/* @__PURE__ */ n((e=>{var t=H_(),n=K_(),r=W_(),i=G_(),a=q_(),o=Y_(),s=X_(),c=Z_(),l=Q_(),u=$_(),d=L_(),f=tv(),p=ev(),m=sv(),h=av(),g=ov();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},y={"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};function b(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},[])}e.coreKnownTags=y,e.getTags=b})),lv=/* @__PURE__ */ n((e=>{var t=Q(),n=H_(),r=W_(),i=G_(),a=cv();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}}})),uv=/* @__PURE__ */ n((e=>{var t=Q(),n=P_(),r=j_();function i(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(`
204
+ `;return`${e}\n${c}${_}`}return`${g}${u}${h.join(` `)}${u}${_}`}function s({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=i})),U_=/* @__PURE__ */ n((e=>{var t=H_(),n=B_(),r=M_(),i=Q(),a=V_(),o=A_();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})),W_=/* @__PURE__ */ n((e=>{var t=Q(),n=U_();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)}})),G_=/* @__PURE__ */ n((e=>{var t=j_(),n=H_(),r=M_(),i=Q(),a=A_(),o=D_(),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})),K_=/* @__PURE__ */ n((e=>{var t=Q(),n=G_();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)}})),q_=/* @__PURE__ */ n((e=>{var t=F_();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)}}})),J_=/* @__PURE__ */ n((e=>{var t=A_();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})),Y_=/* @__PURE__ */ n((e=>{var t=A_();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})),X_=/* @__PURE__ */ n((e=>{function t({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}e.stringifyNumber=t})),Z_=/* @__PURE__ */ n((e=>{var t=A_(),n=X_();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})),Q_=/* @__PURE__ */ n((e=>{var t=X_();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`)}})),$_=/* @__PURE__ */ n((e=>{var t=W_(),n=J_(),r=K_(),i=q_(),a=Y_(),o=Z_(),s=Q_();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),ev=/* @__PURE__ */ n((e=>{var t=A_(),n=W_(),r=K_();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}})})),tv=/* @__PURE__ */ n((e=>{var t=a(`buffer`),n=A_(),r=F_();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?`
205
+ `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),nv=/* @__PURE__ */ n((e=>{var t=Q(),n=V_(),r=A_(),i=G_();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})),rv=/* @__PURE__ */ n((e=>{var t=Q(),n=D_(),r=U_(),i=G_(),a=nv(),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})),iv=/* @__PURE__ */ n((e=>{var t=A_();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})),av=/* @__PURE__ */ n((e=>{var t=A_(),n=X_();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})),ov=/* @__PURE__ */ n((e=>{var t=X_();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})),sv=/* @__PURE__ */ n((e=>{var t=Q(),n=V_(),r=U_(),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})),cv=/* @__PURE__ */ n((e=>{var t=X_();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})),lv=/* @__PURE__ */ n((e=>{var t=W_(),n=J_(),r=K_(),i=q_(),a=tv(),o=iv(),s=av(),c=ov(),l=z_(),u=rv(),d=nv(),f=sv(),p=cv();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]})),uv=/* @__PURE__ */ n((e=>{var t=W_(),n=J_(),r=K_(),i=q_(),a=Y_(),o=Z_(),s=Q_(),c=$_(),l=ev(),u=tv(),d=z_(),f=rv(),p=nv(),m=lv(),h=sv(),g=cv();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},y={"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};function b(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},[])}e.coreKnownTags=y,e.getTags=b})),dv=/* @__PURE__ */ n((e=>{var t=Q(),n=W_(),r=K_(),i=q_(),a=uv();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}}})),fv=/* @__PURE__ */ n((e=>{var t=Q(),n=I_(),r=N_();function i(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(`
204
206
  `)?(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(`
205
207
  `)+`
206
- `}e.stringifyDocument=i})),dv=/* @__PURE__ */ n((e=>{var t=D_(),n=A_(),r=Q(),i=z_(),a=T_(),o=lv(),s=uv(),c=C_(),l=w_(),u=k_(),d=S_(),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})),fv=/* @__PURE__ */ n((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)+`…
207
- `),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`}}})),pv=/* @__PURE__ */ n((e=>{function t(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}}e.resolveProps=t})),mv=/* @__PURE__ */ n((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(`
208
- `))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})),hv=/* @__PURE__ */ n((e=>{var t=mv();function n(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)}}e.flowIndentCheck=n})),gv=/* @__PURE__ */ n((e=>{var t=Q();function n(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))}e.mapIncludes=n})),_v=/* @__PURE__ */ n((e=>{var t=z_(),n=V_(),r=pv(),i=mv(),a=hv(),o=gv();let s=`All mapping items must start at the same column`;function c({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+=`
208
+ `}e.stringifyDocument=i})),pv=/* @__PURE__ */ n((e=>{var t=k_(),n=M_(),r=Q(),i=V_(),a=D_(),o=dv(),s=fv(),c=T_(),l=E_(),u=j_(),d=w_(),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})),mv=/* @__PURE__ */ n((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)+`…
209
+ `),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`}}})),hv=/* @__PURE__ */ n((e=>{function t(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}}e.resolveProps=t})),gv=/* @__PURE__ */ n((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(`
210
+ `))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})),_v=/* @__PURE__ */ n((e=>{var t=gv();function n(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)}}e.flowIndentCheck=n})),vv=/* @__PURE__ */ n((e=>{var t=Q();function n(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))}e.mapIncludes=n})),yv=/* @__PURE__ */ n((e=>{var t=V_(),n=U_(),r=hv(),i=gv(),a=_v(),o=vv();let s=`All mapping items must start at the same column`;function c({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+=`
209
211
  `+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+=`
210
- `+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}e.resolveBlockMap=c})),vv=/* @__PURE__ */ n((e=>{var t=U_(),n=pv(),r=hv();function i({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}e.resolveBlockSeq=i})),yv=/* @__PURE__ */ n((e=>{function t(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}}e.resolveEnd=t})),bv=/* @__PURE__ */ n((e=>{var t=Q(),n=z_(),r=V_(),i=U_(),a=yv(),o=pv(),s=mv(),c=gv();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function d({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+=`
212
+ `+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}e.resolveBlockMap=c})),bv=/* @__PURE__ */ n((e=>{var t=G_(),n=hv(),r=_v();function i({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}e.resolveBlockSeq=i})),xv=/* @__PURE__ */ n((e=>{function t(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}}e.resolveEnd=t})),Sv=/* @__PURE__ */ n((e=>{var t=Q(),n=V_(),r=U_(),i=G_(),a=xv(),o=hv(),s=gv(),c=vv();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function d({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+=`
211
213
  `+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=``;loop:for(let t of h)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let n=v.items[v.items.length-1];t.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+=`
212
214
  `+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+=`
213
215
  `+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+=`
214
- `+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}e.resolveFlowCollection=d})),xv=/* @__PURE__ */ n((e=>{var t=Q(),n=O_(),r=V_(),i=U_(),a=_v(),o=vv(),s=bv();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)}function l(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}e.composeCollection=l})),Sv=/* @__PURE__ */ n((e=>{var t=O_();function n(e,n,a){let o=n.offset,s=r(n,e.options.strict,a);if(!s)return{value:``,type:null,comment:``,range:[o,o,o]};let c=s.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,l=n.source?i(n.source):[],u=l.length;for(let e=l.length-1;e>=0;--e){let t=l[e][1];if(t===``||t===`\r`)u=e;else break}if(u===0){let e=s.chomp===`+`&&l.length>0?`
216
+ `+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}e.resolveFlowCollection=d})),Cv=/* @__PURE__ */ n((e=>{var t=Q(),n=A_(),r=U_(),i=G_(),a=yv(),o=bv(),s=Sv();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)}function l(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}e.composeCollection=l})),wv=/* @__PURE__ */ n((e=>{var t=A_();function n(e,n,a){let o=n.offset,s=r(n,e.options.strict,a);if(!s)return{value:``,type:null,comment:``,range:[o,o,o]};let c=s.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,l=n.source?i(n.source):[],u=l.length;for(let e=l.length-1;e>=0;--e){let t=l[e][1];if(t===``||t===`\r`)u=e;else break}if(u===0){let e=s.chomp===`+`&&l.length>0?`
215
217
  `.repeat(Math.max(1,l.length-1)):``,t=o+s.length;return n.source&&(t+=n.source.length),{value:e,type:c,comment:s.comment,range:[o,t,t]}}let d=n.indent+s.indent,f=n.offset+s.length,p=0;for(let t=0;t<u;++t){let[n,r]=l[t];if(r===``||r===`\r`)s.indent===0&&n.length>d&&(d=n.length);else{n.length<d&&a(f+n.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),s.indent===0&&(d=n.length),p=t,d===0&&!e.atRoot&&a(f,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}f+=n.length+r.length+1}for(let e=l.length-1;e>=u;--e)l[e][0].length>d&&(u=e+1);let m=``,h=``,g=!1;for(let e=0;e<p;++e)m+=l[e][0].slice(d)+`
216
218
  `;for(let e=p;e<u;++e){let[n,r]=l[e];f+=n.length+r.length+1;let i=r[r.length-1]===`\r`;
217
219
  /* istanbul ignore if already caught in lexer */
@@ -232,7 +234,7 @@ if(i&&(r=r.slice(0,-1)),r&&n.length<d){let e=`Block scalar lines must not be les
232
234
  /* istanbul ignore if should not happen */
233
235
  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;
234
236
  /* istanbul ignore next should not happen */
235
- default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function i(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}e.resolveBlockScalar=n})),Cv=/* @__PURE__ */ n((e=>{var t=O_(),n=yv();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;
237
+ default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function i(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}e.resolveBlockScalar=n})),Tv=/* @__PURE__ */ n((e=>{var t=A_(),n=xv();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;
236
238
  /* istanbul ignore next should not happen */
237
239
  default:return o(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,r,o);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}function i(e,t){let n=``;switch(e[0]){
238
240
  /* istanbul ignore next should not happen */
@@ -249,10 +251,10 @@ case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;c
249
251
  `);)r===`
250
252
  `&&(n+=`
251
253
  `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}let l={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
252
- `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(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=r})),wv=/* @__PURE__ */ n((e=>{var t=Q(),n=O_(),r=Sv(),i=Cv();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,l):i.resolveFlowScalar(a,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?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??a,`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??a,`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}function o(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 s({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=a})),Tv=/* @__PURE__ */ n((e=>{function t(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}e.emptyScalarPosition=t})),Ev=/* @__PURE__ */ n((e=>{var t=D_(),n=Q(),r=xv(),i=wv(),a=yv(),o=Tv();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})),Dv=/* @__PURE__ */ n((e=>{var t=dv(),n=Ev(),r=yv(),i=pv();function a(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}e.composeDoc=a})),Ov=/* @__PURE__ */ n((e=>{var t=a(`process`),n=S_(),r=dv(),i=fv(),o=Q(),s=Dv(),c=yv();function l(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 u(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?`
254
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(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=r})),Ev=/* @__PURE__ */ n((e=>{var t=Q(),n=A_(),r=wv(),i=Tv();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,l):i.resolveFlowScalar(a,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?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??a,`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??a,`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}function o(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 s({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=a})),Dv=/* @__PURE__ */ n((e=>{function t(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}e.emptyScalarPosition=t})),Ov=/* @__PURE__ */ n((e=>{var t=k_(),n=Q(),r=Cv(),i=Ev(),a=xv(),o=Dv();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})),kv=/* @__PURE__ */ n((e=>{var t=pv(),n=Ov(),r=xv(),i=hv();function a(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}e.composeDoc=a})),Av=/* @__PURE__ */ n((e=>{var t=a(`process`),n=w_(),r=pv(),i=mv(),o=Q(),s=kv(),c=xv();function l(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 u(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?`
253
255
 
254
256
  `:`
255
- `)+(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=l(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}=u(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(o.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];o.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:u(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=l(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=s.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(l(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(l(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=c.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(l(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}}}})),kv=/* @__PURE__ */ n((e=>{var t=Sv(),n=Cv(),r=fv(),i=N_();function a(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}function o(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:`newline`,offset:-1,indent:r,source:`
257
+ `)+(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=l(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}=u(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(o.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];o.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:u(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=l(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=s.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(l(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(l(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=c.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(l(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}}}})),jv=/* @__PURE__ */ n((e=>{var t=wv(),n=Tv(),r=mv(),i=F_();function a(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}function o(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:`newline`,offset:-1,indent:r,source:`
256
258
  `}];switch(c[0]){case`|`:case`>`:{let e=c.indexOf(`
257
259
  `),t=c.substring(0,e),n=c.substring(e+1)+`
258
260
  `,i=[{type:`block-scalar-header`,offset:o,indent:r,source:t}];return l(i,u)||i.push({type:`newline`,offset:-1,indent:r,source:`
@@ -260,11 +262,11 @@ case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;c
260
262
  `),r=t.substring(0,n),i=t.substring(n+1)+`
261
263
  `;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}];l(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
262
264
  `});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 l(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 u(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:`
263
- `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=o,e.resolveAsScalar=a,e.setScalarValue=s})),Av=/* @__PURE__ */ n((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})),jv=/* @__PURE__ */ n((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})),Mv=/* @__PURE__ */ n((e=>{var t=kv(),n=Av(),r=jv();let i=e=>!!e&&`items`in e,a=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);
265
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=o,e.resolveAsScalar=a,e.setScalarValue=s})),Mv=/* @__PURE__ */ n((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})),Nv=/* @__PURE__ */ n((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})),Pv=/* @__PURE__ */ n((e=>{var t=jv(),n=Mv(),r=Nv();let i=e=>!!e&&`items`in e,a=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);
264
266
  /* istanbul ignore next */
265
267
  function o(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}}function s(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`
266
268
  `:case`\r
267
- `: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}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=i,e.isScalar=a,e.prettyToken=o,e.tokenType=s})),Nv=/* @__PURE__ */ n((e=>{var t=Mv();function n(e){switch(e){case void 0:case` `:case`
269
+ `: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}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=i,e.isScalar=a,e.prettyToken=o,e.tokenType=s})),Fv=/* @__PURE__ */ n((e=>{var t=Pv();function n(e){switch(e){case void 0:case` `:case`
268
270
  `: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(` ,[]{}
269
271
  \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===`
270
272
  `||t===`\r`&&this.buffer[e+1]===`
@@ -283,11 +285,11 @@ function o(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:re
283
285
  `,t=this.buffer[i+1]):r=i),t===`#`||e&&a.has(t))break;if(o===`
284
286
  `){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;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(s),e+=yield*this.pushSpaces(!0);continue loop;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 loop}}}break loop}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===`
285
287
  `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
286
- `?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)}}})),Pv=/* @__PURE__ */ n((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}}}}})),Fv=/* @__PURE__ */ n((e=>{var t=a(`process`),n=Mv(),r=Nv();function i(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function o(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 s(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 c(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;
288
+ `?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)}}})),Iv=/* @__PURE__ */ n((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}}}}})),Lv=/* @__PURE__ */ n((e=>{var t=a(`process`),n=Pv(),r=Fv();function i(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function o(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 s(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 c(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;
287
289
  /* istanbul ignore next should not happen */
288
- default:return[]}}function l(e){if(e.length===0)return[];let t=e.length;loop: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 loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function u(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 d(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,s(t.value)?t.value.end?u(t.value.end,t.sep):t.value.end=t.sep:u(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});return}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)}
290
+ default:return[]}}function l(e){if(e.length===0)return[];let t=e.length;loop: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 loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function u(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 d(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,s(t.value)?t.value.end?u(t.value.end,t.sep):t.value.end=t.sep:u(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)}
289
291
  /* istanbul ignore next should not happen */
290
- yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();
292
+ yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();
291
293
  /* istanbul ignore if should not happen */
292
294
  if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&d(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}
293
295
  /* istanbul ignore next should not happen */
@@ -299,9 +301,9 @@ default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.l
299
301
  /* istanbul ignore else should not happen */
300
302
  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=l(c(t));d(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(`
301
303
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
302
- `,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=l(c(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=l(c(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())}}}})),Iv=/* @__PURE__ */ n((e=>{var t=Ov(),n=dv(),r=fv(),i=I_(),a=Q(),o=Pv(),s=Fv();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=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())}function u(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}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(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))}function f(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)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),Lv=(/* @__PURE__ */ n((e=>{var t=Ov(),n=dv(),r=lv(),i=fv(),a=D_(),o=Q(),s=z_(),c=O_(),l=V_(),u=U_();Mv();var d=Nv(),f=Pv(),p=Fv(),m=Iv(),h=x_();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 Rv(e){let t=(0,Lv.parseDocument)(e),n=!1;function r(r){e=r,t=(0,Lv.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 Lv.Pair(a,r),i.items.splice(e,0,o),n=!0}else if((0,Lv.isAlias)(o.value)){let e=zv(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=Bv(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 zv(e,t){let n;return(0,Lv.visit)(e,{Scalar:(e,r,i)=>{r.anchor===t.source&&typeof r.value==`string`&&(n=r)}}),n}function Bv(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 Vv(e){return e??=[],Array.isArray(e)?e:[e]}function Hv(e){return typeof e==`object`&&!!e&&`json`in e&&typeof e.json==`function`}function Uv(e){if(Hv(e))return e.json();throw TypeError(`response does not implement json()`)}const Wv=3e4,Gv=`version-upgrade@npm node/${j.version}`,Kv=Object.assign((e,t)=>{let n=new Headers(t?.headers);return n.set(`user-agent`,Gv),fg(e,{...t,headers:n})},{preconnect:()=>{}});async function qv(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 Jv(e,t=!1,n,r=Wv,i=3){let a=await qv(()=>nh(e,{cwd:n,force:t,fetch:Kv,metadata:!0,throw:!1}),e,r,i);if(!Zv(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 Xv(o)}async function Yv(e,t=Wv,n=3){let r=await qv(()=>Kv(new URL(`${e}/meta.json`,`https://jsr.io/`),{headers:{accept:`application/json`}}).then(e=>Uv(e)),e,t,n);if(!Qv(r))throw Error(`Invalid JSR package metadata received for "${e}"`);let i=r;return{versions:Object.keys(i.versions),tags:{latest:i.latest}}}function Xv(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 Zv(e){return typeof e==`object`&&!!e&&`versionsMeta`in e&&`distTags`in e}function Qv(e){return typeof e==`object`&&!!e&&`scope`in e&&`name`in e&&`latest`in e&&`versions`in e}const $v=Je(`packages/version-upgrade/src/io/cache`),ey=(0,hf.default)(`version-upgrade:cache`);let ty={},ny=!1;const ry=df(o.tmpdir(),`version-upgrade`),iy=df(ry,`cache.json`),ay=18e5;function oy(){return Date.now()}function sy(e){return oy()-e}async function cy(){w(iy)&&sy(T(iy).mtimeMs)<ay?(ey(`cache loaded from ${iy}`),ty=JSON.parse(await E.readFile(iy,`utf-8`))):ey(`no cache found`)}async function ly(){if(ny)try{await E.mkdir(ry,{recursive:!0}),await E.writeFile(iy,JSON.stringify(ty),`utf-8`),ey(`cache saved to ${iy}`)}catch(e){$v.error(`Failed to save cache`,e instanceof Error?e:Error(String(e)))}}async function uy(e,t=`npm`,n,r,i){let a,o=`${t}:${e}`;if(ty[o]){if(sy(ty[o].cacheTime)<ay)return ey(`cache hit for ${o}`),ty[o].data;delete ty[o]}try{let a=t===`jsr`?await Yv(e,r,i):await Jv(e,!1,n,r,i);if(a)return ty[o]={data:a,cacheTime:oy()},ny=!0,a}catch(e){a=e}return{tags:{},versions:[],error:a instanceof Error&&a.message||String(a),deprecated:{}}}const dy=[`**/node_modules/**`,`**/dist/**`,`**/public/**`,`**/fixture/**`,`**/fixtures/**`];function fy(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,...fy(e,[...t,r])}}else typeof i==`string`&&(n[r]={version:i,parents:t});return n}function py(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 fy(e)}return{}}function my(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 hy(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=my(a[e]);a[e]=t,a=t}a[i]=n}function gy(e,t,n){return Object.entries(py(e,t)||{}).map(([e,{version:r,parents:i}])=>_y({name:e,version:r,type:t,shouldUpdate:n,parents:i}))}function _y({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 vy(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=my(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:yy(e,t)}`}}),n}function yy(e,t){let n=t?`@${t}`:``;return`${e.name}${n}`}async function by(e,t,n,r){let i=df(t.cwd??``,e),a=r??JSON.parse(await F(i,`utf-8`)),o=[];function s(t,r){let o=Object.entries(r).map(([e,t])=>_y({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=Cy(c);if(e.catalog&&typeof e.catalog==`object`&&o.push(s(`bun-catalog:default`,wy(e.catalog))),e.catalogs&&typeof e.catalogs==`object`){let t=Ty(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 xy(e,t){let n=vy(e.resolved,`bun-workspace`);if(Object.keys(n).length&&e.name.startsWith(`bun-catalog:`)){let t=e.name.replace(`bun-catalog:`,``),r=Cy(e.raw.workspaces??{});if(e.raw.workspaces=r,t==="default")r.catalog={...wy(r.catalog??{}),...wy(n)};else{let e=Ty(r.catalogs??{});r.catalogs=e,e[t]||(e[t]={}),e[t]={...e[t],...wy(n)}}await Sy(e.filepath,e.raw)}}async function Sy(e,t){let n;try{n=xg(await F(e,`utf-8`)).indent}catch{}let r=JSON.stringify(t,null,n||` `);await I(e,`${r}\n`,`utf-8`)}function Cy(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 wy(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 Ty(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{}}const Ey=Je(`packages/version-upgrade/src/addons/vscode`);function Dy(e,t){if(typeof e==`object`&&e){for(let[n,r]of Object.entries(e))if(n===t&&typeof r==`string`)return r}}function Oy(e){if(e==null)return!1;let t=e.engines;return Dy(t,`vscode`)!==void 0}function ky(e){for(let t of[`dependencies`,`devDependencies`,`peerDependencies`]){let n=Dy(e[t],`@types/vscode`);if(n!==void 0)return n}return``}const Ay=[{beforeWrite(e){if(!Oy(e.raw)||e.raw==null)return;let t=e.raw,n=ky(t);if(!n||n.includes(`:`))return;let r=t.engines,i=Dy(r,`vscode`);if(!i)return;let a=y_(i),o=y_(n);if(a&&o&&Hg(o,a)){Ey.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 jy(e){return M.from(e.slice(7),`base64`).toString(`hex`)}function My(e){return typeof e==`object`&&!!e&&`version`in e&&typeof e.version==`string`}const Ny=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Py(e,t){return t.depFields?.[e]===!1?!1:e!==`peerDependencies`||!!t.peer}async function Fy(e,t,n,r){let i=df(t.cwd??``,e),a=r??await eb(i),o=[];for(let e of Ny)if(Py(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(_y({name:r,version:`^${s}`,type:`packageManager`,shouldUpdate:n,hexHash:u}))}}else o.push(...gy(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 Iy(e,t){let n=!1;for(let r of Ny)if(Py(r,t)){if(r===`packageManager`){let t=Object.entries(vy(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=jy(e);o=`${o}+sha512.${t}`}}e.raw.packageManager=o,n=!0}}else{let t=py(e.raw,r),i=vy(e.resolved,r),a={};for(let[e,n]of Object.entries(t||{}))My(n)&&(a[e]=n.version);for(let[e,t]of Object.entries(i||{}))a[e]=t;Object.keys(a).length>0&&(hy(e.raw,r,a),n=!0)}}if(n){for(let n of t.addons||Ay)await n.beforeWrite?.(e,t);await tb(e.filepath,e.raw||{})}}const Ly=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Ry(e,t){return e===`peerDependencies`?!!t.peer:t.depFields?.[e]!==!1}async function zy(e){let t=await P.readFile(e,`utf-8`);if(!t)return new Lv.Document({});let n=(0,Lv.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 By(e,t){let{amount:n,type:r}=await P.readFile(e,`utf-8`).then(xg).catch(()=>({amount:2,type:`space`})),i=(0,Lv.stringify)(t,{indent:(r===`tab`?2:n)??2,aliasDuplicateObjects:!1,lineWidth:0}).replace(/^(\s*)"(@[^":]+)":/gm,`$1'$2':`);await P.writeFile(e,i,`utf-8`)}async function Vy(e,t,n){let r=df(t.cwd??``,e),i=await zy(r),a=[];for(let e of Ly)if(Ry(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(_y({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(...gy(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 Hy(e,t){let n=!1;if(e.type!==`package.yaml`)throw Error(`Package type is not supported`);let r=e.yamlDocument||new Lv.Document(e.raw);for(let i of Ly)if(Ry(i,t)){if(i===`packageManager`){let t=Object.entries(vy(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=py(Uy(r),i);t&&Object.keys(t).length>0&&(Object.entries(vy(e.resolved,i)).forEach(([e,t])=>r.setIn([...i.split(`.`),e],t)),n=!0)}}if(n){for(let n of t.addons||Ay)await n.beforeWrite?.(e,t);await By(e.filepath,r)}}function Uy(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 Wy(e,t,n){let r=df(t.cwd??``,e),i=Rv(await F(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>_y({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 Gy(e,t){let n=vy(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 Ky(e,e.context)}}function Ky(e,t){return I(e.filepath,t.toString(),`utf8`)}async function qy(e,t,n){let r=df(t.cwd??``,e),i=Rv(await F(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>_y({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 Jy(e,t){let n=vy(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 Yy(e,e.context)}}function Yy(e,t){return I(e.filepath,t.toString(),`utf8`)}function Xy(e){return e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`)}function Zy(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(`^${Xy(e).replace(/\*+/g,`.*?`)}$`)}function Qy(e,t=!0){if(!e||e.length===0)return()=>t;let n=Vv(e).flatMap(e=>e.split(`,`)).map(Zy);return e=>{for(let t of n)if(t.test(e))return!0;return!1}}function $y(e,t){let n=Qy(e,!0),r=Qy(t,!1);return e=>!r(e)&&n(e)}async function eb(e){return JSON.parse(await E.readFile(e,`utf-8`))}async function tb(e,t){let n=xg(await E.readFile(e,`utf-8`)).indent||` `;await E.writeFile(e,`${JSON.stringify(t,null,n)}\n`,`utf-8`)}async function nb(e,t){switch(e.type){case`package.json`:return Iy(e,t);case`package.yaml`:return Hy(e,t);case`pnpm-workspace.yaml`:return Gy(e,t);case`bun-workspace`:return xy(e,t);case`.yarnrc.yml`:return Jy(e,t);default:throw Error(`Unsupported package type: ${e.type}`)}}async function rb(e,t,n){if(e.endsWith(`pnpm-workspace.yaml`))return Wy(e,t,n);if(e.endsWith(`.yarnrc.yml`))return qy(e,t,n);if(e.endsWith(`package.yaml`))return Vy(e,t,n);if(e.endsWith(`package.json`)){let r=df(t.cwd??``,e);try{let i=await eb(r),a=i?.workspaces;if(a&&typeof a==`object`&&(`catalog`in a||`catalogs`in a)){let r=df(t.cwd||j.cwd());if(w(lf(r,`bun.lockb`))||w(lf(r,`bun.lock`))){let r=await by(e,t,n,i),a=await Fy(e,t,n,i);return[...r,...a]}}return Fy(e,t,n,i)}catch{}}return Fy(e,t,n)}async function ib(e){let t=[],n=df(e.cwd||j.cwd()),r=$y(e.include,e.exclude);if(e.recursive){let n=await Ld(`**/package.yaml`,{ignore:dy.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),r=await Ld(`**/package.json`,{ignore:dy.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=mf(e);i.add(n)}for(let e of r){let n=mf(e);i.has(n)||t.push(e)}}else t=await Ld(`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=lf(n,e),r=wg(`.git`,{cwd:t,last:n});if(r&&mf(r)!==n)return[];let i=wg(`pnpm-workspace.yaml`,{cwd:t,last:n});if(i&&mf(i)!==n)return[];let a=wg(`.yarnrc.yml`,{cwd:t,last:n});if(a&&mf(a)!==n)return[];let o=wg(`bun.lockb`,{cwd:t,last:n})||wg(`bun.lock`,{cwd:t,last:n});return o&&mf(o)!==n?[]:[e]}))).flat()),w(lf(n,`pnpm-workspace.yaml`))&&t.unshift(`pnpm-workspace.yaml`),w(lf(n,`.yarnrc.yml`))&&t.unshift(`.yarnrc.yml`),(await Promise.all(t.map(t=>rb(t,e,r)))).flat()}const ab={error:-1,major:0,minor:1,patch:2,"":3};function ob(e){return e.sort((e,t)=>ab[e.diff||``]-ab[t.diff||``])}function sb(e,t){if(t.packageMode){for(let n of Object.keys(t.packageMode))if(Zy(n).test(e))return t.packageMode[n]}}function cb(e,t){let n=[];for(let r of Vv(t.maturityPeriodExclude).flatMap(e=>e.split(`,`))){let t=r.trim();if(!t)continue;let i=t.startsWith(`/`)?-1:t.lastIndexOf(`@`);if(!Zy(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 lb(e,t){for(let n of t)if(v_(e,n,{includePrerelease:!0}))return!0;return!1}const ub=new ae;function db(e){return e.match(/(@[^/]+\/)?([^/]+)/g)||[]}function fb(e){return e.match(/[^>]+/g)||[]}function pb(e){return/^(?:https?:|git\+|github:)/.test(e)}function mb(e){return/^(?:link|file|workspace|catalog):/.test(e)}function hb(e){return/^(?:npm|jsr):/.test(e)}function gb(e){return e===`npm`?`npm`:e===`jsr`?`jsr`:`npm`}function _b(e){let t=e.indexOf(`:`),n=gb(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 vb(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 yb(e,t){if(!b_(e))return null;if(t==="default")return e;let n=y_(e);return n?{major:`>=`,minor:`^`,patch:`~`}[t]+n:null}function bb(e,t){return e==null||t==null?null:t===`*`?`*`:t+e}function xb(e,t){return bb(t,vb(e))}function Sb(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=yb(t,`default`);if(!n)return;e.filter(e=>!e.includes(`-`)).forEach(e=>{v_(e,n)&&(!i||Hg(e,i))&&(i=e)})}else if(n==="default"&&(t===`*`||t.trim()===``))return;else{let a=yb(t,n);if(!a)throw Error(`invalid_range`);let o=r.latest??null;o&&!v_(o,a)&&(o=null),e.forEach(e=>{v_(e,a)&&(!o||Gg(e,o))&&(!i||Hg(e,i))&&(i=e)})}if(i)return i}function Cb(e,t){return e.filter(e=>!t[e])}function wb(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 Tb(e,t,n){let{tags:r}=e.pkgData,i=Eb(e,n);if(i.length!==0)return e.filteredVersions=i,Sb(i,e.currentVersion,t,r)}function Eb(e,t){let{versions:n,deprecated:r,time:i}=e.pkgData,a=n;r&&Object.keys(r).length>0&&(a=Cb(a,r));let o=cb(e.name,t);if(t.maturityPeriod&&t.maturityPeriod>0&&o!==!0){let e=a;if(a=wb(e,i,t.maturityPeriod),o.length>0){let t=new Set(a);a=e.filter(e=>t.has(e)||lb(e,o))}}return a}function Db(e,t,n){let r=Tb(e,`latest`,n);return r&&Hg(r,t)?r:void 0}function Ob(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;return}if(e.targetVersion=xb(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&&Vg(e.currentVersion,e.targetVersion)){let{versions:t,time:n={},tags:r}=e.pkgData,i=Sb(e.filteredVersions??t,e.currentVersion,`minor`,r);i&&(e.targetVersion=i,e.targetVersionTime=n[e.targetVersion])}try{let t=y_(e.currentVersion),n=y_(e.targetVersion);if(!t||!n)throw Error(`invalid_version`);e.currentVersionTime=e.pkgData.time?.[t.toString()],e.diff=kb(t,n),e.update=e.diff!==null&&Wg(t,n)}catch(t){if(!n)throw t;e.targetVersion=e.currentVersion,e.diff=`error`,e.update=!1}}function kb(e,t){if(Vg(e,t))return null;let n=v_(t,`~${e}`,{includePrerelease:!0}),r=v_(t,`^${e}`,{includePrerelease:!0}),i=v_(t,`>=${e}`,{includePrerelease:!0});return n?r?`patch`:`major`:r?`minor`:i?`major`:`error`}function Ab(e,t){return{...e,diff:null,targetVersion:e.currentVersion,update:!1,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]},...t}}function jb(e){return e!=null&&e!==`ignore`?e:`default`}async function Mb(e,t,n=()=>!0){let r={...e,diff:null,targetVersion:e.currentVersion,update:e.update,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]}},i=sb(r.name,t),a=t.mode,o=i?i===a?a:a==="default"?i:`ignore`:a;if(mb(e.currentVersion)||pb(e.currentVersion)||!e.update||!await Promise.resolve(n(e))||o===`ignore`)return Ab(e);if(hb(e.currentVersion)){let{name:t,version:n,protocol:i}=_b(e.currentVersion);if(r.name=t||r.name,r.currentVersion=n,r.aliasName=e.name,r.protocol=i,!n)return Ab(e,{name:r.name,currentVersion:n,aliasName:e.name,protocol:i})}let s=r.name;r.source===`resolutions`?s=db(r.name).pop()??r.name:r.source===`pnpm.overrides`&&(s=fb(r.name).pop()??r.name);let c=await uy(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 Ab(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol});if(f=Tb(r,jb(o),t),!f)return Ab(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?Ob(r,f,void 0,t.includeLocked):r.targetVersion=r.currentVersion,r.targetVersion===r.currentVersion&&(r.diff=null,r.update=!1);try{let e=y_(f||r.targetVersion||``);e&&(r.latestVersionAvailable=Db(r,e,t));let{nodecompat:n=!0}=t;if(n){let t=j.version,{nodeSemver:n}=r.pkgData;if(n&&e?.version&&e?.version in n){let i=n[e.version];r.nodeCompatibleVersion={compatible:i!=null&&v_(t,i),semver:i??``}}}}catch{}return d?(r.diff=`error`,r.update=!1,r.resolveError=d,r):r}async function Nb(e,t,n=()=>!0,r=()=>{}){let i=e.length,a=0,{concurrency:o=10}=t,s=ub.getStore()||Xd(o);return Promise.all(e.map(e=>s.add(async()=>{let o=await Mb(e,t,n);return a+=1,r(e.name,a,i),o})))}async function Pb(e,t,n,r){let i=await Nb(e.deps,t,n,(t,n,i)=>r?.(e.name,t,n,i));return ob(i),e.resolved=i,e}async function Fb(e,t={}){e.force||await cy();let n=await ib(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=Xd(e.concurrency||10);return await ub.run(s,()=>Promise.all(n.map(async n=>{t.beforePackageStart?.(n),await Ib(n,e,i,{...t,onDependencyResolved:o}),t.afterPackageEnd?.(n)}))),t.afterPackagesEnd?.(n),await ly(),{packages:n}}async function Ib(e,t,n=()=>!0,r={}){await Pb(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 nb(e,t),r.afterPackageWrite?.(e)),e}const Lb={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function Rb(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(`${Rb(e)}\n`)}function zb(...e){process.stderr.write(`${Rb(e)}\n`)}const Bb=async()=>{let e=await Jd();return e?(e.source===`legacy-dev-tools`&&$(`提示: 经 lzi-dev.config.ts 共享读取依赖工具配置,建议补建 lzi-dependencies.config.ts`),e.config):($(`提示: 未找到配置文件 lzi-dependencies.config.ts,使用默认配置`),{})},Vb=[`**/node_modules/**`,`**/oh_modules/**`,`**/target/**`,`**/dist/**`,`**/build/**`,`**/.turbo/**`],Hb=e=>!e||e.length===0?Vb:[...Vb,...e],Ub=il({name:xc().optional(),workspaces:Qc().optional(),devDependencies:dl(xc(),xc()).optional()}),Wb=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=Ub.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 Bb(),r=Hb(n.hoisting?.ignorePaths),i=new Set(n.hoisting?.allowlist??[]),a=t.devDependencies??{},o=await Ld(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),s=0,c=[];for(let t of o){if(t===`package.json`)continue;let n=null;try{let r=Ub.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(Object.keys(r).length!==0){s+=1;for(let[o,s]of Object.entries(r)){let r=a[o];r===void 0||i.has(o)||c.push({packageName:n.name??t,relPath:ne(e,`${e}/${t}`),dependency:o,subRange:s,rootRange:r,drifted:s!==r})}}}if($(`找到 ${s} 个子包,根声明开发依赖 ${Object.keys(a).length} 项`),c.length===0){$(`所有子包均未重复声明根已有的开发依赖`);return}$(`
303
- 以下子包重复声明根已有的开发依赖:`);for(let e of c){let t=e.drifted?` 版本漂移`:``;$(` ${e.packageName} ${e.relPath}`),$(` ${e.dependency} 子声明 ${e.subRange} 根声明 ${e.rootRange}${t}`)}$(`共 ${c.length} 处重复声明,处置口径见 ADR 0036`),process.exit(1)},Gb=`lzi-architecture.yaml`,Kb=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),qb=e=>{if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};return`root`in e&&typeof e.root==`string`&&(t.root=e.root),`exclude`in e&&Kb(e.exclude)&&(t.exclude=e.exclude),t},Jb=async e=>{try{let t=await Bun.file(e).text();return qb(Bun.YAML.parse(t))}catch(t){zb(`错误: 加载配置文件失败: ${e}`,t instanceof Error?t.message:String(t)),process.exit(1)}},Yb=e=>typeof e!=`object`||!e||Array.isArray(e)?{}:`exclude`in e&&Kb(e.exclude)?{exclude:e.exclude}:{},Xb=e=>typeof e==`object`&&e&&`default`in e?e.default:void 0,Zb=async e=>{if(e){let t=re(process.cwd(),e);w(t)||(zb(`错误: 配置文件不存在: ${t}`),process.exit(1));let n=await Jb(t);return{rootDir:re(k(t),n.root??`../`),exclude:n.exclude??[],source:`explicit`}}let t=process.env.LZI_GLOBALS_ROOT;if(t!==void 0&&t!==``){let e=A(re(t),`lzi-architecture.config.ts`);if(w(e))try{let n=Yb(Xb(await import(e)));return{rootDir:k(re(t)),exclude:n.exclude??[],source:`globals`}}catch(t){zb(`错误: 加载 globals 聚合配置失败: ${e}`,t instanceof Error?t.message:String(t)),process.exit(1)}}let n=process.cwd();for(;n!==`/`;){let e=A(n,Gb);if(w(e)){let t=await Jb(e);return{rootDir:re(k(e),t.root??`../`),exclude:t.exclude??[],source:`yaml-upward`}}n=k(n)}return null},Qb=(e,t)=>{let n;try{n=O(e)}catch{zb(`错误: 无法读取聚合根目录: ${e}`),process.exit(1)}let r=new Set(t);return n.filter(e=>!(e.startsWith(`.`)||e===`node_modules`||r.has(e))).map(t=>{let n=A(e,t),r=A(n,`package.json`);try{if(ee(n).isDirectory()&&w(r))return{name:t,dir:n}}catch{}return null}).filter(e=>e!==null)},$b=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,ex=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}/[^"]+":\\s*")[^"]*(")`,`g`)},tx=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),nx=e=>/^[~^]?\d/.test(e),rx=(e,t)=>`${/^[~^]/.exec(e)?.[0]??``}${t}`,ix=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(`
304
- `).map(e=>e.trim()).filter(e=>e.length>0).filter(t=>w(A(e,t)))]:[`package.json`]},ax=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,ox=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[],o=[],s;for(t.lastIndex=0;(s=t.exec(r))!==null;){let e=s[0],t=s[1]??``,r=s[2]??``,i=/^"([^"]+)"/.exec(t)?.[1]??``,a=e.slice(t.length,e.length-r.length),c=n(i,a);a!==c&&nx(a)&&o.push({name:i,oldVersion:a,targetVersion:c,prefix:t,suffix:r})}if(o.length===0)return{matchedPackages:i,changes:a};let c=r;for(let e of o){let t=RegExp(`("${tx(e.name)}":\\s*")[^"]*(")`);c=c.replace(t,`$1${e.targetVersion}$2`),i.push(e.name),a.push({name:e.name,from:e.oldVersion,to:e.targetVersion})}return await Bun.write(e,c),{matchedPackages:i,changes:a}},sx=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[];t.lastIndex=0;let o;for(;(o=t.exec(r))!==null;){let e=o[0],t=o[1]??``,r=o[2]??``,s=/^"([^"]+)"/.exec(t)?.[1]??``,c=e.slice(t.length,e.length-r.length),l=n(s,c);c!==l&&nx(c)&&(i.push(s),a.push({name:s,from:c,to:l}))}return{matchedPackages:i,changes:a}},cx=async(e,t,n,r,i)=>{let{name:a,dir:o}=e,s=ix(o),c=[],l=[],u=[],d=[];for(let e of s){let r=A(o,e),a=await sx(r,t,n);if(a.matchedPackages.length!==0){if(!$b(o,e)){u.push(e);continue}if(i)c.push(...a.matchedPackages),l.push(...a.changes);else{let e=await ox(r,t,n);c.push(...e.matchedPackages),l.push(...e.changes)}d.push(e)}}return d.length===0?u.length>0?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`skipped-dirty`,reason:`package.json 已有未提交改动:${u.join(`,`)}`}:{name:a,dir:o,matchedPackages:c,changes:l,status:`skipped-nochange`,reason:`无匹配 scope 或已是目标版本`}:i||ax(o,d,r)?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`success`}:{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`failed`,reason:`git commit 失败,文件已修改,需人工介入`}},lx=async(e,t)=>{let n=/* @__PURE__ */ new Set;for(let r of e){let e=ix(r.dir);for(let i of e){let e=A(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]},ux=async(e,t)=>{let n=/* @__PURE__ */ new Map,r=[],i=0,a=async e=>{let t=await uy(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){zb(`${Lb.RED}错误: 部分包查询 npm latest 失败,已中止(0 文件改动、0 提交)${Lb.RESET}`);for(let e of r)zb(` ${e.name}: ${e.reason}`);process.exit(1)}return n},dx=async e=>{let{scope:t,version:n,message:r,dryRun:i}=e,a=e.concurrency??10,o=await Zb(e.config);o||(zb(`错误: 未找到产品群配置文件 ${Gb}`),zb(`提示: 请在 architecture 项目创建该配置文件(参考 lzi-architecture.sample.yaml)`),zb(`提示: 或使用 --config <path> 显式指定`),zb(`提示: 或在 .env 设置 LZI_GLOBALS_ROOT 定位 globals 仓 TS 配置(ADR 0081)`),process.exit(1));let s=o.rootDir;w(s)||(zb(`错误: 聚合根目录不存在: ${s}`),process.exit(1));let c=o.exclude,l=n===void 0,u=l?`latest(各自 npm 最新)`:n,d=r??(l?`chore: bump ${t} deps to latest`:`chore: bump ${t} deps to ${n.replace(/^[~^]/,``)}`),f=ex(t);$(`${Lb.BLUE}═══ version upgrade-across ═══${Lb.RESET}`),$(`聚合配置来源: ${o.source}(--config 显式 / env globals / cwd 上溯 yaml)`),$(`聚合根: ${s}`),$(`升级范围: ${t} 下的所有包 -> ${u}`),$(`并发数: ${a}`),c.length>0&&$(`排除项目: ${c.join(`, `)}`),i&&$(`${Lb.YELLOW}[dry-run] 预览模式,不写文件、不提交${Lb.RESET}`),$(``);let p=Qb(s,c);$(`发现 ${p.length} 个子项目,并发处理(并发 ${a})...`),$(``);let m;if(l){let e=await lx(p,f);if(e.length===0){$(`${Lb.YELLOW}未匹配到任何 ${t} 下的包,结束${Lb.RESET}`);return}$(`匹配到 ${e.length} 个 ${t} 下的包,查询 npm latest...`);let n=await ux(e,a);m=(e,t)=>rx(t,n.get(e)??``)}else{let e=n??``;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 cx(t,f,m,d,i);h.push(r),g++;let a=r.status===`success`?`${Lb.GREEN}✓${Lb.RESET}`:r.status===`failed`?`${Lb.RED}✗${Lb.RESET}`:`·`;$(` [${g}/${_}] ${a} ${t.name}`)}},a=Array.from({length:Math.min(t,e.length)},()=>r());await Promise.all(a)})(p,a),$(``),fx(h,i)},fx=(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`);$(`${Lb.BLUE}═══ 处理结果 ═══${Lb.RESET}`);let o=t?`将提交`:`已提交`;$(`${Lb.GREEN}✓ ${o}: ${n.length}${Lb.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){$(``),$(`${Lb.YELLOW}⚠ 跳过(文件已改动): ${r.length}${Lb.RESET}`);for(let e of r)$(` ${e.name}: ${e.reason}`)}if(i.length>0&&($(``),$(`跳过(无匹配/已是目标版本): ${i.length}`)),a.length>0){$(``),$(`${Lb.RED}✗ 失败(需人工介入): ${a.length}${Lb.RESET}`);for(let e of a)$(` ${e.name}: ${e.reason}`),$(` ${e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `)}`)}$(``),$(`${Lb.BLUE}汇总: ${n.length} ${o} / ${r.length} 跳过(dirty) / ${i.length} 跳过(无变更) / ${a.length} 失败${Lb.RESET}`),!t&&n.length>0&&($(``),$(`下一步:推送到远程`),$(` bun push-all`)),a.length>0&&(process.exitCode=1)},px=pl([`default`,`major`,`minor`,`patch`,`latest`,`newest`]).default(`default`),mx=async e=>{let t=(await Bb()).upgrade??{},n=e.mode||t.mode||`default`,r=px.safeParse(n),i=r.success?r.data:`default`,a=[...e.scope?[`${e.scope}/*`]:[],...t.include??[]],{packages:o}=await Fb({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:!1,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;$(`
305
- --- 检查结果 ---`);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 hx(e){Zl(e,{name:`upgrade`,description:`检查依赖版本更新`,arguments:[{signature:`[mode]`,description:`升级模式(major/minor/patch/latest/newest)`},{signature:`[scope]`,description:`可选。仅升级指定 scope 下的依赖(如 @longzai-intelligence-oxlint),内部展开为 include @scope/*`}],options:[{flags:`--write`,description:`将更新写入 package.json`},{flags:`--dry-run`,description:`仅预览`}],schema:al({write:Xc().optional(),dryRun:Xc().optional()}),action:async(e,t)=>{let n=t[0],r=t[1];await mx({mode:n,write:e.write===!0,dryRun:e.dryRun===!0,scope:r})}}),Zl(e,{name:`upgrade-across`,description:`跨产品群批量升级依赖(读 lzi-architecture.yaml)`,options:[{flags:`--scope <scope>`,description:`依赖 scope(必填,如 @longzai-intelligence-builder)`},{flags:`--target <version>`,description:`目标版本号(可选,如 ^0.0.8。省略时自动取每个匹配包的 npm latest)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--config <path>`,description:`配置文件路径(显式指定,覆盖自动查找)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:al({scope:xc().optional(),target:xc().optional(),message:xc().optional(),config:xc().optional(),concurrency:Ll().int().positive().optional(),dryRun:Xc().optional()}),action:async e=>{e.scope||(process.stderr.write(`错误: upgrade-across 需要指定 --scope <@scope>
304
+ `,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=l(c(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=l(c(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())}}}})),Rv=/* @__PURE__ */ n((e=>{var t=Av(),n=pv(),r=mv(),i=R_(),a=Q(),o=Iv(),s=Lv();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=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())}function u(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}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(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))}function f(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)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),zv=(/* @__PURE__ */ n((e=>{var t=Av(),n=pv(),r=dv(),i=mv(),a=k_(),o=Q(),s=V_(),c=A_(),l=U_(),u=G_();Pv();var d=Fv(),f=Iv(),p=Lv(),m=Rv(),h=C_();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 Bv(e){let t=(0,zv.parseDocument)(e),n=!1;function r(r){e=r,t=(0,zv.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 zv.Pair(a,r),i.items.splice(e,0,o),n=!0}else if((0,zv.isAlias)(o.value)){let e=Vv(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=Hv(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 Vv(e,t){let n;return(0,zv.visit)(e,{Scalar:(e,r,i)=>{r.anchor===t.source&&typeof r.value==`string`&&(n=r)}}),n}function Hv(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 Uv(e){return e??=[],Array.isArray(e)?e:[e]}function Wv(e){return typeof e==`object`&&!!e&&`json`in e&&typeof e.json==`function`}function Gv(e){if(Wv(e))return e.json();throw TypeError(`response does not implement json()`)}const Kv=3e4,qv=`version-upgrade@npm node/${j.version}`,Jv=Object.assign((e,t)=>{let n=new Headers(t?.headers);return n.set(`user-agent`,qv),mg(e,{...t,headers:n})},{preconnect:()=>{}});async function Yv(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 Xv(e,t=!1,n,r=Kv,i=3){let a=await Yv(()=>ih(e,{cwd:n,force:t,fetch:Jv,metadata:!0,throw:!1}),e,r,i);if(!$v(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 Qv(o)}async function Zv(e,t=Kv,n=3){let r=await Yv(()=>Jv(new URL(`${e}/meta.json`,`https://jsr.io/`),{headers:{accept:`application/json`}}).then(e=>Gv(e)),e,t,n);if(!ey(r))throw Error(`Invalid JSR package metadata received for "${e}"`);let i=r;return{versions:Object.keys(i.versions),tags:{latest:i.latest}}}function Qv(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 $v(e){return typeof e==`object`&&!!e&&`versionsMeta`in e&&`distTags`in e}function ey(e){return typeof e==`object`&&!!e&&`scope`in e&&`name`in e&&`latest`in e&&`versions`in e}const ty=Je(`packages/version-upgrade/src/io/cache`),ny=(0,_f.default)(`version-upgrade:cache`);let ry={},iy=!1;const ay=pf(o.tmpdir(),`version-upgrade`),oy=pf(ay,`cache.json`),sy=18e5;function cy(){return Date.now()}function ly(e){return cy()-e}async function uy(){w(oy)&&ly(T(oy).mtimeMs)<sy?(ny(`cache loaded from ${oy}`),ry=JSON.parse(await E.readFile(oy,`utf-8`))):ny(`no cache found`)}async function dy(){if(iy)try{await E.mkdir(ay,{recursive:!0}),await E.writeFile(oy,JSON.stringify(ry),`utf-8`),ny(`cache saved to ${oy}`)}catch(e){ty.error(`Failed to save cache`,e instanceof Error?e:Error(String(e)))}}async function fy(e,t=`npm`,n,r,i){let a,o=`${t}:${e}`;if(ry[o]){if(ly(ry[o].cacheTime)<sy)return ny(`cache hit for ${o}`),ry[o].data;delete ry[o]}try{let a=t===`jsr`?await Zv(e,r,i):await Xv(e,!1,n,r,i);if(a)return ry[o]={data:a,cacheTime:cy()},iy=!0,a}catch(e){a=e}return{tags:{},versions:[],error:a instanceof Error&&a.message||String(a),deprecated:{}}}const py=[`**/node_modules/**`,`**/dist/**`,`**/public/**`,`**/fixture/**`,`**/fixtures/**`];function my(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,...my(e,[...t,r])}}else typeof i==`string`&&(n[r]={version:i,parents:t});return n}function hy(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 my(e)}return{}}function gy(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 _y(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=gy(a[e]);a[e]=t,a=t}a[i]=n}function vy(e,t,n){return Object.entries(hy(e,t)||{}).map(([e,{version:r,parents:i}])=>yy({name:e,version:r,type:t,shouldUpdate:n,parents:i}))}function yy({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 by(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=gy(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:xy(e,t)}`}}),n}function xy(e,t){let n=t?`@${t}`:``;return`${e.name}${n}`}async function Sy(e,t,n,r){let i=pf(t.cwd??``,e),a=r??JSON.parse(await F(i,`utf-8`)),o=[];function s(t,r){let o=Object.entries(r).map(([e,t])=>yy({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=Ty(c);if(e.catalog&&typeof e.catalog==`object`&&o.push(s(`bun-catalog:default`,Ey(e.catalog))),e.catalogs&&typeof e.catalogs==`object`){let t=Dy(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 Cy(e,t){let n=by(e.resolved,`bun-workspace`);if(Object.keys(n).length&&e.name.startsWith(`bun-catalog:`)){let t=e.name.replace(`bun-catalog:`,``),r=Ty(e.raw.workspaces??{});if(e.raw.workspaces=r,t==="default")r.catalog={...Ey(r.catalog??{}),...Ey(n)};else{let e=Dy(r.catalogs??{});r.catalogs=e,e[t]||(e[t]={}),e[t]={...e[t],...Ey(n)}}await wy(e.filepath,e.raw)}}async function wy(e,t){let n;try{n=Cg(await F(e,`utf-8`)).indent}catch{}let r=JSON.stringify(t,null,n||` `);await I(e,`${r}\n`,`utf-8`)}function Ty(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 Ey(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 Dy(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{}}const Oy=Je(`packages/version-upgrade/src/addons/vscode`);function ky(e,t){if(typeof e==`object`&&e){for(let[n,r]of Object.entries(e))if(n===t&&typeof r==`string`)return r}}function Ay(e){if(e==null)return!1;let t=e.engines;return ky(t,`vscode`)!==void 0}function jy(e){for(let t of[`dependencies`,`devDependencies`,`peerDependencies`]){let n=ky(e[t],`@types/vscode`);if(n!==void 0)return n}return``}const My=[{beforeWrite(e){if(!Ay(e.raw)||e.raw==null)return;let t=e.raw,n=jy(t);if(!n||n.includes(`:`))return;let r=t.engines,i=ky(r,`vscode`);if(!i)return;let a=x_(i),o=x_(n);if(a&&o&&Wg(o,a)){Oy.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 Ny(e){return M.from(e.slice(7),`base64`).toString(`hex`)}function Py(e){return typeof e==`object`&&!!e&&`version`in e&&typeof e.version==`string`}const Fy=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function Iy(e,t){return t.depFields?.[e]===!1?!1:e!==`peerDependencies`||!!t.peer}async function Ly(e,t,n,r){let i=pf(t.cwd??``,e),a=r??await nb(i),o=[];for(let e of Fy)if(Iy(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(yy({name:r,version:`^${s}`,type:`packageManager`,shouldUpdate:n,hexHash:u}))}}else o.push(...vy(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 Ry(e,t){let n=!1;for(let r of Fy)if(Iy(r,t)){if(r===`packageManager`){let t=Object.entries(by(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=Ny(e);o=`${o}+sha512.${t}`}}e.raw.packageManager=o,n=!0}}else{let t=hy(e.raw,r),i=by(e.resolved,r),a={};for(let[e,n]of Object.entries(t||{}))Py(n)&&(a[e]=n.version);for(let[e,t]of Object.entries(i||{}))a[e]=t;Object.keys(a).length>0&&(_y(e.raw,r,a),n=!0)}}if(n){for(let n of t.addons||My)await n.beforeWrite?.(e,t);await rb(e.filepath,e.raw||{})}}const zy=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`,`packageManager`,`pnpm.overrides`,`resolutions`,`overrides`];function By(e,t){return e===`peerDependencies`?!!t.peer:t.depFields?.[e]!==!1}async function Vy(e){let t=await P.readFile(e,`utf-8`);if(!t)return new zv.Document({});let n=(0,zv.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 Hy(e,t){let{amount:n,type:r}=await P.readFile(e,`utf-8`).then(Cg).catch(()=>({amount:2,type:`space`})),i=(0,zv.stringify)(t,{indent:(r===`tab`?2:n)??2,aliasDuplicateObjects:!1,lineWidth:0}).replace(/^(\s*)"(@[^":]+)":/gm,`$1'$2':`);await P.writeFile(e,i,`utf-8`)}async function Uy(e,t,n){let r=pf(t.cwd??``,e),i=await Vy(r),a=[];for(let e of zy)if(By(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(yy({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(...vy(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 Wy(e,t){let n=!1;if(e.type!==`package.yaml`)throw Error(`Package type is not supported`);let r=e.yamlDocument||new zv.Document(e.raw);for(let i of zy)if(By(i,t)){if(i===`packageManager`){let t=Object.entries(by(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=hy(Gy(r),i);t&&Object.keys(t).length>0&&(Object.entries(by(e.resolved,i)).forEach(([e,t])=>r.setIn([...i.split(`.`),e],t)),n=!0)}}if(n){for(let n of t.addons||My)await n.beforeWrite?.(e,t);await Hy(e.filepath,r)}}function Gy(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 Ky(e,t,n){let r=pf(t.cwd??``,e),i=Bv(await F(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>yy({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 qy(e,t){let n=by(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 Jy(e,e.context)}}function Jy(e,t){return I(e.filepath,t.toString(),`utf8`)}async function Yy(e,t,n){let r=pf(t.cwd??``,e),i=Bv(await F(r,`utf-8`)),a=i.getDocument().toJSON(),o=[];function s(t,o){let s=Object.entries(o).map(([e,t])=>yy({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 Xy(e,t){let n=by(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 Zy(e,e.context)}}function Zy(e,t){return I(e.filepath,t.toString(),`utf8`)}function Qy(e){return e.replace(/[.+?^${}()|[\]\\]/g,`\\$&`)}function $y(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(`^${Qy(e).replace(/\*+/g,`.*?`)}$`)}function eb(e,t=!0){if(!e||e.length===0)return()=>t;let n=Uv(e).flatMap(e=>e.split(`,`)).map($y);return e=>{for(let t of n)if(t.test(e))return!0;return!1}}function tb(e,t){let n=eb(e,!0),r=eb(t,!1);return e=>!r(e)&&n(e)}async function nb(e){return JSON.parse(await E.readFile(e,`utf-8`))}async function rb(e,t){let n=Cg(await E.readFile(e,`utf-8`)).indent||` `;await E.writeFile(e,`${JSON.stringify(t,null,n)}\n`,`utf-8`)}async function ib(e,t){switch(e.type){case`package.json`:return Ry(e,t);case`package.yaml`:return Wy(e,t);case`pnpm-workspace.yaml`:return qy(e,t);case`bun-workspace`:return Cy(e,t);case`.yarnrc.yml`:return Xy(e,t);default:throw Error(`Unsupported package type: ${e.type}`)}}async function ab(e,t,n){if(e.endsWith(`pnpm-workspace.yaml`))return Ky(e,t,n);if(e.endsWith(`.yarnrc.yml`))return Yy(e,t,n);if(e.endsWith(`package.yaml`))return Uy(e,t,n);if(e.endsWith(`package.json`)){let r=pf(t.cwd??``,e);try{let i=await nb(r),a=i?.workspaces;if(a&&typeof a==`object`&&(`catalog`in a||`catalogs`in a)){let r=pf(t.cwd||j.cwd());if(w(df(r,`bun.lockb`))||w(df(r,`bun.lock`))){let r=await Sy(e,t,n,i),a=await Ly(e,t,n,i);return[...r,...a]}}return Ly(e,t,n,i)}catch{}}return Ly(e,t,n)}async function ob(e){let t=[],n=pf(e.cwd||j.cwd()),r=tb(e.include,e.exclude);if(e.recursive){let n=await zd(`**/package.yaml`,{ignore:py.concat(e.ignorePaths||[]),cwd:e.cwd,onlyFiles:!0,dot:!1,expandDirectories:!1}),r=await zd(`**/package.json`,{ignore:py.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=gf(e);i.add(n)}for(let e of r){let n=gf(e);i.has(n)||t.push(e)}}else t=await zd(`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=df(n,e),r=Eg(`.git`,{cwd:t,last:n});if(r&&gf(r)!==n)return[];let i=Eg(`pnpm-workspace.yaml`,{cwd:t,last:n});if(i&&gf(i)!==n)return[];let a=Eg(`.yarnrc.yml`,{cwd:t,last:n});if(a&&gf(a)!==n)return[];let o=Eg(`bun.lockb`,{cwd:t,last:n})||Eg(`bun.lock`,{cwd:t,last:n});return o&&gf(o)!==n?[]:[e]}))).flat()),w(df(n,`pnpm-workspace.yaml`))&&t.unshift(`pnpm-workspace.yaml`),w(df(n,`.yarnrc.yml`))&&t.unshift(`.yarnrc.yml`),(await Promise.all(t.map(t=>ab(t,e,r)))).flat()}const sb={error:-1,major:0,minor:1,patch:2,"":3};function cb(e){return e.sort((e,t)=>sb[e.diff||``]-sb[t.diff||``])}function lb(e,t){if(t.packageMode){for(let n of Object.keys(t.packageMode))if($y(n).test(e))return t.packageMode[n]}}function ub(e,t){let n=[];for(let r of Uv(t.maturityPeriodExclude).flatMap(e=>e.split(`,`))){let t=r.trim();if(!t)continue;let i=t.startsWith(`/`)?-1:t.lastIndexOf(`@`);if(!$y(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 db(e,t){for(let n of t)if(b_(e,n,{includePrerelease:!0}))return!0;return!1}const fb=new ae;function pb(e){return e.match(/(@[^/]+\/)?([^/]+)/g)||[]}function mb(e){return e.match(/[^>]+/g)||[]}function hb(e){return/^(?:https?:|git\+|github:)/.test(e)}function gb(e){return/^(?:link|file|workspace|catalog):/.test(e)}function _b(e){return/^(?:npm|jsr):/.test(e)}function vb(e){return e===`npm`?`npm`:e===`jsr`?`jsr`:`npm`}function yb(e){let t=e.indexOf(`:`),n=vb(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 bb(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 xb(e,t){if(!S_(e))return null;if(t==="default")return e;let n=x_(e);return n?{major:`>=`,minor:`^`,patch:`~`}[t]+n:null}function Sb(e,t){return e==null||t==null?null:t===`*`?`*`:t+e}function Cb(e,t){return Sb(t,bb(e))}function wb(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=xb(t,`default`);if(!n)return;e.filter(e=>!e.includes(`-`)).forEach(e=>{b_(e,n)&&(!i||Wg(e,i))&&(i=e)})}else if(n==="default"&&(t===`*`||t.trim()===``))return;else{let a=xb(t,n);if(!a)throw Error(`invalid_range`);let o=r.latest??null;o&&!b_(o,a)&&(o=null),e.forEach(e=>{b_(e,a)&&(!o||qg(e,o))&&(!i||Wg(e,i))&&(i=e)})}if(i)return i}function Tb(e,t){return e.filter(e=>!t[e])}function Eb(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 Db(e,t,n){let{tags:r}=e.pkgData,i=Ob(e,n);if(i.length!==0)return e.filteredVersions=i,wb(i,e.currentVersion,t,r)}function Ob(e,t){let{versions:n,deprecated:r,time:i}=e.pkgData,a=n;r&&Object.keys(r).length>0&&(a=Tb(a,r));let o=ub(e.name,t);if(t.maturityPeriod&&t.maturityPeriod>0&&o!==!0){let e=a;if(a=Eb(e,i,t.maturityPeriod),o.length>0){let t=new Set(a);a=e.filter(e=>t.has(e)||db(e,o))}}return a}function kb(e,t,n){let r=Db(e,`latest`,n);return r&&Wg(r,t)?r:void 0}function Ab(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=Cb(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&&Ug(e.currentVersion,e.targetVersion)){let{versions:t,time:n={},tags:r}=e.pkgData,i=wb(e.filteredVersions??t,e.currentVersion,`minor`,r);i&&(e.targetVersion=i,e.targetVersionTime=n[e.targetVersion])}try{let t=x_(e.currentVersion),n=x_(e.targetVersion);if(!t||!n)throw Error(`invalid_version`);e.currentVersionTime=e.pkgData.time?.[t.toString()],e.diff=jb(t,n),e.update=e.diff!==null&&Kg(t,n)}catch(t){if(!n)throw t;e.targetVersion=e.currentVersion,e.diff=`error`,e.update=!1}}}function jb(e,t){if(Ug(e,t))return null;let n=b_(t,`~${e}`,{includePrerelease:!0}),r=b_(t,`^${e}`,{includePrerelease:!0}),i=b_(t,`>=${e}`,{includePrerelease:!0});return n?r?`patch`:`major`:r?`minor`:i?`major`:`error`}function Mb(e,t){return{...e,diff:null,targetVersion:e.currentVersion,update:!1,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]},...t}}function Nb(e){return e!=null&&e!==`ignore`?e:`default`}async function Pb(e,t,n=()=>!0){let r={...e,diff:null,targetVersion:e.currentVersion,update:e.update,provenanceDowngraded:!1,pkgData:{tags:{},versions:[]}},i=lb(r.name,t),a=t.mode,o=i?i===a?a:a==="default"?i:`ignore`:a;if(gb(e.currentVersion)||hb(e.currentVersion)||!e.update||!await Promise.resolve(n(e))||o===`ignore`)return Mb(e);if(_b(e.currentVersion)){let{name:t,version:n,protocol:i}=yb(e.currentVersion);if(r.name=t||r.name,r.currentVersion=n,r.aliasName=e.name,r.protocol=i,!n)return Mb(e,{name:r.name,currentVersion:n,aliasName:e.name,protocol:i})}let s=r.name;r.source===`resolutions`?s=pb(r.name).pop()??r.name:r.source===`pnpm.overrides`&&(s=mb(r.name).pop()??r.name);let c=await fy(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 Mb(e,{name:r.name,currentVersion:r.currentVersion,aliasName:r.aliasName,protocol:r.protocol});if(f=Db(r,Nb(o),t),!f)return Mb(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?Ab(r,f,void 0,t.includeLocked):r.targetVersion=r.currentVersion,r.targetVersion===r.currentVersion&&(r.diff=null,r.update=!1);try{let e=x_(f||r.targetVersion||``);e&&(r.latestVersionAvailable=kb(r,e,t));let{nodecompat:n=!0}=t;if(n){let t=j.version,{nodeSemver:n}=r.pkgData;if(n&&e?.version&&e?.version in n){let i=n[e.version];r.nodeCompatibleVersion={compatible:i!=null&&b_(t,i),semver:i??``}}}}catch{}return d&&(r.diff=`error`,r.update=!1,r.resolveError=d),r}async function Fb(e,t,n=()=>!0,r=()=>{}){let i=e.length,a=0,{concurrency:o=10}=t,s=fb.getStore()||Qd(o);return Promise.all(e.map(e=>s.add(async()=>{let o=await Pb(e,t,n);return a+=1,r(e.name,a,i),o})))}async function Ib(e,t,n,r){let i=await Fb(e.deps,t,n,(t,n,i)=>r?.(e.name,t,n,i));return cb(i),e.resolved=i,e}async function Lb(e,t={}){e.force||await uy();let n=await ob(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=Qd(e.concurrency||10);return await fb.run(s,()=>Promise.all(n.map(async n=>{t.beforePackageStart?.(n),await Rb(n,e,i,{...t,onDependencyResolved:o}),t.afterPackageEnd?.(n)}))),t.afterPackagesEnd?.(n),await dy(),{packages:n}}async function Rb(e,t,n=()=>!0,r={}){await Ib(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 ib(e,t),r.afterPackageWrite?.(e)),e}const zb={RED:`\x1B[0;31m`,GREEN:`\x1B[0;32m`,YELLOW:`\x1B[1;33m`,BLUE:`\x1B[0;34m`,RESET:`\x1B[0m`};function Bb(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(`${Bb(e)}\n`)}function Vb(...e){process.stderr.write(`${Bb(e)}\n`)}const Hb=async()=>{let e=await Xd();return e?(e.source===`legacy-dev-tools`&&$(`提示: 经 lzi-dev.config.ts 共享读取依赖工具配置,建议补建 lzi-dependencies.config.ts`),e.config):($(`提示: 未找到配置文件 lzi-dependencies.config.ts,使用默认配置`),{})},Ub=[`**/node_modules/**`,`**/oh_modules/**`,`**/target/**`,`**/dist/**`,`**/build/**`,`**/.turbo/**`],Wb=e=>!e||e.length===0?Ub:[...Ub,...e],Gb=ol({name:Cc().optional(),workspaces:el().optional(),devDependencies:pl(Cc(),Cc()).optional()}),Kb=async()=>{let e=process.cwd();$(`正在扫描 ${e} 下的 package.json 文件...`);let t=null;try{let n=Gb.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 Hb(),r=Wb(n.hoisting?.ignorePaths),i=new Set(n.hoisting?.allowlist??[]),a=t.devDependencies??{},o=await zd(`**/package.json`,{cwd:e,ignore:r,onlyFiles:!0,dot:!1}),s=0,c=[];for(let t of o){if(t===`package.json`)continue;let n=null;try{let r=Gb.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(Object.keys(r).length!==0){s+=1;for(let[o,s]of Object.entries(r)){let r=a[o];r===void 0||i.has(o)||c.push({packageName:n.name??t,relPath:ne(e,`${e}/${t}`),dependency:o,subRange:s,rootRange:r,drifted:s!==r})}}}if($(`找到 ${s} 个子包,根声明开发依赖 ${Object.keys(a).length} 项`),c.length===0)$(`所有子包均未重复声明根已有的开发依赖`);else{$(`
305
+ 以下子包重复声明根已有的开发依赖:`);for(let e of c){let t=e.drifted?` 版本漂移`:``;$(` ${e.packageName} ${e.relPath}`),$(` ${e.dependency} 子声明 ${e.subRange} 根声明 ${e.rootRange}${t}`)}$(`共 ${c.length} 处重复声明,处置口径见 ADR 0036`),process.exit(1)}},qb=`lzi-architecture.yaml`,Jb=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),Yb=e=>{if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};return`root`in e&&typeof e.root==`string`&&(t.root=e.root),`exclude`in e&&Jb(e.exclude)&&(t.exclude=e.exclude),t},Xb=async e=>{try{let t=await Bun.file(e).text();return Yb(Bun.YAML.parse(t))}catch(t){Vb(`错误: 加载配置文件失败: ${e}`,t instanceof Error?t.message:String(t)),process.exit(1)}},Zb=e=>typeof e!=`object`||!e||Array.isArray(e)?{}:`exclude`in e&&Jb(e.exclude)?{exclude:e.exclude}:{},Qb=e=>typeof e==`object`&&e&&`default`in e?e.default:void 0,$b=async e=>{if(e){let t=re(process.cwd(),e);w(t)||(Vb(`错误: 配置文件不存在: ${t}`),process.exit(1));let n=await Xb(t);return{rootDir:re(k(t),n.root??`../`),exclude:n.exclude??[],source:`explicit`}}let t=process.env.LZI_GLOBALS_ROOT;if(t!==void 0&&t!==``){let e=A(re(t),`lzi-architecture.config.ts`);if(w(e))try{let n=Zb(Qb(await import(e)));return{rootDir:k(re(t)),exclude:n.exclude??[],source:`globals`}}catch(t){Vb(`错误: 加载 globals 聚合配置失败: ${e}`,t instanceof Error?t.message:String(t)),process.exit(1)}}let n=process.cwd();for(;n!==`/`;){let e=A(n,qb);if(w(e)){let t=await Xb(e);return{rootDir:re(k(e),t.root??`../`),exclude:t.exclude??[],source:`yaml-upward`}}n=k(n)}return null},ex=(e,t)=>{let n;try{n=O(e)}catch{Vb(`错误: 无法读取聚合根目录: ${e}`),process.exit(1)}let r=new Set(t);return n.filter(e=>!(e.startsWith(`.`)||e===`node_modules`||r.has(e))).map(t=>{let n=A(e,t),r=A(n,`package.json`);try{if(ee(n).isDirectory()&&w(r))return{name:t,dir:n}}catch{}return null}).filter(e=>e!==null)},tx=(e,t)=>Bun.spawnSync([`git`,`diff`,`--quiet`,`HEAD`,`--`,t],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,nx=e=>{let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`("${t}/[^"]+":\\s*")[^"]*(")`,`g`)},rx=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),ix=e=>/^[~^]?\d/.test(e),ax=(e,t)=>`${/^[~^]/.exec(e)?.[0]??``}${t}`,ox=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(`
306
+ `).map(e=>e.trim()).filter(e=>e.length>0).filter(t=>w(A(e,t)))]:[`package.json`]},sx=(e,t,n)=>Bun.spawnSync([`git`,`commit`,...t,`-m`,n],{cwd:e,stdout:`pipe`,stderr:`pipe`}).exitCode===0,cx=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[],o=[],s;for(t.lastIndex=0;(s=t.exec(r))!==null;){let e=s[0],t=s[1]??``,r=s[2]??``,i=/^"([^"]+)"/.exec(t)?.[1]??``,a=e.slice(t.length,e.length-r.length),c=n(i,a);a!==c&&ix(a)&&o.push({name:i,oldVersion:a,targetVersion:c,prefix:t,suffix:r})}if(o.length===0)return{matchedPackages:i,changes:a};let c=r;for(let e of o){let t=RegExp(`("${rx(e.name)}":\\s*")[^"]*(")`);c=c.replace(t,`$1${e.targetVersion}$2`),i.push(e.name),a.push({name:e.name,from:e.oldVersion,to:e.targetVersion})}return await Bun.write(e,c),{matchedPackages:i,changes:a}},lx=async(e,t,n)=>{let r=await Bun.file(e).text(),i=[],a=[];t.lastIndex=0;let o;for(;(o=t.exec(r))!==null;){let e=o[0],t=o[1]??``,r=o[2]??``,s=/^"([^"]+)"/.exec(t)?.[1]??``,c=e.slice(t.length,e.length-r.length),l=n(s,c);c!==l&&ix(c)&&(i.push(s),a.push({name:s,from:c,to:l}))}return{matchedPackages:i,changes:a}},ux=async(e,t,n,r,i)=>{let{name:a,dir:o}=e,s=ox(o),c=[],l=[],u=[],d=[];for(let e of s){let r=A(o,e),a=await lx(r,t,n);if(a.matchedPackages.length!==0){if(!tx(o,e))u.push(e);else{if(i)c.push(...a.matchedPackages),l.push(...a.changes);else{let e=await cx(r,t,n);c.push(...e.matchedPackages),l.push(...e.changes)}d.push(e)}}}return d.length===0?u.length>0?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`skipped-dirty`,reason:`package.json 已有未提交改动:${u.join(`,`)}`}:{name:a,dir:o,matchedPackages:c,changes:l,status:`skipped-nochange`,reason:`无匹配 scope 或已是目标版本`}:i||sx(o,d,r)?{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`success`}:{name:a,dir:o,matchedPackages:c,changes:l,skippedFiles:u,status:`failed`,reason:`git commit 失败,文件已修改,需人工介入`}},dx=async(e,t)=>{let n=/* @__PURE__ */ new Set;for(let r of e){let e=ox(r.dir);for(let i of e){let e=A(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]},fx=async(e,t)=>{let n=/* @__PURE__ */ new Map,r=[],i=0,a=async e=>{let t=await fy(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){Vb(`${zb.RED}错误: 部分包查询 npm latest 失败,已中止(0 文件改动、0 提交)${zb.RESET}`);for(let e of r)Vb(` ${e.name}: ${e.reason}`);process.exit(1)}return n},px=async e=>{let{scope:t,version:n,message:r,dryRun:i}=e,a=e.concurrency??10,o=await $b(e.config);o||(Vb(`错误: 未找到产品群配置文件 ${qb}`),Vb(`提示: 请在 architecture 项目创建该配置文件(参考 lzi-architecture.sample.yaml)`),Vb(`提示: 或使用 --config <path> 显式指定`),Vb(`提示: 或在 .env 设置 LZI_GLOBALS_ROOT 定位 globals 仓 TS 配置(ADR 0081)`),process.exit(1));let s=o.rootDir;w(s)||(Vb(`错误: 聚合根目录不存在: ${s}`),process.exit(1));let c=o.exclude,l=n===void 0,u=l?`latest(各自 npm 最新)`:n,d=r??(l?`chore: bump ${t} deps to latest`:`chore: bump ${t} deps to ${n.replace(/^[~^]/,``)}`),f=nx(t);$(`${zb.BLUE}═══ version upgrade-across ═══${zb.RESET}`),$(`聚合配置来源: ${o.source}(--config 显式 / env globals / cwd 上溯 yaml)`),$(`聚合根: ${s}`),$(`升级范围: ${t} 下的所有包 -> ${u}`),$(`并发数: ${a}`),c.length>0&&$(`排除项目: ${c.join(`, `)}`),i&&$(`${zb.YELLOW}[dry-run] 预览模式,不写文件、不提交${zb.RESET}`),$(``);let p=ex(s,c);$(`发现 ${p.length} 个子项目,并发处理(并发 ${a})...`),$(``);let m;if(l){let e=await dx(p,f);if(e.length===0){$(`${zb.YELLOW}未匹配到任何 ${t} 下的包,结束${zb.RESET}`);return}$(`匹配到 ${e.length} 个 ${t} 下的包,查询 npm latest...`);let n=await fx(e,a);m=(e,t)=>ax(t,n.get(e)??``)}else{let e=n??``;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 ux(t,f,m,d,i);h.push(r),g++;let a=r.status===`success`?`${zb.GREEN}✓${zb.RESET}`:r.status===`failed`?`${zb.RED}✗${zb.RESET}`:`·`;$(` [${g}/${_}] ${a} ${t.name}`)}},a=Array.from({length:Math.min(t,e.length)},()=>r());await Promise.all(a)})(p,a),$(``),mx(h,i)},mx=(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`);$(`${zb.BLUE}═══ 处理结果 ═══${zb.RESET}`);let o=t?`将提交`:`已提交`;$(`${zb.GREEN}✓ ${o}: ${n.length}${zb.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){$(``),$(`${zb.YELLOW}⚠ 跳过(文件已改动): ${r.length}${zb.RESET}`);for(let e of r)$(` ${e.name}: ${e.reason}`)}if(i.length>0&&($(``),$(`跳过(无匹配/已是目标版本): ${i.length}`)),a.length>0){$(``),$(`${zb.RED}✗ 失败(需人工介入): ${a.length}${zb.RESET}`);for(let e of a)$(` ${e.name}: ${e.reason}`),$(` ${e.changes.map(e=>`${e.name.split(`/`).pop()}: ${e.from} → ${e.to}`).join(`, `)}`)}$(``),$(`${zb.BLUE}汇总: ${n.length} ${o} / ${r.length} 跳过(dirty) / ${i.length} 跳过(无变更) / ${a.length} 失败${zb.RESET}`),!t&&n.length>0&&($(``),$(`下一步:推送到远程`),$(` bun push-all`)),a.length>0&&(process.exitCode=1)},hx=hl([`default`,`major`,`minor`,`patch`,`latest`,`newest`]).default(`default`),gx=async e=>{let t=(await Hb()).upgrade??{},n=e.mode||t.mode||`default`,r=hx.safeParse(n),i=r.success?r.data:`default`,a=[...e.scope?[`${e.scope}/*`]:[],...t.include??[]],{packages:o}=await Lb({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:!1,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;$(`
307
+ --- 检查结果 ---`);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 _x(e){$l(e,{name:`upgrade`,description:`检查依赖版本更新`,arguments:[{signature:`[mode]`,description:`升级模式(major/minor/patch/latest/newest)`},{signature:`[scope]`,description:`可选。仅升级指定 scope 下的依赖(如 @longzai-intelligence-oxlint),内部展开为 include @scope/*`}],options:[{flags:`--write`,description:`将更新写入 package.json`},{flags:`--dry-run`,description:`仅预览`}],schema:sl({write:Qc().optional(),dryRun:Qc().optional()}),action:async(e,t)=>{let n=t[0],r=t[1];await gx({mode:n,write:e.write===!0,dryRun:e.dryRun===!0,scope:r})}}),$l(e,{name:`upgrade-across`,description:`跨产品群批量升级依赖(读 lzi-architecture.yaml)`,options:[{flags:`--scope <scope>`,description:`依赖 scope(必填,如 @longzai-intelligence-builder)`},{flags:`--target <version>`,description:`目标版本号(可选,如 ^0.0.8。省略时自动取每个匹配包的 npm latest)`},{flags:`-m, --message <message>`,description:`自定义提交信息`},{flags:`--config <path>`,description:`配置文件路径(显式指定,覆盖自动查找)`},{flags:`--concurrency <n>`,description:`并发数(默认 10)`},{flags:`--dry-run`,description:`仅预览(不写文件、不提交)`}],schema:sl({scope:Cc().optional(),target:Cc().optional(),message:Cc().optional(),config:Cc().optional(),concurrency:zl().int().positive().optional(),dryRun:Qc().optional()}),action:async e=>{e.scope||(process.stderr.write(`错误: upgrade-across 需要指定 --scope <@scope>
306
308
  `),process.stderr.write(`示例: --scope @longzai-intelligence-builder
307
- `),process.exit(1)),await dx({scope:e.scope,version:e.target,message:e.message,config:e.config,concurrency:e.concurrency,dryRun:e.dryRun===!0})}})}function gx(e){Zl(e,{name:`hoisting check`,description:`检查子包开发依赖是否重复声明 workspace 根已有依赖`,schema:al({}),action:async()=>{await Wb()}})}function _x(){let e=ql({name:`lzi-dependencies`,description:`Longzai Intelligence 依赖版本管理工具`,version:`0.0.4`});return hx(e),gx(e),e}async function vx(){await _x().parseAsync(process.argv)}import.meta.main===!0&&await vx();export{_x as buildProgram};
309
+ `),process.exit(1)),await px({scope:e.scope,version:e.target,message:e.message,config:e.config,concurrency:e.concurrency,dryRun:e.dryRun===!0})}})}function vx(e){$l(e,{name:`hoisting check`,description:`检查子包开发依赖是否重复声明 workspace 根已有依赖`,schema:sl({}),action:async()=>{await Kb()}})}function yx(){let e=Yl({name:`lzi-dependencies`,description:`Longzai Intelligence 依赖版本管理工具`,version:`0.0.5`});return _x(e),vx(e),e}async function bx(){await yx().parseAsync(process.argv)}import.meta.main===!0&&await bx();export{yx as buildProgram};