@turbo/gen 2.10.11-canary.3 → 2.10.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +4 -4
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -119,7 +119,7 @@ ${e.format(t)}
119
119
  `;function n(e,i){var a=[],s=``;typeof i==`string`?i={section:i,whitespace:!1}:(i||={},i.whitespace=i.whitespace===!0);var c=i.whitespace?` = `:`=`;return Object.keys(e).forEach(function(n,r,i){var l=e[n];l&&Array.isArray(l)?l.forEach(function(e){s+=o(n+`[]`)+c+o(e)+`
120
120
  `}):l&&typeof l==`object`?a.push(n):s+=o(n)+c+o(l)+t}),i.section&&s.length&&(s=`[`+o(i.section)+`]`+t+s),a.forEach(function(a,o,c){var l=r(a).join(`\\.`),u=(i.section?i.section+`.`:``)+l,d=n(e[a],{section:u,whitespace:i.whitespace});s.length&&d.length&&(s+=t),s+=d}),s}function r(e){return e.replace(/\1/g,`LITERAL\\1LITERAL`).replace(/\\\./g,``).split(/\./).map(function(e){return e.replace(/\1/g,`\\.`).replace(/\2LITERAL\\1LITERAL\2/g,``)})}function i(e){var t={},n=t,i=null,a=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g);return o.forEach(function(e,r,o){if(!(!e||e.match(/^\s*[;#]/))){var c=e.match(a);if(c){if(c[1]!==void 0){if(i=s(c[1]),i===`__proto__`){n={};return}n=t[i]=t[i]||{};return}var l=s(c[2]);if(l!==`__proto__`){var u=c[3]?s(c[4]):!0;switch(u){case`true`:case`false`:case`null`:u=JSON.parse(u)}if(l.length>2&&l.slice(-2)===`[]`){if(l=l.substring(0,l.length-2),l===`__proto__`)return;n[l]?Array.isArray(n[l])||(n[l]=[n[l]]):n[l]=[]}Array.isArray(n[l])?n[l].push(u):n[l]=u}}}}),Object.keys(t).filter(function(e,n,i){if(!t[e]||typeof t[e]!=`object`||Array.isArray(t[e]))return!1;var a=r(e),o=t,s=a.pop(),c=s.replace(/\\\./g,`.`);return a.forEach(function(e,t,n){e!==`__proto__`&&((!o[e]||typeof o[e]!=`object`)&&(o[e]={}),o=o[e])}),o===t&&c===s?!1:(o[c]=t[e],!0)}).forEach(function(e,n,r){delete t[e]}),t}function a(e){return e.charAt(0)===`"`&&e.slice(-1)===`"`||e.charAt(0)===`'`&&e.slice(-1)===`'`}function o(e){return typeof e!=`string`||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&a(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,`\\;`).replace(/#/g,`\\#`)}function s(e,t){if(e=(e||``).trim(),a(e)){e.charAt(0)===`'`&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch{}}else{for(var n=!1,r=``,i=0,o=e.length;i<o;i++){var s=e.charAt(i);if(n)`\\;#`.indexOf(s)===-1?r+=`\\`+s:r+=s,n=!1;else if(`;#`.indexOf(s)!==-1)break;else s===`\\`?n=!0:r+=s}return n&&(r+=`\\`),r.trim()}return e}}),dg=e.__commonJSMin((exports,t)=>{var n=1,r=2;function i(){return``}function a(e,t,n){return e.slice(t,n).replace(/\S/g,` `)}t.exports=function(e,t){t||={};for(var o,s,c=!1,l=!1,u=0,d=``,f=t.whitespace===!1?i:a,p=0;p<e.length;p++){if(o=e[p],s=e[p+1],!l&&o===`"`){var m=e[p-1]===`\\`&&e[p-2]!==`\\`;m||(c=!c)}if(!c){if(!l&&o+s===`//`)d+=e.slice(u,p),u=p,l=n,p++;else if(l===n&&o+s===`\r
121
121
  `){p++,l=!1,d+=f(e,u,p),u=p;continue}else if(l===n&&o===`
122
- `)l=!1,d+=f(e,u,p),u=p;else if(!l&&o+s===`/*`){d+=e.slice(u,p),u=p,l=r,p++;continue}else if(l===r&&o+s===`*/`){p++,l=!1,d+=f(e,u,p+1),u=p+1;continue}}}return d+(l?f(e.substr(u)):e.substr(u))}}),fg=e.__commonJSMin(exports=>{var t=require(`fs`),n=ug(),r=require(`path`),i=dg(),a=exports.parse=function(e){return/^\s*{/.test(e)?JSON.parse(i(e)):n.parse(e)},o=exports.file=function(){var e=[].slice.call(arguments).filter(function(e){return e!=null});for(var n in e)if(typeof e[n]!=`string`)return;var i=r.join.apply(null,e),a;try{return t.readFileSync(i,`utf-8`)}catch{return}},s=exports.json=function(){var e=o.apply(null,arguments);return e?a(e):null},c=exports.env=function(e,t){t||=process.env;var n={},r=e.length;for(var i in t)if(i.toLowerCase().indexOf(e.toLowerCase())===0){for(var a=i.substring(r).split(`__`),o;(o=a.indexOf(``))>-1;)a.splice(o,1);var s=n;a.forEach(function(e,n){!e||typeof s!=`object`||(n===a.length-1&&(s[e]=t[i]),s[e]===void 0&&(s[e]={}),s=s[e])})}return n},l=exports.find=function(){var e=r.join.apply(null,[].slice.call(arguments));function n(e,i){var a=r.join(e,i);try{return t.statSync(a),a}catch{if(r.dirname(e)!==e)return n(r.dirname(e),i)}}return n(process.cwd(),e)}}),pg=e.__commonJSMin((exports,t)=>{function n(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else if(e instanceof Date)return new Date(e.getTime());else if(e instanceof RegExp)return new RegExp(e);else throw Error(`Unexpected situation`)}function i(e){var t=[];return e.forEach(function(e,a){typeof e==`object`&&e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}function a(e,t){return t===`__proto__`?void 0:e[t]}var o=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=`object`)return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),s,c,l;return t.forEach(function(t){typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).forEach(function(l){if(c=a(e,l),s=a(t,l),s!==e)if(typeof s!=`object`||!s){e[l]=s;return}else if(Array.isArray(s)){e[l]=i(s);return}else if(n(s)){e[l]=r(s);return}else if(typeof c!=`object`||!c||Array.isArray(c)){e[l]=o({},s);return}else{e[l]=o(c,s);return}})}),e}}),mg=e.__commonJSMin((exports,t)=>{function n(e,t){var n=e;t.slice(0,-1).forEach(function(e){n=n[e]||{}});var r=t[t.length-1];return r in n}function r(e){return typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return t===`constructor`&&typeof e[t]==`function`||t===`__proto__`}t.exports=function(e,t){t||={};var a={bools:{},strings:{},unknownFn:null};typeof t.unknown==`function`&&(a.unknownFn=t.unknown),typeof t.boolean==`boolean`&&t.boolean?a.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){a.bools[e]=!0});var o={};function s(e){return o[e].some(function(e){return a.bools[e]})}Object.keys(t.alias||{}).forEach(function(e){o[e]=[].concat(t.alias[e]),o[e].forEach(function(t){o[t]=[e].concat(o[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){a.strings[e]=!0,o[e]&&[].concat(o[e]).forEach(function(e){a.strings[e]=!0})});var c=t.default||{},l={_:[]};function u(e,t){return a.allBools&&/^--[^=]+$/.test(t)||a.strings[e]||a.bools[e]||o[e]}function d(e,t,n){for(var r=e,o=0;o<t.length-1;o++){var s=t[o];if(i(r,s))return;r[s]===void 0&&(r[s]={}),(r[s]===Object.prototype||r[s]===Number.prototype||r[s]===String.prototype)&&(r[s]={}),r[s]===Array.prototype&&(r[s]=[]),r=r[s]}var c=t[t.length-1];i(r,c)||((r===Object.prototype||r===Number.prototype||r===String.prototype)&&(r={}),r===Array.prototype&&(r=[]),r[c]===void 0||a.bools[c]||typeof r[c]==`boolean`?r[c]=n:Array.isArray(r[c])?r[c].push(n):r[c]=[r[c],n])}function f(e,t,n){if(!(n&&a.unknownFn&&!u(e,n)&&a.unknownFn(n)===!1)){var i=!a.strings[e]&&r(t)?Number(t):t;d(l,e.split(`.`),i),(o[e]||[]).forEach(function(e){d(l,e.split(`.`),i)})}}Object.keys(a.bools).forEach(function(e){f(e,c[e]===void 0?!1:c[e])});var p=[];e.indexOf(`--`)!==-1&&(p=e.slice(e.indexOf(`--`)+1),e=e.slice(0,e.indexOf(`--`)));for(var m=0;m<e.length;m++){var h=e[m],g,_;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);g=v[1];var y=v[2];a.bools[g]&&(y=y!==`false`),f(g,y,h)}else if(/^--no-.+/.test(h))g=h.match(/^--no-(.+)/)[1],f(g,!1,h);else if(/^--.+/.test(h))g=h.match(/^--(.+)/)[1],_=e[m+1],_!==void 0&&!/^(-|--)[^-]/.test(_)&&!a.bools[g]&&!a.allBools&&(!o[g]||!s(g))?(f(g,_,h),m+=1):/^(true|false)$/.test(_)?(f(g,_===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h);else if(/^-[^-]+/.test(h)){for(var b=h.slice(1,-1).split(``),x=!1,S=0;S<b.length;S++){if(_=h.slice(S+2),_===`-`){f(b[S],_,h);continue}if(/[A-Za-z]/.test(b[S])&&_[0]===`=`){f(b[S],_.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(b[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(_)){f(b[S],_,h),x=!0;break}if(b[S+1]&&b[S+1].match(/\W/)){f(b[S],h.slice(S+2),h),x=!0;break}else f(b[S],a.strings[b[S]]?``:!0,h)}g=h.slice(-1)[0],!x&&g!==`-`&&(e[m+1]&&!/^(-|--)[^-]/.test(e[m+1])&&!a.bools[g]&&(!o[g]||!s(g))?(f(g,e[m+1],h),m+=1):e[m+1]&&/^(true|false)$/.test(e[m+1])?(f(g,e[m+1]===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h))}else if((!a.unknownFn||a.unknownFn(h)!==!1)&&l._.push(a.strings._||!r(h)?h:Number(h)),t.stopEarly){l._.push.apply(l._,e.slice(m+1));break}}return Object.keys(c).forEach(function(e){n(l,e.split(`.`))||(d(l,e.split(`.`),c[e]),(o[e]||[]).forEach(function(t){d(l,t.split(`.`),c[e])}))}),t[`--`]?l[`--`]=p.slice():p.forEach(function(e){l._.push(e)}),l}}),hg=e.__commonJSMin((exports,t)=>{var n=fg(),r=require(`path`).join,i=pg(),a=`/etc`,o=process.platform===`win32`,s=o?process.env.USERPROFILE:process.env.HOME;t.exports=function(e,t,c,l){if(typeof e!=`string`)throw Error(`rc(name): name *must* be string`);c||=mg()(process.argv.slice(2)),t=(typeof t==`string`?n.json(t):t)||{},l||=n.parse;var u=n.env(e+`_`),d=[t],f=[];function p(e){if(!(f.indexOf(e)>=0)){var t=n.file(e);t&&(d.push(l(t)),f.push(e))}}return o||[r(a,e,`config`),r(a,e+`rc`)].forEach(p),s&&[r(s,`.config`,e,`config`),r(s,`.config`,e),r(s,`.`+e,`config`),r(s,`.`+e+`rc`)].forEach(p),p(n.find(`.`+e+`rc`)),u.config&&p(u.config),c.config&&p(c.config),i.apply(null,d.concat([u,c,f.length?{configs:f,config:f[f.length-1]}:void 0]))}}),gg=e.__commonJSMin((exports,t)=>{t.exports=function(e){var t=hg()(`npm`,{registry:`https://registry.npmjs.org/`}),n=t[e+`:registry`]||t.registry;return n.slice(-1)===`/`?n:n+`/`}}),_g=e.__commonJSMin((exports,t)=>{var n=require(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,exports),exports.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}),vg=e.__commonJSMin((exports,t)=>{let n=_g().Buffer;function r(e){return n.from(e,`base64`).toString(`utf8`)}function i(e){return n.from(e,`utf8`).toString(`base64`)}t.exports={decodeBase64:r,encodeBase64:i}}),yg=e.__commonJSMin((exports,t)=>{var n=require(`url`),r=vg(),i=r.decodeBase64,a=r.encodeBase64,o=`:_authToken`,s=`:username`,c=`:_password`;t.exports=function(){var e,t;return arguments.length>=2?(e=arguments[0],t=arguments[1]):typeof arguments[0]==`string`?e=arguments[0]:t=arguments[0],t||={},t.npmrc=t.npmrc||hg()(`npm`,{registry:`https://registry.npmjs.org/`}),e||=t.npmrc.registry,l(e,t)||u(t.npmrc)};function l(e,t){for(var r=n.parse(e,!1,!0),i;i!==`/`&&r.pathname!==i;){i=r.pathname||`/`;var a=`//`+r.host+i.replace(/\/$/,``),o=f(a,t.npmrc);if(o)return o;if(!t.recursive)return/\/$/.test(e)?void 0:l(n.resolve(e,`.`),t);r.pathname=n.resolve(d(i),`..`)||`/`}}function u(e){if(e._auth)return{token:e._auth,type:`Basic`}}function d(e){return e[e.length-1]===`/`?e:e+`/`}function f(e,t){var n=p(t[e+o]||t[e+`/`+o]);if(n)return n;var r=t[e+s]||t[e+`/`+s],i=t[e+c]||t[e+`/`+c],a=m(r,i);if(a)return a}function p(e){if(e){var t=e.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]});return{token:t,type:`Bearer`}}}function m(e,t){if(!(!e||!t)){var n=i(t.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]})),r=a(e+`:`+n);return{token:r,type:`Basic`,password:n,username:e}}}}),bg=e.__commonJSMin((exports,t)=>{let{URL:n}=require(`url`),{join:r}=require(`path`),i=require(`fs`),{promisify:a}=require(`util`),{tmpdir:o}=require(`os`),s=gg(),c=a(i.writeFile),l=a(i.mkdir),u=a(i.readFile),d=(e,t)=>e.localeCompare(t,`en-US`,{numeric:!0}),f=e=>encodeURIComponent(e).replace(/^%40/,`@`),p=async(e,t)=>{let n=o(),a=r(n,`update-check`);i.existsSync(a)||await l(a);let s=`${e.name}-${t}.json`;return e.scope&&(s=`${e.scope}-${s}`),r(a,s)},m=async(e,t,n)=>{if(i.existsSync(e)){let r=await u(e,`utf8`),{lastUpdate:i,latest:a}=JSON.parse(r),o=i+n;if(o>t)return{shouldCheck:!1,latest:a}}return{shouldCheck:!0,latest:null}},h=async(e,t,n)=>{let r=JSON.stringify({latest:t,lastUpdate:n});await c(e,r,`utf8`)},g=(e,t)=>new Promise((n,r)=>{let i={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`},timeout:2e3};t&&(i.headers.authorization=`${t.type} ${t.token}`);let{get:a}=e.protocol===`https:`?require(`https`):require(`http`);a(i,e=>{let{statusCode:t}=e;if(t!==200){let n=Error(`Request failed with code ${t}`);n.code=t,r(n),e.resume();return}let i=``;e.setEncoding(`utf8`),e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let e=JSON.parse(i);n(e)}catch(e){r(e)}})}).on(`error`,r).on(`timeout`,r)}),_=async({full:e,scope:t},r)=>{let i=s(t),a=new n(e,i),o=null;try{o=await g(a)}catch(e){if(e.code&&String(e.code).startsWith(4)){let e=yg(),t=e(i,{recursive:!0});o=await g(a,t)}else throw e}let c=o[`dist-tags`][r];if(!c)throw Error(`Distribution tag ${r} is not available`);return c},v={interval:36e5,distTag:`latest`},y=e=>{let t={full:f(e)};if(e.includes(`/`)){let n=e.split(`/`);t.scope=n[0],t.name=n[1]}else t.scope=null,t.name=e;return t};t.exports=async(e,t)=>{if(typeof e!=`object`)throw Error(`The first parameter should be your package.json file content`);let n=y(e.name),r=Date.now(),{distTag:i,interval:a}=Object.assign({},v,t),o=await p(n,i),s=null,c=!0;({shouldCheck:c,latest:s}=await m(o,r,a)),c&&(s=await _(n,i),await h(o,s,r));let l=d(e.version,s);return l===-1?{latest:s,fromCache:!c}:null}}),xg=e.__toESM(M()),Sg=e.__toESM(bg());function Cg(e){let{packageInfo:t,upgradeCommand:n}=e,r=(0,Sg.default)(t).catch(()=>null);return async function(e=0){try{let i=await r;if(i?.latest){La(),La(xg.default.yellow(xg.default.bold(`A new version of \`${t.name}\` is available!`)));let e=typeof n==`function`?await n():n;e&&La(`You can update by running: ${xg.default.cyan(e)}`),La()}process.exit(e)}catch(t){process.env.DEBUG&&za(`Update check failed:`,t),process.exit(e)}}}const wg=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Tg=typeof AbortController==`function`,Eg=Tg?AbortController:class{constructor(){this.signal=new kg}abort(e=Error(`This operation was aborted`)){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:`abort`,target:this.signal})}},Dg=typeof AbortSignal==`function`,Og=typeof Eg.AbortSignal==`function`,kg=Dg?AbortSignal:Og?Eg.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(t=>t(e),this))}onabort(){}addEventListener(e,t){e===`abort`&&this._listeners.push(t)}removeEventListener(e,t){e===`abort`&&(this._listeners=this._listeners.filter(e=>e!==t))}},Ag=new Set,jg=(e,t)=>{let n=`LRU_CACHE_OPTION_${e}`;Fg(n)&&Ig(n,`${e} option`,`options.${t}`,Vg)},Mg=(e,t)=>{let n=`LRU_CACHE_METHOD_${e}`;if(Fg(n)){let{prototype:r}=Vg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Ig(n,`${e} method`,`cache.${t}()`,i)}},Ng=(e,t)=>{let n=`LRU_CACHE_PROPERTY_${e}`;if(Fg(n)){let{prototype:r}=Vg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Ig(n,`${e} property`,`cache.${t}`,i)}},Pg=(...e)=>{typeof process==`object`&&process&&typeof process.emitWarning==`function`?process.emitWarning(...e):console.error(...e)},Fg=e=>!Ag.has(e),Ig=(e,t,n,r)=>{Ag.add(e);let i=`The ${t} is deprecated. Please use ${n} instead.`;Pg(i,`DeprecationWarning`,e,r)},Lg=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Rg=e=>Lg(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?zg:null:null;var zg=class extends Array{constructor(e){super(e),this.fill(0)}},Bg=class{constructor(e){if(e===0)return[];let t=Rg(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Vg=class e{constructor(t={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,fetchContext:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:x,ignoreFetchAbort:S}=t,{length:C,maxAge:w,stale:T}=t instanceof e?{}:t;if(n!==0&&!Lg(n))throw TypeError(`max option must be a nonnegative integer`);let E=n?Rg(n):Array;if(!E)throw Error(`invalid max value: `+n);if(this.max=n,this.maxSize=p,this.maxEntrySize=m||this.maxSize,this.sizeCalculation=h||C,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(this.fetchMethod=g||null,this.fetchMethod&&typeof this.fetchMethod!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw TypeError(`cannot set fetchContext without fetchMethod`);if(this.keyMap=new Map,this.keyList=Array(n).fill(null),this.valList=Array(n).fill(null),this.next=new E(n),this.prev=new E(n),this.head=0,this.tail=0,this.free=new Bg(n),this.initialFill=1,this.size=0,typeof l==`function`&&(this.dispose=l),typeof u==`function`?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.maxSize!==0&&!Lg(this.maxSize))throw TypeError(`maxSize must be a positive integer if specified`);if(!Lg(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.initializeSizeTracking()}if(this.allowStale=!!c||!!T,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Lg(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||w||0,this.ttl){if(!Lg(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let t=`LRU_CACHE_UNBOUNDED`;if(Fg(t)){Ag.add(t);let n=`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`;Pg(n,`UnboundedCacheWarning`,t,e)}}T&&jg(`stale`,`allowStale`),w&&jg(`maxAge`,`ttl`),C&&jg(`length`,`sizeCalculation`)}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new zg(this.max),this.starts=new zg(this.max),this.setItemTTL=(e,t,n=wg.now())=>{if(this.starts[e]=t===0?0:n,this.ttls[e]=t,t!==0&&this.ttlAutopurge){let n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=this.ttls[e]===0?0:wg.now()},this.statusTTL=(n,r)=>{n&&(n.ttl=this.ttls[r],n.start=this.starts[r],n.now=e||t(),n.remainingTTL=n.now+n.ttl-n.start)};let e=0,t=()=>{let t=wg.now();if(this.ttlResolution>0){e=t;let n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{let r=this.keyMap.get(n);return r===void 0?0:this.ttls[r]===0||this.starts[r]===0?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}statusTTL(e,t){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new zg(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!Lg(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Lg(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.addItemSize=(e,t,n)=>{if(this.sizes[e]=t,this.maxSize){let t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e],n&&(n.entrySize=t,n.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`)}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.head));)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.tail));)t=this.next[t]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,t){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;if(e(i,this.keyList[n],this))return this.get(this.keyList[n],t)}}forEach(e,t=this){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}rforEach(e,t=this){for(let n of this.rindexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}get prune(){return Mg(`prune`,`purgeStale`),this.purgeStale}purgeStale(){let e=!1;for(let t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){let e=[];for(let t of this.indexes({allowStale:!0})){let n=this.keyList[t],r=this.valList[t],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;let a={value:i};if(this.ttls){a.ttl=this.ttls[t];let e=wg.now()-this.starts[t];a.start=Math.floor(Date.now()-e)}this.sizes&&(a.size=this.sizes[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=wg.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:s=this.noUpdateTTL,status:c}={}){if(a=this.requireSize(e,t,a,o),this.maxEntrySize&&a>this.maxEntrySize)return c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=t,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,a,c),c&&(c.set=`add`),s=!1;else{this.moveToTail(l);let n=this.valList[l];if(t!==n){if(this.isBackgroundFetch(n)?n.__abortController.abort(Error(`replaced`)):i||(this.dispose(n,e,`set`),this.disposeAfter&&this.disposed.push([n,e,`set`])),this.removeItemSize(l),this.valList[l]=t,this.addItemSize(l,a,c),c){c.set=`replace`;let e=n&&this.isBackgroundFetch(n)?n.__staleWhileFetching:n;e!==void 0&&(c.oldValue=e)}}else c&&(c.set=`update`)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),s||this.setItemTTL(l,n,r),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length===0?this.initialFill++:this.free.pop()}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort(Error(`evicted`)):(this.dispose(r,n,`evict`),this.disposeAfter&&this.disposed.push([r,n,`evict`])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas,status:n}={}){let r=this.keyMap.get(e);if(r!==void 0)if(this.isStale(r))n&&(n.has=`stale`,this.statusTTL(n,r));else return t&&this.updateItemAge(r),n&&(n.has=`hit`),this.statusTTL(n,r),!0;else n&&(n.has=`miss`);return!1}peek(e,{allowStale:t=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(t||!this.isStale(n))){let e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){let i=t===void 0?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;let a=new Eg;n.signal&&n.signal.addEventListener(`abort`,()=>a.abort(n.signal.reason));let o={signal:a.signal,options:n,context:r},s=(r,i=!1)=>{let{aborted:s}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;return n.status&&(s&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!i?l(a.signal.reason):(this.valList[t]===d&&(r===void 0?d.__staleWhileFetching?this.valList[t]=d.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,o.options))),r)},c=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)),l=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection;if(this.valList[t]===d){let n=!c||d.__staleWhileFetching===void 0;n?this.delete(e):o||(this.valList[t]=d.__staleWhileFetching)}if(s)return n.status&&d.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw r},u=(t,r)=>{this.fetchMethod(e,i,o).then(e=>t(e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(),n.allowStaleOnFetchAbort&&(t=e=>s(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(u).then(s,c);return d.__abortController=a,d.__staleWhileFetching=i,d.__returned=null,t===void 0?(this.set(e,d,{...o.options,status:void 0}),t=this.keyMap.get(e)):this.valList[t]=d,d}isBackgroundFetch(e){return e&&typeof e==`object`&&typeof e.then==`function`&&Object.prototype.hasOwnProperty.call(e,`__staleWhileFetching`)&&Object.prototype.hasOwnProperty.call(e,`__returned`)&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,fetchContext:p=this.fetchContext,forceRefresh:m=!1,status:h,signal:g}={}){if(!this.fetchMethod)return h&&(h.fetch=`get`),this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:h});let _={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:a,size:o,sizeCalculation:s,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:h,signal:g},v=this.keyMap.get(e);if(v===void 0){h&&(h.fetch=`miss`);let t=this.backgroundFetch(e,v,_,p);return t.__returned=t}else{let r=this.valList[v];if(this.isBackgroundFetch(r)){let e=t&&r.__staleWhileFetching!==void 0;return h&&(h.fetch=`inflight`,e&&(h.returnedStale=!0)),e?r.__staleWhileFetching:r.__returned=r}let i=this.isStale(v);if(!m&&!i)return h&&(h.fetch=`hit`),this.moveToTail(v),n&&this.updateItemAge(v),this.statusTTL(h,v),r;let a=this.backgroundFetch(e,v,_,p),o=a.__staleWhileFetching!==void 0,s=o&&t;return h&&(h.fetch=o&&i?`stale`:`refresh`,s&&i&&(h.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:i}={}){let a=this.keyMap.get(e);if(a!==void 0){let o=this.valList[a],s=this.isBackgroundFetch(o);return this.statusTTL(i,a),this.isStale(a)?(i&&(i.get=`stale`),s?(i&&(i.returnedStale=t&&o.__staleWhileFetching!==void 0),t?o.__staleWhileFetching:void 0):(r||this.delete(e),i&&(i.returnedStale=t),t?o:void 0)):(i&&(i.get=`hit`),s?o.__staleWhileFetching:(this.moveToTail(a),n&&this.updateItemAge(a),o))}else i&&(i.get=`miss`)}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Mg(`del`,`delete`),this.delete}delete(e){let t=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(t=!0,this.size===1)this.clear();else{this.removeItemSize(n);let t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort(Error(`deleted`)):(this.dispose(t,e,`delete`),this.disposeAfter&&this.disposed.push([t,e,`delete`])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(let e of this.rindexes({allowStale:!0})){let t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort(Error(`deleted`));else{let n=this.keyList[e];this.dispose(t,n,`delete`),this.disposeAfter&&this.disposed.push([t,n,`delete`])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Mg(`reset`,`clear`),this.clear}get length(){return Ng(`length`,`size`),this.size}static get AbortController(){return Eg}static get AbortSignal(){return kg}},Hg=Vg,Ug={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Wg(e){try{return new URL(e)}catch{return null}}function Gg(e){var t=(typeof e==`string`?Wg(e):e)||{},n=t.protocol,r=t.host,i=t.port;if(typeof r!=`string`||!r||typeof n!=`string`||(n=n.split(`:`,1)[0],r=r.replace(/:\d*$/,``),i=parseInt(i)||Ug[n]||0,!Kg(r,i)))return``;var a=qg(n+`_proxy`)||qg(`all_proxy`);return a&&a.indexOf(`://`)===-1&&(a=n+`://`+a),a}function Kg(e,t){var n=qg(`no_proxy`).toLowerCase();return n?n===`*`?!1:n.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,a=r?parseInt(r[2]):0;return a&&a!==t?!0:/^[.*]/.test(i)?(i.charAt(0)===`*`&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function qg(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||``}var Jg=e.__toESM(e.require_src(),1);const Yg=(0,Jg.default)(`proxy-agent`),Xg={http:async()=>(await Promise.resolve().then(function(){return require(`./dist-P1p1wUPd.js`)})).HttpProxyAgent,https:async()=>(await Promise.resolve().then(function(){return require(`./dist-CqU63zlG.js`)})).HttpsProxyAgent,socks:async()=>(await Promise.resolve().then(function(){return require(`./dist-TKIODOC0.js`)})).SocksProxyAgent,pac:async()=>(await Promise.resolve().then(function(){return require(`./dist-nw78g_9w.js`)})).PacProxyAgent},Zg={http:[Xg.http,Xg.https],https:[Xg.http,Xg.https],socks:[Xg.socks,Xg.socks],socks4:[Xg.socks,Xg.socks],socks4a:[Xg.socks,Xg.socks],socks5:[Xg.socks,Xg.socks],socks5h:[Xg.socks,Xg.socks],"pac+data":[Xg.pac,Xg.pac],"pac+file":[Xg.pac,Xg.pac],"pac+ftp":[Xg.pac,Xg.pac],"pac+http":[Xg.pac,Xg.pac],"pac+https":[Xg.pac,Xg.pac]};function Qg(e){return Object.keys(Zg).includes(e)}var $g=class extends e.Agent{constructor(e){super(e),this.cache=new Hg({max:20,dispose:e=>e.destroy()}),Yg(`Creating new ProxyAgent instance: %o`,e),this.connectOpts=e,this.httpAgent=e?.httpAgent||new T.Agent(e),this.httpsAgent=e?.httpsAgent||new w.Agent(e),this.getProxyForUrl=e?.getProxyForUrl||Gg}async connect(e,t){let{secureEndpoint:n}=t,r=e.getHeader(`upgrade`)===`websocket`,i=n?r?`wss:`:`https:`:r?`ws:`:`http:`,a=e.getHeader(`host`),o=new C.URL(e.path,`${i}//${a}`).href,s=await this.getProxyForUrl(o,e);if(!s)return Yg(`Proxy not enabled for URL: %o`,o),n?this.httpsAgent:this.httpAgent;Yg(`Request URL: %o`,o),Yg(`Proxy URL: %o`,s);let c=`${i}+${s}`,l=this.cache.get(c);if(l)Yg(`Cache hit for proxy URL: %o`,s);else{let e=new C.URL(s),t=e.protocol.replace(`:`,``);if(!Qg(t))throw Error(`Unsupported protocol for proxy URL: ${s}`);let i=await Zg[t][n||r?1:0]();l=new i(s,this.connectOpts),this.cache.set(c,l)}return l}destroy(){for(let e of this.cache.values())e.destroy();super.destroy()}},e_=`@turbo/gen`,t_=`2.10.11-canary.3`,n_=`Extend a Turborepo`,r_=`https://turborepo.dev`,i_={url:`https://github.com/vercel/turborepo/issues`},a_=`MIT`,o_={type:`git`,url:`git+https://github.com/vercel/turborepo.git`,directory:`packages/turbo-gen`},s_=`dist/cli.js`,c_=[`dist`],l_=`dist/types.d.ts`,u_={access:`public`},d_={"@inquirer/prompts":`^7.10.1`,esbuild:`^0.28.1`},f_={"@arethetypeswrong/cli":`0.18.2`,"@jest/globals":`30.3.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/fs-extra":`9.0.13`,"@types/node":`18.17.4`,"@types/validate-npm-package-name":`4.0.0`,"brace-expansion":`5.0.9`,commander:`10.0.0`,"fs-extra":`10.1.0`,handlebars:`4.7.9`,jest:`30.3.0`,minimatch:`9.0.7`,"node-plop":`0.32.3`,picocolors:`1.0.1`,"proxy-agent":`8.0.2`,tsdown:`0.12.0`,typescript:`npm:@typescript/typescript6@^6.0.2`,"typescript-7":`npm:typescript@7.0.2`,"update-check":`1.5.4`,"validate-npm-package-name":`5.0.0`},p_={name:e_,version:t_,description:n_,homepage:r_,bugs:i_,license:a_,repository:o_,bin:s_,files:c_,types:l_,publishConfig:u_,dependencies:d_,devDependencies:f_},m_=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){if(t){let n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=n[r];e[i]=t[i]}}return e}function o(e,t){let n=``;for(let r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),h_=e.__commonJSMin((exports,t)=>{function n(e,t){let n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
122
+ `)l=!1,d+=f(e,u,p),u=p;else if(!l&&o+s===`/*`){d+=e.slice(u,p),u=p,l=r,p++;continue}else if(l===r&&o+s===`*/`){p++,l=!1,d+=f(e,u,p+1),u=p+1;continue}}}return d+(l?f(e.substr(u)):e.substr(u))}}),fg=e.__commonJSMin(exports=>{var t=require(`fs`),n=ug(),r=require(`path`),i=dg(),a=exports.parse=function(e){return/^\s*{/.test(e)?JSON.parse(i(e)):n.parse(e)},o=exports.file=function(){var e=[].slice.call(arguments).filter(function(e){return e!=null});for(var n in e)if(typeof e[n]!=`string`)return;var i=r.join.apply(null,e),a;try{return t.readFileSync(i,`utf-8`)}catch{return}},s=exports.json=function(){var e=o.apply(null,arguments);return e?a(e):null},c=exports.env=function(e,t){t||=process.env;var n={},r=e.length;for(var i in t)if(i.toLowerCase().indexOf(e.toLowerCase())===0){for(var a=i.substring(r).split(`__`),o;(o=a.indexOf(``))>-1;)a.splice(o,1);var s=n;a.forEach(function(e,n){!e||typeof s!=`object`||(n===a.length-1&&(s[e]=t[i]),s[e]===void 0&&(s[e]={}),s=s[e])})}return n},l=exports.find=function(){var e=r.join.apply(null,[].slice.call(arguments));function n(e,i){var a=r.join(e,i);try{return t.statSync(a),a}catch{if(r.dirname(e)!==e)return n(r.dirname(e),i)}}return n(process.cwd(),e)}}),pg=e.__commonJSMin((exports,t)=>{function n(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function r(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}else if(e instanceof Date)return new Date(e.getTime());else if(e instanceof RegExp)return new RegExp(e);else throw Error(`Unexpected situation`)}function i(e){var t=[];return e.forEach(function(e,a){typeof e==`object`&&e?Array.isArray(e)?t[a]=i(e):n(e)?t[a]=r(e):t[a]=o({},e):t[a]=e}),t}function a(e,t){return t===`__proto__`?void 0:e[t]}var o=t.exports=function(){if(arguments.length<1||typeof arguments[0]!=`object`)return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],t=Array.prototype.slice.call(arguments,1),s,c,l;return t.forEach(function(t){typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).forEach(function(l){if(c=a(e,l),s=a(t,l),s!==e)if(typeof s!=`object`||!s){e[l]=s;return}else if(Array.isArray(s)){e[l]=i(s);return}else if(n(s)){e[l]=r(s);return}else if(typeof c!=`object`||!c||Array.isArray(c)){e[l]=o({},s);return}else{e[l]=o(c,s);return}})}),e}}),mg=e.__commonJSMin((exports,t)=>{function n(e,t){var n=e;t.slice(0,-1).forEach(function(e){n=n[e]||{}});var r=t[t.length-1];return r in n}function r(e){return typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function i(e,t){return t===`constructor`&&typeof e[t]==`function`||t===`__proto__`}t.exports=function(e,t){t||={};var a={bools:{},strings:{},unknownFn:null};typeof t.unknown==`function`&&(a.unknownFn=t.unknown),typeof t.boolean==`boolean`&&t.boolean?a.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(e){a.bools[e]=!0});var o={};function s(e){return o[e].some(function(e){return a.bools[e]})}Object.keys(t.alias||{}).forEach(function(e){o[e]=[].concat(t.alias[e]),o[e].forEach(function(t){o[t]=[e].concat(o[e].filter(function(e){return t!==e}))})}),[].concat(t.string).filter(Boolean).forEach(function(e){a.strings[e]=!0,o[e]&&[].concat(o[e]).forEach(function(e){a.strings[e]=!0})});var c=t.default||{},l={_:[]};function u(e,t){return a.allBools&&/^--[^=]+$/.test(t)||a.strings[e]||a.bools[e]||o[e]}function d(e,t,n){for(var r=e,o=0;o<t.length-1;o++){var s=t[o];if(i(r,s))return;r[s]===void 0&&(r[s]={}),(r[s]===Object.prototype||r[s]===Number.prototype||r[s]===String.prototype)&&(r[s]={}),r[s]===Array.prototype&&(r[s]=[]),r=r[s]}var c=t[t.length-1];i(r,c)||((r===Object.prototype||r===Number.prototype||r===String.prototype)&&(r={}),r===Array.prototype&&(r=[]),r[c]===void 0||a.bools[c]||typeof r[c]==`boolean`?r[c]=n:Array.isArray(r[c])?r[c].push(n):r[c]=[r[c],n])}function f(e,t,n){if(!(n&&a.unknownFn&&!u(e,n)&&a.unknownFn(n)===!1)){var i=!a.strings[e]&&r(t)?Number(t):t;d(l,e.split(`.`),i),(o[e]||[]).forEach(function(e){d(l,e.split(`.`),i)})}}Object.keys(a.bools).forEach(function(e){f(e,c[e]===void 0?!1:c[e])});var p=[];e.indexOf(`--`)!==-1&&(p=e.slice(e.indexOf(`--`)+1),e=e.slice(0,e.indexOf(`--`)));for(var m=0;m<e.length;m++){var h=e[m],g,_;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);g=v[1];var y=v[2];a.bools[g]&&(y=y!==`false`),f(g,y,h)}else if(/^--no-.+/.test(h))g=h.match(/^--no-(.+)/)[1],f(g,!1,h);else if(/^--.+/.test(h))g=h.match(/^--(.+)/)[1],_=e[m+1],_!==void 0&&!/^(-|--)[^-]/.test(_)&&!a.bools[g]&&!a.allBools&&(!o[g]||!s(g))?(f(g,_,h),m+=1):/^(true|false)$/.test(_)?(f(g,_===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h);else if(/^-[^-]+/.test(h)){for(var b=h.slice(1,-1).split(``),x=!1,S=0;S<b.length;S++){if(_=h.slice(S+2),_===`-`){f(b[S],_,h);continue}if(/[A-Za-z]/.test(b[S])&&_[0]===`=`){f(b[S],_.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(b[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(_)){f(b[S],_,h),x=!0;break}if(b[S+1]&&b[S+1].match(/\W/)){f(b[S],h.slice(S+2),h),x=!0;break}else f(b[S],a.strings[b[S]]?``:!0,h)}g=h.slice(-1)[0],!x&&g!==`-`&&(e[m+1]&&!/^(-|--)[^-]/.test(e[m+1])&&!a.bools[g]&&(!o[g]||!s(g))?(f(g,e[m+1],h),m+=1):e[m+1]&&/^(true|false)$/.test(e[m+1])?(f(g,e[m+1]===`true`,h),m+=1):f(g,a.strings[g]?``:!0,h))}else if((!a.unknownFn||a.unknownFn(h)!==!1)&&l._.push(a.strings._||!r(h)?h:Number(h)),t.stopEarly){l._.push.apply(l._,e.slice(m+1));break}}return Object.keys(c).forEach(function(e){n(l,e.split(`.`))||(d(l,e.split(`.`),c[e]),(o[e]||[]).forEach(function(t){d(l,t.split(`.`),c[e])}))}),t[`--`]?l[`--`]=p.slice():p.forEach(function(e){l._.push(e)}),l}}),hg=e.__commonJSMin((exports,t)=>{var n=fg(),r=require(`path`).join,i=pg(),a=`/etc`,o=process.platform===`win32`,s=o?process.env.USERPROFILE:process.env.HOME;t.exports=function(e,t,c,l){if(typeof e!=`string`)throw Error(`rc(name): name *must* be string`);c||=mg()(process.argv.slice(2)),t=(typeof t==`string`?n.json(t):t)||{},l||=n.parse;var u=n.env(e+`_`),d=[t],f=[];function p(e){if(!(f.indexOf(e)>=0)){var t=n.file(e);t&&(d.push(l(t)),f.push(e))}}return o||[r(a,e,`config`),r(a,e+`rc`)].forEach(p),s&&[r(s,`.config`,e,`config`),r(s,`.config`,e),r(s,`.`+e,`config`),r(s,`.`+e+`rc`)].forEach(p),p(n.find(`.`+e+`rc`)),u.config&&p(u.config),c.config&&p(c.config),i.apply(null,d.concat([u,c,f.length?{configs:f,config:f[f.length-1]}:void 0]))}}),gg=e.__commonJSMin((exports,t)=>{t.exports=function(e){var t=hg()(`npm`,{registry:`https://registry.npmjs.org/`}),n=t[e+`:registry`]||t.registry;return n.slice(-1)===`/`?n:n+`/`}}),_g=e.__commonJSMin((exports,t)=>{var n=require(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,exports),exports.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}}),vg=e.__commonJSMin((exports,t)=>{let n=_g().Buffer;function r(e){return n.from(e,`base64`).toString(`utf8`)}function i(e){return n.from(e,`utf8`).toString(`base64`)}t.exports={decodeBase64:r,encodeBase64:i}}),yg=e.__commonJSMin((exports,t)=>{var n=require(`url`),r=vg(),i=r.decodeBase64,a=r.encodeBase64,o=`:_authToken`,s=`:username`,c=`:_password`;t.exports=function(){var e,t;return arguments.length>=2?(e=arguments[0],t=arguments[1]):typeof arguments[0]==`string`?e=arguments[0]:t=arguments[0],t||={},t.npmrc=t.npmrc||hg()(`npm`,{registry:`https://registry.npmjs.org/`}),e||=t.npmrc.registry,l(e,t)||u(t.npmrc)};function l(e,t){for(var r=n.parse(e,!1,!0),i;i!==`/`&&r.pathname!==i;){i=r.pathname||`/`;var a=`//`+r.host+i.replace(/\/$/,``),o=f(a,t.npmrc);if(o)return o;if(!t.recursive)return/\/$/.test(e)?void 0:l(n.resolve(e,`.`),t);r.pathname=n.resolve(d(i),`..`)||`/`}}function u(e){if(e._auth)return{token:e._auth,type:`Basic`}}function d(e){return e[e.length-1]===`/`?e:e+`/`}function f(e,t){var n=p(t[e+o]||t[e+`/`+o]);if(n)return n;var r=t[e+s]||t[e+`/`+s],i=t[e+c]||t[e+`/`+c],a=m(r,i);if(a)return a}function p(e){if(e){var t=e.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]});return{token:t,type:`Bearer`}}}function m(e,t){if(!(!e||!t)){var n=i(t.replace(/^\$\{?([^}]*)\}?$/,function(e,t){return process.env[t]})),r=a(e+`:`+n);return{token:r,type:`Basic`,password:n,username:e}}}}),bg=e.__commonJSMin((exports,t)=>{let{URL:n}=require(`url`),{join:r}=require(`path`),i=require(`fs`),{promisify:a}=require(`util`),{tmpdir:o}=require(`os`),s=gg(),c=a(i.writeFile),l=a(i.mkdir),u=a(i.readFile),d=(e,t)=>e.localeCompare(t,`en-US`,{numeric:!0}),f=e=>encodeURIComponent(e).replace(/^%40/,`@`),p=async(e,t)=>{let n=o(),a=r(n,`update-check`);i.existsSync(a)||await l(a);let s=`${e.name}-${t}.json`;return e.scope&&(s=`${e.scope}-${s}`),r(a,s)},m=async(e,t,n)=>{if(i.existsSync(e)){let r=await u(e,`utf8`),{lastUpdate:i,latest:a}=JSON.parse(r),o=i+n;if(o>t)return{shouldCheck:!1,latest:a}}return{shouldCheck:!0,latest:null}},h=async(e,t,n)=>{let r=JSON.stringify({latest:t,lastUpdate:n});await c(e,r,`utf8`)},g=(e,t)=>new Promise((n,r)=>{let i={host:e.hostname,path:e.pathname,port:e.port,headers:{accept:`application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`},timeout:2e3};t&&(i.headers.authorization=`${t.type} ${t.token}`);let{get:a}=e.protocol===`https:`?require(`https`):require(`http`);a(i,e=>{let{statusCode:t}=e;if(t!==200){let n=Error(`Request failed with code ${t}`);n.code=t,r(n),e.resume();return}let i=``;e.setEncoding(`utf8`),e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let e=JSON.parse(i);n(e)}catch(e){r(e)}})}).on(`error`,r).on(`timeout`,r)}),_=async({full:e,scope:t},r)=>{let i=s(t),a=new n(e,i),o=null;try{o=await g(a)}catch(e){if(e.code&&String(e.code).startsWith(4)){let e=yg(),t=e(i,{recursive:!0});o=await g(a,t)}else throw e}let c=o[`dist-tags`][r];if(!c)throw Error(`Distribution tag ${r} is not available`);return c},v={interval:36e5,distTag:`latest`},y=e=>{let t={full:f(e)};if(e.includes(`/`)){let n=e.split(`/`);t.scope=n[0],t.name=n[1]}else t.scope=null,t.name=e;return t};t.exports=async(e,t)=>{if(typeof e!=`object`)throw Error(`The first parameter should be your package.json file content`);let n=y(e.name),r=Date.now(),{distTag:i,interval:a}=Object.assign({},v,t),o=await p(n,i),s=null,c=!0;({shouldCheck:c,latest:s}=await m(o,r,a)),c&&(s=await _(n,i),await h(o,s,r));let l=d(e.version,s);return l===-1?{latest:s,fromCache:!c}:null}}),xg=e.__toESM(M()),Sg=e.__toESM(bg());function Cg(e){let{packageInfo:t,upgradeCommand:n}=e,r=(0,Sg.default)(t).catch(()=>null);return async function(e=0){try{let i=await r;if(i?.latest){La(),La(xg.default.yellow(xg.default.bold(`A new version of \`${t.name}\` is available!`)));let e=typeof n==`function`?await n():n;e&&La(`You can update by running: ${xg.default.cyan(e)}`),La()}process.exit(e)}catch(t){process.env.DEBUG&&za(`Update check failed:`,t),process.exit(e)}}}const wg=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Tg=typeof AbortController==`function`,Eg=Tg?AbortController:class{constructor(){this.signal=new kg}abort(e=Error(`This operation was aborted`)){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:`abort`,target:this.signal})}},Dg=typeof AbortSignal==`function`,Og=typeof Eg.AbortSignal==`function`,kg=Dg?AbortSignal:Og?Eg.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(t=>t(e),this))}onabort(){}addEventListener(e,t){e===`abort`&&this._listeners.push(t)}removeEventListener(e,t){e===`abort`&&(this._listeners=this._listeners.filter(e=>e!==t))}},Ag=new Set,jg=(e,t)=>{let n=`LRU_CACHE_OPTION_${e}`;Fg(n)&&Ig(n,`${e} option`,`options.${t}`,Vg)},Mg=(e,t)=>{let n=`LRU_CACHE_METHOD_${e}`;if(Fg(n)){let{prototype:r}=Vg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Ig(n,`${e} method`,`cache.${t}()`,i)}},Ng=(e,t)=>{let n=`LRU_CACHE_PROPERTY_${e}`;if(Fg(n)){let{prototype:r}=Vg,{get:i}=Object.getOwnPropertyDescriptor(r,e);Ig(n,`${e} property`,`cache.${t}`,i)}},Pg=(...e)=>{typeof process==`object`&&process&&typeof process.emitWarning==`function`?process.emitWarning(...e):console.error(...e)},Fg=e=>!Ag.has(e),Ig=(e,t,n,r)=>{Ag.add(e);let i=`The ${t} is deprecated. Please use ${n} instead.`;Pg(i,`DeprecationWarning`,e,r)},Lg=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Rg=e=>Lg(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?zg:null:null;var zg=class extends Array{constructor(e){super(e),this.fill(0)}},Bg=class{constructor(e){if(e===0)return[];let t=Rg(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Vg=class e{constructor(t={}){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:h,fetchMethod:g,fetchContext:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:x,ignoreFetchAbort:S}=t,{length:C,maxAge:w,stale:T}=t instanceof e?{}:t;if(n!==0&&!Lg(n))throw TypeError(`max option must be a nonnegative integer`);let E=n?Rg(n):Array;if(!E)throw Error(`invalid max value: `+n);if(this.max=n,this.maxSize=p,this.maxEntrySize=m||this.maxSize,this.sizeCalculation=h||C,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(this.fetchMethod=g||null,this.fetchMethod&&typeof this.fetchMethod!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.fetchContext=_,!this.fetchMethod&&_!==void 0)throw TypeError(`cannot set fetchContext without fetchMethod`);if(this.keyMap=new Map,this.keyList=Array(n).fill(null),this.valList=Array(n).fill(null),this.next=new E(n),this.prev=new E(n),this.head=0,this.tail=0,this.free=new Bg(n),this.initialFill=1,this.size=0,typeof l==`function`&&(this.dispose=l),typeof u==`function`?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!S,this.maxEntrySize!==0){if(this.maxSize!==0&&!Lg(this.maxSize))throw TypeError(`maxSize must be a positive integer if specified`);if(!Lg(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.initializeSizeTracking()}if(this.allowStale=!!c||!!T,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Lg(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||w||0,this.ttl){if(!Lg(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let t=`LRU_CACHE_UNBOUNDED`;if(Fg(t)){Ag.add(t);let n=`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`;Pg(n,`UnboundedCacheWarning`,t,e)}}T&&jg(`stale`,`allowStale`),w&&jg(`maxAge`,`ttl`),C&&jg(`length`,`sizeCalculation`)}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new zg(this.max),this.starts=new zg(this.max),this.setItemTTL=(e,t,n=wg.now())=>{if(this.starts[e]=t===0?0:n,this.ttls[e]=t,t!==0&&this.ttlAutopurge){let n=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);n.unref&&n.unref()}},this.updateItemAge=e=>{this.starts[e]=this.ttls[e]===0?0:wg.now()},this.statusTTL=(n,r)=>{n&&(n.ttl=this.ttls[r],n.start=this.starts[r],n.now=e||t(),n.remainingTTL=n.now+n.ttl-n.start)};let e=0,t=()=>{let t=wg.now();if(this.ttlResolution>0){e=t;let n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=n=>{let r=this.keyMap.get(n);return r===void 0?0:this.ttls[r]===0||this.starts[r]===0?1/0:this.starts[r]+this.ttls[r]-(e||t())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||t())-this.starts[n]>this.ttls[n]}updateItemAge(e){}statusTTL(e,t){}setItemTTL(e,t,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new zg(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,n,r)=>{if(this.isBackgroundFetch(t))return 0;if(!Lg(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Lg(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.addItemSize=(e,t,n)=>{if(this.sizes[e]=t,this.maxSize){let t=this.maxSize-this.sizes[e];for(;this.calculatedSize>t;)this.evict(!0)}this.calculatedSize+=this.sizes[e],n&&(n.entrySize=t,n.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,n,r){if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`)}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.head));)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.tail));)t=this.next[t]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,t){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;if(e(i,this.keyList[n],this))return this.get(this.keyList[n],t)}}forEach(e,t=this){for(let n of this.indexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}rforEach(e,t=this){for(let n of this.rindexes()){let r=this.valList[n],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;e.call(t,i,this.keyList[n],this)}}get prune(){return Mg(`prune`,`purgeStale`),this.purgeStale}purgeStale(){let e=!1;for(let t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){let e=[];for(let t of this.indexes({allowStale:!0})){let n=this.keyList[t],r=this.valList[t],i=this.isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0)continue;let a={value:i};if(this.ttls){a.ttl=this.ttls[t];let e=wg.now()-this.starts[t];a.start=Math.floor(Date.now()-e)}this.sizes&&(a.size=this.sizes[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=wg.now()-e}this.set(t,n.value,n)}}dispose(e,t,n){}set(e,t,{ttl:n=this.ttl,start:r,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:s=this.noUpdateTTL,status:c}={}){if(a=this.requireSize(e,t,a,o),this.maxEntrySize&&a>this.maxEntrySize)return c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=t,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,a,c),c&&(c.set=`add`),s=!1;else{this.moveToTail(l);let n=this.valList[l];if(t!==n){if(this.isBackgroundFetch(n)?n.__abortController.abort(Error(`replaced`)):i||(this.dispose(n,e,`set`),this.disposeAfter&&this.disposed.push([n,e,`set`])),this.removeItemSize(l),this.valList[l]=t,this.addItemSize(l,a,c),c){c.set=`replace`;let e=n&&this.isBackgroundFetch(n)?n.__staleWhileFetching:n;e!==void 0&&(c.oldValue=e)}}else c&&(c.set=`update`)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),s||this.setItemTTL(l,n,r),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length===0?this.initialFill++:this.free.pop()}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let t=this.head,n=this.keyList[t],r=this.valList[t];return this.isBackgroundFetch(r)?r.__abortController.abort(Error(`evicted`)):(this.dispose(r,n,`evict`),this.disposeAfter&&this.disposed.push([r,n,`evict`])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(n),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas,status:n}={}){let r=this.keyMap.get(e);if(r!==void 0)if(this.isStale(r))n&&(n.has=`stale`,this.statusTTL(n,r));else return t&&this.updateItemAge(r),n&&(n.has=`hit`),this.statusTTL(n,r),!0;else n&&(n.has=`miss`);return!1}peek(e,{allowStale:t=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(t||!this.isStale(n))){let e=this.valList[n];return this.isBackgroundFetch(e)?e.__staleWhileFetching:e}}backgroundFetch(e,t,n,r){let i=t===void 0?void 0:this.valList[t];if(this.isBackgroundFetch(i))return i;let a=new Eg;n.signal&&n.signal.addEventListener(`abort`,()=>a.abort(n.signal.reason));let o={signal:a.signal,options:n,context:r},s=(r,i=!1)=>{let{aborted:s}=a.signal,c=n.ignoreFetchAbort&&r!==void 0;return n.status&&(s&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!i?l(a.signal.reason):(this.valList[t]===d&&(r===void 0?d.__staleWhileFetching?this.valList[t]=d.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,o.options))),r)},c=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)),l=r=>{let{aborted:i}=a.signal,o=i&&n.allowStaleOnFetchAbort,s=o||n.allowStaleOnFetchRejection,c=s||n.noDeleteOnFetchRejection;if(this.valList[t]===d){let n=!c||d.__staleWhileFetching===void 0;n?this.delete(e):o||(this.valList[t]=d.__staleWhileFetching)}if(s)return n.status&&d.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),d.__staleWhileFetching;if(d.__returned===d)throw r},u=(t,r)=>{this.fetchMethod(e,i,o).then(e=>t(e),r),a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(),n.allowStaleOnFetchAbort&&(t=e=>s(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(u).then(s,c);return d.__abortController=a,d.__staleWhileFetching=i,d.__returned=null,t===void 0?(this.set(e,d,{...o.options,status:void 0}),t=this.keyMap.get(e)):this.valList[t]=d,d}isBackgroundFetch(e){return e&&typeof e==`object`&&typeof e.then==`function`&&Object.prototype.hasOwnProperty.call(e,`__staleWhileFetching`)&&Object.prototype.hasOwnProperty.call(e,`__returned`)&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,fetchContext:p=this.fetchContext,forceRefresh:m=!1,status:h,signal:g}={}){if(!this.fetchMethod)return h&&(h.fetch=`get`),this.get(e,{allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,status:h});let _={allowStale:t,updateAgeOnGet:n,noDeleteOnStaleGet:r,ttl:i,noDisposeOnSet:a,size:o,sizeCalculation:s,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:d,status:h,signal:g},v=this.keyMap.get(e);if(v===void 0){h&&(h.fetch=`miss`);let t=this.backgroundFetch(e,v,_,p);return t.__returned=t}else{let r=this.valList[v];if(this.isBackgroundFetch(r)){let e=t&&r.__staleWhileFetching!==void 0;return h&&(h.fetch=`inflight`,e&&(h.returnedStale=!0)),e?r.__staleWhileFetching:r.__returned=r}let i=this.isStale(v);if(!m&&!i)return h&&(h.fetch=`hit`),this.moveToTail(v),n&&this.updateItemAge(v),this.statusTTL(h,v),r;let a=this.backgroundFetch(e,v,_,p),o=a.__staleWhileFetching!==void 0,s=o&&t;return h&&(h.fetch=o&&i?`stale`:`refresh`,s&&i&&(h.returnedStale=!0)),s?a.__staleWhileFetching:a.__returned=a}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:i}={}){let a=this.keyMap.get(e);if(a!==void 0){let o=this.valList[a],s=this.isBackgroundFetch(o);return this.statusTTL(i,a),this.isStale(a)?(i&&(i.get=`stale`),s?(i&&(i.returnedStale=t&&o.__staleWhileFetching!==void 0),t?o.__staleWhileFetching:void 0):(r||this.delete(e),i&&(i.returnedStale=t),t?o:void 0)):(i&&(i.get=`hit`),s?o.__staleWhileFetching:(this.moveToTail(a),n&&this.updateItemAge(a),o))}else i&&(i.get=`miss`)}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return Mg(`del`,`delete`),this.delete}delete(e){let t=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(t=!0,this.size===1)this.clear();else{this.removeItemSize(n);let t=this.valList[n];this.isBackgroundFetch(t)?t.__abortController.abort(Error(`deleted`)):(this.dispose(t,e,`delete`),this.disposeAfter&&this.disposed.push([t,e,`delete`])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(let e of this.rindexes({allowStale:!0})){let t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort(Error(`deleted`));else{let n=this.keyList[e];this.dispose(t,n,`delete`),this.disposeAfter&&this.disposed.push([t,n,`delete`])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return Mg(`reset`,`clear`),this.clear}get length(){return Ng(`length`,`size`),this.size}static get AbortController(){return Eg}static get AbortSignal(){return kg}},Hg=Vg,Ug={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Wg(e){try{return new URL(e)}catch{return null}}function Gg(e){var t=(typeof e==`string`?Wg(e):e)||{},n=t.protocol,r=t.host,i=t.port;if(typeof r!=`string`||!r||typeof n!=`string`||(n=n.split(`:`,1)[0],r=r.replace(/:\d*$/,``),i=parseInt(i)||Ug[n]||0,!Kg(r,i)))return``;var a=qg(n+`_proxy`)||qg(`all_proxy`);return a&&a.indexOf(`://`)===-1&&(a=n+`://`+a),a}function Kg(e,t){var n=qg(`no_proxy`).toLowerCase();return n?n===`*`?!1:n.split(/[,\s]/).every(function(n){if(!n)return!0;var r=n.match(/^(.+):(\d+)$/),i=r?r[1]:n,a=r?parseInt(r[2]):0;return a&&a!==t?!0:/^[.*]/.test(i)?(i.charAt(0)===`*`&&(i=i.slice(1)),!e.endsWith(i)):e!==i}):!0}function qg(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||``}var Jg=e.__toESM(e.require_src(),1);const Yg=(0,Jg.default)(`proxy-agent`),Xg={http:async()=>(await Promise.resolve().then(function(){return require(`./dist-P1p1wUPd.js`)})).HttpProxyAgent,https:async()=>(await Promise.resolve().then(function(){return require(`./dist-CqU63zlG.js`)})).HttpsProxyAgent,socks:async()=>(await Promise.resolve().then(function(){return require(`./dist-TKIODOC0.js`)})).SocksProxyAgent,pac:async()=>(await Promise.resolve().then(function(){return require(`./dist-nw78g_9w.js`)})).PacProxyAgent},Zg={http:[Xg.http,Xg.https],https:[Xg.http,Xg.https],socks:[Xg.socks,Xg.socks],socks4:[Xg.socks,Xg.socks],socks4a:[Xg.socks,Xg.socks],socks5:[Xg.socks,Xg.socks],socks5h:[Xg.socks,Xg.socks],"pac+data":[Xg.pac,Xg.pac],"pac+file":[Xg.pac,Xg.pac],"pac+ftp":[Xg.pac,Xg.pac],"pac+http":[Xg.pac,Xg.pac],"pac+https":[Xg.pac,Xg.pac]};function Qg(e){return Object.keys(Zg).includes(e)}var $g=class extends e.Agent{constructor(e){super(e),this.cache=new Hg({max:20,dispose:e=>e.destroy()}),Yg(`Creating new ProxyAgent instance: %o`,e),this.connectOpts=e,this.httpAgent=e?.httpAgent||new T.Agent(e),this.httpsAgent=e?.httpsAgent||new w.Agent(e),this.getProxyForUrl=e?.getProxyForUrl||Gg}async connect(e,t){let{secureEndpoint:n}=t,r=e.getHeader(`upgrade`)===`websocket`,i=n?r?`wss:`:`https:`:r?`ws:`:`http:`,a=e.getHeader(`host`),o=new C.URL(e.path,`${i}//${a}`).href,s=await this.getProxyForUrl(o,e);if(!s)return Yg(`Proxy not enabled for URL: %o`,o),n?this.httpsAgent:this.httpAgent;Yg(`Request URL: %o`,o),Yg(`Proxy URL: %o`,s);let c=`${i}+${s}`,l=this.cache.get(c);if(l)Yg(`Cache hit for proxy URL: %o`,s);else{let e=new C.URL(s),t=e.protocol.replace(`:`,``);if(!Qg(t))throw Error(`Unsupported protocol for proxy URL: ${s}`);let i=await Zg[t][n||r?1:0]();l=new i(s,this.connectOpts),this.cache.set(c,l)}return l}destroy(){for(let e of this.cache.values())e.destroy();super.destroy()}},e_=`@turbo/gen`,t_=`2.10.11`,n_=`Extend a Turborepo`,r_=`https://turborepo.dev`,i_={url:`https://github.com/vercel/turborepo/issues`},a_=`MIT`,o_={type:`git`,url:`git+https://github.com/vercel/turborepo.git`,directory:`packages/turbo-gen`},s_=`dist/cli.js`,c_=[`dist`],l_=`dist/types.d.ts`,u_={access:`public`},d_={"@inquirer/prompts":`^7.10.1`,esbuild:`^0.28.1`},f_={"@arethetypeswrong/cli":`0.18.2`,"@jest/globals":`30.3.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/fs-extra":`9.0.13`,"@types/node":`18.17.4`,"@types/validate-npm-package-name":`4.0.0`,"brace-expansion":`5.0.9`,commander:`10.0.0`,"fs-extra":`10.1.0`,handlebars:`4.7.9`,jest:`30.3.0`,minimatch:`9.0.7`,"node-plop":`0.32.3`,picocolors:`1.0.1`,"proxy-agent":`8.0.2`,tsdown:`0.12.0`,typescript:`npm:@typescript/typescript6@^6.0.2`,"typescript-7":`npm:typescript@7.0.2`,"update-check":`1.5.4`,"validate-npm-package-name":`5.0.0`},p_={name:e_,version:t_,description:n_,homepage:r_,bugs:i_,license:a_,repository:o_,bin:s_,files:c_,types:l_,publishConfig:u_,dependencies:d_,devDependencies:f_},m_=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){if(t){let n=Object.keys(t);for(let r=0,i=n.length;r<i;r+=1){let i=n[r];e[i]=t[i]}}return e}function o(e,t){let n=``;for(let r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),h_=e.__commonJSMin((exports,t)=>{function n(e,t){let n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
123
123
 
124
124
  `+e.mark.snippet),r+` `+n):r}function r(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){return this.name+`: `+n(this,e)},t.exports=r}),g_=e.__commonJSMin((exports,t)=>{let n=m_();function r(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function i(e,t){return n.repeat(` `,t-e.length)+e}function a(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);let a=/\r?\n|\r|\0/g,o=[0],s=[],c,l=-1;for(;c=a.exec(e.buffer);)s.push(c.index),o.push(c.index+c[0].length),e.position<=c.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);let u=``,d=Math.min(e.line+t.linesAfter,s.length).toString().length,f=t.maxLength-(t.indent+d+3);for(let a=1;a<=t.linesBefore&&!(l-a<0);a++){let c=r(e.buffer,o[l-a],s[l-a],e.position-(o[l]-o[l-a]),f);u=n.repeat(` `,t.indent)+i((e.line-a+1).toString(),d)+` | `+c.str+`
125
125
  `+u}let p=r(e.buffer,o[l],s[l],e.position,f);u+=n.repeat(` `,t.indent)+i((e.line+1).toString(),d)+` | `+p.str+`
@@ -265,7 +265,7 @@ Expecting `+E.join(`, `)+`, got '`+(this.terminals_[g]||g)+`'`:`Parse error on l
265
265
  }`},blockValue:function(e){var t=this.aliasable(`container.hooks.blockHelperMissing`),n=[this.contextName(0)];this.setupHelperArgs(e,0,n);var r=this.popStack();n.splice(1,0,r),this.push(this.source.functionCall(t,`call`,n))},ambiguousBlockValue:function(){var e=this.aliasable(`container.hooks.blockHelperMissing`),t=[this.contextName(0)];this.setupHelperArgs(``,0,t,!0),this.flushInline();var n=this.topStack();t.splice(1,0,n),this.pushSource([`if (!`,this.lastHelper,`) { `,n,` = `,this.source.functionCall(e,`call`,t),`}`])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(e){return[` != null ? `,e,` : ""`]}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource([`if (`,e,` != null) { `,this.appendToBuffer(e,void 0,!0),` }`]),this.environment.isSimple&&this.pushSource([`else { `,this.appendToBuffer(`''`,void 0,!0),` }`])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable(`container.escapeExpression`),`(`,this.popStack(),`)`]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,n,r){var i=0;!r&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[i++])):this.pushContext(),this.resolvePath(`context`,e,i,t,n)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push([`blockParams[`,e[0],`][`,e[1],`]`]),this.resolvePath(`context`,t,1)},lookupData:function(e,t,n){e?this.pushStackLiteral(`container.data(data, `+e+`)`):this.pushStackLiteral(`data`),this.resolvePath(`data`,t,0,!0,n)},resolvePath:function(e,t,n,r,i){var a=this;if(this.options.strict||this.options.assumeObjects){this.push(d(this.options.strict&&i,this,t,n,e));return}for(var o=t.length,s=function(n){a.replaceStack(function(i){var o=a.nameLookup(i,t[n],e);return r?[` && `,o]:[` != null ? `,o,` : `,i]})},c=n;c<o;c++)s(c)},resolvePossibleLambda:function(){this.push([this.aliasable(`container.lambda`),`(`,this.popStack(),`, `,this.contextName(0),`)`])},pushStringParam:function(e,t){this.pushContext(),this.pushString(t),t!==`SubExpression`&&(typeof e==`string`?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push(`{}`),this.stringParams&&(this.push(`{}`),this.push(`{}`)),this.pushStackLiteral(e?`undefined`:`{}`)},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e==null?this.pushStackLiteral(null):this.pushStackLiteral(this.programExpression(e))},registerDecorator:function(e,t){var n=this.nameLookup(`decorators`,t,`decorator`),r=this.setupHelperArgs(t,e);this.decorators.push([`var decorator = `,n,`;`]),this.decorators.push([`if (typeof decorator !== "function") { throw new Error(`,this.quotedString(`Missing decorator: "`+t+`"`),`); }`]),this.decorators.push([`fn = `,this.decorators.functionCall(`decorator`,``,[`fn`,`props`,`container`,r]),` || fn;`])},invokeHelper:function(e,t,n){var r=this.popStack(),i=this.setupHelper(e,t),a=[];n&&a.push(i.name),a.push(r),this.options.strict||a.push(this.aliasable(`container.hooks.helperMissing`));var o=[`(`,this.itemsSeparatedBy(a,`||`),`)`],s=this.source.functionCall(o,`call`,i.callParams);this.push(s)},itemsSeparatedBy:function(e,t){var n=[];n.push(e[0]);for(var r=1;r<e.length;r++)n.push(t,e[r]);return n},invokeKnownHelper:function(e,t){var n=this.setupHelper(e,t);this.push(this.source.functionCall(n.name,`call`,n.callParams))},invokeAmbiguous:function(e,t){this.useRegister(`helper`);var n=this.popStack();this.emptyHash();var r=this.setupHelper(0,e,t),i=this.lastHelper=this.nameLookup(`helpers`,e,`helper`),a=[`(`,`(helper = `,i,` || `,n,`)`];this.options.strict||(a[0]=`(helper = `,a.push(` != null ? helper : `,this.aliasable(`container.hooks.helperMissing`))),this.push([`(`,a,r.paramsInit?[`),(`,r.paramsInit]:[],`),`,`(typeof helper === `,this.aliasable(`"function"`),` ? `,this.source.functionCall(`helper`,`call`,r.callParams),` : helper))`])},invokePartial:function(e,t,n){var r=[],i=this.setupParams(t,1,r);e&&(t=this.popStack(),delete i.name),n&&(i.indent=JSON.stringify(n)),i.helpers=`helpers`,i.partials=`partials`,i.decorators=`container.decorators`,e?r.unshift(t):r.unshift(this.nameLookup(`partials`,t,`partial`)),this.options.compat&&(i.depths=`depths`),i=this.objectLiteral(i),r.push(i),this.push(this.source.functionCall(`container.invokePartial`,``,r))},assignToHash:function(e){var t=this.popStack(),n=void 0,r=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(r=this.popStack(),n=this.popStack());var a=this.hash;n&&(a.contexts[e]=n),r&&(a.types[e]=r),i&&(a.ids[e]=i),a.values[e]=t},pushId:function(e,t,n){e===`BlockParam`?this.pushStackLiteral(`blockParams[`+t[0]+`].path[`+t[1]+`]`+(n?` + `+JSON.stringify(`.`+n):``)):e===`PathExpression`?this.pushString(t):e===`SubExpression`?this.pushStackLiteral(`true`):this.pushStackLiteral(`null`)},compiler:u,compileChildren:function(e,t){for(var n=e.children,r=void 0,i=void 0,a=0,o=n.length;a<o;a++){r=n[a],i=new this.compiler;var s=this.matchExistingProgram(r);if(s==null){var c=this.context.programs.push(``)-1;r.index=c,r.name=`program`+c,this.context.programs[c]=i.compile(r,t,this.context,!this.precompile),this.context.decorators[c]=i.decorators,this.context.environments[c]=r,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,r.useDepths=this.useDepths,r.useBlockParams=this.useBlockParams}else r.index=s.index,r.name=`program`+s.index,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams}},matchExistingProgram:function(e){for(var t=0,n=this.context.environments.length;t<n;t++){var r=this.context.environments[t];if(r&&r.equals(e))return r}},programExpression:function(e){var t=this.environment.children[e],n=[t.index,`data`,t.blockParams];return(this.useBlockParams||this.useDepths)&&n.push(`blockParams`),this.useDepths&&n.push(`depths`),`container.program(`+n.join(`, `)+`)`},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof l||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new l(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var t=[`(`],n=void 0,r=void 0,i=void 0;if(!this.isInline())throw new a.default(`replaceStack on non-inline`);var o=this.popStack(!0);if(o instanceof l)n=[o.value],t=[`(`,n],i=!0;else{r=!0;var s=this.incrStack();t=[`((`,this.push(s),` = `,o,`)`],n=this.topStack()}var c=e.call(this,n);i||this.popStack(),r&&this.stackSlot--,this.push(t.concat(c,`)`))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push(`stack`+this.stackSlot),this.topStackName()},topStackName:function(){return`stack`+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];if(r instanceof l)this.compileStack.push(r);else{var i=this.incrStack();this.pushSource([i,` = `,r,`;`]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var t=this.isInline(),n=(t?this.inlineStack:this.compileStack).pop();if(!e&&n instanceof l)return n.value;if(!t){if(!this.stackSlot)throw new a.default(`Invalid stack pop`);this.stackSlot--}return n},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,t=e[e.length-1];return t instanceof l?t.value:t},contextName:function(e){return this.useDepths&&e?`depths[`+e+`]`:`depth`+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var t=this.aliases[e];return t?(t.referenceCount++,t):(t=this.aliases[e]=this.source.wrap(e),t.aliasable=!0,t.referenceCount=1,t)},setupHelper:function(e,t,n){var r=[],i=this.setupHelperArgs(t,e,r,n),a=this.nameLookup(`helpers`,t,`helper`),o=this.aliasable(this.contextName(0)+` != null ? `+this.contextName(0)+` : (container.nullContext || {})`);return{params:r,paramsInit:i,name:a,callParams:[o].concat(r)}},setupParams:function(e,t,n){var r={},i=[],a=[],o=[],s=!n,c=void 0;s&&(n=[]),r.name=this.quotedString(e),r.hash=this.popStack(),this.trackIds&&(r.hashIds=this.popStack()),this.stringParams&&(r.hashTypes=this.popStack(),r.hashContexts=this.popStack());var l=this.popStack(),u=this.popStack();(u||l)&&(r.fn=u||`container.noop`,r.inverse=l||`container.noop`);for(var d=t;d--;)c=this.popStack(),n[d]=c,this.trackIds&&(o[d]=this.popStack()),this.stringParams&&(a[d]=this.popStack(),i[d]=this.popStack());return s&&(r.args=this.source.generateArray(n)),this.trackIds&&(r.ids=this.source.generateArray(o)),this.stringParams&&(r.types=this.source.generateArray(a),r.contexts=this.source.generateArray(i)),this.options.data&&(r.data=`data`),this.useBlockParams&&(r.blockParams=`blockParams`),r},setupHelperArgs:function(e,t,n,r){var i=this.setupParams(e,t,n);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),r?(this.useRegister(`options`),n.push(`options`),[`options=`,i]):n?(n.push(i),``):i}},function(){for(var e=`break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false`.split(` `),t=u.RESERVED_WORDS={},n=0,r=e.length;n<r;n++)t[e[n]]=!0}(),u.isValidJavaScriptVariableName=function(e){return!u.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)};function d(e,t,n,r,i){var a=t.popStack(),o=n.length;e&&o--;for(var s=r;s<o;s++)a=t.nameLookup(a,n[s],i);return e?[t.aliasable(`container.strict`),`(`,a,`, `,t.quotedString(n[o]),`, `,JSON.stringify(t.source.currentLocation),` )`]:a}exports.default=u,t.exports=exports.default}),qE=e.__commonJSMin((exports,t)=>{exports.__esModule=!0;function n(e){return e&&e.__esModule?e:{default:e}}var r=LE(),i=n(r),a=RE(),o=n(a),s=UE(),c=WE(),l=KE(),u=n(l),d=BE(),f=n(d),p=IE(),m=n(p),h=i.default.create;function g(){var e=h();return e.compile=function(t,n){return c.compile(t,n,e)},e.precompile=function(t,n){return c.precompile(t,n,e)},e.AST=o.default,e.Compiler=c.Compiler,e.JavaScriptCompiler=u.default,e.Parser=s.parser,e.parse=s.parse,e.parseWithoutProcessing=s.parseWithoutProcessing,e}var _=g();_.create=g,m.default(_),_.Visitor=f.default,_.default=_,exports.default=_,t.exports=exports.default}),JE=e.__commonJSMin(exports=>{exports.__esModule=!0,exports.print=i,exports.PrintVisitor=a;function t(e){return e&&e.__esModule?e:{default:e}}var n=BE(),r=t(n);function i(e){return new a().accept(e)}function a(){this.padding=0}a.prototype=new r.default,a.prototype.pad=function(e){for(var t=``,n=0,r=this.padding;n<r;n++)t+=` `;return t+=e+`
266
266
  `,t},a.prototype.Program=function(e){var t=``,n=e.body,r=void 0,i=void 0;if(e.blockParams){var a=`BLOCK PARAMS: [`;for(r=0,i=e.blockParams.length;r<i;r++)a+=` `+e.blockParams[r];a+=` ]`,t+=this.pad(a)}for(r=0,i=n.length;r<i;r++)t+=this.accept(n[r]);return this.padding--,t},a.prototype.MustacheStatement=function(e){return this.pad(`{{ `+this.SubExpression(e)+` }}`)},a.prototype.Decorator=function(e){return this.pad(`{{ DIRECTIVE `+this.SubExpression(e)+` }}`)},a.prototype.BlockStatement=a.prototype.DecoratorBlock=function(e){var t=``;return t+=this.pad((e.type===`DecoratorBlock`?`DIRECTIVE `:``)+`BLOCK:`),this.padding++,t+=this.pad(this.SubExpression(e)),e.program&&(t+=this.pad(`PROGRAM:`),this.padding++,t+=this.accept(e.program),this.padding--),e.inverse&&(e.program&&this.padding++,t+=this.pad(`{{^}}`),this.padding++,t+=this.accept(e.inverse),this.padding--,e.program&&this.padding--),this.padding--,t},a.prototype.PartialStatement=function(e){var t=`PARTIAL:`+e.name.original;return e.params[0]&&(t+=` `+this.accept(e.params[0])),e.hash&&(t+=` `+this.accept(e.hash)),this.pad(`{{> `+t+` }}`)},a.prototype.PartialBlockStatement=function(e){var t=`PARTIAL BLOCK:`+e.name.original;return e.params[0]&&(t+=` `+this.accept(e.params[0])),e.hash&&(t+=` `+this.accept(e.hash)),t+=` `+this.pad(`PROGRAM:`),this.padding++,t+=this.accept(e.program),this.padding--,this.pad(`{{> `+t+` }}`)},a.prototype.ContentStatement=function(e){return this.pad(`CONTENT[ '`+e.value+`' ]`)},a.prototype.CommentStatement=function(e){return this.pad(`{{! '`+e.value+`' }}`)},a.prototype.SubExpression=function(e){for(var t=e.params,n=[],r=void 0,i=0,a=t.length;i<a;i++)n.push(this.accept(t[i]));return t=`[`+n.join(`, `)+`]`,r=e.hash?` `+this.accept(e.hash):``,this.accept(e.path)+` `+t+r},a.prototype.PathExpression=function(e){var t=e.parts.join(`/`);return(e.data?`@`:``)+`PATH:`+t},a.prototype.StringLiteral=function(e){return`"`+e.value+`"`},a.prototype.NumberLiteral=function(e){return`NUMBER{`+e.value+`}`},a.prototype.BooleanLiteral=function(e){return`BOOLEAN{`+e.value+`}`},a.prototype.UndefinedLiteral=function(){return`UNDEFINED`},a.prototype.NullLiteral=function(){return`NULL`},a.prototype.Hash=function(e){for(var t=e.pairs,n=[],r=0,i=t.length;r<i;r++)n.push(this.accept(t[r]));return`HASH{`+n.join(`, `)+`}`},a.prototype.HashPair=function(e){return e.key+`=`+this.accept(e.value)}}),YE=e.__commonJSMin((exports,t)=>{var n=qE().default,r=JE();n.PrintVisitor=r.PrintVisitor,n.print=r.print,t.exports=n;function i(e,t){var r=require(`fs`),i=r.readFileSync(t,`utf8`);e.exports=n.compile(i)}typeof require<`u`&&require.extensions&&(require.extensions[`.handlebars`]=i,require.extensions[`.hbs`]=i)}),XE=e.__commonJSMin((exports,t)=>{t.exports=function(e,t,n,r,i){for(t=t.split?t.split(`.`):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}}),ZE=e.__commonJSMin((exports,t)=>{var n=require(`os`);t.exports=n.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform===`win32`?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform===`darwin`?e||(t?`/Users/`+t:null):process.platform===`linux`?e||(process.getuid()===0?`/root`:t?`/home/`+t:null):e||null}}),QE=e.__commonJSMin((exports,t)=>{t.exports=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var t=Error().stack;return Error.prepareStackTrace=e,t[2].getFileName()}}),$E=e.__commonJSMin((exports,t)=>{var n=process.platform===`win32`,r=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,i={};function a(e){return r.exec(e).slice(1)}i.parse=function(e){if(typeof e!=`string`)throw TypeError(`Parameter 'pathString' must be a string, not `+typeof e);var t=a(e);if(!t||t.length!==5)throw TypeError(`Invalid path '`+e+`'`);return{root:t[1],dir:t[0]===t[1]?t[0]:t[0].slice(0,-1),base:t[2],ext:t[4],name:t[3]}};var o=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,s={};function c(e){return o.exec(e).slice(1)}s.parse=function(e){if(typeof e!=`string`)throw TypeError(`Parameter 'pathString' must be a string, not `+typeof e);var t=c(e);if(!t||t.length!==5)throw TypeError(`Invalid path '`+e+`'`);return{root:t[1],dir:t[0].slice(0,-1),base:t[2],ext:t[4],name:t[3]}},n?t.exports=i.parse:t.exports=s.parse,t.exports.posix=s.parse,t.exports.win32=i.parse}),eD=e.__commonJSMin((exports,t)=>{var n=require(`path`),r=n.parse||$E(),i=/^([A-Za-z]:)/,a=/^\\\\/,o=function(e,t){var o=`/`;i.test(e)?o=``:a.test(e)&&(o=`\\\\`);for(var s=[e],c=r(e);c.dir!==s[s.length-1];)s.push(c.dir),c=r(c.dir);return s.reduce(function(e,r){return e.concat(t.map(function(e){return n.resolve(o,r,e)}))},[])};t.exports=function(e,t,n){var r=t&&t.moduleDirectory?[].concat(t.moduleDirectory):[`node_modules`];if(t&&typeof t.paths==`function`)return t.paths(n,e,function(){return o(e,r)},t);var i=o(e,r);return t&&t.paths?i.concat(t.paths):i}}),tD=e.__commonJSMin((exports,t)=>{t.exports=function(e,t){return t||{}}}),nD=e.__commonJSMin((exports,t)=>{var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}}),rD=e.__commonJSMin((exports,t)=>{var n=nD();t.exports=Function.prototype.bind||n}),iD=e.__commonJSMin((exports,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty,i=rD();t.exports=i.call(n,r)}),aD=e.__commonJSMin((exports,t)=>{t.exports={assert:!0,"node:assert":[`>= 14.18 && < 15`,`>= 16`],"assert/strict":`>= 15`,"node:assert/strict":`>= 16`,async_hooks:`>= 8`,"node:async_hooks":[`>= 14.18 && < 15`,`>= 16`],buffer_ieee754:`>= 0.5 && < 0.9.7`,buffer:!0,"node:buffer":[`>= 14.18 && < 15`,`>= 16`],child_process:!0,"node:child_process":[`>= 14.18 && < 15`,`>= 16`],cluster:`>= 0.5`,"node:cluster":[`>= 14.18 && < 15`,`>= 16`],console:!0,"node:console":[`>= 14.18 && < 15`,`>= 16`],constants:!0,"node:constants":[`>= 14.18 && < 15`,`>= 16`],crypto:!0,"node:crypto":[`>= 14.18 && < 15`,`>= 16`],_debug_agent:`>= 1 && < 8`,_debugger:`< 8`,dgram:!0,"node:dgram":[`>= 14.18 && < 15`,`>= 16`],diagnostics_channel:[`>= 14.17 && < 15`,`>= 15.1`],"node:diagnostics_channel":[`>= 14.18 && < 15`,`>= 16`],dns:!0,"node:dns":[`>= 14.18 && < 15`,`>= 16`],"dns/promises":`>= 15`,"node:dns/promises":`>= 16`,domain:`>= 0.7.12`,"node:domain":[`>= 14.18 && < 15`,`>= 16`],events:!0,"node:events":[`>= 14.18 && < 15`,`>= 16`],freelist:`< 6`,fs:!0,"node:fs":[`>= 14.18 && < 15`,`>= 16`],"fs/promises":[`>= 10 && < 10.1`,`>= 14`],"node:fs/promises":[`>= 14.18 && < 15`,`>= 16`],_http_agent:`>= 0.11.1`,"node:_http_agent":[`>= 14.18 && < 15`,`>= 16`],_http_client:`>= 0.11.1`,"node:_http_client":[`>= 14.18 && < 15`,`>= 16`],_http_common:`>= 0.11.1`,"node:_http_common":[`>= 14.18 && < 15`,`>= 16`],_http_incoming:`>= 0.11.1`,"node:_http_incoming":[`>= 14.18 && < 15`,`>= 16`],_http_outgoing:`>= 0.11.1`,"node:_http_outgoing":[`>= 14.18 && < 15`,`>= 16`],_http_server:`>= 0.11.1`,"node:_http_server":[`>= 14.18 && < 15`,`>= 16`],http:!0,"node:http":[`>= 14.18 && < 15`,`>= 16`],http2:`>= 8.8`,"node:http2":[`>= 14.18 && < 15`,`>= 16`],https:!0,"node:https":[`>= 14.18 && < 15`,`>= 16`],inspector:`>= 8`,"node:inspector":[`>= 14.18 && < 15`,`>= 16`],"inspector/promises":[`>= 19`],"node:inspector/promises":[`>= 19`],_linklist:`< 8`,module:!0,"node:module":[`>= 14.18 && < 15`,`>= 16`],net:!0,"node:net":[`>= 14.18 && < 15`,`>= 16`],"node-inspect/lib/_inspect":`>= 7.6 && < 12`,"node-inspect/lib/internal/inspect_client":`>= 7.6 && < 12`,"node-inspect/lib/internal/inspect_repl":`>= 7.6 && < 12`,os:!0,"node:os":[`>= 14.18 && < 15`,`>= 16`],path:!0,"node:path":[`>= 14.18 && < 15`,`>= 16`],"path/posix":`>= 15.3`,"node:path/posix":`>= 16`,"path/win32":`>= 15.3`,"node:path/win32":`>= 16`,perf_hooks:`>= 8.5`,"node:perf_hooks":[`>= 14.18 && < 15`,`>= 16`],process:`>= 1`,"node:process":[`>= 14.18 && < 15`,`>= 16`],punycode:`>= 0.5`,"node:punycode":[`>= 14.18 && < 15`,`>= 16`],querystring:!0,"node:querystring":[`>= 14.18 && < 15`,`>= 16`],readline:!0,"node:readline":[`>= 14.18 && < 15`,`>= 16`],"readline/promises":`>= 17`,"node:readline/promises":`>= 17`,repl:!0,"node:repl":[`>= 14.18 && < 15`,`>= 16`],"node:sea":[`>= 20.12 && < 21`,`>= 21.7`],smalloc:`>= 0.11.5 && < 3`,"node:sqlite":[`>= 22.13 && < 23`,`>= 23.4`],_stream_duplex:`>= 0.9.4`,"node:_stream_duplex":[`>= 14.18 && < 15`,`>= 16`],_stream_transform:`>= 0.9.4`,"node:_stream_transform":[`>= 14.18 && < 15`,`>= 16`],_stream_wrap:`>= 1.4.1`,"node:_stream_wrap":[`>= 14.18 && < 15`,`>= 16`],_stream_passthrough:`>= 0.9.4`,"node:_stream_passthrough":[`>= 14.18 && < 15`,`>= 16`],_stream_readable:`>= 0.9.4`,"node:_stream_readable":[`>= 14.18 && < 15`,`>= 16`],_stream_writable:`>= 0.9.4`,"node:_stream_writable":[`>= 14.18 && < 15`,`>= 16`],stream:!0,"node:stream":[`>= 14.18 && < 15`,`>= 16`],"stream/consumers":`>= 16.7`,"node:stream/consumers":`>= 16.7`,"stream/promises":`>= 15`,"node:stream/promises":`>= 16`,"stream/web":`>= 16.5`,"node:stream/web":`>= 16.5`,string_decoder:!0,"node:string_decoder":[`>= 14.18 && < 15`,`>= 16`],sys:[`>= 0.4 && < 0.7`,`>= 0.8`],"node:sys":[`>= 14.18 && < 15`,`>= 16`],"test/reporters":`>= 19.9 && < 20.2`,"node:test/reporters":[`>= 18.17 && < 19`,`>= 19.9`,`>= 20`],"test/mock_loader":`>= 22.3 && < 22.7`,"node:test/mock_loader":`>= 22.3 && < 22.7`,"node:test":[`>= 16.17 && < 17`,`>= 18`],timers:!0,"node:timers":[`>= 14.18 && < 15`,`>= 16`],"timers/promises":`>= 15`,"node:timers/promises":`>= 16`,_tls_common:`>= 0.11.13`,"node:_tls_common":[`>= 14.18 && < 15`,`>= 16`],_tls_legacy:`>= 0.11.3 && < 10`,_tls_wrap:`>= 0.11.3`,"node:_tls_wrap":[`>= 14.18 && < 15`,`>= 16`],tls:!0,"node:tls":[`>= 14.18 && < 15`,`>= 16`],trace_events:`>= 10`,"node:trace_events":[`>= 14.18 && < 15`,`>= 16`],tty:!0,"node:tty":[`>= 14.18 && < 15`,`>= 16`],url:!0,"node:url":[`>= 14.18 && < 15`,`>= 16`],util:!0,"node:util":[`>= 14.18 && < 15`,`>= 16`],"util/types":`>= 15.3`,"node:util/types":`>= 16`,"v8/tools/arguments":`>= 10 && < 12`,"v8/tools/codemap":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/consarray":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/csvparser":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/logreader":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/profile_view":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/splaytree":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],v8:`>= 1`,"node:v8":[`>= 14.18 && < 15`,`>= 16`],vm:!0,"node:vm":[`>= 14.18 && < 15`,`>= 16`],wasi:[`>= 13.4 && < 13.5`,`>= 18.17 && < 19`,`>= 20`],"node:wasi":[`>= 18.17 && < 19`,`>= 20`],worker_threads:`>= 11.7`,"node:worker_threads":[`>= 14.18 && < 15`,`>= 16`],zlib:`>= 0.5`,"node:zlib":[`>= 14.18 && < 15`,`>= 16`]}}),oD=e.__commonJSMin((exports,t)=>{var n=iD();function r(e,t){for(var n=e.split(`.`),r=t.split(` `),i=r.length>1?r[0]:`=`,a=(r.length>1?r[1]:r[0]).split(`.`),o=0;o<3;++o){var s=parseInt(n[o]||0,10),c=parseInt(a[o]||0,10);if(s!==c)return i===`<`?s<c:i===`>=`?s>=c:!1}return i===`>=`}function i(e,t){var n=t.split(/ ?&& ?/);if(n.length===0)return!1;for(var i=0;i<n.length;++i)if(!r(e,n[i]))return!1;return!0}function a(e,t){if(typeof t==`boolean`)return t;var n=e===void 0?process.versions&&process.versions.node:e;if(typeof n!=`string`)throw TypeError(e===void 0?`Unable to determine current node version`:`If provided, a valid node version is required`);if(t&&typeof t==`object`){for(var r=0;r<t.length;++r)if(i(n,t[r]))return!0;return!1}return i(n,t)}var o=aD();t.exports=function(e,t){return n(o,e)&&a(t,o[e])}}),sD=e.__commonJSMin((exports,t)=>{var n=require(`fs`),r=ZE(),i=require(`path`),a=QE(),o=eD(),s=tD(),c=oD(),l=process.platform!==`win32`&&n.realpath&&typeof n.realpath.native==`function`?n.realpath.native:n.realpath,u=/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/,d=/^\w:[/\\]*$/,f=/[/\\]node_modules[/\\]*$/,p=r(),m=function(){return[i.join(p,`.node_modules`),i.join(p,`.node_libraries`)]},h=function(e,t){n.stat(e,function(e,n){return e?e.code===`ENOENT`||e.code===`ENOTDIR`?t(null,!1):t(e):t(null,n.isFile()||n.isFIFO())})},g=function(e,t){n.stat(e,function(e,n){return e?e.code===`ENOENT`||e.code===`ENOTDIR`?t(null,!1):t(e):t(null,n.isDirectory())})},_=function(e,t){l(e,function(n,r){n&&n.code!==`ENOENT`?t(n):t(null,n?e:r)})},v=function(e,t,n,r){n&&n.preserveSymlinks===!1?e(t,r):r(null,t)},y=function(e,t,n){e(t,function(e,t){if(e)n(e);else try{var r=JSON.parse(t);n(null,r)}catch{n(null)}})},b=function(e,t,n){for(var r=o(t,n,e),a=0;a<r.length;a++)r[a]=i.join(r[a],e);return r};t.exports=function(e,t,r){var o=r,l=t;if(typeof t==`function`&&(o=l,l={}),typeof e!=`string`){var p=TypeError(`Path must be a string.`);return process.nextTick(function(){o(p)})}l=s(e,l);var x=l.isFile||h,S=l.isDirectory||g,C=l.readFile||n.readFile,w=l.realpath||_,T=l.readPackage||y;if(l.readFile&&l.readPackage){var E=TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){o(E)})}var D=l.packageIterator,O=l.extensions||[`.js`],k=l.includeCoreModules!==!1,A=l.basedir||i.dirname(a()),j=l.filename||A;l.paths=l.paths||m();var M=i.resolve(A);v(w,M,l,function(e,t){e?o(e):P(t)});var N;function P(t){if(u.test(e))N=i.resolve(t,e),(e===`.`||e===`..`||e.slice(-1)===`/`)&&(N+=`/`),e.slice(-1)===`/`&&N===t?R(N,l.package,F):I(N,l.package,F);else if(k&&c(e))return o(null,e);else B(e,t,function(t,n,r){if(t)o(t);else if(n)return v(w,n,l,function(e,t){e?o(e):o(null,t,r)});else{var i=Error(`Cannot find module '`+e+`' from '`+j+`'`);i.code=`MODULE_NOT_FOUND`,o(i)}})}function F(t,n,r){t?o(t):n?o(null,n,r):R(N,function(t,n,r){if(t)o(t);else if(n)v(w,n,l,function(e,t){e?o(e):o(null,t,r)});else{var i=Error(`Cannot find module '`+e+`' from '`+j+`'`);i.code=`MODULE_NOT_FOUND`,o(i)}})}function I(e,t,n){var r=t,a=n;typeof r==`function`&&(a=r,r=void 0);var o=[``].concat(O);s(o,e,r);function s(e,t,n){if(e.length===0)return a(null,void 0,n);var r=t+e[0],o=n;o?c(null,o):L(i.dirname(r),c);function c(n,c,d){if(o=c,n)return a(n);if(d&&o&&l.pathFilter){var f=i.relative(d,r),p=f.slice(0,f.length-e[0].length),m=l.pathFilter(o,t,p);if(m)return s([``].concat(O.slice()),i.resolve(d,m),o)}x(r,u)}function u(n,i){if(n)return a(n);if(i)return a(null,r,o);s(e.slice(1),t,o)}}}function L(e,t){if(e===``||e===`/`||process.platform===`win32`&&d.test(e)||f.test(e))return t(null);v(w,e,l,function(n,r){if(n)return L(i.dirname(e),t);var a=i.join(r,`package.json`);x(a,function(n,r){if(!r)return L(i.dirname(e),t);T(C,a,function(n,r){n&&t(n);var i=r;i&&l.packageFilter&&(i=l.packageFilter(i,a)),t(null,i,e)})})})}function R(e,t,n){var r=n,a=t;typeof a==`function`&&(r=a,a=l.package),v(w,e,l,function(t,n){if(t)return r(t);var o=i.join(n,`package.json`);x(o,function(t,n){if(t)return r(t);if(!n)return I(i.join(e,`index`),a,r);T(C,o,function(t,n){if(t)return r(t);var a=n;if(a&&l.packageFilter&&(a=l.packageFilter(a,o)),a&&a.main){if(typeof a.main!=`string`){var s=TypeError(`package “`+a.name+"” `main` must be a string");return s.code=`INVALID_PACKAGE_MAIN`,r(s)}(a.main===`.`||a.main===`./`)&&(a.main=`index`),I(i.resolve(e,a.main),a,function(t,n,a){if(t)return r(t);if(n)return r(null,n,a);if(!a)return I(i.join(e,`index`),a,r);var o=i.resolve(e,a.main);R(o,a,function(t,n,a){if(t)return r(t);if(n)return r(null,n,a);I(i.join(e,`index`),a,r)})});return}I(i.join(e,`/index`),a,r)})})})}function z(e,t){if(t.length===0)return e(null,void 0);var n=t[0];S(i.dirname(n),r);function r(r,i){if(r)return e(r);if(!i)return z(e,t.slice(1));I(n,l.package,a)}function a(t,r,i){if(t)return e(t);if(r)return e(null,r,i);R(n,l.package,o)}function o(n,r,i){if(n)return e(n);if(r)return e(null,r,i);z(e,t.slice(1))}}function B(e,t,n){var r=function(){return b(e,t,l)};z(n,D?D(e,t,r,l):r())}}}),cD=e.__commonJSMin((exports,t)=>{t.exports={assert:!0,"node:assert":[`>= 14.18 && < 15`,`>= 16`],"assert/strict":`>= 15`,"node:assert/strict":`>= 16`,async_hooks:`>= 8`,"node:async_hooks":[`>= 14.18 && < 15`,`>= 16`],buffer_ieee754:`>= 0.5 && < 0.9.7`,buffer:!0,"node:buffer":[`>= 14.18 && < 15`,`>= 16`],child_process:!0,"node:child_process":[`>= 14.18 && < 15`,`>= 16`],cluster:`>= 0.5`,"node:cluster":[`>= 14.18 && < 15`,`>= 16`],console:!0,"node:console":[`>= 14.18 && < 15`,`>= 16`],constants:!0,"node:constants":[`>= 14.18 && < 15`,`>= 16`],crypto:!0,"node:crypto":[`>= 14.18 && < 15`,`>= 16`],_debug_agent:`>= 1 && < 8`,_debugger:`< 8`,dgram:!0,"node:dgram":[`>= 14.18 && < 15`,`>= 16`],diagnostics_channel:[`>= 14.17 && < 15`,`>= 15.1`],"node:diagnostics_channel":[`>= 14.18 && < 15`,`>= 16`],dns:!0,"node:dns":[`>= 14.18 && < 15`,`>= 16`],"dns/promises":`>= 15`,"node:dns/promises":`>= 16`,domain:`>= 0.7.12`,"node:domain":[`>= 14.18 && < 15`,`>= 16`],events:!0,"node:events":[`>= 14.18 && < 15`,`>= 16`],freelist:`< 6`,fs:!0,"node:fs":[`>= 14.18 && < 15`,`>= 16`],"fs/promises":[`>= 10 && < 10.1`,`>= 14`],"node:fs/promises":[`>= 14.18 && < 15`,`>= 16`],_http_agent:`>= 0.11.1`,"node:_http_agent":[`>= 14.18 && < 15`,`>= 16`],_http_client:`>= 0.11.1`,"node:_http_client":[`>= 14.18 && < 15`,`>= 16`],_http_common:`>= 0.11.1`,"node:_http_common":[`>= 14.18 && < 15`,`>= 16`],_http_incoming:`>= 0.11.1`,"node:_http_incoming":[`>= 14.18 && < 15`,`>= 16`],_http_outgoing:`>= 0.11.1`,"node:_http_outgoing":[`>= 14.18 && < 15`,`>= 16`],_http_server:`>= 0.11.1`,"node:_http_server":[`>= 14.18 && < 15`,`>= 16`],http:!0,"node:http":[`>= 14.18 && < 15`,`>= 16`],http2:`>= 8.8`,"node:http2":[`>= 14.18 && < 15`,`>= 16`],https:!0,"node:https":[`>= 14.18 && < 15`,`>= 16`],inspector:`>= 8`,"node:inspector":[`>= 14.18 && < 15`,`>= 16`],"inspector/promises":[`>= 19`],"node:inspector/promises":[`>= 19`],_linklist:`< 8`,module:!0,"node:module":[`>= 14.18 && < 15`,`>= 16`],net:!0,"node:net":[`>= 14.18 && < 15`,`>= 16`],"node-inspect/lib/_inspect":`>= 7.6 && < 12`,"node-inspect/lib/internal/inspect_client":`>= 7.6 && < 12`,"node-inspect/lib/internal/inspect_repl":`>= 7.6 && < 12`,os:!0,"node:os":[`>= 14.18 && < 15`,`>= 16`],path:!0,"node:path":[`>= 14.18 && < 15`,`>= 16`],"path/posix":`>= 15.3`,"node:path/posix":`>= 16`,"path/win32":`>= 15.3`,"node:path/win32":`>= 16`,perf_hooks:`>= 8.5`,"node:perf_hooks":[`>= 14.18 && < 15`,`>= 16`],process:`>= 1`,"node:process":[`>= 14.18 && < 15`,`>= 16`],punycode:`>= 0.5`,"node:punycode":[`>= 14.18 && < 15`,`>= 16`],querystring:!0,"node:querystring":[`>= 14.18 && < 15`,`>= 16`],readline:!0,"node:readline":[`>= 14.18 && < 15`,`>= 16`],"readline/promises":`>= 17`,"node:readline/promises":`>= 17`,repl:!0,"node:repl":[`>= 14.18 && < 15`,`>= 16`],"node:sea":[`>= 20.12 && < 21`,`>= 21.7`],smalloc:`>= 0.11.5 && < 3`,"node:sqlite":[`>= 22.13 && < 23`,`>= 23.4`],_stream_duplex:`>= 0.9.4`,"node:_stream_duplex":[`>= 14.18 && < 15`,`>= 16`],_stream_transform:`>= 0.9.4`,"node:_stream_transform":[`>= 14.18 && < 15`,`>= 16`],_stream_wrap:`>= 1.4.1`,"node:_stream_wrap":[`>= 14.18 && < 15`,`>= 16`],_stream_passthrough:`>= 0.9.4`,"node:_stream_passthrough":[`>= 14.18 && < 15`,`>= 16`],_stream_readable:`>= 0.9.4`,"node:_stream_readable":[`>= 14.18 && < 15`,`>= 16`],_stream_writable:`>= 0.9.4`,"node:_stream_writable":[`>= 14.18 && < 15`,`>= 16`],stream:!0,"node:stream":[`>= 14.18 && < 15`,`>= 16`],"stream/consumers":`>= 16.7`,"node:stream/consumers":`>= 16.7`,"stream/promises":`>= 15`,"node:stream/promises":`>= 16`,"stream/web":`>= 16.5`,"node:stream/web":`>= 16.5`,string_decoder:!0,"node:string_decoder":[`>= 14.18 && < 15`,`>= 16`],sys:[`>= 0.4 && < 0.7`,`>= 0.8`],"node:sys":[`>= 14.18 && < 15`,`>= 16`],"test/reporters":`>= 19.9 && < 20.2`,"node:test/reporters":[`>= 18.17 && < 19`,`>= 19.9`,`>= 20`],"test/mock_loader":`>= 22.3 && < 22.7`,"node:test/mock_loader":`>= 22.3 && < 22.7`,"node:test":[`>= 16.17 && < 17`,`>= 18`],timers:!0,"node:timers":[`>= 14.18 && < 15`,`>= 16`],"timers/promises":`>= 15`,"node:timers/promises":`>= 16`,_tls_common:`>= 0.11.13`,"node:_tls_common":[`>= 14.18 && < 15`,`>= 16`],_tls_legacy:`>= 0.11.3 && < 10`,_tls_wrap:`>= 0.11.3`,"node:_tls_wrap":[`>= 14.18 && < 15`,`>= 16`],tls:!0,"node:tls":[`>= 14.18 && < 15`,`>= 16`],trace_events:`>= 10`,"node:trace_events":[`>= 14.18 && < 15`,`>= 16`],tty:!0,"node:tty":[`>= 14.18 && < 15`,`>= 16`],url:!0,"node:url":[`>= 14.18 && < 15`,`>= 16`],util:!0,"node:util":[`>= 14.18 && < 15`,`>= 16`],"util/types":`>= 15.3`,"node:util/types":`>= 16`,"v8/tools/arguments":`>= 10 && < 12`,"v8/tools/codemap":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/consarray":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/csvparser":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/logreader":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/profile_view":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],"v8/tools/splaytree":[`>= 4.4 && < 5`,`>= 5.2 && < 12`],v8:`>= 1`,"node:v8":[`>= 14.18 && < 15`,`>= 16`],vm:!0,"node:vm":[`>= 14.18 && < 15`,`>= 16`],wasi:[`>= 13.4 && < 13.5`,`>= 18.17 && < 19`,`>= 20`],"node:wasi":[`>= 18.17 && < 19`,`>= 20`],worker_threads:`>= 11.7`,"node:worker_threads":[`>= 14.18 && < 15`,`>= 16`],zlib:`>= 0.5`,"node:zlib":[`>= 14.18 && < 15`,`>= 16`]}}),lD=e.__commonJSMin((exports,t)=>{var n=oD(),r=cD(),i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=n(a));t.exports=i}),uD=e.__commonJSMin((exports,t)=>{var n=oD();t.exports=function(e){return n(e)}}),dD=e.__commonJSMin((exports,t)=>{var n=oD(),r=require(`fs`),i=require(`path`),a=ZE(),o=QE(),s=eD(),c=tD(),l=process.platform!==`win32`&&r.realpathSync&&typeof r.realpathSync.native==`function`?r.realpathSync.native:r.realpathSync,u=/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/,d=/^\w:[/\\]*$/,f=/[/\\]node_modules[/\\]*$/,p=a(),m=function(){return[i.join(p,`.node_modules`),i.join(p,`.node_libraries`)]},h=function(e){try{var t=r.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&(e.code===`ENOENT`||e.code===`ENOTDIR`))return!1;throw e}return!!t&&(t.isFile()||t.isFIFO())},g=function(e){try{var t=r.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&(e.code===`ENOENT`||e.code===`ENOTDIR`))return!1;throw e}return!!t&&t.isDirectory()},_=function(e){try{return l(e)}catch(e){if(e.code!==`ENOENT`)throw e}return e},v=function(e,t,n){return n&&n.preserveSymlinks===!1?e(t):t},y=function(e,t){var n=e(t);try{var r=JSON.parse(n);return r}catch{}},b=function(e,t,n){for(var r=s(t,n,e),a=0;a<r.length;a++)r[a]=i.join(r[a],e);return r};t.exports=function(e,t){if(typeof e!=`string`)throw TypeError(`Path must be a string.`);var a=c(e,t),s=a.isFile||h,l=a.readFileSync||r.readFileSync,p=a.isDirectory||g,x=a.realpathSync||_,S=a.readPackageSync||y;if(a.readFileSync&&a.readPackageSync)throw TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var C=a.packageIterator,w=a.extensions||[`.js`],T=a.includeCoreModules!==!1,E=a.basedir||i.dirname(o()),D=a.filename||E;a.paths=a.paths||m();var O=v(x,i.resolve(E),a);if(u.test(e)){var k=i.resolve(O,e);(e===`.`||e===`..`||e.slice(-1)===`/`)&&(k+=`/`);var A=N(k)||F(k);if(A)return v(x,A,a)}else if(T&&n(e))return e;else{var j=I(e,O);if(j)return v(x,j,a)}var M=Error(`Cannot find module '`+e+`' from '`+D+`'`);throw M.code=`MODULE_NOT_FOUND`,M;function N(e){var t=P(i.dirname(e));if(t&&t.dir&&t.pkg&&a.pathFilter){var n=i.relative(t.dir,e),r=a.pathFilter(t.pkg,e,n);r&&(e=i.resolve(t.dir,r))}if(s(e))return e;for(var o=0;o<w.length;o++){var c=e+w[o];if(s(c))return c}}function P(e){if(!(e===``||e===`/`)&&!(process.platform===`win32`&&d.test(e))&&!f.test(e)){var t=i.join(v(x,e,a),`package.json`);if(!s(t))return P(i.dirname(e));var n=S(l,t);return n&&a.packageFilter&&(n=a.packageFilter(n,e)),{pkg:n,dir:e}}}function F(e){var t=i.join(v(x,e,a),`/package.json`);if(s(t)){try{var n=S(l,t)}catch{}if(n&&a.packageFilter&&(n=a.packageFilter(n,e)),n&&n.main){if(typeof n.main!=`string`){var r=TypeError(`package “`+n.name+"” `main` must be a string");throw r.code=`INVALID_PACKAGE_MAIN`,r}(n.main===`.`||n.main===`./`)&&(n.main=`index`);try{var o=N(i.resolve(e,n.main));if(o)return o;var c=F(i.resolve(e,n.main));if(c)return c}catch{}}}return N(i.join(e,`/index`))}function I(e,t){for(var n=function(){return b(e,t,a)},r=C?C(e,t,n,a):n(),o=0;o<r.length;o++){var s=r[o];if(p(i.dirname(s))){var c=N(s);if(c)return c;var l=F(s);if(l)return l}}}}}),fD=e.__commonJSMin((exports,t)=>{var n=sD();n.core=lD(),n.isCore=uD(),n.sync=dD(),t.exports=n});const pD=/([\p{Ll}\d])(\p{Lu})/gu,mD=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,hD=/(\d)\p{Ll}|(\p{L})\d/u,gD=/[^\p{L}\d]+/giu,_D=`$1\0$2`,vD=``;function yD(e){let t=e.trim();t=t.replace(pD,_D).replace(mD,_D),t=t.replace(gD,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function bD(e){let t=yD(e);for(let e=0;e<t.length;e++){let n=t[e],r=hD.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function xD(e,t){let[n,r,i]=PD(e,t);return n+r.map(AD(t?.locale)).join(t?.delimiter??` `)+i}function SD(e,t){let[n,r,i]=PD(e,t),a=AD(t?.locale),o=jD(t?.locale),s=t?.mergeAmbiguousCharacters?MD(a,o):ND(a,o);return n+r.map((e,t)=>t===0?a(e):s(e,t)).join(t?.delimiter??``)+i}function CD(e,t){let[n,r,i]=PD(e,t),a=AD(t?.locale),o=jD(t?.locale),s=t?.mergeAmbiguousCharacters?MD(a,o):ND(a,o);return n+r.map(s).join(t?.delimiter??``)+i}function wD(e,t){let[n,r,i]=PD(e,t);return n+r.map(jD(t?.locale)).join(t?.delimiter??`_`)+i}function TD(e,t){return xD(e,{delimiter:`.`,...t})}function ED(e,t){return xD(e,{delimiter:`-`,...t})}function DD(e,t){return xD(e,{delimiter:`/`,...t})}function OD(e,t){let[n,r,i]=PD(e,t),a=AD(t?.locale),o=jD(t?.locale),s=MD(a,o);return n+r.map((e,t)=>t===0?s(e):a(e)).join(t?.delimiter??` `)+i}function kD(e,t){return xD(e,{delimiter:`_`,...t})}function AD(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function jD(e){return e===!1?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function MD(e,t){return n=>`${t(n[0])}${e(n.slice(1))}`}function ND(e,t){return(n,r)=>{let i=n[0],a=r>0&&i>=`0`&&i<=`9`?`_`+i:t(i);return a+e(n.slice(1))}}function PD(e,t={}){let n=t.split??(t.separateNumbers?bD:yD),r=t.prefixCharacters??vD,i=t.suffixCharacters??vD,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}const FD=/(\S+)|(.)/g,ID=/[\.#][\p{L}\p{N}]/u,LD=/\p{Ll}(?=[\p{Lu}])/u,RD=/[\p{L}\p{N}]+/gu,zD=/^([^\p{L}])*(?:\p{L}\.){2,}([^\p{L}])*$/u,BD=new Set([`—`,`–`,`-`,`―`,`/`]),VD=new Set([`.`,`!`,`?`]),HD=new Set([...VD,`:`,`"`,`'`,`”`]),UD=new Set(`a.an.and.as.at.because.but.by.en.for.if.in.neither.nor.of.on.only.or.over.per.so.some.than.that.the.to.up.upon.v.versus.via.vs.when.with.without.yet`.split(`.`));function WD(e,t={}){let{locale:n=void 0,sentenceCase:r=!1,sentenceTerminators:i=VD,titleTerminators:a=HD,smallWords:o=UD,wordSeparators:s=BD}=typeof t==`string`||Array.isArray(t)?{locale:t}:t,c=r?i:a,l=``,u=!0;for(let t of e.matchAll(FD)){let{1:i,2:a,index:d=0}=t;if(a){l+=a;continue}if(ID.test(i)){let e=i.match(zD);if(e){let[t,a=``,o=``]=e;l+=r&&!u?i:GD(i,a.length,n),u=c.has(o.charAt(0));continue}l+=i,u=c.has(i.charAt(i.length-1))}else{let t=Array.from(i.matchAll(RD)),a=i,f=!1;for(let l=0;l<t.length;l++){let{0:p,index:m=0}=t[l],h=i.charAt(m+p.length);if(f=c.has(h),u)u=!1;else if(r||LD.test(p))continue;else if(t.length===1){if(o.has(p)){let t=d+i.length===e.length;if(!t&&!f)continue}}else if(l>0&&(!s.has(i.charAt(m-1))||o.has(p)&&s.has(h)))continue;a=GD(a,m,n)}l+=a,u=f||c.has(i.charAt(i.length-1))}}return l}function GD(e,t,n){return e.slice(0,t)+e.charAt(t).toLocaleUpperCase(n)+e.slice(t+1)}var KD={camelCase:SD,snakeCase:kD,dotCase:TD,pathCase:DD,lowerCase:e=>e.toLowerCase(),upperCase:e=>e.toUpperCase(),sentenceCase:OD,constantCase:wD,titleCase:WD,dashCase:ED,kabobCase:ED,kebabCase:ED,properCase:CD,pascalCase:CD};const qD=e=>{let t=typeof e==`object`;return t&&e.value!=null?e.value:t&&e.name!=null?e.name:t&&e.key!=null?e.key:e};function JD(e,t){return typeof e==`string`&&e.toLowerCase()===t.toLowerCase()}function YD(e,t,n){return JD(e,n)||JD(e.value,n)||JD(e.key,n)||JD(e.name,n)||JD(t.toString(),n)}const XD=(e,t)=>e.includes(t.toLowerCase()),ZD={isTrue:e=>XD([`yes`,`y`,`true`,`t`],e),isFalse:e=>XD([`no`,`n`,`false`,`f`],e),isPrompt:e=>/^_+$/.test(e)},QD=(e,t)=>{let n=t.choices.find((t,n)=>YD(t,n,e));if(n!=null)return qD(n);throw Error(`invalid choice`)},$D={confirm(e){if(ZD.isTrue(e))return!0;if(ZD.isFalse(e))return!1;throw Error(`invalid input`)},checkbox(e,t){if(e===``)return[];let n=e.split(`,`),r=n.filter(e=>!t.choices.some((t,n)=>YD(t,n,e)));if(r.length)throw Error(`no match for "${r.join(`", "`)}"`);return n.map(e=>qD(t.choices.find((t,n)=>YD(t,n,e))))},list:QD,rawlist:QD,expand:QD};async function eO(e,t,n){let r=[e,{},[]];if(!Array.isArray(e)||t.length===0)return r;let{prompts:i}=n.inquirer.prompt,a={},o=[],s=[];for(let n=0;n<e.length;n++){let r=e[n];if(n>=t.length){s.push(!1);continue}let c=t[n].toString();if(ZD.isPrompt(c)){s.push(!1);continue}if(typeof r.when==`function`){o.push(`You can not bypass conditional prompts: ${r.name}`),s.push(!1);continue}try{let e=i[r.type]||{},t=r.bypass||e.bypass||$D[r.type]||null,n=typeof t==`function`,l=n?t.call(null,c,r):c,u=r.filter?r.filter(l,a):l;if(r.validate){let e=await r.validate(l,a);if(e!==!0){o.push(e),s.push(!1);continue}}a[r.name]=u}catch(e){o.push(`The "${r.name}" prompt did not recognize "${c}" as a valid ${r.type} value (ERROR: ${e.message})`),s.push(!1);continue}s.push(!0)}let c=e.filter((e,t)=>s[t]),l=[{when:e=>(Object.assign(e,a),!1)},...e.filter(e=>!c.includes(e))];if(o.length)throw Error(o[0]);return[l,a]}function tO(e,{checkPath:t=!0,checkAbortOnFail:n=!0}={}){if(typeof e!=`object`)return`Invalid action object: ${JSON.stringify(e)}`;let{path:r,abortOnFail:i}=e;return t&&(typeof r!=`string`||r.length===0)?`Invalid path "${r}"`:n&&i!==void 0&&typeof i!=`boolean`?`Invalid value for abortOnFail (${i} is not a Boolean)`:`transform`in e&&typeof e.transform!=`function`?`Invalid value for transform (${typeof e.transform} is not a function)`:e.type===`modify`&&!(`pattern`in e)&&!(`transform`in e)?`Invalid modify action (modify must have a pattern or transform function)`:`skip`in e&&typeof e.skip!=`function`?`Invalid value for skip (${typeof e.skip} is not a function)`:!0}const nO=e=>s.default.promises.mkdir(e,{recursive:!0}),rO=s.default.promises.readdir,iO=s.default.promises.stat,aO=s.default.promises.chmod,oO=e=>s.default.promises.readFile(e,`utf8`),sO=(e,t)=>s.default.promises.writeFile(e,t,`utf8`),cO=e=>s.default.promises.readFile(e,null),lO=(e,t)=>s.default.promises.writeFile(e,t,null),uO=e=>s.default.promises.access(e).then(()=>!0,()=>!1),dO=s.default.constants,fO=(e,t)=>Object.assign({},t.data,e),pO=e=>!e.sep||e.sep===`\\`?e.replace(/\\/g,`/`):e,mO=(e,t,n)=>o.default.resolve(n.getDestBasePath(),n.renderString(pO(t.path)||``,fO(e,t)));function hO(e,t,n){if(t.templateFile){let r=o.default.resolve(n.getPlopfilePath(),t.templateFile);return n.renderString(pO(r),fO(e,t))}return null}async function gO(e,t,n){let r=e=>o.default.resolve(n.getPlopfilePath(),e),{template:i}=t;return t.templateFile&&(i=await oO(r(t.templateFile))),i??=``,i}async function _O(e,t,n){let r=await gO(e,t,n);return n.renderString(r,fO(e,t))}const vO=(e,t)=>e.replace(o.default.resolve(t.getDestBasePath()),``),yO=e=>{throw typeof e==`string`?e:e.message||JSON.stringify(e)};async function bO(e,t,n){if(`transform`in n){let r=await n.transform(e,t);if(typeof r!=`string`)throw TypeError(`Invalid return value for transform (${JSON.stringify(r)} is not a string)`);return r}else return e}var xO=e.__commonJSMin(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.isBinaryFileSync=exports.isBinaryFile=void 0;let t=require(`fs`),n=require(`util`),r=(0,n.promisify)(t.stat),i=(0,n.promisify)(t.open),a=(0,n.promisify)(t.close),o=512,s=3;var c=class{fileBuffer;size;offset;error;constructor(e,t){this.fileBuffer=e,this.size=t,this.offset=0,this.error=!1}hasError(){return this.error}nextByte(){return this.offset===this.size||this.hasError()?(this.error=!0,255):this.fileBuffer[this.offset++]}next(e){let t=[];for(let n=0;n<e;n++){if(this.error)return t;t[n]=this.nextByte()}return t}};function l(e){let t=0,n=0;for(;!e.hasError();){let r=e.nextByte();if(n|=(r&127)<<7*t,!(r&128))break;if(t>=10){e.error=!0;break}t++}return n}function u(e){let t=l(e),n=t&7;switch(n){case 0:return l(e),!0;case 1:return e.next(8),!0;case 2:let t=l(e);return e.next(t),!0;case 5:return e.next(4),!0}return!1}function d(e,t){let n=new c(e,t),r=0;for(;;){if(!u(n)&&!n.hasError())return!1;if(n.hasError())break;r++}return r>0}async function f(e,n){if(h(e)){let n=await r(e);g(n);let c=await i(e,`r`),l=Buffer.alloc(o+s);return new Promise((e,n)=>{t.read(c,l,0,o+s,0,(t,r,i)=>{if(a(c),t)n(t);else try{e(m(l,r))}catch(e){n(e)}})})}else return n===void 0&&(n=e.length),m(e,n)}exports.isBinaryFile=f;function p(e,n){if(h(e)){let n=t.statSync(e);g(n);let r=t.openSync(e,`r`),i=Buffer.alloc(o+s),a=t.readSync(r,i,0,o+s,0);return t.closeSync(r),m(i,a)}else return n===void 0&&(n=e.length),m(e,n)}exports.isBinaryFileSync=p;function m(e,t){if(t===0)return!1;let n=0,r=Math.min(t,o+s),i=Math.min(r,o);if(t>=3&&e[0]===239&&e[1]===187&&e[2]===191||t>=4&&e[0]===0&&e[1]===0&&e[2]===254&&e[3]===255||t>=4&&e[0]===255&&e[1]===254&&e[2]===0&&e[3]===0||t>=4&&e[0]===132&&e[1]===49&&e[2]===149&&e[3]===51)return!1;if(r>=5&&e.slice(0,5).toString()===`%PDF-`)return!0;if(t>=2&&e[0]===254&&e[1]===255||t>=2&&e[0]===255&&e[1]===254)return!1;for(let t=0;t<i;t++)if(e[t]===0)return!0;else if((e[t]<7||e[t]>14)&&(e[t]<32||e[t]>127)){if(e[t]>=192&&e[t]<=223&&t+1<r){if(t++,e[t]>=128&&e[t]<=191)continue}else if(e[t]>=224&&e[t]<=239&&t+2<r){if(t++,e[t]>=128&&e[t]<=191&&e[t+1]>=128&&e[t+1]<=191){t++;continue}}else if(e[t]>=240&&e[t]<=247&&t+3<r&&(t++,e[t]>=128&&e[t]<=191&&e[t+1]>=128&&e[t+1]<=191&&e[t+2]>=128&&e[t+2]<=191)){t+=2;continue}if(n++,t>=32&&n*100/i>10)return!0}return!!(n*100/i>10||n>1&&d(e,i))}function h(e){return typeof e==`string`}function g(e){if(!e.isFile())throw Error(`Path provided was not a file!`)}}),SO=e.__toESM(xO(),1);async function CO(e,t,n){let r=mO(e,t,n),{force:i,skipIfExists:a=!1}=t;try{let s=await uO(r);if(i===!0&&s&&(await(0,g.rm)(r,{force:i,recursive:!0}),s=!1),s){if(a)return`[SKIPPED] ${r} (exists)`;throw`File already exists\n -> ${r}`}else{await nO(o.default.dirname(r));let i=t.templateFile&&o.default.resolve(n.getPlopfilePath(),t.templateFile)||null;if(i!=null&&(0,SO.isBinaryFileSync)(i)){let e=await cO(t.templateFile);await lO(r,e)}else{let i=await _O(e,t,n),a=await bO(i,e,t);await sO(r,a)}if(i!=null){let e=await iO(i),t=await iO(r),n=e.mode&(dO.S_IXUSR|dO.S_IXGRP|dO.S_IXOTH);await aO(r,t.mode|n)}}return vO(r,n)}catch(e){yO(e)}}async function wO(e,t,n){let r=tO(t);if(r!==!0)throw r;return t.templateFile=hO(e,t,n),await CO(e,t,n)}var TO=(0,k.createRequire)(require(`url`).pathToFileURL(__filename).href);function EO(e){let t=(0,o.normalize)(e);return t.length>1&&t[t.length-1]===o.sep&&(t=t.substring(0,t.length-1)),t}const DO=/[\\/]/g;function OO(e,t){return e.replace(DO,t)}const kO=/^[a-z]:[\\/]$/i;function AO(e){return e===`/`||kO.test(e)}function jO(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);if(n&&(e=(0,o.resolve)(e)),(r||a)&&(e=EO(e)),e===`.`)return``;let s=e[e.length-1]!==i;return OO(s?e+i:e,i)}function MO(e,t){return t+e}function NO(e,t){return function(n,r){let i=r.startsWith(e);return i?r.slice(e.length)+n:OO((0,o.relative)(e,r),t.pathSeparator)+t.pathSeparator+n}}function PO(e){return e}function FO(e,t,n){return t+e+n}function IO(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?NO(e,t):r?MO:PO}function LO(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function RO(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const zO=(e,t)=>{t.push(e||`.`)},BO=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},VO=()=>{};function HO(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?RO(e):LO(e):r&&r.length?BO:zO:VO}const UO=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},WO=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},GO=(e,t,n,r)=>{n.files++},KO=(e,t)=>{t.push(e)},qO=()=>{};function JO(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?qO:n&&n.length?r?UO:WO:r?GO:KO}const YO=e=>e,XO=()=>[``].slice(0,0);function ZO(e){return e.group?XO:YO}const QO=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},$O=()=>{};function ek(e){return e.group?QO:$O}const tk=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()&&ik(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},nk=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()&&ik(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function rk(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?nk:tk}function ik(e,t,n){if(n.options.useRealPaths)return ak(t,n);let r=(0,o.dirname)(e),i=1;for(;r!==n.root&&i<2;){let e=n.symlinks.get(r),a=!!e&&(e===t||e.startsWith(t)||t.startsWith(e));a?i++:r=(0,o.dirname)(r)}return n.symlinks.set(e,t),i>1}function ak(e,t){return t.visited.includes(e+t.options.pathSeparator)}const ok=e=>e.counts,sk=e=>e.groups,ck=e=>e.paths,lk=e=>e.paths.slice(0,e.options.maxFiles),uk=(e,t,n)=>(mk(t,n,e.counts,e.options.suppressErrors),null),dk=(e,t,n)=>(mk(t,n,e.paths,e.options.suppressErrors),null),fk=(e,t,n)=>(mk(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),pk=(e,t,n)=>(mk(t,n,e.groups,e.options.suppressErrors),null);function mk(e,t,n,r){t(e&&!r?e:null,n)}function hk(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?ok:uk:r?t?sk:pk:i?t?lk:fk:t?ck:dk}const gk={withFileTypes:!0},_k=(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||`.`,gk,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},vk=(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||`.`,gk)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function yk(e){return e?vk:_k}var bk=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))}},xk=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}get dirs(){return this._directories}},Sk=class{aborted=!1;abort(){this.aborted=!0}},Ck=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=hk(t,this.isSynchronous),this.root=jO(e,t),this.state={root:AO(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new xk,options:t,queue:new bk((e,t)=>this.callbackInvoker(t,e,n)),symlinks:new Map,visited:[``].slice(0,0),controller:new Sk,fs:t.fs||s},this.joinPath=IO(this.root,t),this.pushDirectory=HO(this.root,t),this.pushFile=JO(t),this.getArray=ZO(t),this.groupFiles=ek(t),this.resolveSymlink=rk(t,this.isSynchronous),this.walkDirectory=yk(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:s,exclude:c,maxFiles:l,signal:u,useRealPaths:d,pathSeparator:f},controller:p}=this.state;if(p.aborted||u&&u.aborted||l&&r.length>l)return;let m=this.getArray(this.state.paths);for(let l=0;l<e.length;++l){let u=e[l];if(u.isFile()||u.isSymbolicLink()&&!a&&!s){let e=this.joinPath(u.name,t);this.pushFile(e,m,this.state.counts,i)}else if(u.isDirectory()){let e=FO(u.name,t,this.state.options.pathSeparator);if(c&&c(u.name,e))continue;this.pushDirectory(e,r,i),this.walkDirectory(this.state,e,e,n-1,this.walk)}else if(this.resolveSymlink&&u.isSymbolicLink()){let e=MO(u.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=jO(r,this.state.options),c&&c(u.name,d?r:e+f))return;this.walkDirectory(this.state,r,d?r:e+f,n-1,this.walk)}else{r=d?r:e;let t=(0,o.basename)(r),n=jO((0,o.dirname)(r),this.state.options);r=this.joinPath(t,n),this.pushFile(r,m,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,m)}};function wk(e,t){return new Promise((n,r)=>{Tk(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function Tk(e,t,n){let r=new Ck(e,t,n);r.start()}function Ek(e,t){let n=new Ck(e,t);return n.start()}var Dk=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return wk(this.root,this.options)}withCallback(e){Tk(this.root,this.options,e)}sync(){return Ek(this.root,this.options)}};let Ok=null;try{TO.resolve(`picomatch`),Ok=TO(`picomatch`)}catch{}var kk=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:o.sep,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 Dk(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new Dk(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||Ok;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}},Ak=e.__commonJSMin((exports,t)=>{let n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m=`(?!${a})`,h=`(?!${f}${p})`,g=`(?!${a}{0,1}${d})`,_=`(?!${p})`,v=`[^.${c}]`,y=`${u}*?`,b=`/`,x={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:m,NO_DOTS:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:_,QMARK_NO_DOT:v,STAR:y,START_ANCHOR:f,SEP:b},S={...x,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`},C={__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`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:C,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?S:x}}}),jk=e.__commonJSMin(exports=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=Ak();exports.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),exports.hasRegexChars=e=>r.test(e),exports.isRegexChar=t=>t.length===1&&exports.hasRegexChars(t),exports.escapeRegex=e=>e.replace(i,`\\$1`),exports.toPosixSlashes=e=>e.replace(t,`/`),exports.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},exports.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),exports.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?exports.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},exports.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},exports.wrapOutput=(e,t={},n={})=>{let r=n.contains?``:`^`,i=n.contains?``:`$`,a=`${r}(?:${e})${i}`;return t.negated===!0&&(a=`(?:^(?!${a}).*$)`),a},exports.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}}),Mk=e.__commonJSMin((exports,t)=>{let n=jk(),{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:_}=Ak(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},b=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,z=!1,B=0,V,H,U={value:``,depth:0,isGlob:!1},W=()=>D>=x,G=()=>E.charCodeAt(D+1),K=()=>(V=H,E.charCodeAt(++D));for(;D<x;){H=K();let e;if(H===a){I=U.backslashes=!0,H=K(),H===u&&(F=!0);continue}if(F===!0||H===u){for(B++;W()!==!0&&(H=K());){if(H===a){I=U.backslashes=!0,K();continue}if(H===u){B++;continue}if(F!==!0&&H===s&&(H=K())===s){if(A=U.isBrace=!0,M=U.isGlob=!0,z=!0,S===!0)continue;break}if(F!==!0&&H===o){if(A=U.isBrace=!0,M=U.isGlob=!0,z=!0,S===!0)continue;break}if(H===h&&(B--,B===0)){F=!1,A=U.isBrace=!0,z=!0;break}}if(S===!0)continue;break}if(H===l){if(C.push(D),w.push(U),U={value:``,depth:0,isGlob:!1},z===!0)continue;if(V===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0){let e=H===p||H===i||H===r||H===m||H===c;if(e===!0&&G()===d){if(M=U.isGlob=!0,N=U.isExtglob=!0,z=!0,H===c&&D===O&&(R=!0),S===!0){for(;W()!==!0&&(H=K());){if(H===a){I=U.backslashes=!0,H=K();continue}if(H===g){M=U.isGlob=!0,z=!0;break}}continue}break}}if(H===r){if(V===r&&(P=U.isGlobstar=!0),M=U.isGlob=!0,z=!0,S===!0)continue;break}if(H===m){if(M=U.isGlob=!0,z=!0,S===!0)continue;break}if(H===f){for(;W()!==!0&&(e=K());){if(e===a){I=U.backslashes=!0,K();continue}if(e===_){j=U.isBracket=!0,M=U.isGlob=!0,z=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&H===c&&D===O){L=U.negated=!0,O++;continue}if(b.noparen!==!0&&H===d){if(M=U.isGlob=!0,S===!0){for(;W()!==!0&&(H=K());){if(H===d){I=U.backslashes=!0,H=K();continue}if(H===g){z=!0;break}}continue}break}if(M===!0){if(z=!0,S===!0)continue;break}}b.noext===!0&&(N=!1,M=!1);let q=E,ee=``,J=``;O>0&&(ee=E.slice(0,O),E=E.slice(O),k-=O),q&&M===!0&&k>0?(q=E.slice(0,k),J=E.slice(k)):M===!0?(q=``,J=E):q=E,q&&q!==``&&q!==`/`&&q!==E&&v(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),b.unescape===!0&&(J&&=n.removeBackslashes(J),q&&I===!0&&(q=n.removeBackslashes(q)));let Y={prefix:ee,input:e,start:O,base:q,glob:J,isBrace:A,isBracket:j,isGlob:M,isExtglob:N,isGlobstar:P,negated:L,negatedExtglob:R};if(b.tokens===!0&&(Y.maxDepth=0,v(H)||w.push(U),Y.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=ee):w[n].value=a,y(w[n]),Y.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),Y.maxDepth+=w[w.length-1].depth)}Y.slashes=C,Y.parts=T}return Y};t.exports=b}),Nk=e.__commonJSMin((exports,t)=>{let n=Ak(),r=jk(),{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=>{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;let i=n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`;return`${i}*`},_=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},v=(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};for(let e of i){let t=g(e);if(t)return{risky:!0,safeOutput:t};if(_(e)>r)return{risky:!0}}return{risky:!1}},y=(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),b=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:j,START_ANCHOR:M}=_,N=e=>`(${g}(?:(?!${M}${e.dot?T:x}).)*?)`,P=d.dot?``:E,F=d.dot?k:A,I=d.bash===!0?N(d):j;d.capture&&(I=`(${I})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let L={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,L),p=e.length;let R=[],z=[],B=[],V=m,H,U=()=>L.index===p-1,W=L.peek=(t=1)=>e[L.index+t],G=L.advance=()=>e[++L.index]||``,K=()=>e.slice(L.index+1),q=(e=``,t=0)=>{L.consumed+=e,L.index+=t},ee=e=>{L.output+=e.output==null?e.value:e.output,q(e.value)},J=()=>{let e=1;for(;W()===`!`&&(W(2)!==`(`||W(3)===`?`);)G(),L.start++,e++;return e%2==0?!1:(L.negated=!0,L.start++,!0)},Y=e=>{L[e]++,B.push(e)},te=e=>{L[e]--,B.pop()},X=e=>{if(V.type===`globstar`){let t=L.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||R.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(L.output=L.output.slice(0,-V.output.length),V.type=`star`,V.value=`*`,V.output=I,L.output+=V.output)}if(R.length&&e.type!==`paren`&&(R[R.length-1].inner+=e.value),(e.value||e.output)&&ee(e),V&&V.type===`text`&&e.type===`text`){V.output=(V.output||V.value)+e.value,V.value+=e.value;return}e.prev=V,h.push(e),V=e},Z=(e,t)=>{let n={...b[t],conditions:1,inner:``};n.prev=V,n.parens=L.parens,n.output=L.output,n.startIndex=L.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;Y(`parens`),X({type:e,value:t,output:L.output?``:w}),X({type:`paren`,extglob:!0,value:G(),output:r}),R.push(n)},ne=n=>{let i=e.slice(n.startIndex,L.index+1),a=e.slice(n.startIndex+2,L.index),o=v(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;L.output=n.output+t.output,L.backtrack=!0,X({type:`paren`,extglob:!0,value:H,output:``}),te(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=I;if(n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=N(d)),(e!==I||U()||/^\)+$/.test(K()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=K())&&/^\.[^\\/.]+$/.test(c)){let r=y(c,{...t,fastpaths:!1}).output;s=n.close=`)${r})${e})`}n.prev.type===`bos`&&(L.negatedExtglob=!0)}X({type:`paren`,extglob:!0,value:H,output:s}),te(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?F+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?I:``):I: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?(L.output=e,L):(L.output=r.wrapOutput(i,L,t),L)}for(;!U();){if(H=G(),H===`\0`)continue;if(H===`\\`){let e=W();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){H+=`\\`,X({type:`text`,value:H});continue}let t=/^\\+/.exec(K()),n=0;if(t&&t[0].length>2&&(n=t[0].length,L.index+=n,n%2!=0&&(H+=`\\`)),d.unescape===!0?H=G():H+=G(),L.brackets===0){X({type:`text`,value:H});continue}}if(L.brackets>0&&(H!==`]`||V.value===`[`||V.value===`[^`)){if(d.posix!==!1&&H===`:`){let e=V.value.slice(1);if(e.includes(`[`)&&(V.posix=!0,e.includes(`:`))){let e=V.value.lastIndexOf(`[`),t=V.value.slice(0,e),n=V.value.slice(e+2),r=a[n];if(r){V.value=t+r,L.backtrack=!0,G(),!m.output&&h.indexOf(V)===1&&(m.output=w);continue}}}(H===`[`&&W()!==`:`||H===`-`&&W()===`]`)&&(H=`\\${H}`),H===`]`&&(V.value===`[`||V.value===`[^`)&&(H=`\\${H}`),d.posix===!0&&H===`!`&&V.value===`[`&&(H=`^`),V.value+=H,ee({value:H});continue}if(L.quotes===1&&H!==`"`){H=r.escapeRegex(H),V.value+=H,ee({value:H});continue}if(H===`"`){L.quotes=L.quotes===1?0:1,d.keepQuotes===!0&&X({type:`text`,value:H});continue}if(H===`(`){Y(`parens`),X({type:`paren`,value:H});continue}if(H===`)`){if(L.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=R[R.length-1];if(e&&L.parens===e.parens+1){ne(R.pop());continue}X({type:`paren`,value:H,output:L.parens?`)`:`\\)`}),te(`parens`);continue}if(H===`[`){if(d.nobracket===!0||!K().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));H=`\\${H}`}else Y(`brackets`);X({type:`bracket`,value:H});continue}if(H===`]`){if(d.nobracket===!0||V&&V.type===`bracket`&&V.value.length===1){X({type:`text`,value:H,output:`\\${H}`});continue}if(L.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));X({type:`text`,value:H,output:`\\${H}`});continue}te(`brackets`);let e=V.value.slice(1);if(V.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(H=`/${H}`),V.value+=H,ee({value:H}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(V.value);if(L.output=L.output.slice(0,-V.value.length),d.literalBrackets===!0){L.output+=t,V.value=t;continue}V.value=`(${g}${t}|${V.value})`,L.output+=V.value;continue}if(H===`{`&&d.nobrace!==!0){Y(`braces`);let e={type:`brace`,value:H,output:`(`,outputIndex:L.output.length,tokensIndex:L.tokens.length};z.push(e),X(e);continue}if(H===`}`){let e=z[z.length-1];if(d.nobrace===!0||!e){X({type:`text`,value:H,output:H});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),L.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=L.output.slice(0,e.outputIndex),r=L.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,H=t=`\\}`,L.output=n;for(let e of r)L.output+=e.output||e.value}X({type:`brace`,value:H,output:t}),te(`braces`),z.pop();continue}if(H===`|`){R.length>0&&R[R.length-1].conditions++,X({type:`text`,value:H});continue}if(H===`,`){let e=H,t=z[z.length-1];t&&B[B.length-1]===`braces`&&(t.comma=!0,e=`|`),X({type:`comma`,value:H,output:e});continue}if(H===`/`){if(V.type===`dot`&&L.index===L.start+1){L.start=L.index+1,L.consumed=``,L.output=``,h.pop(),V=m;continue}X({type:`slash`,value:H,output:C});continue}if(H===`.`){if(L.braces>0&&V.type===`dot`){V.value===`.`&&(V.output=x);let e=z[z.length-1];V.type=`dots`,V.output+=H,V.value+=H,e.dots=!0;continue}if(L.braces+L.parens===0&&V.type!==`bos`&&V.type!==`slash`){X({type:`text`,value:H,output:x});continue}X({type:`dot`,value:H,output:x});continue}if(H===`?`){let e=V&&V.value===`(`;if(!e&&d.noextglob!==!0&&W()===`(`&&W(2)!==`?`){Z(`qmark`,H);continue}if(V&&V.type===`paren`){let e=W(),t=H;(V.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${H}`),X({type:`text`,value:H,output:t});continue}if(d.dot!==!0&&(V.type===`slash`||V.type===`bos`)){X({type:`qmark`,value:H,output:A});continue}X({type:`qmark`,value:H,output:k});continue}if(H===`!`){if(d.noextglob!==!0&&W()===`(`&&(W(2)!==`?`||!/[!=<:]/.test(W(3)))){Z(`negate`,H);continue}if(d.nonegate!==!0&&L.index===0){J();continue}}if(H===`+`){if(d.noextglob!==!0&&W()===`(`&&W(2)!==`?`){Z(`plus`,H);continue}if(V&&V.value===`(`||d.regex===!1){X({type:`plus`,value:H,output:S});continue}if(V&&(V.type===`bracket`||V.type===`paren`||V.type===`brace`)||L.parens>0){X({type:`plus`,value:H});continue}X({type:`plus`,value:S});continue}if(H===`@`){if(d.noextglob!==!0&&W()===`(`&&W(2)!==`?`){X({type:`at`,extglob:!0,value:H,output:``});continue}X({type:`text`,value:H});continue}if(H!==`*`){(H===`$`||H===`^`)&&(H=`\\${H}`);let e=o.exec(K());e&&(H+=e[0],L.index+=e[0].length),X({type:`text`,value:H});continue}if(V&&(V.type===`globstar`||V.star===!0)){V.type=`star`,V.star=!0,V.value+=H,V.output=I,L.backtrack=!0,L.globstar=!0,q(H);continue}let t=K();if(d.noextglob!==!0&&/^\([^?]/.test(t)){Z(`star`,H);continue}if(V.type===`star`){if(d.noglobstar===!0){q(H);continue}let n=V.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]!==`/`)){X({type:`star`,value:H,output:``});continue}let o=L.braces>0&&(n.type===`comma`||n.type===`brace`),s=R.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){X({type:`star`,value:H,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[L.index+4];if(n&&n!==`/`)break;t=t.slice(3),q(`/**`,3)}if(n.type===`bos`&&U()){V.type=`globstar`,V.value+=H,V.output=N(d),L.output=V.output,L.globstar=!0,q(H);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&U()){L.output=L.output.slice(0,-(n.output+V.output).length),n.output=`(?:${n.output}`,V.type=`globstar`,V.output=N(d)+(d.strictSlashes?`)`:`|$)`),V.value+=H,L.globstar=!0,L.output+=n.output+V.output,q(H);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;L.output=L.output.slice(0,-(n.output+V.output).length),n.output=`(?:${n.output}`,V.type=`globstar`,V.output=`${N(d)}${C}|${C}${e})`,V.value+=H,L.output+=n.output+V.output,L.globstar=!0,q(H+G()),X({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){V.type=`globstar`,V.value+=H,V.output=`(?:^|${C}|${N(d)}${C})`,L.output=V.output,L.globstar=!0,q(H+G()),X({type:`slash`,value:`/`,output:``});continue}L.output=L.output.slice(0,-V.output.length),V.type=`globstar`,V.output=N(d),V.value+=H,L.output+=V.output,L.globstar=!0,q(H);continue}let n={type:`star`,value:H,output:I};if(d.bash===!0){n.output=`.*?`,(V.type===`bos`||V.type===`slash`)&&(n.output=P+n.output),X(n);continue}if(V&&(V.type===`bracket`||V.type===`paren`)&&d.regex===!0){n.output=H,X(n);continue}(L.index===L.start||V.type===`slash`||V.type===`dot`)&&(V.type===`dot`?(L.output+=D,V.output+=D):d.dot===!0?(L.output+=O,V.output+=O):(L.output+=P,V.output+=P),W()!==`*`&&(L.output+=w,V.output+=w)),X(n)}for(;L.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));L.output=r.escapeLast(L.output,`[`),te(`brackets`)}for(;L.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));L.output=r.escapeLast(L.output,`(`),te(`parens`)}for(;L.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));L.output=r.escapeLast(L.output,`{`),te(`braces`)}if(d.strictSlashes!==!0&&(V.type===`star`||V.type===`bracket`)&&X({type:`maybe_slash`,value:``,output:`${C}?`}),L.backtrack===!0){L.output=``;for(let e of L.tokens)L.output+=e.output==null?e.value:e.output,e.suffix&&(L.output+=e.suffix)}return L};y.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=r.removePrefix(e,x),E=w(T);return E&&a.strictSlashes!==!0&&(E+=`${u}?`),E},t.exports=y}),Pk=e.__commonJSMin((exports,t)=>{let n=Mk(),r=Nk(),i=jk(),a=Ak(),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)),i=e=>{for(let t of r){let n=t(e);if(n)return n}return!1};return i}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:!0)};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)=>{let r=t instanceof RegExp?t:s.makeRe(t,n);return r.test(i.basename(e))},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}),Fk=e.__commonJSMin((exports,t)=>{let n=Pk(),r=jk();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}),Ik=e.__toESM(Fk(),1);const Lk=Array.isArray,Rk=process.platform===`win32`,zk=/^(\/?\.\.)+$/;function Bk(e,t={}){let n=e.length,r=Array(n),i=Array(n),a=!t.noglobstar;for(let a=0;a<n;a++){let n=Kk(e[a]);r[a]=n;let o=n.length,s=Array(o);for(let e=0;e<o;e++)s[e]=(0,Ik.default)(n[e],t);i[a]=s}return t=>{let n=t.split(`/`);if(n[0]===`..`&&zk.test(t))return!0;for(let t=0;t<e.length;t++){let e=r[t],o=i[t],s=n.length,c=Math.min(s,e.length),l=0;for(;l<c;){let t=e[l];if(t.includes(`/`))return!0;let r=o[l](n[l]);if(!r)break;if(a&&t===`**`)return!0;l++}if(l===s)return!0}return!1}}const Vk=/^[A-Z]:\/$/i,Hk=Rk?e=>Vk.test(e):e=>e===`/`;function Uk(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=Hk(e)?e.length:e.length+1;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=>o.posix.relative(e,t)||`.`:n=>o.posix.relative(e,`${t}/${n}`)||`.`}function Wk(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=o.posix.relative(e,`${t}/${n}`);return n.endsWith(`/`)&&r!==``?`${r}/`:r||`.`}}const Gk={parts:!0};function Kk(e){var t;let n=Ik.default.scan(e,Gk);return(t=n.parts)?.length?n.parts:[e]}const qk=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Jk=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Yk=e=>e.replace(qk,`\\$&`),Xk=e=>e.replace(Jk,`\\$&`),Zk=Rk?Xk:Yk;function Qk(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=Ik.default.scan(e);return n.isGlob||n.negated}function $k(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString(`es`)}]`,...e)}const eA=/^(\/?\.\.)+/,tA=/\\(?=[()[\]{}!*+?@|])/g,nA=/\\/g;function rA(e,t,n,r,i){let a=e;e.endsWith(`/`)&&(a=e.slice(0,-1)),!a.endsWith(`*`)&&t&&(a+=`/**`);let s=Zk(n);a=o.default.isAbsolute(a.replace(tA,``))?o.posix.relative(s,a):o.posix.normalize(a);let c=eA.exec(a),l=Kk(a);if(c?.[0]){let e=(c[0].length+1)/3,t=0,i=s.split(`/`);for(;t<e&&l[t+e]===i[i.length+t-e];)a=a.slice(0,(e-t-1)*3)+a.slice((e-t)*3+l[t+e].length+1)||`.`,t++;let u=o.posix.join(n,c[0].slice(t*3));!u.startsWith(`.`)&&r.root.length>u.length&&(r.root=u,r.depthOffset=-e+t)}if(!i&&r.depthOffset>=0){var u;(u=r.commonPath)??(r.commonPath=l);let e=[],t=Math.min(r.commonPath.length,l.length);for(let n=0;n<t;n++){let t=l[n];if(t===`**`&&!l[n+1]){e.pop();break}if(t!==r.commonPath[n]||Qk(t)||n===l.length-1)break;e.push(t)}r.depthOffset=e.length,r.commonPath=e,r.root=e.length>0?o.posix.join(n,...e):n}return a}function iA({patterns:e=[`**/*`],ignore:t=[],expandDirectories:n=!0},r,i){typeof e==`string`&&(e=[e]),typeof t==`string`&&(t=[t]);let a=[],o=[];for(let e of t){if(!e)continue;(e[0]!==`!`||e[1]===`(`)&&o.push(rA(e,n,r,i,!0))}for(let t of e){if(!t)continue;t[0]!==`!`||t[1]===`(`?a.push(rA(t,n,r,i,!1)):(t[1]!==`!`||t[2]===`(`)&&o.push(rA(t.slice(1),n,r,i,!0))}return{match:a,ignore:o}}function aA(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];e[n]=t(r)}return e}function oA(e){return e?e instanceof URL?(0,C.fileURLToPath)(e).replace(nA,`/`):o.default.resolve(e).replace(nA,`/`):process.cwd().replace(nA,`/`)}function sA(e,t={}){let n=process.env.TINYGLOBBY_DEBUG?{...t,debug:!0}:t,r=oA(n.cwd);if(n.debug&&$k(`globbing with:`,{patterns:e,options:n,cwd:r}),Array.isArray(e)&&e.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let i={root:r,commonPath:null,depthOffset:0},a=iA({...n,patterns:e},r,i);n.debug&&$k(`internal processing patterns:`,a);let o={dot:n.dot,nobrace:n.braceExpansion===!1,nocase:n.caseSensitiveMatch===!1,noextglob:n.extglob===!1,noglobstar:n.globstar===!1,posix:!0},c=(0,Ik.default)(a.match,{...o,ignore:a.ignore}),l=(0,Ik.default)(a.ignore,o),u=Bk(a.match,o),d=Uk(r,i.root,n.absolute),f=n.absolute?d:Uk(r,i.root,!0),p={filters:[n.debug?(e,t)=>{let n=d(e,t),r=c(n);return r&&$k(`matched ${n}`),r}:(e,t)=>c(d(e,t))],exclude:n.debug?(e,t)=>{let n=f(t,!0),r=n!==`.`&&!u(n)||l(n);return $k(r?`skipped ${t}`:`crawling ${t}`),r}:(e,t)=>{let n=f(t,!0);return n!==`.`&&!u(n)||l(n)},fs:n.fs?{readdir:n.fs.readdir||s.default.readdir,readdirSync:n.fs.readdirSync||s.default.readdirSync,realpath:n.fs.realpath||s.default.realpath,realpathSync:n.fs.realpathSync||s.default.realpathSync,stat:n.fs.stat||s.default.stat,statSync:n.fs.statSync||s.default.statSync}:void 0,pathSeparator:`/`,relativePaths:!0,resolveSymlinks:!0,signal:n.signal};n.deep!==void 0&&(p.maxDepth=Math.round(n.deep-i.depthOffset)),n.absolute&&(p.relativePaths=!1,p.resolvePaths=!0,p.includeBasePath=!0),n.followSymbolicLinks===!1&&(p.resolveSymlinks=!1,p.excludeSymlinks=!0),n.onlyDirectories?(p.excludeFiles=!0,p.includeDirs=!0):n.onlyFiles===!1&&(p.includeDirs=!0),i.root=i.root.replace(nA,``);let m=i.root;n.debug&&$k(`internal properties:`,i);let h=r!==m&&!n.absolute&&Wk(r,i.root);return[new kk(p).crawl(m),h]}function cA(e,t){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=Lk(e)||typeof e==`string`,r=n?t:e,i=n?e:e.patterns,[a,o]=sA(i,r);return o?aA(a.sync(),o):a.sync()}const lA={verbose:!0,stripExtensions:[`hbs`]};async function uA(e,t,n){let r=Object.assign({},lA,t),i=tO(r,{checkPath:!1});if(i!==!0)throw i;let a=r.destination;if(typeof a!=`string`||a.length===0)throw`Invalid destination "${a}"`;r.base&&=n.renderString(r.base,e),typeof r.templateFiles==`function`&&(r.templateFiles=r.templateFiles()),r.templateFiles=[].concat(r.templateFiles).map(t=>n.renderString(t,e));let s=dA(r.templateFiles,r.base,r.globOptions,n),c=[],l=o.default.resolve(n.getPlopfilePath()),u=o.default.resolve(l,r.base||``);for(let t of s){let i=o.default.relative(u,t),a=Object.assign({},r,{path:_A(r.stripExtensions,mA(r.destination,i,r.base)),templateFile:t}),s=await CO(e,a,n);c.push(s)}let d=`${c.length} files added`;return r.verbose?`${d}\n -> ${c.join(`
267
267
  -> `)}`:d}function dA(e,t,n,r){let i=o.default.resolve(r.getPlopfilePath()),a=o.default.resolve(i,t||``);return cA(e,{cwd:i,braceExpansion:!1,expandDirectories:!0,absolute:!0,...n}).filter(pA(a)).filter(fA(i))}function fA(e){return e=>s.default.existsSync(e)&&s.default.lstatSync(e).isFile()}function pA(e=``){let t=e.replace(/\\/g,`/`);return e=>e.startsWith(t)}function mA(e,t,n){return pO(o.default.join(e,hA(t,n)))}function hA(e,t){return t?e.replace(t,``):gA(e)}function gA(e){let t=o.default.normalize(e).split(o.default.sep);return t.shift(),t.join(o.default.sep)}function _A(e,t){let n=o.default.parse(t);return Array.isArray(e)&&!e.map(e=>`.${e}`).includes(n.ext)?t:o.default.parse(n.name).ext!==``||n.name.startsWith(`.`)?o.default.join(n.dir,n.name):t}async function vA(e,t,n){let r=tO(t);if(r!==!0)throw r;let i=mO(e,t,n);try{let r=await uO(i);if(r){let r=await oO(i);t.templateFile=hO(e,t,n);let a=await _O(e,t,n);(typeof t.pattern==`string`||t.pattern instanceof RegExp)&&(r=r.replace(t.pattern,a));let o=await bO(r,e,t);await sO(i,o)}else throw`File does not exist`;return vO(i,n)}catch(e){yO(e)}}const yA=async function(e,t,n,r){let i=await _O(e,t,n),{separator:a=`
268
- `}=t;if(t.unique!==!1){let e=r.split(t.pattern),n=e[e.length-1],o=n.replace(new RegExp(a+i,`g`),``);r=r.replace(n,o)}return t.pattern?r.replace(t.pattern,`$&`+a+i):(r.length>0&&(r+=a),r+i)};async function bA(e,t,n){let r=tO(t);if(r!==!0)throw r;let i=mO(e,t,n);try{let r=await uO(i);if(r){let r=await oO(i);t.templateFile=hO(e,t,n),r=await yA(e,t,n,r),await sO(i,r)}else throw`File does not exist`;return vO(i,n)}catch(e){yO(e)}}var xA={};e.__export(xA,{add:()=>wO,addMany:()=>uA,append:()=>bA,modify:()=>vA});function SA(e,t){let n,r=async function(t,n=[]){let{prompts:r}=t;if(r==null)throw Error(`${t.name} has no prompts`);if(typeof r==`function`)return await r(e.inquirer);let[i,a]=await eO(r,n,e);return await e.inquirer.prompt(i).then(e=>Object.assign(e,a))},i=async function(e,r={},i={}){let s=()=>{},{onSuccess:c=s,onFailure:l=s,onComment:u=s}=i,d=[],f=[],{actions:p}=e,m=o(),h=Object.assign({},m,xA);if(n=!1,typeof p==`function`&&(p=p(r)),p==null)throw Error(`${e.name} has no actions`);if(!Array.isArray(p))throw Error(`${e.name} has invalid actions`);for(let[e,i]of p.entries()){if(typeof i==`string`&&n)continue;if(typeof i==`string`){u(i);continue}let o=typeof i==`function`,s=o?{type:`function`}:i,p=o?i:h[s.type];if(n){let e={type:s.type||``,path:s.path||``,error:`Aborted due to previous action failure`};l(e),f.push(e);continue}if(s.force=t.force===!0||s.force===!0,typeof p!=`function`){s.abortOnFail!==!1&&(n=!0);let t={type:s.type||``,path:s.path||``,error:`Invalid action (#${e+1})`};l(t),f.push(t);continue}try{let e=await a(p,s,r);c(e),d.push(e)}catch(e){s.abortOnFail!==!1&&(n=!0),l(e),f.push(e)}}return{changes:d,failures:f}},a=async function(t,n,r){let i=n.type||``,a=n.data||{};if(typeof a==`function`&&(a=await a()),typeof n.skip==`function`){let e=await n.skip({...r,...a});if(typeof e==`string`)return{type:`skip`,path:e}}let o=Object.keys(a).filter(e=>r[e]===void 0);return o.forEach(e=>{r[e]=a[e]}),await Promise.resolve(t(r,n,e)).then(e=>({type:i,path:typeof e==`string`?e:JSON.stringify(e)}),e=>{throw{type:i,path:``,error:e.message||e.toString()}}).finally(()=>o.forEach(e=>{delete r[e]}))};function o(){return e.getActionTypeList().reduce(function(t,n){return t[n]=e.getActionType(n),t},{})}return{runGeneratorActions:i,runGeneratorPrompts:r}}var CA=e.__toESM(YE(),1),wA=e.__toESM(XE(),1),TA=e.__toESM(fD(),1);const EA=(0,E.createRequire)(require(`url`).pathToFileURL(__filename).href),DA=(e,t,n)=>(0,wA.default)(e,t.replace(`[`,`.`).replace(`]`,``),n);async function OA(e=``,t={}){let n={},r={generators:!0},i,{destBasePath:a,force:c}=t,l={},u={},d={},f=Object.assign({pkg:e=>DA(n,e,``)},KD),p=Object.keys(f),m=_E.registerPrompt,h=e=>{i=e},g=(e,t)=>{f[e]=t},_=(e,t)=>{u[e]=t},v=(e,t)=>{d[e]=t};function y(e,t){return Object.keys(f).forEach(e=>CA.default.registerHelper(e,f[e])),Object.keys(u).forEach(e=>CA.default.registerPartial(e,u[e])),CA.default.compile(e)(t)}let b=()=>i,x=e=>f[e],S=e=>u[e],w=e=>d[e],T=e=>l[e];function E(t=``,n={}){return t||=`generator-${Object.keys(l).length+1}`,l[t]=Object.assign(n,{name:t,basePath:e}),l[t]}let D=()=>Object.keys(f).filter(e=>!p.includes(e)),O=()=>Object.keys(u),k=()=>Object.keys(d);function A(){return Object.keys(l).map(function(e){let{description:t}=l[e];return{name:e,description:t}})}let j=e=>r=e,M=()=>r,N=()=>a||e,P=()=>e,F=t=>{let n=s.default.statSync(t);e=n.isFile()?o.default.dirname(t):t};async function I(e,t={},n){typeof e==`string`&&(e=[e]);let r=Object.assign({destBasePath:N()},t);await Promise.all(e.map(async function(e){let t=TA.default.sync(e,{basedir:P()}),i=await OA(t,r),a=i.getDefaultInclude()||{},o=n||a,s=Object.assign({generators:!1,helpers:!1,partials:!1,actionTypes:!1},o),c=i.getGeneratorList().map(e=>e.name);L(c,o===!0||s.generators,E,e=>({proxyName:e,proxy:i})),L(i.getPartialList(),o===!0||s.partials,_,i.getPartial),L(i.getHelperList(),o===!0||s.helpers,g,i.getHelper),L(i.getActionTypeList(),o===!0||s.actionTypes,v,i.getActionType)}))}function L(e,t,n,r){var i;t===!0&&(i=e),t instanceof Array&&(i=t.filter(e=>typeof e==`string`)),i!=null&&(t=i.reduce(function(e,t){return e[t]=t,e},{})),t instanceof Object&&Object.keys(t).forEach(e=>n(t[e],r(e)))}function R(){try{n=EA(o.default.join(N(),`package.json`))}catch{n={}}}let z={setPrompt:m,setWelcomeMessage:h,getWelcomeMessage:b,setGenerator:E,getGenerator:T,getGeneratorList:A,setPartial:_,getPartial:S,getPartialList:O,setHelper:g,getHelper:x,getHelperList:D,setActionType:v,getActionType:w,getActionTypeList:k,setPlopfilePath:F,getPlopfilePath:P,getDestBasePath:N,load:I,setDefaultInclude:j,getDefaultInclude:M,renderString:y,inquirer:_E,handlebars:CA.default,addPrompt:m,addPartial:_,addHelper:g},B=SA(z,{force:c}),V=Object.assign({},z,{getGenerator(e){var t=z.getGenerator(e);if(t==null)throw Error(`Generator "${e}" does not exist.`);return t.proxy?t.proxy.getGenerator(t.proxyName):Object.assign({},t,{runActions:(e,n)=>B.runGeneratorActions(t,e,n),runPrompts:(e=[])=>B.runGeneratorPrompts(t,e)})},setGenerator(e,t){let n=z.setGenerator(e,t);return this.getGenerator(n.name)}});if(e){e=o.default.resolve(e);let n=o.default.basename(e);F(e),R();let r=o.default.join(e,n),i=await import((0,C.pathToFileURL)(r).href),a=typeof i==`function`?i:i.default;await a(z,t)}else F(process.cwd()),R();return V}var kA=OA,AA=kA,jA=class e extends Error{type;constructor(t,n){super(t),this.name=`GenerateError`,this.type=n?.type??`unknown`,Error.captureStackTrace(this,e)}},MA=e.__toESM(sy());const NA=[`ts`,`js`,`cjs`,`mts`,`mjs`],PA=l.default.join(`turbo`,`generators`),FA=NA.map(e=>l.default.join(PA,`config.${e}`)),IA=[...FA,...NA.map(e=>l.default.join(`plopfile.${e}`))];async function LA(e,t){try{return await AA(await KA(e),{destBasePath:t,force:!1})}catch(e){za(e);return}}function RA(e,t){if(t){if(!MA.default.existsSync(t))throw new jA(`No config at "${t}"`,{type:`plop_no_config`});return[{config:t,root:t,workspace:`root`}]}let n=[];for(let t of IA){let r=l.default.join(e.paths.root,t);if(MA.default.existsSync(r)){n.push({config:r,root:e.paths.root,workspace:`root`});break}}for(let t of YA({project:e})){let r=e.workspaceData.workspaces.find(e=>e.paths.root===t.root);n.push({...t,workspace:r?.name??l.default.basename(t.root)})}return n}async function zA({project:e,configPath:t}){let n=RA(e,t),r={};try{for(let e of n){let t=await LA(e.config,e.root);if(!t)continue;for(let n of t.getGeneratorList()){let i=t.getGenerator(n.name);i.workspace=e.workspace,i.configPath=e.config,i.destBasePath=e.root,r[e.workspace]??=[],r[e.workspace].push(i)}}}finally{JA()}let i=[];for(let[e,t]of Object.entries(r))i.push(new A.Separator(e)),i.push(...t);return i}function BA(e){return`${e.workspace}/${e.name}`}function VA(e){let t=e.indexOf(`/`);return t===-1?null:{workspace:e.slice(0,t),generator:e.slice(t+1)}}function HA({project:e,generator:t}){let n={cwd:process.cwd(),root:e.paths.root,workspace:t.basePath?Za({cwd:t.basePath,target:`package.json`}):void 0},r={};try{r=Xa(t.basePath)}catch{}return{turbo:{paths:n,configs:r}}}const UA=new Set,WA=[`@inquirer/prompts`];function GA(){let e=[];try{let t=(0,E.createRequire)(__filename),n=t.resolve(`@inquirer/prompts`),r=l.default.dirname(n);for(;r!==l.default.dirname(r);){if(l.default.basename(r)===`node_modules`){e.push(r);break}r=l.default.dirname(r)}}catch{}return e}async function KA(e){let t=l.default.basename(e).replace(/\.(ts|js|cjs|mts|mjs)$/,`.turbo-gen-bundled.cjs`),n=l.default.dirname(e),r=l.default.join(n,t);try{let t=GA(),n=await(0,j.build)({entryPoints:[e],outfile:r,bundle:!0,format:`cjs`,platform:`node`,nodePaths:t,plugins:[qA(e)],logLevel:`silent`,footer:{js:`if(module.exports&&module.exports.__esModule&&typeof module.exports.default==="function"){module.exports=module.exports.default;}`}});return n.errors.length>0?e:(UA.add(r),r)}catch{return e}}function qA(e){return{name:`turbo-gen-cli-provided`,setup(t){t.onResolve({filter:/^[^./]/},t=>{let n;if(t.path.startsWith(`@`)){let e=t.path.split(`/`);n=e.slice(0,2).join(`/`)}else n=t.path.split(`/`)[0];if(WA.includes(n))try{let n=(0,E.createRequire)(t.resolveDir?l.default.join(t.resolveDir,`_`):e);n.resolve(t.path);return}catch{try{let e=(0,E.createRequire)(__filename),n=e.resolve(t.path);return{path:n}}catch{return}}})}}}function JA(){for(let e of UA)try{MA.default.removeSync(e)}catch{}UA.clear()}function YA({project:e}){let t=[];for(let n of e.workspaceData.workspaces)for(let e of FA)MA.default.existsSync(l.default.join(n.paths.root,e))&&t.push({config:l.default.join(n.paths.root,e),root:n.paths.root});return t}async function XA({project:e,generator:t,bypassArgs:n,configPath:r}){let i=r??t.configPath,a=r??t.destBasePath,o;try{o=await LA(i,a)}finally{JA()}if(!o)throw new jA(`Unable to load generators`,{type:`plop_unable_to_load_config`});let s;try{s=o.getGenerator(t.name)}catch{}if(!s)throw new jA(`Generator ${BA(t)} not found`,{type:`plop_generator_not_found`});let c=await s.runPrompts(n),l=await s.runActions({...c,...HA({project:e,generator:s})},{onComment:e=>{Fa(e)}});if(l.failures.length>0){for(let e of l.failures)e instanceof Error?za(`Error - ${e.message}`):za(`Error - ${e.error}. Unable to ${e.type} to "${e.path}"`);throw new jA(`Failed to run "${BA(t)}" generator`,{type:`plop_error_running_generator`})}if(l.changes.length>0){Na(`Changes made:`);for(let e of l.changes)e.path&&Ia(`${e.path} (${e.type})`)}}function ZA(e,t){let n=VA(t);if(n)return e.find(e=>!(e instanceof A.Separator)&&e.name===n.generator&&e.workspace===n.workspace);let r=e.filter(e=>!(e instanceof A.Separator)&&e.name===t);if(r.length===1)return r[0];if(r.length>1){Ra(`Multiple generators named "${t}" found. Use a qualified name to disambiguate:`);for(let e of r)Ia(BA(e));La()}}async function QA({generators:e,generator:t}){if(t){let n=ZA(e,t);if(n)return{selectedGenerator:n};Ra(`Generator "${t}" not found`),La()}let n=await(0,A.select)({message:`Select generator to run`,choices:e.map(e=>{if(e instanceof A.Separator)return e;let t=BA(e);return{name:e.description?` ${t}: ${e.description}`:` ${t}`,value:e}})});return{selectedGenerator:n}}async function $A(){let e=await(0,A.select)({message:`Should the generator config be created with TS or JS?`,default:`ts`,choices:[{name:`JavaScript`,value:`js`},{name:`TypeScript`,value:`ts`}]});return{answer:e}}async function ej({message:e}){let t=await(0,A.confirm)({message:e});return{answer:t}}const tj={"simple-js":{files:[{relativePath:`config.js`,content:`module.exports = function generator(plop) {
268
+ `}=t;if(t.unique!==!1){let e=r.split(t.pattern),n=e[e.length-1],o=n.replace(new RegExp(a+i,`g`),``);r=r.replace(n,o)}return t.pattern?r.replace(t.pattern,`$&`+a+i):(r.length>0&&(r+=a),r+i)};async function bA(e,t,n){let r=tO(t);if(r!==!0)throw r;let i=mO(e,t,n);try{let r=await uO(i);if(r){let r=await oO(i);t.templateFile=hO(e,t,n),r=await yA(e,t,n,r),await sO(i,r)}else throw`File does not exist`;return vO(i,n)}catch(e){yO(e)}}var xA={};e.__export(xA,{add:()=>wO,addMany:()=>uA,append:()=>bA,modify:()=>vA});function SA(e,t){let n,r=async function(t,n=[]){let{prompts:r}=t;if(r==null)throw Error(`${t.name} has no prompts`);if(typeof r==`function`)return await r(e.inquirer);let[i,a]=await eO(r,n,e);return await e.inquirer.prompt(i).then(e=>Object.assign(e,a))},i=async function(e,r={},i={}){let s=()=>{},{onSuccess:c=s,onFailure:l=s,onComment:u=s}=i,d=[],f=[],{actions:p}=e,m=o(),h=Object.assign({},m,xA);if(n=!1,typeof p==`function`&&(p=p(r)),p==null)throw Error(`${e.name} has no actions`);if(!Array.isArray(p))throw Error(`${e.name} has invalid actions`);for(let[e,i]of p.entries()){if(typeof i==`string`&&n)continue;if(typeof i==`string`){u(i);continue}let o=typeof i==`function`,s=o?{type:`function`}:i,p=o?i:h[s.type];if(n){let e={type:s.type||``,path:s.path||``,error:`Aborted due to previous action failure`};l(e),f.push(e);continue}if(s.force=t.force===!0||s.force===!0,typeof p!=`function`){s.abortOnFail!==!1&&(n=!0);let t={type:s.type||``,path:s.path||``,error:`Invalid action (#${e+1})`};l(t),f.push(t);continue}try{let e=await a(p,s,r);c(e),d.push(e)}catch(e){s.abortOnFail!==!1&&(n=!0),l(e),f.push(e)}}return{changes:d,failures:f}},a=async function(t,n,r){let i=n.type||``,a=n.data||{};if(typeof a==`function`&&(a=await a()),typeof n.skip==`function`){let e=await n.skip({...r,...a});if(typeof e==`string`)return{type:`skip`,path:e}}let o=Object.keys(a).filter(e=>r[e]===void 0);return o.forEach(e=>{r[e]=a[e]}),await Promise.resolve(t(r,n,e)).then(e=>({type:i,path:typeof e==`string`?e:JSON.stringify(e)}),e=>{throw{type:i,path:``,error:e.message||e.toString()}}).finally(()=>o.forEach(e=>{delete r[e]}))};function o(){return e.getActionTypeList().reduce(function(t,n){return t[n]=e.getActionType(n),t},{})}return{runGeneratorActions:i,runGeneratorPrompts:r}}var CA=e.__toESM(YE(),1),wA=e.__toESM(XE(),1),TA=e.__toESM(fD(),1);const EA=(0,E.createRequire)(require(`url`).pathToFileURL(__filename).href),DA=(e,t,n)=>(0,wA.default)(e,t.replace(`[`,`.`).replace(`]`,``),n);async function OA(e=``,t={}){let n={},r={generators:!0},i,{destBasePath:a,force:c}=t,l={},u={},d={},f=Object.assign({pkg:e=>DA(n,e,``)},KD),p=Object.keys(f),m=_E.registerPrompt,h=e=>{i=e},g=(e,t)=>{f[e]=t},_=(e,t)=>{u[e]=t},v=(e,t)=>{d[e]=t};function y(e,t){return Object.keys(f).forEach(e=>CA.default.registerHelper(e,f[e])),Object.keys(u).forEach(e=>CA.default.registerPartial(e,u[e])),CA.default.compile(e)(t)}let b=()=>i,x=e=>f[e],S=e=>u[e],w=e=>d[e],T=e=>l[e];function E(t=``,n={}){return t||=`generator-${Object.keys(l).length+1}`,l[t]=Object.assign(n,{name:t,basePath:e}),l[t]}let D=()=>Object.keys(f).filter(e=>!p.includes(e)),O=()=>Object.keys(u),k=()=>Object.keys(d);function A(){return Object.keys(l).map(function(e){let{description:t}=l[e];return{name:e,description:t}})}let j=e=>r=e,M=()=>r,N=()=>a||e,P=()=>e,F=t=>{let n=s.default.statSync(t);e=n.isFile()?o.default.dirname(t):t};async function I(e,t={},n){typeof e==`string`&&(e=[e]);let r=Object.assign({destBasePath:N()},t);await Promise.all(e.map(async function(e){let t=TA.default.sync(e,{basedir:P()}),i=await OA(t,r),a=i.getDefaultInclude()||{},o=n||a,s=Object.assign({generators:!1,helpers:!1,partials:!1,actionTypes:!1},o),c=i.getGeneratorList().map(e=>e.name);L(c,o===!0||s.generators,E,e=>({proxyName:e,proxy:i})),L(i.getPartialList(),o===!0||s.partials,_,i.getPartial),L(i.getHelperList(),o===!0||s.helpers,g,i.getHelper),L(i.getActionTypeList(),o===!0||s.actionTypes,v,i.getActionType)}))}function L(e,t,n,r){var i;t===!0&&(i=e),t instanceof Array&&(i=t.filter(e=>typeof e==`string`)),i!=null&&(t=i.reduce(function(e,t){return e[t]=t,e},{})),t instanceof Object&&Object.keys(t).forEach(e=>n(t[e],r(e)))}function R(){try{n=EA(o.default.join(N(),`package.json`))}catch{n={}}}let z={setPrompt:m,setWelcomeMessage:h,getWelcomeMessage:b,setGenerator:E,getGenerator:T,getGeneratorList:A,setPartial:_,getPartial:S,getPartialList:O,setHelper:g,getHelper:x,getHelperList:D,setActionType:v,getActionType:w,getActionTypeList:k,setPlopfilePath:F,getPlopfilePath:P,getDestBasePath:N,load:I,setDefaultInclude:j,getDefaultInclude:M,renderString:y,inquirer:_E,handlebars:CA.default,addPrompt:m,addPartial:_,addHelper:g},B=SA(z,{force:c}),V=Object.assign({},z,{getGenerator(e){var t=z.getGenerator(e);if(t==null)throw Error(`Generator "${e}" does not exist.`);return t.proxy?t.proxy.getGenerator(t.proxyName):Object.assign({},t,{runActions:(e,n)=>B.runGeneratorActions(t,e,n),runPrompts:(e=[])=>B.runGeneratorPrompts(t,e)})},setGenerator(e,t){let n=z.setGenerator(e,t);return this.getGenerator(n.name)}});if(e){e=o.default.resolve(e);let n=o.default.basename(e);F(e),R();let r=o.default.join(e,n),i=await import((0,C.pathToFileURL)(r).href),a=typeof i==`function`?i:i.default;await a(z,t)}else F(process.cwd()),R();return V}var kA=OA,AA=kA,jA=class e extends Error{type;constructor(t,n){super(t),this.name=`GenerateError`,this.type=n?.type??`unknown`,Error.captureStackTrace(this,e)}},MA=e.__toESM(sy());const NA=[`ts`,`js`,`cjs`,`mts`,`mjs`],PA=l.default.join(`turbo`,`generators`),FA=NA.map(e=>l.default.join(PA,`config.${e}`)),IA=[...FA,...NA.map(e=>l.default.join(`plopfile.${e}`))];async function LA(e,t){let n=await GA(e);try{return await AA(n,{destBasePath:t,force:!1})}catch(e){za(e);return}finally{if(n!==e)try{MA.default.removeSync(n)}catch{}}}function RA(e,t){if(t){if(!MA.default.existsSync(t))throw new jA(`No config at "${t}"`,{type:`plop_no_config`});return[{config:t,root:t,workspace:`root`}]}let n=[];for(let t of IA){let r=l.default.join(e.paths.root,t);if(MA.default.existsSync(r)){n.push({config:r,root:e.paths.root,workspace:`root`});break}}for(let t of qA({project:e})){let r=e.workspaceData.workspaces.find(e=>e.paths.root===t.root);n.push({...t,workspace:r?.name??l.default.basename(t.root)})}return n}async function zA({project:e,configPath:t}){let n=RA(e,t),r={};for(let e of n){let t=await LA(e.config,e.root);if(!t)continue;for(let n of t.getGeneratorList()){let i=t.getGenerator(n.name);i.workspace=e.workspace,i.configPath=e.config,i.destBasePath=e.root,r[e.workspace]??=[],r[e.workspace].push(i)}}let i=[];for(let[e,t]of Object.entries(r))i.push(new A.Separator(e)),i.push(...t);return i}function BA(e){return`${e.workspace}/${e.name}`}function VA(e){let t=e.indexOf(`/`);return t===-1?null:{workspace:e.slice(0,t),generator:e.slice(t+1)}}function HA({project:e,generator:t}){let n={cwd:process.cwd(),root:e.paths.root,workspace:t.basePath?Za({cwd:t.basePath,target:`package.json`}):void 0},r={};try{r=Xa(t.basePath)}catch{}return{turbo:{paths:n,configs:r}}}const UA=[`@inquirer/prompts`];function WA(){let e=[];try{let t=(0,E.createRequire)(__filename),n=t.resolve(`@inquirer/prompts`),r=l.default.dirname(n);for(;r!==l.default.dirname(r);){if(l.default.basename(r)===`node_modules`){e.push(r);break}r=l.default.dirname(r)}}catch{}return e}async function GA(e){let t=l.default.basename(e).replace(/\.(ts|js|cjs|mts|mjs)$/,`.${(0,S.randomUUID)()}.turbo-gen-bundled.cjs`),n=l.default.dirname(e),r=l.default.join(n,t);try{let t=WA(),n=await(0,j.build)({entryPoints:[e],outfile:r,bundle:!0,format:`cjs`,platform:`node`,nodePaths:t,plugins:[KA(e)],logLevel:`silent`,footer:{js:`if(module.exports&&module.exports.__esModule&&typeof module.exports.default==="function"){module.exports=module.exports.default;}`}});return n.errors.length>0?e:r}catch{return e}}function KA(e){return{name:`turbo-gen-cli-provided`,setup(t){t.onResolve({filter:/^[^./]/},t=>{let n;if(t.path.startsWith(`@`)){let e=t.path.split(`/`);n=e.slice(0,2).join(`/`)}else n=t.path.split(`/`)[0];if(UA.includes(n))try{let n=(0,E.createRequire)(t.resolveDir?l.default.join(t.resolveDir,`_`):e);n.resolve(t.path);return}catch{try{let e=(0,E.createRequire)(__filename),n=e.resolve(t.path);return{path:n}}catch{return}}})}}}function qA({project:e}){let t=[];for(let n of e.workspaceData.workspaces)for(let e of FA)MA.default.existsSync(l.default.join(n.paths.root,e))&&t.push({config:l.default.join(n.paths.root,e),root:n.paths.root});return t}async function JA({project:e,generator:t,bypassArgs:n,configPath:r}){let i=r??t.configPath,a=r??t.destBasePath,o=await LA(i,a);if(!o)throw new jA(`Unable to load generators`,{type:`plop_unable_to_load_config`});let s;try{s=o.getGenerator(t.name)}catch{}if(!s)throw new jA(`Generator ${BA(t)} not found`,{type:`plop_generator_not_found`});let c=await s.runPrompts(n),l=await s.runActions({...c,...HA({project:e,generator:s})},{onComment:e=>{Fa(e)}});if(l.failures.length>0){for(let e of l.failures)e instanceof Error?za(`Error - ${e.message}`):za(`Error - ${e.error}. Unable to ${e.type} to "${e.path}"`);throw new jA(`Failed to run "${BA(t)}" generator`,{type:`plop_error_running_generator`})}if(l.changes.length>0){Na(`Changes made:`);for(let e of l.changes)e.path&&Ia(`${e.path} (${e.type})`)}}function YA(e,t){let n=VA(t);if(n)return e.find(e=>!(e instanceof A.Separator)&&e.name===n.generator&&e.workspace===n.workspace);let r=e.filter(e=>!(e instanceof A.Separator)&&e.name===t);if(r.length===1)return r[0];if(r.length>1){Ra(`Multiple generators named "${t}" found. Use a qualified name to disambiguate:`);for(let e of r)Ia(BA(e));La()}}async function XA({generators:e,generator:t}){if(t){let n=YA(e,t);if(n)return{selectedGenerator:n};Ra(`Generator "${t}" not found`),La()}let n=await(0,A.select)({message:`Select generator to run`,choices:e.map(e=>{if(e instanceof A.Separator)return e;let t=BA(e);return{name:e.description?` ${t}: ${e.description}`:` ${t}`,value:e}})});return{selectedGenerator:n}}async function ZA(){let e=await(0,A.select)({message:`Should the generator config be created with TS or JS?`,default:`ts`,choices:[{name:`JavaScript`,value:`js`},{name:`TypeScript`,value:`ts`}]});return{answer:e}}async function QA({message:e}){let t=await(0,A.confirm)({message:e});return{answer:t}}const $A={"simple-js":{files:[{relativePath:`config.js`,content:`module.exports = function generator(plop) {
269
269
  plop.setGenerator("example", {
270
270
  description:
271
271
  "An example Turborepo generator - creates a new file at the root of the project",
@@ -369,10 +369,10 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
369
369
  ### Created with Turborepo Generators
370
370
 
371
371
  Read the docs at [turborepo.dev](https://turborepo.dev/docs/guides/generating-code).
372
- `}]}};var nj=e.__toESM(sy());async function rj({project:e,template:t}){let n=l.default.join(e.paths.root,`turbo`,`generators`),r=`simple-${t}`,i=tj[r];if(!i)throw new jA(`Unknown template "${r}"`,{type:`config_directory_already_exists`});if(await nj.default.pathExists(n))throw new jA(`Generator config directory already exists at ${n}`,{type:`config_directory_already_exists`});for(let e of i.files){let t=l.default.join(n,e.relativePath);await nj.default.outputFile(t,e.content)}}async function ij({generator:e,project:t,opts:n}){let r=!1,i=await zA({project:t,configPath:n.config});if(!i.length){za(`No generators found.`),La();let{answer:e}=await ej({message:`Would you like to add a config with a sample custom generator to ${t.name}?`});if(e){r=!0;let{answer:e}=await $A();try{await rj({project:t,template:e})}catch(e){throw e instanceof jA||za(`Failed to create generator config`),e}if(La(),Na(`Generator config successfully created!`),Na(`Loading generator config...`),La(),i=await zA({project:t,configPath:n.config}),!i.length){za(`Error loading generator`);return}}else{La(),Fa(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`);return}}let{selectedGenerator:a}=await QA({generators:i,generator:e});try{await XA({project:t,generator:a,bypassArgs:n.args,configPath:n.config})}catch(e){if(e instanceof jA)throw e;let t=`Failed to run generator`;throw e instanceof Error&&(t=e.message),new jA(t,{type:`plop_error_running_generator`})}finally{r&&(La(),Na(`Congrats! You just ran your first Turborepo generator`),Fa(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`))}La(),Pa(Oa(`>>> Success!`))}const aj=(e,t,n)=>{let r=e instanceof RegExp?oj(e,n):e,i=t instanceof RegExp?oj(t,n):t,a=r!==null&&i!=null&&sj(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},oj=(e,t)=>{let n=t.match(e);return n?n[0]:null},sj=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},cj=`\0SLASH`+Math.random()+`\0`,lj=`\0OPEN`+Math.random()+`\0`,uj=`\0CLOSE`+Math.random()+`\0`,dj=`\0COMMA`+Math.random()+`\0`,fj=`\0PERIOD`+Math.random()+`\0`,pj=new RegExp(cj,`g`),mj=new RegExp(lj,`g`),hj=new RegExp(uj,`g`),gj=new RegExp(dj,`g`),_j=new RegExp(fj,`g`),vj=/\\\\/g,yj=/\\{/g,bj=/\\}/g,xj=/\\,/g,Sj=/\\\./g,Cj=1e5,wj=4e6;function Tj(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Ej(e){return e.replace(vj,cj).replace(yj,lj).replace(bj,uj).replace(xj,dj).replace(Sj,fj)}function Dj(e){return e.replace(pj,`\\`).replace(mj,`{`).replace(hj,`}`).replace(gj,`,`).replace(_j,`.`)}function Oj(e){if(!e)return[``];let t=[],n=aj(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=Oj(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function kj(e,t={}){if(!e)return[];let{max:n=Cj,maxLength:r=wj}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),Ij(Ej(e),n,r,!0).map(Dj)}function Aj(e){return`{`+e+`}`}function jj(e){return/^-?0\d/.test(e)}function Mj(e,t){return e<=t}function Nj(e,t){return e>=t}function Pj(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function Fj(e,t,n,r){let i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;let o=Tj(i[0]),s=Tj(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Tj(i[2])),1):1,u=Mj,d=s<o;d&&(l*=-1,u=Nj);let f=i.some(jj),p=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),f){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(p+n.length>r)break;a.push(n),p+=n.length}return a}function Ij(e,t,n,r){let i=[``],a=!1,o=!0;for(;;){let s=aj(`{`,`}`,e);if(!s)return Pj(i,e,[``],t,n,a);let c=s.pre;if(/\$$/.test(c)){if(i=Pj(i,c+`{`+s.body+`}`,[``],t,n,a&&!s.post.length),o=!1,!s.post.length)break;e=s.post;continue}let l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=l||u,f=s.body.indexOf(`,`)>=0;if(!d&&!f){if(s.post.match(/,(?!,).*\}/)){e=s.pre+`{`+s.body+uj+s.post,r=!0;continue}return Pj(i,c+`{`+s.body+`}`+s.post,[``],t,n,a)}o&&(a=r&&!d,o=!1);let p;if(d)p=Fj(s.body,u,t,n);else{let r=Oj(s.body);if(r.length===1&&r[0]!==void 0&&(r=Ij(r[0],t,n,!1).map(Aj),r.length===1)){if(i=Pj(i,c+r[0],[``],t,n,a&&!s.post.length),!s.post.length)break;e=s.post;continue}let o=a&&!s.post.length&&!c;for(let e=0;o&&e<i.length;e++)i[e]&&(o=!1);p=[];let l=0;outer:for(let e=0;e<r.length;e++){let i=Ij(r[e],t,n,!1);for(let e=0;e<i.length;e++){let r=i[e];if(!(o&&!r)){if(p.length>=t||l+r.length>n)break outer;p.push(r),l+=r.length}}}}if(i=Pj(i,c,p,t,n,a&&!s.post.length),!s.post.length)break;e=s.post}return i}const Lj=1024*64,Rj=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>Lj)throw TypeError(`pattern is too long`)},zj={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},Bj=e=>e.replace(/[[\]\\-]/g,`\\$&`),Vj=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Hj=e=>e.join(``),Uj=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(zj))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(Bj(d)+`-`+Bj(t)):t===d&&r.push(Bj(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(Bj(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(Bj(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[Vj(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+Hj(r)+`]`,p=`[`+(l?``:`^`)+Hj(i)+`]`,m=r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p;return[m,s,u-n,!0]},Wj=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`);var Gj;const Kj=new Set([`!`,`?`,`+`,`*`,`@`]),qj=e=>Kj.has(e),Jj=e=>qj(e.type),Yj=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Xj=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),Zj=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Qj=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),$j=`(?!(?:^|/)\\.\\.?(?:$|/))`,eM=`(?!\\.)`,tM=new Set([`[`,`.`]),nM=new Set([`..`,`.`]),rM=new Set(`().*{}+?[]^$\\!`),iM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),aM=`[^/]`,oM=aM+`*?`,sM=aM+`+?`;var cM=class{type;#root;#hasMagic;#uflag=!1;#parts=[];#parent;#parentIndex;#negs;#filledNegs=!1;#options;#toString;#emptyExt=!1;constructor(e,t,n={}){this.type=e,e&&(this.#hasMagic=!0),this.#parent=t,this.#root=this.#parent?this.#parent.#root:this,this.#options=this.#root===this?n:this.#root.#options,this.#negs=this.#root===this?[]:this.#root.#negs,e===`!`&&!this.#root.#filledNegs&&this.#negs.push(this),this.#parentIndex=this.#parent?this.#parent.#parts.length:0}get hasMagic(){if(this.#hasMagic!==void 0)return this.#hasMagic;for(let e of this.#parts){if(typeof e==`string`)continue;if(e.type||e.hasMagic)return this.#hasMagic=!0}return this.#hasMagic}toString(){return this.#toString===void 0?this.type?this.#toString=this.type+`(`+this.#parts.map(e=>String(e)).join(`|`)+`)`:this.#toString=this.#parts.map(e=>String(e)).join(``):this.#toString}#fillNegs(){if(this!==this.#root)throw Error(`should only call on root`);if(this.#filledNegs)return this;this.toString(),this.#filledNegs=!0;let e;for(;e=this.#negs.pop();){if(e.type!==`!`)continue;let t=e,n=t.#parent;for(;n;){for(let r=t.#parentIndex+1;!n.type&&r<n.#parts.length;r++)for(let t of e.#parts){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#parts[r])}t=n,n=t.#parent}}return this}push(...e){for(let t of e){if(t===``)continue;if(typeof t!=`string`&&!(t instanceof Gj&&t.#parent===this))throw Error(`invalid part: `+t);this.#parts.push(t)}}toJSON(){let e=this.type===null?this.#parts.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#parts.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#root||this.#root.#filledNegs&&this.#parent?.type===`!`)&&e.push({}),e}isStart(){if(this.#root===this)return!0;if(!this.#parent?.isStart())return!1;if(this.#parentIndex===0)return!0;let e=this.#parent;for(let t=0;t<this.#parentIndex;t++){let n=e.#parts[t];if(!(n instanceof Gj&&n.type===`!`))return!1}return!0}isEnd(){if(this.#root===this||this.#parent?.type===`!`)return!0;if(!this.#parent?.isEnd())return!1;if(!this.type)return this.#parent?.isEnd();let e=this.#parent?this.#parent.#parts.length:0;return this.#parentIndex===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new Gj(this.type,e);for(let e of this.#parts)t.copyIn(e);return t}static#parseAST(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}let f=!r.noext&&qj(n)&&e.charAt(u)===`(`&&i<=a;if(f){t.push(d),d=``;let a=new Gj(n,t);u=Gj.#parseAST(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new Gj(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}let m=qj(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#canAdoptType(n));if(m){let a=t&&t.#canAdoptType(n)?0:1;d.push(p),p=``;let o=new Gj(n,d);d.push(o),u=Gj.#parseAST(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new Gj(null,t);continue}if(n===`)`)return p===``&&t.#parts.length===0&&(t.#emptyExt=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#hasMagic=void 0,t.#parts=[e.substring(n-1)],u}#canAdoptWithSpace(e){return this.#canAdopt(e,Xj)}#canAdopt(e,t=Yj){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null)return!1;let n=e.#parts[0];return!n||typeof n!=`object`||n.type===null?!1:this.#canAdoptType(n.type,t)}#canAdoptType(e,t=Zj){return!!t.get(this.type)?.includes(e)}#adoptWithSpace(e,t){let n=e.#parts[0],r=new Gj(null,n,this.options);r.#parts.push(``),n.push(r),this.#adopt(e,t)}#adopt(e,t){let n=e.#parts[0];this.#parts.splice(t,1,...n.#parts);for(let e of n.#parts)typeof e==`object`&&(e.#parent=this);this.#toString=void 0}#canUsurpType(e){let t=Qj.get(this.type);return!!t?.has(e)}#canUsurp(e){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null||this.#parts.length!==1)return!1;let t=e.#parts[0];return!t||typeof t!=`object`||t.type===null?!1:this.#canUsurpType(t.type)}#usurp(e){let t=Qj.get(this.type),n=e.#parts[0],r=t?.get(n.type);if(!r)return!1;this.#parts=n.#parts;for(let e of this.#parts)typeof e==`object`&&(e.#parent=this);this.type=r,this.#toString=void 0,this.#emptyExt=!1}#flatten(){if(Jj(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#parts.length;e++){let n=this.#parts[e];typeof n==`object`&&(n.#flatten(),this.#canAdopt(n)?(t=!1,this.#adopt(n,e)):this.#canAdoptWithSpace(n)?(t=!1,this.#adoptWithSpace(n,e)):this.#canUsurp(n)&&(t=!1,this.#usurp(n)))}}while(!t&&++e<10)}else for(let e of this.#parts)typeof e==`object`&&e.#flatten();this.#toString=void 0}static fromGlob(e,t={}){let n=new Gj(null,void 0,t);return Gj.#parseAST(e,n,0,t,0),n}toMMPattern(){if(this!==this.#root)return this.#root.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource(),a=r||this.#hasMagic||this.#options.nocase&&!this.#options.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase();if(!a)return n;let o=(this.#options.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,o),{_src:t,_glob:e})}get options(){return this.#options}toRegExpSource(e){let t=e??!!this.#options.dot;if(this.#root===this&&(this.#flatten(),this.#fillNegs()),!Jj(this)){let n=this.isStart()&&this.isEnd(),r=this.#parts.map(t=>{let[r,i,a,o]=typeof t==`string`?Gj.#parseGlob(t,this.#hasMagic,n):t.toRegExpSource(e);return this.#hasMagic=this.#hasMagic||a,this.#uflag=this.#uflag||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#parts[0]==`string`){let n=this.#parts.length===1&&nM.has(this.#parts[0]);if(!n){let n=tM,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?$j:o?eM:``}}let a=``;this.isEnd()&&this.#root.#filledNegs&&this.#parent?.type===`!`&&(a=`(?:$|\\/)`);let o=i+r+a;return[o,Wj(r),this.#hasMagic=!!this.#hasMagic,this.#uflag]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#partsToRegExp(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#parts=[e],t.type=null,t.#hasMagic=void 0,[e,Wj(this.toString()),!1,!1]}let a=!n||e||t||!eM?``:this.#partsToRegExp(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#emptyExt)o=(this.isStart()&&!t?eM:``)+sM;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?eM:``)+oM+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,Wj(i),this.#hasMagic=!!this.#hasMagic,this.#uflag]}#partsToRegExp(e){return this.#parts.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#uflag=this.#uflag||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#parseGlob(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(rM.has(c)?`\\`:``)+c,o=!1;continue}if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,c,l]=Uj(e,s);if(c){i+=n,a||=r,s+=c-1,t||=l,o=!1;continue}}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?sM:oM,t=!0;continue}else o=!1;if(c===`?`){i+=aM,t=!0;continue}i+=iM(c)}return[i,Wj(e),!!t,a]}};Gj=cM;const lM=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),uM=(e,t,n={})=>(Rj(t),!n.nocomment&&t.charAt(0)===`#`?!1:new qM(t,n).match(e)),dM=/^\*+([^+@!?\*\[\(]*)$/,fM=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),pM=e=>t=>t.endsWith(e),mM=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),hM=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),gM=/^\*+\.\*+$/,_M=e=>!e.startsWith(`.`)&&e.includes(`.`),vM=e=>e!==`.`&&e!==`..`&&e.includes(`.`),yM=/^\.\*+$/,bM=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),xM=/^\*+$/,SM=e=>e.length!==0&&!e.startsWith(`.`),CM=e=>e.length!==0&&e!==`.`&&e!==`..`,wM=/^\?+([^+@!?\*\[\(]*)?$/,TM=([e,t=``])=>{let n=kM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},EM=([e,t=``])=>{let n=AM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},DM=([e,t=``])=>{let n=AM([e]);return t?e=>n(e)&&e.endsWith(t):n},OM=([e,t=``])=>{let n=kM([e]);return t?e=>n(e)&&e.endsWith(t):n},kM=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},AM=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},jM=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,MM={win32:{sep:`\\`},posix:{sep:`/`}},NM=jM===`win32`?MM.win32.sep:MM.posix.sep;uM.sep=NM;const PM=Symbol(`globstar **`);uM.GLOBSTAR=PM;const FM=`[^/]`,IM=FM+`*?`,LM=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,RM=`(?:(?!(?:\\/|^)\\.).)*?`,zM=(e,t={})=>n=>uM(n,e,t);uM.filter=zM;const BM=(e,t={})=>Object.assign({},e,t),VM=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return uM;let t=uM,n=(n,r,i={})=>t(n,r,BM(e,i));return Object.assign(n,{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,BM(e,n))}static defaults(n){return t.defaults(BM(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,BM(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,BM(e,r))}},unescape:(n,r={})=>t.unescape(n,BM(e,r)),escape:(n,r={})=>t.escape(n,BM(e,r)),filter:(n,r={})=>t.filter(n,BM(e,r)),defaults:n=>t.defaults(BM(e,n)),makeRe:(n,r={})=>t.makeRe(n,BM(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,BM(e,r)),match:(n,r,i={})=>t.match(n,r,BM(e,i)),sep:t.sep,GLOBSTAR:PM})};uM.defaults=VM;const HM=(e,t={})=>(Rj(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:kj(e));uM.braceExpand=HM;const UM=(e,t={})=>new qM(e,t).makeRe();uM.makeRe=UM;const WM=(e,t,n={})=>{let r=new qM(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};uM.match=WM;const GM=/[?*]|[+@!]\(.*?\)|\[|\]/,KM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var qM=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Rj(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||jM,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!GM.test(e[2]))&&!GM.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`,r=e?[`.`]:[];n.splice(i-1,2,...r),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(PM)?this.#matchGlobstar(e,t,n,r,i):this.#matchOne(e,t,n,r,i)}#matchGlobstar(e,t,n,r,i){let a=t.indexOf(PM,i),o=t.lastIndexOf(PM),[s,c,l]=[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#matchOne(t,s,n,0,0))return!1;r+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#matchOne(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#matchOne(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===PM?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#matchGlobStarBodySections(e,d,r,0,n,0,!!u)}#matchGlobStarBodySections(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){let s=this.#matchOne(e.slice(0,n+c.length),c,i,n,0);if(s&&a<this.maxGlobstarRecursion){let s=this.#matchGlobStarBodySections(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let l=e[n];if(l===`.`||l===`..`||!this.options.dot&&l.startsWith(`.`))return!1;n++}return null}#matchOne(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===PM)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return HM(this.pattern,this.options)}parse(e){Rj(e);let t=this.options;if(e===`**`)return PM;if(e===``)return``;let n,r=null;(n=e.match(xM))?r=t.dot?CM:SM:(n=e.match(dM))?r=(t.nocase?t.dot?hM:mM:t.dot?pM:fM)(n[1]):(n=e.match(wM))?r=(t.nocase?t.dot?EM:TM:t.dot?DM:OM)(n):(n=e.match(gM))?r=t.dot?vM:_M:(n=e.match(yM))&&(r=bM);let i=cM.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?IM:t.dot?LM:RM,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?KM(e):e===PM?PM:e._src});return t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==PM||a===PM||(a===void 0?i!==void 0&&i!==PM?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|`+n+`)?`:i!==PM&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=PM))}),t.filter(e=>e!==PM).join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;n.matchBase&&o.length===1&&(s=[a]);let c=this.matchOne(s,o,t);if(c)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return uM.defaults(e).Minimatch}};uM.AST=cM,uM.Minimatch=qM,uM.escape=lM,uM.unescape=Wj;var JM=e.__commonJSMin((exports,t)=>{var n=class{constructor(){this.max=1e3,this.map=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){let n=this.delete(e);if(!n&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};t.exports=n}),YM=e.__commonJSMin((exports,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({}),i=e=>e?typeof e==`object`?e:n:r;t.exports=i}),XM=e.__commonJSMin((exports,t)=>{let n=`2.0.0`,r=256,i=2**53-1||9007199254740991,a=16,o=r-6,s=[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`];t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:i,RELEASE_TYPES:s,SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),ZM=e.__commonJSMin((exports,t)=>{let n=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{};t.exports=n}),QM=e.__commonJSMin((exports,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=XM(),a=ZM();exports=t.exports={};let o=exports.re=[],s=exports.safeRe=[],c=exports.src=[],l=exports.safeSrc=[],u=exports.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),exports.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),exports.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),exports.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)}),$M=e.__commonJSMin((exports,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},i=(e,t)=>r(t,e);t.exports={compareIdentifiers:r,rcompareIdentifiers:i}}),eN=e.__commonJSMin((exports,t)=>{let n=ZM(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=XM(),{safeRe:a,t:o}=QM(),s=YM(),{compareIdentifiers:c}=$M();var l=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[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}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),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?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),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 r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,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)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};t.exports=l}),tN=e.__commonJSMin((exports,t)=>{let n=eN(),r=(e,t,r)=>new n(e,r).compare(new n(t,r));t.exports=r}),nN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)===0;t.exports=r}),rN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)!==0;t.exports=r}),iN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)>0;t.exports=r}),aN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)>=0;t.exports=r}),oN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)<0;t.exports=r}),sN=e.__commonJSMin((exports,t)=>{let n=tN(),r=(e,t,r)=>n(e,t,r)<=0;t.exports=r}),cN=e.__commonJSMin((exports,t)=>{let n=nN(),r=rN(),i=iN(),a=aN(),o=oN(),s=sN(),c=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}};t.exports=c}),lN=e.__commonJSMin((exports,t)=>{let n=Symbol(`SemVer ANY`);var r=class e{static get ANY(){return n}constructor(t,r){if(r=i(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),c(`comparator`,t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,c(`comp`,this)}parse(e){let t=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new u(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new u(this.value,n).test(t.semver):(n=i(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.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.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||s(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||s(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};t.exports=r;let i=YM(),{safeRe:a,t:o}=QM(),s=cN(),c=ZM(),l=eN(),u=uN()}),uN=e.__commonJSMin((exports,t)=>{let n=/\s+/g;var r=class e{constructor(t,r){if(r=o(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof s)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=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!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=>!_(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&&v(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}parseRange(e){let t=(this.options.includePrerelease&&h)|(this.options.loose&&g),n=t+`:`+e,r=a.get(n);if(r)return r;let i=this.options.loose,o=i?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(o,A(this.options.includePrerelease)),c(`hyphen replace`,e),e=e.replace(u[d.COMPARATORTRIM],f),c(`comparator trim`,e),e=e.replace(u[d.TILDETRIM],p),c(`tilde trim`,e),e=e.replace(u[d.CARETTRIM],m),c(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>k(e,this.options));i&&(l=l.filter(e=>(c(`loose invalid filter`,e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c(`range list`,l);let v=new Map,y=l.map(e=>new s(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return a.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}};t.exports=r;let i=JM(),a=new i,o=YM(),s=lN(),c=ZM(),l=eN(),{safeRe:u,t:d,comparatorTrimReplace:f,tildeTrimReplace:p,caretTrimReplace:m}=QM(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=XM(),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(u[d.BUILD],``),c(`comp`,e,t),e=w(e,t),c(`caret`,e),e=S(e,t),c(`tildes`,e),e=E(e,t),c(`xrange`,e),e=O(e,t),c(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{let n=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(n,(t,n,r,i,a)=>{c(`tilde`,e,t,n,r,i,a);let o;return x(n)?o=``:x(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:x(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(c(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,c(`tilde return`,o),o})},w=(e,t)=>e.trim().split(/\s+/).map(e=>T(e,t)).join(` `),T=(e,t)=>{c(`caret`,e,t);let n=t.loose?u[d.CARETLOOSE]:u[d.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{c(`caret`,e,t,n,i,a,o);let s;return x(n)?s=``:x(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(c(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(c(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),c(`caret return`,s),s})},E=(e,t)=>(c(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>D(e,t)).join(` `)),D=(e,t)=>{e=e.trim();let n=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{c(`xRange`,e,n,r,i,a,o,s);let l=x(i),u=l||x(a),d=u||x(o),f=d;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),o=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):u?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),c(`xRange return`,n),n})},O=(e,t)=>(c(`replaceStars`,e,t),e.trim().replace(u[d.STAR],``)),k=(e,t)=>(c(`replaceGTE0`,e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],``)),A=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),j=(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++)if(c(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}}),dN=e.__commonJSMin((exports,t)=>{let n=uN(),r=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)};t.exports=r}),fN=e.__commonJSMin((exports,t)=>{let n=dN(),r=`assert.buffer.child_process.cluster.console.constants.crypto.dgram.dns.domain.events.fs.http.https.module.net.os.path.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.tty.url.util.vm.zlib`.split(`.`),i={freelist:`<6.0.0`,v8:`>=1.0.0`,process:`>=1.1.0`,inspector:`>=8.0.0`,async_hooks:`>=8.1.0`,http2:`>=8.4.0`,perf_hooks:`>=8.5.0`,trace_events:`>=10.0.0`,worker_threads:`>=12.0.0`,"node:test":`>=18.0.0`},a={worker_threads:`>=10.5.0`,wasi:`>=12.16.0`,diagnostics_channel:`^14.17.0 || >=15.1.0`};t.exports=({version:e=process.version,experimental:t=!1}={})=>{let o=[...r];for(let[t,r]of Object.entries(i))(e===`*`||n(e,r))&&o.push(t);if(t)for(let[t,r]of Object.entries(a))!o.includes(t)&&(e===`*`||n(e,r))&&o.push(t);return o}}),pN=e.__commonJSMin((exports,t)=>{var n=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),r=fN(),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.match(/^\./)&&a.push(`name cannot start with a period`),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 a blacklisted name`)}),r({version:`*`}).forEach(function(n){e.toLowerCase()===n&&t.push(n+` 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(n);if(s){var c=s[1],l=s[2];if(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});function mN({project:e}){let t=e.workspaceData.workspaces,n=t.map(t=>l.default.relative(e.paths.root,t.paths.root)),r=new Set;for(let t of e.workspaceData.globs)if(!n.includes(t)&&!t.startsWith(`!`)){let e=t.split(`/`),n=e[0];r.add(n)}return Array.from(r)}function hN({project:e,workspace:t}){return l.default.relative(e.paths.root,t.paths.root).split(l.default.sep)[0]}function gN({project:e}){let t=mN({project:e}),n=t.includes(`apps`),r=t.includes(`packages`),i={},a=[];for(let t of e.workspaceData.workspaces){let n=hN({project:e,workspace:t});n!==`apps`&&a.push(t),n in i||(i[n]=[]),i[n].push(t)}return{hasRootApps:n,hasRootPackages:r,workspacesByGroup:i,nonAppWorkspaces:a}}function _N({project:e,type:t,showAllDependencies:n}){let r=gN({project:e}),i=[],a=e.workspaceData.workspaces;n||(t===`app`&&r.hasRootApps?a=r.workspacesByGroup.apps:t===`package`&&r.nonAppWorkspaces.length>0&&(a=r.nonAppWorkspaces));let o;for(let t of a){let n=hN({project:e,workspace:t});n!==o&&i.push(new A.Separator(n)),o=n,i.push(t)}return i}var vN=e.__toESM(sy()),yN=e.__toESM(pN());async function bN({override:e,suggestion:t,workspaceType:n}){let{validForNewPackages:r}=(0,yN.default)(e||``);if(e&&r)return{answer:e};let i=await(0,A.input)({message:`What is the name of the ${n}?`,default:t,validate:e=>{let{validForNewPackages:t}=(0,yN.default)(e);return t||`Invalid ${n} name`}});return{answer:i}}async function xN({override:e,message:t}){if(e)return{answer:e};let n=await(0,A.select)({message:t??`What type of workspace should be added?`,choices:[{name:`app`,value:`app`},{name:`package`,value:`package`}]});return{answer:n}}async function SN({workspaceType:e,workspaceName:t,destination:n,project:r}){let i=t.includes(`/`)?t.split(`/`)[1]:t;if(n){let{valid:e,root:t}=_s(n);if(e)return{absolute:t,relative:l.default.relative(r.paths.root,t)}}let a,o=gN({project:r});e===`app`&&o.hasRootApps?a=`${r.paths.root}/apps/${i}`:e===`package`&&o.hasRootPackages&&(a=`${r.paths.root}/packages/${i}`);let s=await(0,A.input)({message:`Where should "${t}" be added?`,default:a?l.default.relative(r.paths.root,a):void 0,validate:e=>{let t=l.default.join(r.paths.root,e),{valid:n,error:i}=_s(t),a=r.workspaceData.globs.some(t=>uM(e,t));return n&&a?!0:a?i??`Invalid directory`:`${e} is not a valid workspace location`}});return{absolute:l.default.join(r.paths.root,s),relative:s}}async function CN({override:e,workspaces:t,workspaceName:n}){if(e){let n=t.find(t=>t instanceof A.Separator?!1:t.name===e);if(n)return{answer:n};Ra(`Workspace "${e}" not found`),La()}let r=await(0,A.select)({message:`Which workspace should "${n}" start from?`,loop:!1,pageSize:25,choices:t.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e})});return{answer:r}}async function wN({workspaceName:e,project:t,workspaceSource:n,showAllDependencies:r}){let i={dependencies:{},devDependencies:{},peerDependencies:{},optionalDependencies:{}},{answer:a}=await TN({message:`Add workspace dependencies to "${e}"?`});if(!a)return i;let o=await(0,A.checkbox)({message:`Select all dependencies types to modify for "${e}"`,loop:!1,choices:[{name:`dependencies`,value:`dependencies`},{name:`devDependencies`,value:`devDependencies`},{name:`peerDependencies`,value:`peerDependencies`},{name:`optionalDependencies`,value:`optionalDependencies`}]}),s=_N({project:t,type:`package`,showAllDependencies:r}),c=n?vN.default.readJsonSync(n.paths.packageJson):void 0;for(let n of o){let r=await(0,A.checkbox)({message:`Which packages should be added as ${n} to "${e}?`,pageSize:15,loop:!1,choices:s.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e.name})}),a=c?.[n]||{};if(Object.keys(a).length){let e=new Set(Object.keys(a));for(let n of r)e.has(n)||(a[n]=t.packageManager===`pnpm`?`workspace:*`:`*`);i[n]=a}else i[n]=r.reduce((e,n)=>({...e,[n]:t.packageManager===`pnpm`?`workspace:*`:`*`}),{})}return i}async function TN({message:e}){let t=await(0,A.confirm)({message:e});return{answer:t}}async function EN({project:e,opts:t}){let n,r=t.method===`copy`&&t.copy.type===`external`?t.examplePath?.split(`/`).pop()||t.copy.source.split(`/`).pop():void 0,{answer:i}=await xN({override:t.type,message:t.method===`copy`&&t.copy.source===`external`&&r?`What type of workspace should "${r}" be created as?`:void 0}),{answer:a}=await bN({override:t.name,workspaceType:i,suggestion:r});if(t.method===`copy`&&t.copy.type===`internal`){let{answer:r}=await CN({override:t.copy.source,workspaces:_N({project:e,type:i}),workspaceName:a});n=r}let o=await SN({workspaceType:i,workspaceName:a,project:e,destination:t.destination}),s=await wN({workspaceName:a,project:e,workspaceSource:n,showAllDependencies:t.showAllDependencies});return{type:i,name:a,location:o,source:n,dependencies:s}}var DN=e.__toESM(sy()),ON=e.__toESM(M());async function kN({project:e,opts:t}){let{name:n,location:r,dependencies:i}=await EN({project:e,opts:t}),a={name:n,version:`0.0.0`,private:!0,scripts:{dev:`echo 'Add dev script here'`,build:`echo 'Add build script here'`,test:`echo 'Add test script here'`,lint:`echo 'Add lint script here'`}};for(let e of Object.keys(i)){let t=i[e];t&&Object.keys(t).length>0&&(a[e]={...a[e],...t})}DN.default.mkdirSync(r.absolute,{recursive:!0}),DN.default.writeFileSync(l.default.join(r.absolute,`package.json`),JSON.stringify(a,null,2)),DN.default.writeFileSync(l.default.join(r.absolute,`README.md`),`# \`${n}\``),La(),La(`${ON.default.bold(Oa(`>>> Success!`))} Created ${n} at "${r.relative}"`)}var AN=e.__toESM(sy()),jN=e.__toESM(M());async function MN({project:e,opts:t}){let{name:n,type:r,location:i,source:a,dependencies:o}=await EN({project:e,opts:t}),s=l.default.join(i.absolute,`package.json`);if(t.copy.type===`external`){La(),Ra(`Some manual modifications may be required.`),Fa(`This ${r} may require local dependencies or a different package manager than what is available in this repo`),await cg({appPath:i.absolute,example:t.copy.source,examplePath:t.examplePath});try{if(AN.default.existsSync(s)){let e=await AN.default.readJSON(s);if(e.workspaces)throw Error(`New workspace root detected - unexpected 'workspaces' field in package.json`)}else throw Error(`New workspace is missing a package.json file`);if(AN.default.existsSync(l.default.join(i.absolute,`pnpm-workspace.yaml`)))throw Error(`New workspace root detected - unexpected pnpm-workspace.yaml`)}catch(e){let t=`UNKNOWN_ERROR`;e instanceof Error&&(t=e.message),za(t),await AN.default.rm(i.absolute,{recursive:!0,force:!0});return}}else if(a){let e=async e=>!e.includes(`node_modules`),t=Ma(`Creating "${n}" from "${a.name}"...`);t.start(),await AN.default.copy(a.paths.root,i.absolute,{filter:e}),t.stop()}let c=await AN.default.readJSON(s);c.name=n;for(let e of Object.keys(o)){let t=o[e];t&&Object.keys(t).length>0&&(c[e]={...c[e],...t})}await AN.default.writeJSON(s,c,{spaces:2}),La(),La(`${jN.default.bold(Oa(`>>> Success!`))} Created ${n} at "${i.relative}"`)}function NN(e){let{copy:t,...n}=e,r=t===!0||typeof t==`string`?`copy`:`empty`,i=typeof t==`string`?t:``,a=typeof t==`string`&&t.startsWith(`https://`)?`external`:`internal`;return{method:r,copy:{type:a,source:i},...n}}async function PN(e){let t=await Nv(e),n=NN(e);La();let r={project:t,opts:n};n.method===`copy`?(n.copy.type===`external`?Na(`Copy a remote workspace from ${n.copy.source}`):Na(`Copy an existing workspace from "${t.name}"`),La(),await MN(r)):(Na(`Add an empty workspace to "${t.name}"`),La(),await kN(r))}async function FN(e,t){let n=await Nv(t);La(),Na(`Modify "${n.name}" using custom generators`),La(),await ij({generator:e,project:n,opts:t})}function IN(e){try{let t=JSON.parse(e),n={};for(let e in t){let r=lg(e,{to:`camel`});n[r]=t[e]}return n}catch(e){za(`Error parsing arguments`,e),process.exit(1)}}async function LN(e,t){if(e===`workspace`){let e=IN(t.json);e.showAllDependencies=e.showAllDependencies??!1;let n=!1,r=e.empty||!0;e.copy===``||e.copy===!0?(n=!0,r=!1):e.copy&&e.copy.length>0&&(n=e.copy,r=!1),e.copy=n,e.empty=r,await PN(e)}else if(e===`run`){let e=IN(t.json),{generatorName:n,...r}=e;await FN(n,r)}else za(`Received unknown command - "${e}" (must be one of "workspace" | "run")`),process.exit(1)}var RN=e.__toESM(M());const zN=Cg({packageInfo:p_}),BN=new $g;n.default.globalAgent=BN,r.default.globalAgent=BN;const VN=new ee;VN.name(RN.default.bold(Oa(`@turbo/gen`))).description(`Extend your Turborepo`).version(p_.version,`-v, --version`,`Output the current version`).helpOption(`-h, --help`,`Display help for command`).showHelpAfterError(!1),VN.command(`run`,{isDefault:!0}).alias(`r`).description(`Run custom generators`).addArgument(new J(`[generator-name]`,`The name of the generator to run`)).addOption(new Y(`-c, --config <config>`,`Generator configuration file (default: turbo/generators/config.js`)).addOption(new Y(`-r, --root <dir>`,`The root of your repository (default: directory with root turbo.json)`)).addOption(new Y(`-a, --args <args...>`,`Arguments passed directly to generator`).default([])).action(FN),VN.command(`workspace`).aliases([`w`]).description(`Add a new package or app to your project`).addOption(new Y(`-n, --name <workspace-name>`,`Name for the new workspace`)).addOption(new Y(`-b, --empty`,`Generate an empty workspace`).conflicts(`copy`).default(!0)).addOption(new Y(`-c, --copy [source]`,`Generate a workspace using an existing workspace as a template. Can be the name of a local workspace
372
+ `}]}};var ej=e.__toESM(sy());async function tj({project:e,template:t}){let n=l.default.join(e.paths.root,`turbo`,`generators`),r=`simple-${t}`,i=$A[r];if(!i)throw new jA(`Unknown template "${r}"`,{type:`config_directory_already_exists`});if(await ej.default.pathExists(n))throw new jA(`Generator config directory already exists at ${n}`,{type:`config_directory_already_exists`});for(let e of i.files){let t=l.default.join(n,e.relativePath);await ej.default.outputFile(t,e.content)}}async function nj({generator:e,project:t,opts:n}){let r=!1,i=await zA({project:t,configPath:n.config});if(!i.length){za(`No generators found.`),La();let{answer:e}=await QA({message:`Would you like to add a config with a sample custom generator to ${t.name}?`});if(e){r=!0;let{answer:e}=await ZA();try{await tj({project:t,template:e})}catch(e){throw e instanceof jA||za(`Failed to create generator config`),e}if(La(),Na(`Generator config successfully created!`),Na(`Loading generator config...`),La(),i=await zA({project:t,configPath:n.config}),!i.length){za(`Error loading generator`);return}}else{La(),Fa(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`);return}}let{selectedGenerator:a}=await XA({generators:i,generator:e});try{await JA({project:t,generator:a,bypassArgs:n.args,configPath:n.config})}catch(e){if(e instanceof jA)throw e;let t=`Failed to run generator`;throw e instanceof Error&&(t=e.message),new jA(t,{type:`plop_error_running_generator`})}finally{r&&(La(),Na(`Congrats! You just ran your first Turborepo generator`),Fa(`Learn more about custom Turborepo generators - https://turborepo.dev/docs/guides/generating-code#custom-generators`))}La(),Pa(Oa(`>>> Success!`))}const rj=(e,t,n)=>{let r=e instanceof RegExp?ij(e,n):e,i=t instanceof RegExp?ij(t,n):t,a=r!==null&&i!=null&&aj(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},ij=(e,t)=>{let n=t.match(e);return n?n[0]:null},aj=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},oj=`\0SLASH`+Math.random()+`\0`,sj=`\0OPEN`+Math.random()+`\0`,cj=`\0CLOSE`+Math.random()+`\0`,lj=`\0COMMA`+Math.random()+`\0`,uj=`\0PERIOD`+Math.random()+`\0`,dj=new RegExp(oj,`g`),fj=new RegExp(sj,`g`),pj=new RegExp(cj,`g`),mj=new RegExp(lj,`g`),hj=new RegExp(uj,`g`),gj=/\\\\/g,_j=/\\{/g,vj=/\\}/g,yj=/\\,/g,bj=/\\\./g,xj=1e5,Sj=4e6;function Cj(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function wj(e){return e.replace(gj,oj).replace(_j,sj).replace(vj,cj).replace(yj,lj).replace(bj,uj)}function Tj(e){return e.replace(dj,`\\`).replace(fj,`{`).replace(pj,`}`).replace(mj,`,`).replace(hj,`.`)}function Ej(e){if(!e)return[``];let t=[],n=rj(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=Ej(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function Dj(e,t={}){if(!e)return[];let{max:n=xj,maxLength:r=Sj}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),Pj(wj(e),n,r,!0).map(Tj)}function Oj(e){return`{`+e+`}`}function kj(e){return/^-?0\d/.test(e)}function Aj(e,t){return e<=t}function jj(e,t){return e>=t}function Mj(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function Nj(e,t,n,r){let i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;let o=Cj(i[0]),s=Cj(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Cj(i[2])),1):1,u=Aj,d=s<o;d&&(l*=-1,u=jj);let f=i.some(kj),p=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),f){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(p+n.length>r)break;a.push(n),p+=n.length}return a}function Pj(e,t,n,r){let i=[``],a=!1,o=!0;for(;;){let s=rj(`{`,`}`,e);if(!s)return Mj(i,e,[``],t,n,a);let c=s.pre;if(/\$$/.test(c)){if(i=Mj(i,c+`{`+s.body+`}`,[``],t,n,a&&!s.post.length),o=!1,!s.post.length)break;e=s.post;continue}let l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=l||u,f=s.body.indexOf(`,`)>=0;if(!d&&!f){if(s.post.match(/,(?!,).*\}/)){e=s.pre+`{`+s.body+cj+s.post,r=!0;continue}return Mj(i,c+`{`+s.body+`}`+s.post,[``],t,n,a)}o&&(a=r&&!d,o=!1);let p;if(d)p=Nj(s.body,u,t,n);else{let r=Ej(s.body);if(r.length===1&&r[0]!==void 0&&(r=Pj(r[0],t,n,!1).map(Oj),r.length===1)){if(i=Mj(i,c+r[0],[``],t,n,a&&!s.post.length),!s.post.length)break;e=s.post;continue}let o=a&&!s.post.length&&!c;for(let e=0;o&&e<i.length;e++)i[e]&&(o=!1);p=[];let l=0;outer:for(let e=0;e<r.length;e++){let i=Pj(r[e],t,n,!1);for(let e=0;e<i.length;e++){let r=i[e];if(!(o&&!r)){if(p.length>=t||l+r.length>n)break outer;p.push(r),l+=r.length}}}}if(i=Mj(i,c,p,t,n,a&&!s.post.length),!s.post.length)break;e=s.post}return i}const Fj=1024*64,Ij=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>Fj)throw TypeError(`pattern is too long`)},Lj={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},Rj=e=>e.replace(/[[\]\\-]/g,`\\$&`),zj=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Bj=e=>e.join(``),Vj=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(Lj))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(Rj(d)+`-`+Rj(t)):t===d&&r.push(Rj(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(Rj(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(Rj(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[zj(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+Bj(r)+`]`,p=`[`+(l?``:`^`)+Bj(i)+`]`,m=r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p;return[m,s,u-n,!0]},Hj=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`);var Uj;const Wj=new Set([`!`,`?`,`+`,`*`,`@`]),Gj=e=>Wj.has(e),Kj=e=>Gj(e.type),qj=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Jj=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),Yj=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Xj=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),Zj=`(?!(?:^|/)\\.\\.?(?:$|/))`,Qj=`(?!\\.)`,$j=new Set([`[`,`.`]),eM=new Set([`..`,`.`]),tM=new Set(`().*{}+?[]^$\\!`),nM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),rM=`[^/]`,iM=rM+`*?`,aM=rM+`+?`;var oM=class{type;#root;#hasMagic;#uflag=!1;#parts=[];#parent;#parentIndex;#negs;#filledNegs=!1;#options;#toString;#emptyExt=!1;constructor(e,t,n={}){this.type=e,e&&(this.#hasMagic=!0),this.#parent=t,this.#root=this.#parent?this.#parent.#root:this,this.#options=this.#root===this?n:this.#root.#options,this.#negs=this.#root===this?[]:this.#root.#negs,e===`!`&&!this.#root.#filledNegs&&this.#negs.push(this),this.#parentIndex=this.#parent?this.#parent.#parts.length:0}get hasMagic(){if(this.#hasMagic!==void 0)return this.#hasMagic;for(let e of this.#parts){if(typeof e==`string`)continue;if(e.type||e.hasMagic)return this.#hasMagic=!0}return this.#hasMagic}toString(){return this.#toString===void 0?this.type?this.#toString=this.type+`(`+this.#parts.map(e=>String(e)).join(`|`)+`)`:this.#toString=this.#parts.map(e=>String(e)).join(``):this.#toString}#fillNegs(){if(this!==this.#root)throw Error(`should only call on root`);if(this.#filledNegs)return this;this.toString(),this.#filledNegs=!0;let e;for(;e=this.#negs.pop();){if(e.type!==`!`)continue;let t=e,n=t.#parent;for(;n;){for(let r=t.#parentIndex+1;!n.type&&r<n.#parts.length;r++)for(let t of e.#parts){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#parts[r])}t=n,n=t.#parent}}return this}push(...e){for(let t of e){if(t===``)continue;if(typeof t!=`string`&&!(t instanceof Uj&&t.#parent===this))throw Error(`invalid part: `+t);this.#parts.push(t)}}toJSON(){let e=this.type===null?this.#parts.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#parts.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#root||this.#root.#filledNegs&&this.#parent?.type===`!`)&&e.push({}),e}isStart(){if(this.#root===this)return!0;if(!this.#parent?.isStart())return!1;if(this.#parentIndex===0)return!0;let e=this.#parent;for(let t=0;t<this.#parentIndex;t++){let n=e.#parts[t];if(!(n instanceof Uj&&n.type===`!`))return!1}return!0}isEnd(){if(this.#root===this||this.#parent?.type===`!`)return!0;if(!this.#parent?.isEnd())return!1;if(!this.type)return this.#parent?.isEnd();let e=this.#parent?this.#parent.#parts.length:0;return this.#parentIndex===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new Uj(this.type,e);for(let e of this.#parts)t.copyIn(e);return t}static#parseAST(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}let f=!r.noext&&Gj(n)&&e.charAt(u)===`(`&&i<=a;if(f){t.push(d),d=``;let a=new Uj(n,t);u=Uj.#parseAST(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new Uj(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}let m=Gj(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#canAdoptType(n));if(m){let a=t&&t.#canAdoptType(n)?0:1;d.push(p),p=``;let o=new Uj(n,d);d.push(o),u=Uj.#parseAST(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new Uj(null,t);continue}if(n===`)`)return p===``&&t.#parts.length===0&&(t.#emptyExt=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#hasMagic=void 0,t.#parts=[e.substring(n-1)],u}#canAdoptWithSpace(e){return this.#canAdopt(e,Jj)}#canAdopt(e,t=qj){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null)return!1;let n=e.#parts[0];return!n||typeof n!=`object`||n.type===null?!1:this.#canAdoptType(n.type,t)}#canAdoptType(e,t=Yj){return!!t.get(this.type)?.includes(e)}#adoptWithSpace(e,t){let n=e.#parts[0],r=new Uj(null,n,this.options);r.#parts.push(``),n.push(r),this.#adopt(e,t)}#adopt(e,t){let n=e.#parts[0];this.#parts.splice(t,1,...n.#parts);for(let e of n.#parts)typeof e==`object`&&(e.#parent=this);this.#toString=void 0}#canUsurpType(e){let t=Xj.get(this.type);return!!t?.has(e)}#canUsurp(e){if(!e||typeof e!=`object`||e.type!==null||e.#parts.length!==1||this.type===null||this.#parts.length!==1)return!1;let t=e.#parts[0];return!t||typeof t!=`object`||t.type===null?!1:this.#canUsurpType(t.type)}#usurp(e){let t=Xj.get(this.type),n=e.#parts[0],r=t?.get(n.type);if(!r)return!1;this.#parts=n.#parts;for(let e of this.#parts)typeof e==`object`&&(e.#parent=this);this.type=r,this.#toString=void 0,this.#emptyExt=!1}#flatten(){if(Kj(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#parts.length;e++){let n=this.#parts[e];typeof n==`object`&&(n.#flatten(),this.#canAdopt(n)?(t=!1,this.#adopt(n,e)):this.#canAdoptWithSpace(n)?(t=!1,this.#adoptWithSpace(n,e)):this.#canUsurp(n)&&(t=!1,this.#usurp(n)))}}while(!t&&++e<10)}else for(let e of this.#parts)typeof e==`object`&&e.#flatten();this.#toString=void 0}static fromGlob(e,t={}){let n=new Uj(null,void 0,t);return Uj.#parseAST(e,n,0,t,0),n}toMMPattern(){if(this!==this.#root)return this.#root.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource(),a=r||this.#hasMagic||this.#options.nocase&&!this.#options.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase();if(!a)return n;let o=(this.#options.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,o),{_src:t,_glob:e})}get options(){return this.#options}toRegExpSource(e){let t=e??!!this.#options.dot;if(this.#root===this&&(this.#flatten(),this.#fillNegs()),!Kj(this)){let n=this.isStart()&&this.isEnd(),r=this.#parts.map(t=>{let[r,i,a,o]=typeof t==`string`?Uj.#parseGlob(t,this.#hasMagic,n):t.toRegExpSource(e);return this.#hasMagic=this.#hasMagic||a,this.#uflag=this.#uflag||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#parts[0]==`string`){let n=this.#parts.length===1&&eM.has(this.#parts[0]);if(!n){let n=$j,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?Zj:o?Qj:``}}let a=``;this.isEnd()&&this.#root.#filledNegs&&this.#parent?.type===`!`&&(a=`(?:$|\\/)`);let o=i+r+a;return[o,Hj(r),this.#hasMagic=!!this.#hasMagic,this.#uflag]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#partsToRegExp(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#parts=[e],t.type=null,t.#hasMagic=void 0,[e,Hj(this.toString()),!1,!1]}let a=!n||e||t||!Qj?``:this.#partsToRegExp(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#emptyExt)o=(this.isStart()&&!t?Qj:``)+aM;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?Qj:``)+iM+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,Hj(i),this.#hasMagic=!!this.#hasMagic,this.#uflag]}#partsToRegExp(e){return this.#parts.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#uflag=this.#uflag||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#parseGlob(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(tM.has(c)?`\\`:``)+c,o=!1;continue}if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,c,l]=Vj(e,s);if(c){i+=n,a||=r,s+=c-1,t||=l,o=!1;continue}}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?aM:iM,t=!0;continue}else o=!1;if(c===`?`){i+=rM,t=!0;continue}i+=nM(c)}return[i,Hj(e),!!t,a]}};Uj=oM;const sM=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),cM=(e,t,n={})=>(Ij(t),!n.nocomment&&t.charAt(0)===`#`?!1:new GM(t,n).match(e)),lM=/^\*+([^+@!?\*\[\(]*)$/,uM=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),dM=e=>t=>t.endsWith(e),fM=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),pM=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),mM=/^\*+\.\*+$/,hM=e=>!e.startsWith(`.`)&&e.includes(`.`),gM=e=>e!==`.`&&e!==`..`&&e.includes(`.`),_M=/^\.\*+$/,vM=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),yM=/^\*+$/,bM=e=>e.length!==0&&!e.startsWith(`.`),xM=e=>e.length!==0&&e!==`.`&&e!==`..`,SM=/^\?+([^+@!?\*\[\(]*)?$/,CM=([e,t=``])=>{let n=DM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},wM=([e,t=``])=>{let n=OM([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},TM=([e,t=``])=>{let n=OM([e]);return t?e=>n(e)&&e.endsWith(t):n},EM=([e,t=``])=>{let n=DM([e]);return t?e=>n(e)&&e.endsWith(t):n},DM=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},OM=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},kM=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,AM={win32:{sep:`\\`},posix:{sep:`/`}},jM=kM===`win32`?AM.win32.sep:AM.posix.sep;cM.sep=jM;const MM=Symbol(`globstar **`);cM.GLOBSTAR=MM;const NM=`[^/]`,PM=NM+`*?`,FM=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,IM=`(?:(?!(?:\\/|^)\\.).)*?`,LM=(e,t={})=>n=>cM(n,e,t);cM.filter=LM;const RM=(e,t={})=>Object.assign({},e,t),zM=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return cM;let t=cM,n=(n,r,i={})=>t(n,r,RM(e,i));return Object.assign(n,{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,RM(e,n))}static defaults(n){return t.defaults(RM(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,RM(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,RM(e,r))}},unescape:(n,r={})=>t.unescape(n,RM(e,r)),escape:(n,r={})=>t.escape(n,RM(e,r)),filter:(n,r={})=>t.filter(n,RM(e,r)),defaults:n=>t.defaults(RM(e,n)),makeRe:(n,r={})=>t.makeRe(n,RM(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,RM(e,r)),match:(n,r,i={})=>t.match(n,r,RM(e,i)),sep:t.sep,GLOBSTAR:MM})};cM.defaults=zM;const BM=(e,t={})=>(Ij(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Dj(e));cM.braceExpand=BM;const VM=(e,t={})=>new GM(e,t).makeRe();cM.makeRe=VM;const HM=(e,t,n={})=>{let r=new GM(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};cM.match=HM;const UM=/[?*]|[+@!]\(.*?\)|\[|\]/,WM=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var GM=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Ij(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||kM,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!UM.test(e[2]))&&!UM.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`,r=e?[`.`]:[];n.splice(i-1,2,...r),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(MM)?this.#matchGlobstar(e,t,n,r,i):this.#matchOne(e,t,n,r,i)}#matchGlobstar(e,t,n,r,i){let a=t.indexOf(MM,i),o=t.lastIndexOf(MM),[s,c,l]=[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#matchOne(t,s,n,0,0))return!1;r+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#matchOne(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#matchOne(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===MM?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#matchGlobStarBodySections(e,d,r,0,n,0,!!u)}#matchGlobStarBodySections(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){let s=this.#matchOne(e.slice(0,n+c.length),c,i,n,0);if(s&&a<this.maxGlobstarRecursion){let s=this.#matchGlobStarBodySections(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let l=e[n];if(l===`.`||l===`..`||!this.options.dot&&l.startsWith(`.`))return!1;n++}return null}#matchOne(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===MM)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return BM(this.pattern,this.options)}parse(e){Ij(e);let t=this.options;if(e===`**`)return MM;if(e===``)return``;let n,r=null;(n=e.match(yM))?r=t.dot?xM:bM:(n=e.match(lM))?r=(t.nocase?t.dot?pM:fM:t.dot?dM:uM)(n[1]):(n=e.match(SM))?r=(t.nocase?t.dot?wM:CM:t.dot?TM:EM)(n):(n=e.match(mM))?r=t.dot?gM:hM:(n=e.match(_M))&&(r=vM);let i=oM.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?PM:t.dot?FM:IM,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?WM(e):e===MM?MM:e._src});return t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==MM||a===MM||(a===void 0?i!==void 0&&i!==MM?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|`+n+`)?`:i!==MM&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=MM))}),t.filter(e=>e!==MM).join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;n.matchBase&&o.length===1&&(s=[a]);let c=this.matchOne(s,o,t);if(c)return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return cM.defaults(e).Minimatch}};cM.AST=oM,cM.Minimatch=GM,cM.escape=sM,cM.unescape=Hj;var KM=e.__commonJSMin((exports,t)=>{var n=class{constructor(){this.max=1e3,this.map=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){let n=this.delete(e);if(!n&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};t.exports=n}),qM=e.__commonJSMin((exports,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({}),i=e=>e?typeof e==`object`?e:n:r;t.exports=i}),JM=e.__commonJSMin((exports,t)=>{let n=`2.0.0`,r=256,i=2**53-1||9007199254740991,a=16,o=r-6,s=[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`];t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:i,RELEASE_TYPES:s,SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),YM=e.__commonJSMin((exports,t)=>{let n=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{};t.exports=n}),XM=e.__commonJSMin((exports,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=JM(),a=YM();exports=t.exports={};let o=exports.re=[],s=exports.safeRe=[],c=exports.src=[],l=exports.safeSrc=[],u=exports.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),exports.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),exports.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),exports.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)}),ZM=e.__commonJSMin((exports,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},i=(e,t)=>r(t,e);t.exports={compareIdentifiers:r,rcompareIdentifiers:i}}),QM=e.__commonJSMin((exports,t)=>{let n=YM(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=JM(),{safeRe:a,t:o}=XM(),s=qM(),{compareIdentifiers:c}=ZM();var l=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[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}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),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?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),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 r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,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)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}};t.exports=l}),$M=e.__commonJSMin((exports,t)=>{let n=QM(),r=(e,t,r)=>new n(e,r).compare(new n(t,r));t.exports=r}),eN=e.__commonJSMin((exports,t)=>{let n=$M(),r=(e,t,r)=>n(e,t,r)===0;t.exports=r}),tN=e.__commonJSMin((exports,t)=>{let n=$M(),r=(e,t,r)=>n(e,t,r)!==0;t.exports=r}),nN=e.__commonJSMin((exports,t)=>{let n=$M(),r=(e,t,r)=>n(e,t,r)>0;t.exports=r}),rN=e.__commonJSMin((exports,t)=>{let n=$M(),r=(e,t,r)=>n(e,t,r)>=0;t.exports=r}),iN=e.__commonJSMin((exports,t)=>{let n=$M(),r=(e,t,r)=>n(e,t,r)<0;t.exports=r}),aN=e.__commonJSMin((exports,t)=>{let n=$M(),r=(e,t,r)=>n(e,t,r)<=0;t.exports=r}),oN=e.__commonJSMin((exports,t)=>{let n=eN(),r=tN(),i=nN(),a=rN(),o=iN(),s=aN(),c=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}};t.exports=c}),sN=e.__commonJSMin((exports,t)=>{let n=Symbol(`SemVer ANY`);var r=class e{static get ANY(){return n}constructor(t,r){if(r=i(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),c(`comparator`,t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,c(`comp`,this)}parse(e){let t=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new u(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new u(this.value,n).test(t.semver):(n=i(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.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.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||s(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||s(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};t.exports=r;let i=qM(),{safeRe:a,t:o}=XM(),s=oN(),c=YM(),l=QM(),u=cN()}),cN=e.__commonJSMin((exports,t)=>{let n=/\s+/g;var r=class e{constructor(t,r){if(r=o(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof s)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=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!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=>!_(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&&v(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}parseRange(e){let t=(this.options.includePrerelease&&h)|(this.options.loose&&g),n=t+`:`+e,r=a.get(n);if(r)return r;let i=this.options.loose,o=i?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(o,A(this.options.includePrerelease)),c(`hyphen replace`,e),e=e.replace(u[d.COMPARATORTRIM],f),c(`comparator trim`,e),e=e.replace(u[d.TILDETRIM],p),c(`tilde trim`,e),e=e.replace(u[d.CARETTRIM],m),c(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>k(e,this.options));i&&(l=l.filter(e=>(c(`loose invalid filter`,e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c(`range list`,l);let v=new Map,y=l.map(e=>new s(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return a.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new l(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}};t.exports=r;let i=KM(),a=new i,o=qM(),s=sN(),c=YM(),l=QM(),{safeRe:u,t:d,comparatorTrimReplace:f,tildeTrimReplace:p,caretTrimReplace:m}=XM(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=JM(),_=e=>e.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(u[d.BUILD],``),c(`comp`,e,t),e=w(e,t),c(`caret`,e),e=S(e,t),c(`tildes`,e),e=E(e,t),c(`xrange`,e),e=O(e,t),c(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(` `),C=(e,t)=>{let n=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(n,(t,n,r,i,a)=>{c(`tilde`,e,t,n,r,i,a);let o;return x(n)?o=``:x(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:x(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(c(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,c(`tilde return`,o),o})},w=(e,t)=>e.trim().split(/\s+/).map(e=>T(e,t)).join(` `),T=(e,t)=>{c(`caret`,e,t);let n=t.loose?u[d.CARETLOOSE]:u[d.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{c(`caret`,e,t,n,i,a,o);let s;return x(n)?s=``:x(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(c(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(c(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),c(`caret return`,s),s})},E=(e,t)=>(c(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>D(e,t)).join(` `)),D=(e,t)=>{e=e.trim();let n=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{c(`xRange`,e,n,r,i,a,o,s);let l=x(i),u=l||x(a),d=u||x(o),f=d;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),o=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):u?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),c(`xRange return`,n),n})},O=(e,t)=>(c(`replaceStars`,e,t),e.trim().replace(u[d.STAR],``)),k=(e,t)=>(c(`replaceGTE0`,e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],``)),A=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),j=(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++)if(c(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}}),lN=e.__commonJSMin((exports,t)=>{let n=cN(),r=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)};t.exports=r}),uN=e.__commonJSMin((exports,t)=>{let n=lN(),r=`assert.buffer.child_process.cluster.console.constants.crypto.dgram.dns.domain.events.fs.http.https.module.net.os.path.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.tty.url.util.vm.zlib`.split(`.`),i={freelist:`<6.0.0`,v8:`>=1.0.0`,process:`>=1.1.0`,inspector:`>=8.0.0`,async_hooks:`>=8.1.0`,http2:`>=8.4.0`,perf_hooks:`>=8.5.0`,trace_events:`>=10.0.0`,worker_threads:`>=12.0.0`,"node:test":`>=18.0.0`},a={worker_threads:`>=10.5.0`,wasi:`>=12.16.0`,diagnostics_channel:`^14.17.0 || >=15.1.0`};t.exports=({version:e=process.version,experimental:t=!1}={})=>{let o=[...r];for(let[t,r]of Object.entries(i))(e===`*`||n(e,r))&&o.push(t);if(t)for(let[t,r]of Object.entries(a))!o.includes(t)&&(e===`*`||n(e,r))&&o.push(t);return o}}),dN=e.__commonJSMin((exports,t)=>{var n=RegExp(`^(?:@([^/]+?)[/])?([^/]+?)$`),r=uN(),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.match(/^\./)&&a.push(`name cannot start with a period`),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 a blacklisted name`)}),r({version:`*`}).forEach(function(n){e.toLowerCase()===n&&t.push(n+` 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(n);if(s){var c=s[1],l=s[2];if(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});function fN({project:e}){let t=e.workspaceData.workspaces,n=t.map(t=>l.default.relative(e.paths.root,t.paths.root)),r=new Set;for(let t of e.workspaceData.globs)if(!n.includes(t)&&!t.startsWith(`!`)){let e=t.split(`/`),n=e[0];r.add(n)}return Array.from(r)}function pN({project:e,workspace:t}){return l.default.relative(e.paths.root,t.paths.root).split(l.default.sep)[0]}function mN({project:e}){let t=fN({project:e}),n=t.includes(`apps`),r=t.includes(`packages`),i={},a=[];for(let t of e.workspaceData.workspaces){let n=pN({project:e,workspace:t});n!==`apps`&&a.push(t),n in i||(i[n]=[]),i[n].push(t)}return{hasRootApps:n,hasRootPackages:r,workspacesByGroup:i,nonAppWorkspaces:a}}function hN({project:e,type:t,showAllDependencies:n}){let r=mN({project:e}),i=[],a=e.workspaceData.workspaces;n||(t===`app`&&r.hasRootApps?a=r.workspacesByGroup.apps:t===`package`&&r.nonAppWorkspaces.length>0&&(a=r.nonAppWorkspaces));let o;for(let t of a){let n=pN({project:e,workspace:t});n!==o&&i.push(new A.Separator(n)),o=n,i.push(t)}return i}var gN=e.__toESM(sy()),_N=e.__toESM(dN());async function vN({override:e,suggestion:t,workspaceType:n}){let{validForNewPackages:r}=(0,_N.default)(e||``);if(e&&r)return{answer:e};let i=await(0,A.input)({message:`What is the name of the ${n}?`,default:t,validate:e=>{let{validForNewPackages:t}=(0,_N.default)(e);return t||`Invalid ${n} name`}});return{answer:i}}async function yN({override:e,message:t}){if(e)return{answer:e};let n=await(0,A.select)({message:t??`What type of workspace should be added?`,choices:[{name:`app`,value:`app`},{name:`package`,value:`package`}]});return{answer:n}}async function bN({workspaceType:e,workspaceName:t,destination:n,project:r}){let i=t.includes(`/`)?t.split(`/`)[1]:t;if(n){let{valid:e,root:t}=_s(n);if(e)return{absolute:t,relative:l.default.relative(r.paths.root,t)}}let a,o=mN({project:r});e===`app`&&o.hasRootApps?a=`${r.paths.root}/apps/${i}`:e===`package`&&o.hasRootPackages&&(a=`${r.paths.root}/packages/${i}`);let s=await(0,A.input)({message:`Where should "${t}" be added?`,default:a?l.default.relative(r.paths.root,a):void 0,validate:e=>{let t=l.default.join(r.paths.root,e),{valid:n,error:i}=_s(t),a=r.workspaceData.globs.some(t=>cM(e,t));return n&&a?!0:a?i??`Invalid directory`:`${e} is not a valid workspace location`}});return{absolute:l.default.join(r.paths.root,s),relative:s}}async function xN({override:e,workspaces:t,workspaceName:n}){if(e){let n=t.find(t=>t instanceof A.Separator?!1:t.name===e);if(n)return{answer:n};Ra(`Workspace "${e}" not found`),La()}let r=await(0,A.select)({message:`Which workspace should "${n}" start from?`,loop:!1,pageSize:25,choices:t.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e})});return{answer:r}}async function SN({workspaceName:e,project:t,workspaceSource:n,showAllDependencies:r}){let i={dependencies:{},devDependencies:{},peerDependencies:{},optionalDependencies:{}},{answer:a}=await CN({message:`Add workspace dependencies to "${e}"?`});if(!a)return i;let o=await(0,A.checkbox)({message:`Select all dependencies types to modify for "${e}"`,loop:!1,choices:[{name:`dependencies`,value:`dependencies`},{name:`devDependencies`,value:`devDependencies`},{name:`peerDependencies`,value:`peerDependencies`},{name:`optionalDependencies`,value:`optionalDependencies`}]}),s=hN({project:t,type:`package`,showAllDependencies:r}),c=n?gN.default.readJsonSync(n.paths.packageJson):void 0;for(let n of o){let r=await(0,A.checkbox)({message:`Which packages should be added as ${n} to "${e}?`,pageSize:15,loop:!1,choices:s.map(e=>e instanceof A.Separator?e:{name:` ${e.name}`,value:e.name})}),a=c?.[n]||{};if(Object.keys(a).length){let e=new Set(Object.keys(a));for(let n of r)e.has(n)||(a[n]=t.packageManager===`pnpm`?`workspace:*`:`*`);i[n]=a}else i[n]=r.reduce((e,n)=>({...e,[n]:t.packageManager===`pnpm`?`workspace:*`:`*`}),{})}return i}async function CN({message:e}){let t=await(0,A.confirm)({message:e});return{answer:t}}async function wN({project:e,opts:t}){let n,r=t.method===`copy`&&t.copy.type===`external`?t.examplePath?.split(`/`).pop()||t.copy.source.split(`/`).pop():void 0,{answer:i}=await yN({override:t.type,message:t.method===`copy`&&t.copy.source===`external`&&r?`What type of workspace should "${r}" be created as?`:void 0}),{answer:a}=await vN({override:t.name,workspaceType:i,suggestion:r});if(t.method===`copy`&&t.copy.type===`internal`){let{answer:r}=await xN({override:t.copy.source,workspaces:hN({project:e,type:i}),workspaceName:a});n=r}let o=await bN({workspaceType:i,workspaceName:a,project:e,destination:t.destination}),s=await SN({workspaceName:a,project:e,workspaceSource:n,showAllDependencies:t.showAllDependencies});return{type:i,name:a,location:o,source:n,dependencies:s}}var TN=e.__toESM(sy()),EN=e.__toESM(M());async function DN({project:e,opts:t}){let{name:n,location:r,dependencies:i}=await wN({project:e,opts:t}),a={name:n,version:`0.0.0`,private:!0,scripts:{dev:`echo 'Add dev script here'`,build:`echo 'Add build script here'`,test:`echo 'Add test script here'`,lint:`echo 'Add lint script here'`}};for(let e of Object.keys(i)){let t=i[e];t&&Object.keys(t).length>0&&(a[e]={...a[e],...t})}TN.default.mkdirSync(r.absolute,{recursive:!0}),TN.default.writeFileSync(l.default.join(r.absolute,`package.json`),JSON.stringify(a,null,2)),TN.default.writeFileSync(l.default.join(r.absolute,`README.md`),`# \`${n}\``),La(),La(`${EN.default.bold(Oa(`>>> Success!`))} Created ${n} at "${r.relative}"`)}var ON=e.__toESM(sy()),kN=e.__toESM(M());async function AN({project:e,opts:t}){let{name:n,type:r,location:i,source:a,dependencies:o}=await wN({project:e,opts:t}),s=l.default.join(i.absolute,`package.json`);if(t.copy.type===`external`){La(),Ra(`Some manual modifications may be required.`),Fa(`This ${r} may require local dependencies or a different package manager than what is available in this repo`),await cg({appPath:i.absolute,example:t.copy.source,examplePath:t.examplePath});try{if(ON.default.existsSync(s)){let e=await ON.default.readJSON(s);if(e.workspaces)throw Error(`New workspace root detected - unexpected 'workspaces' field in package.json`)}else throw Error(`New workspace is missing a package.json file`);if(ON.default.existsSync(l.default.join(i.absolute,`pnpm-workspace.yaml`)))throw Error(`New workspace root detected - unexpected pnpm-workspace.yaml`)}catch(e){let t=`UNKNOWN_ERROR`;e instanceof Error&&(t=e.message),za(t),await ON.default.rm(i.absolute,{recursive:!0,force:!0});return}}else if(a){let e=async e=>!e.includes(`node_modules`),t=Ma(`Creating "${n}" from "${a.name}"...`);t.start(),await ON.default.copy(a.paths.root,i.absolute,{filter:e}),t.stop()}let c=await ON.default.readJSON(s);c.name=n;for(let e of Object.keys(o)){let t=o[e];t&&Object.keys(t).length>0&&(c[e]={...c[e],...t})}await ON.default.writeJSON(s,c,{spaces:2}),La(),La(`${kN.default.bold(Oa(`>>> Success!`))} Created ${n} at "${i.relative}"`)}function jN(e){let{copy:t,...n}=e,r=t===!0||typeof t==`string`?`copy`:`empty`,i=typeof t==`string`?t:``,a=typeof t==`string`&&t.startsWith(`https://`)?`external`:`internal`;return{method:r,copy:{type:a,source:i},...n}}async function MN(e){let t=await Nv(e),n=jN(e);La();let r={project:t,opts:n};n.method===`copy`?(n.copy.type===`external`?Na(`Copy a remote workspace from ${n.copy.source}`):Na(`Copy an existing workspace from "${t.name}"`),La(),await AN(r)):(Na(`Add an empty workspace to "${t.name}"`),La(),await DN(r))}async function NN(e,t){let n=await Nv(t);La(),Na(`Modify "${n.name}" using custom generators`),La(),await nj({generator:e,project:n,opts:t})}function PN(e){try{let t=JSON.parse(e),n={};for(let e in t){let r=lg(e,{to:`camel`});n[r]=t[e]}return n}catch(e){za(`Error parsing arguments`,e),process.exit(1)}}async function FN(e,t){if(e===`workspace`){let e=PN(t.json);e.showAllDependencies=e.showAllDependencies??!1;let n=!1,r=e.empty||!0;e.copy===``||e.copy===!0?(n=!0,r=!1):e.copy&&e.copy.length>0&&(n=e.copy,r=!1),e.copy=n,e.empty=r,await MN(e)}else if(e===`run`){let e=PN(t.json),{generatorName:n,...r}=e;await NN(n,r)}else za(`Received unknown command - "${e}" (must be one of "workspace" | "run")`),process.exit(1)}var IN=e.__toESM(M());const LN=Cg({packageInfo:p_}),RN=new $g;n.default.globalAgent=RN,r.default.globalAgent=RN;const zN=new ee;zN.name(IN.default.bold(Oa(`@turbo/gen`))).description(`Extend your Turborepo`).version(p_.version,`-v, --version`,`Output the current version`).helpOption(`-h, --help`,`Display help for command`).showHelpAfterError(!1),zN.command(`run`,{isDefault:!0}).alias(`r`).description(`Run custom generators`).addArgument(new J(`[generator-name]`,`The name of the generator to run`)).addOption(new Y(`-c, --config <config>`,`Generator configuration file (default: turbo/generators/config.js`)).addOption(new Y(`-r, --root <dir>`,`The root of your repository (default: directory with root turbo.json)`)).addOption(new Y(`-a, --args <args...>`,`Arguments passed directly to generator`).default([])).action(NN),zN.command(`workspace`).aliases([`w`]).description(`Add a new package or app to your project`).addOption(new Y(`-n, --name <workspace-name>`,`Name for the new workspace`)).addOption(new Y(`-b, --empty`,`Generate an empty workspace`).conflicts(`copy`).default(!0)).addOption(new Y(`-c, --copy [source]`,`Generate a workspace using an existing workspace as a template. Can be the name of a local workspace
373
373
  within your monorepo, or a fully qualified GitHub URL with any branch and/or subdirectory.
374
374
  `).conflicts(`empty`)).addOption(new Y(`-d, --destination <dir>`,`Where the new workspace should be created`)).addOption(new Y(`-t, --type <type>`,`The type of workspace to create`).choices([`app`,`package`])).addOption(new Y(`-r, --root <dir>`,`The root of your repository (default: directory with root turbo.json)`)).addOption(new Y(`-p, --example-path <path-to-example>`,`In a rare case, your GitHub URL might contain a branch name with
375
375
  a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).
376
376
  In this case, you must specify the path to the example separately:
377
377
  --example-path foo/bar
378
- `).implies({copy:!0})).addOption(new Y(`--show-all-dependencies`,`Do not filter available dependencies by the workspace type`).default(!1)).action(PN),VN.command(`raw`,{hidden:!0}).argument(`<type>`,`The type of generator to run`).addOption(new Y(`--json <arguments>`,`Arguments as raw JSON`)).action(LN),VN.parseAsync().then(()=>zN()).catch(async e=>{e?.name===`ExitPromptError`&&process.exit(0),La(),e instanceof jA?za(e.message):(za(`Unexpected error. Please report it as a bug:`),La(e)),La(),await zN(1)});
378
+ `).implies({copy:!0})).addOption(new Y(`--show-all-dependencies`,`Do not filter available dependencies by the workspace type`).default(!1)).action(MN),zN.command(`raw`,{hidden:!0}).argument(`<type>`,`The type of generator to run`).addOption(new Y(`--json <arguments>`,`Arguments as raw JSON`)).action(FN),zN.parseAsync().then(()=>LN()).catch(async e=>{e?.name===`ExitPromptError`&&process.exit(0),La(),e instanceof jA?za(e.message):(za(`Unexpected error. Please report it as a bug:`),La(e)),La(),await LN(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbo/gen",
3
- "version": "2.10.11-canary.3",
3
+ "version": "2.10.11",
4
4
  "description": "Extend a Turborepo",
5
5
  "homepage": "https://turborepo.dev",
6
6
  "bugs": {
@@ -45,8 +45,8 @@
45
45
  "update-check": "1.5.4",
46
46
  "validate-npm-package-name": "5.0.0",
47
47
  "@turbo/test-utils": "0.0.0",
48
- "@turbo/tsconfig": "0.0.0",
49
48
  "@turbo/utils": "0.0.0",
50
- "@turbo/workspaces": "2.10.11-canary.3"
49
+ "@turbo/tsconfig": "0.0.0",
50
+ "@turbo/workspaces": "2.10.11"
51
51
  }
52
52
  }