@storybook/cli 8.3.0-alpha.6 → 8.3.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/index.cjs +22 -24
- package/dist/bin/index.js +14 -21
- package/package.json +6 -5
package/dist/bin/index.js
CHANGED
|
@@ -4,38 +4,33 @@ import { withTelemetry } from 'storybook/internal/core-server';
|
|
|
4
4
|
import { logger as logger$1 } from 'storybook/internal/node-logger';
|
|
5
5
|
import { addToGlobalContext, telemetry } from 'storybook/internal/telemetry';
|
|
6
6
|
import chalk22, { cyan, yellow } from 'chalk';
|
|
7
|
-
import program from 'commander';
|
|
7
|
+
import { program } from 'commander';
|
|
8
8
|
import envinfo from 'envinfo';
|
|
9
9
|
import { findPackageSync } from 'fd-package-json';
|
|
10
10
|
import leven from 'leven';
|
|
11
11
|
import invariant2 from 'tiny-invariant';
|
|
12
|
-
import { join,
|
|
12
|
+
import { join, basename, extname, isAbsolute, normalize } from 'node:path';
|
|
13
13
|
import { readConfig, writeConfig, loadConfig, formatConfig, babelParse } from 'storybook/internal/csf-tools';
|
|
14
14
|
import semver, { prerelease, lt, gt, eq, clean } from 'semver';
|
|
15
15
|
import { dedent } from 'ts-dedent';
|
|
16
16
|
import process2 from 'node:process';
|
|
17
17
|
import fse2, { move, remove, existsSync, readdir, createWriteStream, readFile, writeFile } from 'fs-extra';
|
|
18
18
|
import prompts5, { prompt } from 'prompts';
|
|
19
|
-
import { EOL } from 'os';
|
|
19
|
+
import { EOL } from 'node:os';
|
|
20
20
|
import { getStorybookVersionSpecifier, hasStorybookDependencies, isNxProject, AngularJSON, extractEslintInfo, findEslintFile, SUPPORTED_ESLINT_EXTENSIONS, configureEslintPlugin, frameworkToRenderer, CoreWebpackCompilers, builderNameToCoreBuilder, frameworkToDefaultBuilder, CoreBuilder, compilerNameToCoreCompiler, detectPnp } from 'storybook/internal/cli';
|
|
21
21
|
import { listCodemods, runCodemod } from '@storybook/codemod';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import * as actualFS from 'node:fs';
|
|
25
|
-
import { lstat, readdir as readdir$2, readlink, realpath, readFile as readFile$1 } from 'node:fs/promises';
|
|
26
|
-
import { EventEmitter } from 'node:events';
|
|
27
|
-
import Stream from 'node:stream';
|
|
28
|
-
import { StringDecoder } from 'node:string_decoder';
|
|
22
|
+
import { glob } from 'glob';
|
|
23
|
+
import { readFile as readFile$1 } from 'node:fs/promises';
|
|
29
24
|
import findUp from 'find-up';
|
|
30
25
|
import * as babel from '@babel/core';
|
|
31
26
|
import * as t from '@babel/types';
|
|
32
|
-
import { sync
|
|
27
|
+
import { sync, spawn } from 'cross-spawn';
|
|
33
28
|
import { initiate } from 'create-storybook';
|
|
34
29
|
import { downloadTemplate } from 'giget';
|
|
35
30
|
import { UpgradeStorybookInWrongWorkingDirectory, UpgradeStorybookToLowerVersionError, UpgradeStorybookToSameVersionError, UpgradeStorybookUnknownCurrentVersionError } from 'storybook/internal/server-errors';
|
|
36
31
|
|
|
37
32
|
var require_eastasianwidth=__commonJS({"../../node_modules/eastasianwidth/eastasianwidth.js"(exports,module){var eaw={};typeof module>"u"?window.eastasianwidth=eaw:module.exports=eaw;eaw.eastAsianWidth=function(character){var x=character.charCodeAt(0),y=character.length==2?character.charCodeAt(1):0,codePoint=x;return 55296<=x&&x<=56319&&56320<=y&&y<=57343&&(x&=1023,y&=1023,codePoint=x<<10|y,codePoint+=65536),codePoint==12288||65281<=codePoint&&codePoint<=65376||65504<=codePoint&&codePoint<=65510?"F":codePoint==8361||65377<=codePoint&&codePoint<=65470||65474<=codePoint&&codePoint<=65479||65482<=codePoint&&codePoint<=65487||65490<=codePoint&&codePoint<=65495||65498<=codePoint&&codePoint<=65500||65512<=codePoint&&codePoint<=65518?"H":4352<=codePoint&&codePoint<=4447||4515<=codePoint&&codePoint<=4519||4602<=codePoint&&codePoint<=4607||9001<=codePoint&&codePoint<=9002||11904<=codePoint&&codePoint<=11929||11931<=codePoint&&codePoint<=12019||12032<=codePoint&&codePoint<=12245||12272<=codePoint&&codePoint<=12283||12289<=codePoint&&codePoint<=12350||12353<=codePoint&&codePoint<=12438||12441<=codePoint&&codePoint<=12543||12549<=codePoint&&codePoint<=12589||12593<=codePoint&&codePoint<=12686||12688<=codePoint&&codePoint<=12730||12736<=codePoint&&codePoint<=12771||12784<=codePoint&&codePoint<=12830||12832<=codePoint&&codePoint<=12871||12880<=codePoint&&codePoint<=13054||13056<=codePoint&&codePoint<=19903||19968<=codePoint&&codePoint<=42124||42128<=codePoint&&codePoint<=42182||43360<=codePoint&&codePoint<=43388||44032<=codePoint&&codePoint<=55203||55216<=codePoint&&codePoint<=55238||55243<=codePoint&&codePoint<=55291||63744<=codePoint&&codePoint<=64255||65040<=codePoint&&codePoint<=65049||65072<=codePoint&&codePoint<=65106||65108<=codePoint&&codePoint<=65126||65128<=codePoint&&codePoint<=65131||110592<=codePoint&&codePoint<=110593||127488<=codePoint&&codePoint<=127490||127504<=codePoint&&codePoint<=127546||127552<=codePoint&&codePoint<=127560||127568<=codePoint&&codePoint<=127569||131072<=codePoint&&codePoint<=194367||177984<=codePoint&&codePoint<=196605||196608<=codePoint&&codePoint<=262141?"W":32<=codePoint&&codePoint<=126||162<=codePoint&&codePoint<=163||165<=codePoint&&codePoint<=166||codePoint==172||codePoint==175||10214<=codePoint&&codePoint<=10221||10629<=codePoint&&codePoint<=10630?"Na":codePoint==161||codePoint==164||167<=codePoint&&codePoint<=168||codePoint==170||173<=codePoint&&codePoint<=174||176<=codePoint&&codePoint<=180||182<=codePoint&&codePoint<=186||188<=codePoint&&codePoint<=191||codePoint==198||codePoint==208||215<=codePoint&&codePoint<=216||222<=codePoint&&codePoint<=225||codePoint==230||232<=codePoint&&codePoint<=234||236<=codePoint&&codePoint<=237||codePoint==240||242<=codePoint&&codePoint<=243||247<=codePoint&&codePoint<=250||codePoint==252||codePoint==254||codePoint==257||codePoint==273||codePoint==275||codePoint==283||294<=codePoint&&codePoint<=295||codePoint==299||305<=codePoint&&codePoint<=307||codePoint==312||319<=codePoint&&codePoint<=322||codePoint==324||328<=codePoint&&codePoint<=331||codePoint==333||338<=codePoint&&codePoint<=339||358<=codePoint&&codePoint<=359||codePoint==363||codePoint==462||codePoint==464||codePoint==466||codePoint==468||codePoint==470||codePoint==472||codePoint==474||codePoint==476||codePoint==593||codePoint==609||codePoint==708||codePoint==711||713<=codePoint&&codePoint<=715||codePoint==717||codePoint==720||728<=codePoint&&codePoint<=731||codePoint==733||codePoint==735||768<=codePoint&&codePoint<=879||913<=codePoint&&codePoint<=929||931<=codePoint&&codePoint<=937||945<=codePoint&&codePoint<=961||963<=codePoint&&codePoint<=969||codePoint==1025||1040<=codePoint&&codePoint<=1103||codePoint==1105||codePoint==8208||8211<=codePoint&&codePoint<=8214||8216<=codePoint&&codePoint<=8217||8220<=codePoint&&codePoint<=8221||8224<=codePoint&&codePoint<=8226||8228<=codePoint&&codePoint<=8231||codePoint==8240||8242<=codePoint&&codePoint<=8243||codePoint==8245||codePoint==8251||codePoint==8254||codePoint==8308||codePoint==8319||8321<=codePoint&&codePoint<=8324||codePoint==8364||codePoint==8451||codePoint==8453||codePoint==8457||codePoint==8467||codePoint==8470||8481<=codePoint&&codePoint<=8482||codePoint==8486||codePoint==8491||8531<=codePoint&&codePoint<=8532||8539<=codePoint&&codePoint<=8542||8544<=codePoint&&codePoint<=8555||8560<=codePoint&&codePoint<=8569||codePoint==8585||8592<=codePoint&&codePoint<=8601||8632<=codePoint&&codePoint<=8633||codePoint==8658||codePoint==8660||codePoint==8679||codePoint==8704||8706<=codePoint&&codePoint<=8707||8711<=codePoint&&codePoint<=8712||codePoint==8715||codePoint==8719||codePoint==8721||codePoint==8725||codePoint==8730||8733<=codePoint&&codePoint<=8736||codePoint==8739||codePoint==8741||8743<=codePoint&&codePoint<=8748||codePoint==8750||8756<=codePoint&&codePoint<=8759||8764<=codePoint&&codePoint<=8765||codePoint==8776||codePoint==8780||codePoint==8786||8800<=codePoint&&codePoint<=8801||8804<=codePoint&&codePoint<=8807||8810<=codePoint&&codePoint<=8811||8814<=codePoint&&codePoint<=8815||8834<=codePoint&&codePoint<=8835||8838<=codePoint&&codePoint<=8839||codePoint==8853||codePoint==8857||codePoint==8869||codePoint==8895||codePoint==8978||9312<=codePoint&&codePoint<=9449||9451<=codePoint&&codePoint<=9547||9552<=codePoint&&codePoint<=9587||9600<=codePoint&&codePoint<=9615||9618<=codePoint&&codePoint<=9621||9632<=codePoint&&codePoint<=9633||9635<=codePoint&&codePoint<=9641||9650<=codePoint&&codePoint<=9651||9654<=codePoint&&codePoint<=9655||9660<=codePoint&&codePoint<=9661||9664<=codePoint&&codePoint<=9665||9670<=codePoint&&codePoint<=9672||codePoint==9675||9678<=codePoint&&codePoint<=9681||9698<=codePoint&&codePoint<=9701||codePoint==9711||9733<=codePoint&&codePoint<=9734||codePoint==9737||9742<=codePoint&&codePoint<=9743||9748<=codePoint&&codePoint<=9749||codePoint==9756||codePoint==9758||codePoint==9792||codePoint==9794||9824<=codePoint&&codePoint<=9825||9827<=codePoint&&codePoint<=9829||9831<=codePoint&&codePoint<=9834||9836<=codePoint&&codePoint<=9837||codePoint==9839||9886<=codePoint&&codePoint<=9887||9918<=codePoint&&codePoint<=9919||9924<=codePoint&&codePoint<=9933||9935<=codePoint&&codePoint<=9953||codePoint==9955||9960<=codePoint&&codePoint<=9983||codePoint==10045||codePoint==10071||10102<=codePoint&&codePoint<=10111||11093<=codePoint&&codePoint<=11097||12872<=codePoint&&codePoint<=12879||57344<=codePoint&&codePoint<=63743||65024<=codePoint&&codePoint<=65039||codePoint==65533||127232<=codePoint&&codePoint<=127242||127248<=codePoint&&codePoint<=127277||127280<=codePoint&&codePoint<=127337||127344<=codePoint&&codePoint<=127386||917760<=codePoint&&codePoint<=917999||983040<=codePoint&&codePoint<=1048573||1048576<=codePoint&&codePoint<=1114109?"A":"N"};eaw.characterLength=function(character){var code=this.eastAsianWidth(character);return code=="F"||code=="W"||code=="A"?2:1};function stringToArray(string){return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}eaw.length=function(string){for(var characters=stringToArray(string),len=0,i=0;i<characters.length;i++)len=len+this.characterLength(characters[i]);return len};eaw.slice=function(text,start,end){textLen=eaw.length(text),start=start||0,end=end||1,start<0&&(start=textLen+start),end<0&&(end=textLen+end);for(var result="",eawLen=0,chars=stringToArray(text),i=0;i<chars.length;i++){var char=chars[i],charLen=eaw.length(char);if(eawLen>=start-(charLen==2?1:0))if(eawLen+charLen<=end)result+=char;else break;eawLen+=charLen;}return result};}});var require_emoji_regex=__commonJS({"../../node_modules/emoji-regex/index.js"(exports,module){module.exports=function(){return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};}});var require_boxes=__commonJS({"../../node_modules/cli-boxes/boxes.json"(exports,module){module.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}};}});var require_cli_boxes=__commonJS({"../../node_modules/cli-boxes/index.js"(exports,module){var cliBoxes2=require_boxes();module.exports=cliBoxes2;module.exports.default=cliBoxes2;}});var require_ansi_regex=__commonJS({"../../node_modules/string-width/node_modules/ansi-regex/index.js"(exports,module){module.exports=({onlyFirst=!1}={})=>{let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,onlyFirst?void 0:"g")};}});var require_strip_ansi=__commonJS({"../../node_modules/string-width/node_modules/strip-ansi/index.js"(exports,module){var ansiRegex3=require_ansi_regex();module.exports=string=>typeof string=="string"?string.replace(ansiRegex3(),""):string;}});var require_is_fullwidth_code_point=__commonJS({"../../node_modules/is-fullwidth-code-point/index.js"(exports,module){var isFullwidthCodePoint=codePoint=>Number.isNaN(codePoint)?!1:codePoint>=4352&&(codePoint<=4447||codePoint===9001||codePoint===9002||11904<=codePoint&&codePoint<=12871&&codePoint!==12351||12880<=codePoint&&codePoint<=19903||19968<=codePoint&&codePoint<=42182||43360<=codePoint&&codePoint<=43388||44032<=codePoint&&codePoint<=55203||63744<=codePoint&&codePoint<=64255||65040<=codePoint&&codePoint<=65049||65072<=codePoint&&codePoint<=65131||65281<=codePoint&&codePoint<=65376||65504<=codePoint&&codePoint<=65510||110592<=codePoint&&codePoint<=110593||127488<=codePoint&&codePoint<=127569||131072<=codePoint&&codePoint<=262141);module.exports=isFullwidthCodePoint;module.exports.default=isFullwidthCodePoint;}});var require_emoji_regex2=__commonJS({"../../node_modules/string-width/node_modules/emoji-regex/index.js"(exports,module){module.exports=function(){return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};}});var require_string_width=__commonJS({"../../node_modules/string-width/index.js"(exports,module){var stripAnsi2=require_strip_ansi(),isFullwidthCodePoint=require_is_fullwidth_code_point(),emojiRegex4=require_emoji_regex2(),stringWidth4=string=>{if(typeof string!="string"||string.length===0||(string=stripAnsi2(string),string.length===0))return 0;string=string.replace(emojiRegex4()," ");let width=0;for(let i=0;i<string.length;i++){let code=string.codePointAt(i);code<=31||code>=127&&code<=159||code>=768&&code<=879||(code>65535&&i++,width+=isFullwidthCodePoint(code)?2:1);}return width};module.exports=stringWidth4;module.exports.default=stringWidth4;}});var require_ansi_align=__commonJS({"../../node_modules/ansi-align/index.js"(exports,module){var stringWidth4=require_string_width();function ansiAlign2(text,opts){if(!text)return text;opts=opts||{};let align=opts.align||"center";if(align==="left")return text;let split=opts.split||`
|
|
38
|
-
`,pad=opts.pad||" ",widthDiffFn=align!=="right"?halfDiff:fullDiff,returnString=!1;Array.isArray(text)||(returnString=!0,text=String(text).split(split));let width,maxWidth=0;return text=text.map(function(str){return str=String(str),width=stringWidth4(str),maxWidth=Math.max(width,maxWidth),{str,width}}).map(function(obj){return new Array(widthDiffFn(maxWidth,obj.width)+1).join(pad)+obj.str}),returnString?text.join(split):text}ansiAlign2.left=function(text){return ansiAlign2(text,{align:"left"})};ansiAlign2.center=function(text){return ansiAlign2(text,{align:"center"})};ansiAlign2.right=function(text){return ansiAlign2(text,{align:"right"})};module.exports=ansiAlign2;function halfDiff(maxWidth,curWidth){return Math.floor((maxWidth-curWidth)/2)}function fullDiff(maxWidth,curWidth){return maxWidth-curWidth}}});var
|
|
33
|
+
`,pad=opts.pad||" ",widthDiffFn=align!=="right"?halfDiff:fullDiff,returnString=!1;Array.isArray(text)||(returnString=!0,text=String(text).split(split));let width,maxWidth=0;return text=text.map(function(str){return str=String(str),width=stringWidth4(str),maxWidth=Math.max(width,maxWidth),{str,width}}).map(function(obj){return new Array(widthDiffFn(maxWidth,obj.width)+1).join(pad)+obj.str}),returnString?text.join(split):text}ansiAlign2.left=function(text){return ansiAlign2(text,{align:"left"})};ansiAlign2.center=function(text){return ansiAlign2(text,{align:"center"})};ansiAlign2.right=function(text){return ansiAlign2(text,{align:"right"})};module.exports=ansiAlign2;function halfDiff(maxWidth,curWidth){return Math.floor((maxWidth-curWidth)/2)}function fullDiff(maxWidth,curWidth){return maxWidth-curWidth}}});var postinstallAddon=async(addonName,options)=>{try{let modulePath=__require.resolve(`${addonName}/postinstall`,{paths:[process.cwd()]}),postinstall=__require(modulePath);try{console.log(`Running postinstall script for ${addonName}`),await postinstall(options);}catch(e){console.error(`Error running postinstall script for ${addonName}`),console.error(e);}}catch{}};var getVersionSpecifier=addon=>{let groups=/^(@{0,1}[^@]+)(?:@(.+))?$/.exec(addon);return groups?[groups[1],groups[2]]:[addon,void 0]},requireMain=configDir=>{let absoluteConfigDir=isAbsolute(configDir)?configDir:join(process.cwd(),configDir),mainFile=join(absoluteConfigDir,"main");return serverRequire(mainFile)??{}},checkInstalled=(addonName,main)=>!!main.addons?.find(entry=>(typeof entry=="string"?entry:entry.name)?.endsWith(addonName)),isCoreAddon=addonName=>Object.hasOwn(versions,addonName);async function add(addon,{packageManager:pkgMgr,skipPostinstall,configDir:userSpecifiedConfigDir},logger28=console){let[addonName,inputVersion]=getVersionSpecifier(addon),packageManager=JsPackageManagerFactory.getPackageManager({force:pkgMgr}),packageJson=await packageManager.retrievePackageJson(),{mainConfig,configDir:inferredConfigDir}=getStorybookInfo(packageJson,userSpecifiedConfigDir),configDir=userSpecifiedConfigDir||inferredConfigDir||".storybook";if(typeof configDir>"u")throw new Error(dedent`
|
|
39
34
|
Unable to find storybook config directory
|
|
40
35
|
`);if(!mainConfig){logger28.error("Unable to find storybook main.js config");return}if(checkInstalled(addonName,requireMain(configDir)))throw new Error(dedent`
|
|
41
36
|
Addon ${addonName} is already installed; we skipped adding it to your ${mainConfig}.
|
|
@@ -209,7 +204,7 @@ ${chalk22.cyan("npx storybook doctor")}`;logger2.info(),foundIssues?(logger2.inf
|
|
|
209
204
|
of the 7.0 migration guide. It contains useful tools for detecting and fixing any remaining issues.
|
|
210
205
|
|
|
211
206
|
${chalk22.cyan("https://storybook.js.org/migration-guides/7.0")}
|
|
212
|
-
`},async run({result:{storiesMdxFiles},dryRun}){await Promise.all([...storiesMdxFiles.map(async fname=>{let contents=await fse2.readFile(fname,"utf-8"),updated=fixMdxComments(fixMdxStyleTags(contents));updated===contents?logger9.info(`\u{1F197} Unmodified ${basename(fname)}`):(logger9.info(`\u2705 Modified ${basename(fname)}`),dryRun||await fse2.writeFile(fname,updated));})]);}};function slash(
|
|
207
|
+
`},async run({result:{storiesMdxFiles},dryRun}){await Promise.all([...storiesMdxFiles.map(async fname=>{let contents=await fse2.readFile(fname,"utf-8"),updated=fixMdxComments(fixMdxStyleTags(contents));updated===contents?logger9.info(`\u{1F197} Unmodified ${basename(fname)}`):(logger9.info(`\u2705 Modified ${basename(fname)}`),dryRun||await fse2.writeFile(fname,updated));})]);}};function slash(path){return path.startsWith("\\\\?\\")?path:path.replace(/\\/g,"/")}var logger10=console,mdxgfm={id:"github-flavored-markdown-mdx",versionRange:["<7",">=7"],async check({configDir,mainConfig}){let hasMDXFiles=await mainConfig?.stories?.reduce(async(acc,item)=>{if(await acc===!0)return !0;let pattern;if(typeof configDir>"u")return !1;if(typeof item=="string")pattern=slash(join(configDir,item));else if(typeof item=="object"){let directory=item.directory||"..",files2=item.files||"**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))";pattern=slash(join(configDir,directory,files2));}if(!pattern)return !1;let{globby}=await import('globby');return (await globby(pattern,commonGlobOptions(pattern))).some(f=>f.endsWith(".mdx"))},Promise.resolve(!1));return mainConfig?.features?.legacyMdx1===!0||!1||!hasMDXFiles||!!mainConfig.addons?.find(item=>item==="@storybook/addon-mdx-gfm"?!0:typeof item=="string"?!1:item.name==="@storybook/addon-docs"?item.options?.mdxPluginOptions?.mdxCompileOptions?.remarkPlugins?.length>0:!1)?null:{}},prompt(){return dedent`
|
|
213
208
|
In MDX1 you had the option of using GitHub flavored markdown.
|
|
214
209
|
|
|
215
210
|
Storybook >= 8.0 uses MDX3 for compiling MDX, and thus no longer supports GFM out of the box.
|
|
@@ -218,9 +213,7 @@ ${chalk22.cyan("npx storybook doctor")}`;logger2.info(),foundIssues?(logger2.inf
|
|
|
218
213
|
|
|
219
214
|
We recommend that you follow the guide in the link above; however, we can add a temporary Storybook addon to help make this migration easier.
|
|
220
215
|
We'll install the addon and add it to your storybook config.
|
|
221
|
-
`},async run({packageManager,dryRun,mainConfigPath,skipInstall}){if(!dryRun){let packageJson=await packageManager.retrievePackageJson(),versionToInstall=getStorybookVersionSpecifier(await packageManager.retrievePackageJson());await packageManager.addDependencies({installAsDevDependencies:!0,skipInstall,packageJson},[`@storybook/addon-mdx-gfm@${versionToInstall}`]),await updateMainConfig({mainConfigPath,dryRun:!!dryRun},async main=>{logger10.info('\u2705 Adding "@storybook/addon-mdx-gfm" addon'),dryRun||main.appendValueToArray(["addons"],"@storybook/addon-mdx-gfm");});}}};var import_brace_expansion=__toESM(require_brace_expansion(),1);var assertValidPattern=pattern=>{if(typeof pattern!="string")throw new TypeError("invalid pattern");if(pattern.length>65536)throw new TypeError("pattern is too long")};var posixClasses={"[: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]},braceEscape=s=>s.replace(/[[\]\\-]/g,"\\$&"),regexpEscape=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),rangesToString=ranges=>ranges.join(""),parseClass=(glob2,position)=>{let pos=position;if(glob2.charAt(pos)!=="[")throw new Error("not in a brace expression");let ranges=[],negs=[],i=pos+1,sawStart=!1,uflag=!1,escaping=!1,negate=!1,endPos=pos,rangeStart="";WHILE:for(;i<glob2.length;){let c=glob2.charAt(i);if((c==="!"||c==="^")&&i===pos+1){negate=!0,i++;continue}if(c==="]"&&sawStart&&!escaping){endPos=i+1;break}if(sawStart=!0,c==="\\"&&!escaping){escaping=!0,i++;continue}if(c==="["&&!escaping){for(let[cls,[unip,u,neg]]of Object.entries(posixClasses))if(glob2.startsWith(cls,i)){if(rangeStart)return ["$.",!1,glob2.length-pos,!0];i+=cls.length,neg?negs.push(unip):ranges.push(unip),uflag=uflag||u;continue WHILE}}if(escaping=!1,rangeStart){c>rangeStart?ranges.push(braceEscape(rangeStart)+"-"+braceEscape(c)):c===rangeStart&&ranges.push(braceEscape(c)),rangeStart="",i++;continue}if(glob2.startsWith("-]",i+1)){ranges.push(braceEscape(c+"-")),i+=2;continue}if(glob2.startsWith("-",i+1)){rangeStart=c,i+=2;continue}ranges.push(braceEscape(c)),i++;}if(endPos<i)return ["",!1,0,!1];if(!ranges.length&&!negs.length)return ["$.",!1,glob2.length-pos,!0];if(negs.length===0&&ranges.length===1&&/^\\?.$/.test(ranges[0])&&!negate){let r=ranges[0].length===2?ranges[0].slice(-1):ranges[0];return [regexpEscape(r),!1,endPos-pos,!1]}let sranges="["+(negate?"^":"")+rangesToString(ranges)+"]",snegs="["+(negate?"":"^")+rangesToString(negs)+"]";return [ranges.length&&negs.length?"("+sranges+"|"+snegs+")":ranges.length?sranges:snegs,uflag,endPos-pos,!0]};var unescape=(s,{windowsPathsNoEscape=!1}={})=>windowsPathsNoEscape?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var types=new Set(["!","?","+","*","@"]),isExtglobType=c=>types.has(c),startNoTraversal="(?!(?:^|/)\\.\\.?(?:$|/))",startNoDot="(?!\\.)",addPatternStart=new Set(["[","."]),justDots=new Set(["..","."]),reSpecials=new Set("().*{}+?[]^$\\!"),regExpEscape=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),qmark="[^/]",star=qmark+"*?",starNoEmpty=qmark+"+?",AST=class _AST{type;#root;#hasMagic;#uflag=!1;#parts=[];#parent;#parentIndex;#negs;#filledNegs=!1;#options;#toString;#emptyExt=!1;constructor(type,parent,options={}){this.type=type,type&&(this.#hasMagic=!0),this.#parent=parent,this.#root=this.#parent?this.#parent.#root:this,this.#options=this.#root===this?options:this.#root.#options,this.#negs=this.#root===this?[]:this.#root.#negs,type==="!"&&!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 p of this.#parts)if(typeof p!="string"&&(p.type||p.hasMagic))return this.#hasMagic=!0;return this.#hasMagic}toString(){return this.#toString!==void 0?this.#toString:this.type?this.#toString=this.type+"("+this.#parts.map(p=>String(p)).join("|")+")":this.#toString=this.#parts.map(p=>String(p)).join("")}#fillNegs(){if(this!==this.#root)throw new Error("should only call on root");if(this.#filledNegs)return this;this.toString(),this.#filledNegs=!0;let n;for(;n=this.#negs.pop();){if(n.type!=="!")continue;let p=n,pp=p.#parent;for(;pp;){for(let i=p.#parentIndex+1;!pp.type&&i<pp.#parts.length;i++)for(let part of n.#parts){if(typeof part=="string")throw new Error("string part in extglob AST??");part.copyIn(pp.#parts[i]);}p=pp,pp=p.#parent;}}return this}push(...parts){for(let p of parts)if(p!==""){if(typeof p!="string"&&!(p instanceof _AST&&p.#parent===this))throw new Error("invalid part: "+p);this.#parts.push(p);}}toJSON(){let ret=this.type===null?this.#parts.slice().map(p=>typeof p=="string"?p:p.toJSON()):[this.type,...this.#parts.map(p=>p.toJSON())];return this.isStart()&&!this.type&&ret.unshift([]),this.isEnd()&&(this===this.#root||this.#root.#filledNegs&&this.#parent?.type==="!")&&ret.push({}),ret}isStart(){if(this.#root===this)return !0;if(!this.#parent?.isStart())return !1;if(this.#parentIndex===0)return !0;let p=this.#parent;for(let i=0;i<this.#parentIndex;i++){let pp=p.#parts[i];if(!(pp instanceof _AST&&pp.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 pl=this.#parent?this.#parent.#parts.length:0;return this.#parentIndex===pl-1}copyIn(part){typeof part=="string"?this.push(part):this.push(part.clone(this));}clone(parent){let c=new _AST(this.type,parent);for(let p of this.#parts)c.copyIn(p);return c}static#parseAST(str,ast,pos,opt){let escaping=!1,inBrace=!1,braceStart=-1,braceNeg=!1;if(ast.type===null){let i2=pos,acc2="";for(;i2<str.length;){let c=str.charAt(i2++);if(escaping||c==="\\"){escaping=!escaping,acc2+=c;continue}if(inBrace){i2===braceStart+1?(c==="^"||c==="!")&&(braceNeg=!0):c==="]"&&!(i2===braceStart+2&&braceNeg)&&(inBrace=!1),acc2+=c;continue}else if(c==="["){inBrace=!0,braceStart=i2,braceNeg=!1,acc2+=c;continue}if(!opt.noext&&isExtglobType(c)&&str.charAt(i2)==="("){ast.push(acc2),acc2="";let ext2=new _AST(c,ast);i2=_AST.#parseAST(str,ext2,i2,opt),ast.push(ext2);continue}acc2+=c;}return ast.push(acc2),i2}let i=pos+1,part=new _AST(null,ast),parts=[],acc="";for(;i<str.length;){let c=str.charAt(i++);if(escaping||c==="\\"){escaping=!escaping,acc+=c;continue}if(inBrace){i===braceStart+1?(c==="^"||c==="!")&&(braceNeg=!0):c==="]"&&!(i===braceStart+2&&braceNeg)&&(inBrace=!1),acc+=c;continue}else if(c==="["){inBrace=!0,braceStart=i,braceNeg=!1,acc+=c;continue}if(isExtglobType(c)&&str.charAt(i)==="("){part.push(acc),acc="";let ext2=new _AST(c,part);part.push(ext2),i=_AST.#parseAST(str,ext2,i,opt);continue}if(c==="|"){part.push(acc),acc="",parts.push(part),part=new _AST(null,ast);continue}if(c===")")return acc===""&&ast.#parts.length===0&&(ast.#emptyExt=!0),part.push(acc),acc="",ast.push(...parts,part),i;acc+=c;}return ast.type=null,ast.#hasMagic=void 0,ast.#parts=[str.substring(pos-1)],i}static fromGlob(pattern,options={}){let ast=new _AST(null,void 0,options);return _AST.#parseAST(pattern,ast,0,options),ast}toMMPattern(){if(this!==this.#root)return this.#root.toMMPattern();let glob2=this.toString(),[re,body,hasMagic2,uflag]=this.toRegExpSource();if(!(hasMagic2||this.#hasMagic||this.#options.nocase&&!this.#options.nocaseMagicOnly&&glob2.toUpperCase()!==glob2.toLowerCase()))return body;let flags=(this.#options.nocase?"i":"")+(uflag?"u":"");return Object.assign(new RegExp(`^${re}$`,flags),{_src:re,_glob:glob2})}get options(){return this.#options}toRegExpSource(allowDot){let dot=allowDot??!!this.#options.dot;if(this.#root===this&&this.#fillNegs(),!this.type){let noEmpty=this.isStart()&&this.isEnd(),src=this.#parts.map(p=>{let[re,_,hasMagic2,uflag]=typeof p=="string"?_AST.#parseGlob(p,this.#hasMagic,noEmpty):p.toRegExpSource(allowDot);return this.#hasMagic=this.#hasMagic||hasMagic2,this.#uflag=this.#uflag||uflag,re}).join(""),start2="";if(this.isStart()&&typeof this.#parts[0]=="string"&&!(this.#parts.length===1&&justDots.has(this.#parts[0]))){let aps=addPatternStart,needNoTrav=dot&&aps.has(src.charAt(0))||src.startsWith("\\.")&&aps.has(src.charAt(2))||src.startsWith("\\.\\.")&&aps.has(src.charAt(4)),needNoDot=!dot&&!allowDot&&aps.has(src.charAt(0));start2=needNoTrav?startNoTraversal:needNoDot?startNoDot:"";}let end="";return this.isEnd()&&this.#root.#filledNegs&&this.#parent?.type==="!"&&(end="(?:$|\\/)"),[start2+src+end,unescape(src),this.#hasMagic=!!this.#hasMagic,this.#uflag]}let repeated=this.type==="*"||this.type==="+",start=this.type==="!"?"(?:(?!(?:":"(?:",body=this.#partsToRegExp(dot);if(this.isStart()&&this.isEnd()&&!body&&this.type!=="!"){let s=this.toString();return this.#parts=[s],this.type=null,this.#hasMagic=void 0,[s,unescape(this.toString()),!1,!1]}let bodyDotAllowed=!repeated||allowDot||dot||!startNoDot?"":this.#partsToRegExp(!0);bodyDotAllowed===body&&(bodyDotAllowed=""),bodyDotAllowed&&(body=`(?:${body})(?:${bodyDotAllowed})*?`);let final="";if(this.type==="!"&&this.#emptyExt)final=(this.isStart()&&!dot?startNoDot:"")+starNoEmpty;else {let close=this.type==="!"?"))"+(this.isStart()&&!dot&&!allowDot?startNoDot:"")+star+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&bodyDotAllowed?")":this.type==="*"&&bodyDotAllowed?")?":`)${this.type}`;final=start+body+close;}return [final,unescape(body),this.#hasMagic=!!this.#hasMagic,this.#uflag]}#partsToRegExp(dot){return this.#parts.map(p=>{if(typeof p=="string")throw new Error("string type in extglob ast??");let[re,_,_hasMagic,uflag]=p.toRegExpSource(dot);return this.#uflag=this.#uflag||uflag,re}).filter(p=>!(this.isStart()&&this.isEnd())||!!p).join("|")}static#parseGlob(glob2,hasMagic2,noEmpty=!1){let escaping=!1,re="",uflag=!1;for(let i=0;i<glob2.length;i++){let c=glob2.charAt(i);if(escaping){escaping=!1,re+=(reSpecials.has(c)?"\\":"")+c;continue}if(c==="\\"){i===glob2.length-1?re+="\\\\":escaping=!0;continue}if(c==="["){let[src,needUflag,consumed,magic]=parseClass(glob2,i);if(consumed){re+=src,uflag=uflag||needUflag,i+=consumed-1,hasMagic2=hasMagic2||magic;continue}}if(c==="*"){noEmpty&&glob2==="*"?re+=starNoEmpty:re+=star,hasMagic2=!0;continue}if(c==="?"){re+=qmark,hasMagic2=!0;continue}re+=regExpEscape(c);}return [re,unescape(glob2),!!hasMagic2,uflag]}};var escape=(s,{windowsPathsNoEscape=!1}={})=>windowsPathsNoEscape?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&");var minimatch=(p,pattern,options={})=>(assertValidPattern(pattern),!options.nocomment&&pattern.charAt(0)==="#"?!1:new Minimatch(pattern,options).match(p)),starDotExtRE=/^\*+([^+@!?\*\[\(]*)$/,starDotExtTest=ext2=>f=>!f.startsWith(".")&&f.endsWith(ext2),starDotExtTestDot=ext2=>f=>f.endsWith(ext2),starDotExtTestNocase=ext2=>(ext2=ext2.toLowerCase(),f=>!f.startsWith(".")&&f.toLowerCase().endsWith(ext2)),starDotExtTestNocaseDot=ext2=>(ext2=ext2.toLowerCase(),f=>f.toLowerCase().endsWith(ext2)),starDotStarRE=/^\*+\.\*+$/,starDotStarTest=f=>!f.startsWith(".")&&f.includes("."),starDotStarTestDot=f=>f!=="."&&f!==".."&&f.includes("."),dotStarRE=/^\.\*+$/,dotStarTest=f=>f!=="."&&f!==".."&&f.startsWith("."),starRE=/^\*+$/,starTest=f=>f.length!==0&&!f.startsWith("."),starTestDot=f=>f.length!==0&&f!=="."&&f!=="..",qmarksRE=/^\?+([^+@!?\*\[\(]*)?$/,qmarksTestNocase=([$0,ext2=""])=>{let noext=qmarksTestNoExt([$0]);return ext2?(ext2=ext2.toLowerCase(),f=>noext(f)&&f.toLowerCase().endsWith(ext2)):noext},qmarksTestNocaseDot=([$0,ext2=""])=>{let noext=qmarksTestNoExtDot([$0]);return ext2?(ext2=ext2.toLowerCase(),f=>noext(f)&&f.toLowerCase().endsWith(ext2)):noext},qmarksTestDot=([$0,ext2=""])=>{let noext=qmarksTestNoExtDot([$0]);return ext2?f=>noext(f)&&f.endsWith(ext2):noext},qmarksTest=([$0,ext2=""])=>{let noext=qmarksTestNoExt([$0]);return ext2?f=>noext(f)&&f.endsWith(ext2):noext},qmarksTestNoExt=([$0])=>{let len=$0.length;return f=>f.length===len&&!f.startsWith(".")},qmarksTestNoExtDot=([$0])=>{let len=$0.length;return f=>f.length===len&&f!=="."&&f!==".."},defaultPlatform=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",path={win32:{sep:"\\"},posix:{sep:"/"}},sep=defaultPlatform==="win32"?path.win32.sep:path.posix.sep;minimatch.sep=sep;var GLOBSTAR=Symbol("globstar **");minimatch.GLOBSTAR=GLOBSTAR;var qmark2="[^/]",star2=qmark2+"*?",twoStarDot="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",twoStarNoDot="(?:(?!(?:\\/|^)\\.).)*?",filter=(pattern,options={})=>p=>minimatch(p,pattern,options);minimatch.filter=filter;var ext=(a,b={})=>Object.assign({},a,b),defaults=def=>{if(!def||typeof def!="object"||!Object.keys(def).length)return minimatch;let orig=minimatch;return Object.assign((p,pattern,options={})=>orig(p,pattern,ext(def,options)),{Minimatch:class extends orig.Minimatch{constructor(pattern,options={}){super(pattern,ext(def,options));}static defaults(options){return orig.defaults(ext(def,options)).Minimatch}},AST:class extends orig.AST{constructor(type,parent,options={}){super(type,parent,ext(def,options));}static fromGlob(pattern,options={}){return orig.AST.fromGlob(pattern,ext(def,options))}},unescape:(s,options={})=>orig.unescape(s,ext(def,options)),escape:(s,options={})=>orig.escape(s,ext(def,options)),filter:(pattern,options={})=>orig.filter(pattern,ext(def,options)),defaults:options=>orig.defaults(ext(def,options)),makeRe:(pattern,options={})=>orig.makeRe(pattern,ext(def,options)),braceExpand:(pattern,options={})=>orig.braceExpand(pattern,ext(def,options)),match:(list,pattern,options={})=>orig.match(list,pattern,ext(def,options)),sep:orig.sep,GLOBSTAR})};minimatch.defaults=defaults;var braceExpand=(pattern,options={})=>(assertValidPattern(pattern),options.nobrace||!/\{(?:(?!\{).)*\}/.test(pattern)?[pattern]:(0, import_brace_expansion.default)(pattern));minimatch.braceExpand=braceExpand;var makeRe=(pattern,options={})=>new Minimatch(pattern,options).makeRe();minimatch.makeRe=makeRe;var match=(list,pattern,options={})=>{let mm=new Minimatch(pattern,options);return list=list.filter(f=>mm.match(f)),mm.options.nonull&&!list.length&&list.push(pattern),list};minimatch.match=match;var globMagic=/[?*]|[+@!]\(.*?\)|\[|\]/,regExpEscape2=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Minimatch=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(pattern,options={}){assertValidPattern(pattern),options=options||{},this.options=options,this.pattern=pattern,this.platform=options.platform||defaultPlatform,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!options.windowsPathsNoEscape||options.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!options.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!options.nonegate,this.comment=!1,this.empty=!1,this.partial=!!options.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=options.windowsNoMagicRoot!==void 0?options.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make();}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return !0;for(let pattern of this.set)for(let part of pattern)if(typeof part!="string")return !0;return !1}debug(..._){}make(){let pattern=this.pattern,options=this.options;if(!options.nocomment&&pattern.charAt(0)==="#"){this.comment=!0;return}if(!pattern){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],options.debug&&(this.debug=(...args)=>console.error(...args)),this.debug(this.pattern,this.globSet);let rawGlobParts=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(rawGlobParts),this.debug(this.pattern,this.globParts);let set=this.globParts.map((s,_,__)=>{if(this.isWindows&&this.windowsNoMagicRoot){let isUNC=s[0]===""&&s[1]===""&&(s[2]==="?"||!globMagic.test(s[2]))&&!globMagic.test(s[3]),isDrive=/^[a-z]:/i.test(s[0]);if(isUNC)return [...s.slice(0,4),...s.slice(4).map(ss=>this.parse(ss))];if(isDrive)return [s[0],...s.slice(1).map(ss=>this.parse(ss))]}return s.map(ss=>this.parse(ss))});if(this.debug(this.pattern,set),this.set=set.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let p=this.set[i];p[0]===""&&p[1]===""&&this.globParts[i][2]==="?"&&typeof p[3]=="string"&&/^[a-z]:$/i.test(p[3])&&(p[2]="?");}this.debug(this.pattern,this.set);}preprocess(globParts){if(this.options.noglobstar)for(let i=0;i<globParts.length;i++)for(let j=0;j<globParts[i].length;j++)globParts[i][j]==="**"&&(globParts[i][j]="*");let{optimizationLevel=1}=this.options;return optimizationLevel>=2?(globParts=this.firstPhasePreProcess(globParts),globParts=this.secondPhasePreProcess(globParts)):optimizationLevel>=1?globParts=this.levelOneOptimize(globParts):globParts=this.adjascentGlobstarOptimize(globParts),globParts}adjascentGlobstarOptimize(globParts){return globParts.map(parts=>{let gs=-1;for(;(gs=parts.indexOf("**",gs+1))!==-1;){let i=gs;for(;parts[i+1]==="**";)i++;i!==gs&&parts.splice(gs,i-gs);}return parts})}levelOneOptimize(globParts){return globParts.map(parts=>(parts=parts.reduce((set,part)=>{let prev=set[set.length-1];return part==="**"&&prev==="**"?set:part===".."&&prev&&prev!==".."&&prev!=="."&&prev!=="**"?(set.pop(),set):(set.push(part),set)},[]),parts.length===0?[""]:parts))}levelTwoFileOptimize(parts){Array.isArray(parts)||(parts=this.slashSplit(parts));let didSomething=!1;do{if(didSomething=!1,!this.preserveMultipleSlashes){for(let i=1;i<parts.length-1;i++){let p=parts[i];i===1&&p===""&&parts[0]===""||(p==="."||p==="")&&(didSomething=!0,parts.splice(i,1),i--);}parts[0]==="."&&parts.length===2&&(parts[1]==="."||parts[1]==="")&&(didSomething=!0,parts.pop());}let dd=0;for(;(dd=parts.indexOf("..",dd+1))!==-1;){let p=parts[dd-1];p&&p!=="."&&p!==".."&&p!=="**"&&(didSomething=!0,parts.splice(dd-1,2),dd-=2);}}while(didSomething);return parts.length===0?[""]:parts}firstPhasePreProcess(globParts){let didSomething=!1;do{didSomething=!1;for(let parts of globParts){let gs=-1;for(;(gs=parts.indexOf("**",gs+1))!==-1;){let gss=gs;for(;parts[gss+1]==="**";)gss++;gss>gs&&parts.splice(gs+1,gss-gs);let next=parts[gs+1],p=parts[gs+2],p2=parts[gs+3];if(next!==".."||!p||p==="."||p===".."||!p2||p2==="."||p2==="..")continue;didSomething=!0,parts.splice(gs,1);let other=parts.slice(0);other[gs]="**",globParts.push(other),gs--;}if(!this.preserveMultipleSlashes){for(let i=1;i<parts.length-1;i++){let p=parts[i];i===1&&p===""&&parts[0]===""||(p==="."||p==="")&&(didSomething=!0,parts.splice(i,1),i--);}parts[0]==="."&&parts.length===2&&(parts[1]==="."||parts[1]==="")&&(didSomething=!0,parts.pop());}let dd=0;for(;(dd=parts.indexOf("..",dd+1))!==-1;){let p=parts[dd-1];if(p&&p!=="."&&p!==".."&&p!=="**"){didSomething=!0;let splin=dd===1&&parts[dd+1]==="**"?["."]:[];parts.splice(dd-1,2,...splin),parts.length===0&&parts.push(""),dd-=2;}}}}while(didSomething);return globParts}secondPhasePreProcess(globParts){for(let i=0;i<globParts.length-1;i++)for(let j=i+1;j<globParts.length;j++){let matched=this.partsMatch(globParts[i],globParts[j],!this.preserveMultipleSlashes);if(matched){globParts[i]=[],globParts[j]=matched;break}}return globParts.filter(gs=>gs.length)}partsMatch(a,b,emptyGSMatch=!1){let ai=0,bi=0,result=[],which="";for(;ai<a.length&&bi<b.length;)if(a[ai]===b[bi])result.push(which==="b"?b[bi]:a[ai]),ai++,bi++;else if(emptyGSMatch&&a[ai]==="**"&&b[bi]===a[ai+1])result.push(a[ai]),ai++;else if(emptyGSMatch&&b[bi]==="**"&&a[ai]===b[bi+1])result.push(b[bi]),bi++;else if(a[ai]==="*"&&b[bi]&&(this.options.dot||!b[bi].startsWith("."))&&b[bi]!=="**"){if(which==="b")return !1;which="a",result.push(a[ai]),ai++,bi++;}else if(b[bi]==="*"&&a[ai]&&(this.options.dot||!a[ai].startsWith("."))&&a[ai]!=="**"){if(which==="a")return !1;which="b",result.push(b[bi]),ai++,bi++;}else return !1;return a.length===b.length&&result}parseNegate(){if(this.nonegate)return;let pattern=this.pattern,negate=!1,negateOffset=0;for(let i=0;i<pattern.length&&pattern.charAt(i)==="!";i++)negate=!negate,negateOffset++;negateOffset&&(this.pattern=pattern.slice(negateOffset)),this.negate=negate;}matchOne(file,pattern,partial=!1){let options=this.options;if(this.isWindows){let fileDrive=typeof file[0]=="string"&&/^[a-z]:$/i.test(file[0]),fileUNC=!fileDrive&&file[0]===""&&file[1]===""&&file[2]==="?"&&/^[a-z]:$/i.test(file[3]),patternDrive=typeof pattern[0]=="string"&&/^[a-z]:$/i.test(pattern[0]),patternUNC=!patternDrive&&pattern[0]===""&&pattern[1]===""&&pattern[2]==="?"&&typeof pattern[3]=="string"&&/^[a-z]:$/i.test(pattern[3]),fdi=fileUNC?3:fileDrive?0:void 0,pdi=patternUNC?3:patternDrive?0:void 0;if(typeof fdi=="number"&&typeof pdi=="number"){let[fd,pd]=[file[fdi],pattern[pdi]];fd.toLowerCase()===pd.toLowerCase()&&(pattern[pdi]=fd,pdi>fdi?pattern=pattern.slice(pdi):fdi>pdi&&(file=file.slice(fdi)));}}let{optimizationLevel=1}=this.options;optimizationLevel>=2&&(file=this.levelTwoFileOptimize(file)),this.debug("matchOne",this,{file,pattern}),this.debug("matchOne",file.length,pattern.length);for(var fi=0,pi=0,fl=file.length,pl=pattern.length;fi<fl&&pi<pl;fi++,pi++){this.debug("matchOne loop");var p=pattern[pi],f=file[fi];if(this.debug(pattern,p,f),p===!1)return !1;if(p===GLOBSTAR){this.debug("GLOBSTAR",[pattern,p,f]);var fr=fi,pr=pi+1;if(pr===pl){for(this.debug("** at the end");fi<fl;fi++)if(file[fi]==="."||file[fi]===".."||!options.dot&&file[fi].charAt(0)===".")return !1;return !0}for(;fr<fl;){var swallowee=file[fr];if(this.debug(`
|
|
222
|
-
globstar while`,file,fr,pattern,pr,swallowee),this.matchOne(file.slice(fr),pattern.slice(pr),partial))return this.debug("globstar found match!",fr,fl,swallowee),!0;if(swallowee==="."||swallowee===".."||!options.dot&&swallowee.charAt(0)==="."){this.debug("dot detected!",file,fr,pattern,pr);break}this.debug("globstar swallow a segment, and continue"),fr++;}return !!(partial&&(this.debug(`
|
|
223
|
-
>>> no match, partial?`,file,fr,pattern,pr),fr===fl))}let hit;if(typeof p=="string"?(hit=f===p,this.debug("string match",p,f,hit)):(hit=p.test(f),this.debug("pattern match",p,f,hit)),!hit)return !1}if(fi===fl&&pi===pl)return !0;if(fi===fl)return partial;if(pi===pl)return fi===fl-1&&file[fi]==="";throw new Error("wtf?")}braceExpand(){return braceExpand(this.pattern,this.options)}parse(pattern){assertValidPattern(pattern);let options=this.options;if(pattern==="**")return GLOBSTAR;if(pattern==="")return "";let m,fastTest=null;(m=pattern.match(starRE))?fastTest=options.dot?starTestDot:starTest:(m=pattern.match(starDotExtRE))?fastTest=(options.nocase?options.dot?starDotExtTestNocaseDot:starDotExtTestNocase:options.dot?starDotExtTestDot:starDotExtTest)(m[1]):(m=pattern.match(qmarksRE))?fastTest=(options.nocase?options.dot?qmarksTestNocaseDot:qmarksTestNocase:options.dot?qmarksTestDot:qmarksTest)(m):(m=pattern.match(starDotStarRE))?fastTest=options.dot?starDotStarTestDot:starDotStarTest:(m=pattern.match(dotStarRE))&&(fastTest=dotStarTest);let re=AST.fromGlob(pattern,this.options).toMMPattern();return fastTest&&typeof re=="object"&&Reflect.defineProperty(re,"test",{value:fastTest}),re}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let set=this.set;if(!set.length)return this.regexp=!1,this.regexp;let options=this.options,twoStar=options.noglobstar?star2:options.dot?twoStarDot:twoStarNoDot,flags=new Set(options.nocase?["i"]:[]),re=set.map(pattern=>{let pp=pattern.map(p=>{if(p instanceof RegExp)for(let f of p.flags.split(""))flags.add(f);return typeof p=="string"?regExpEscape2(p):p===GLOBSTAR?GLOBSTAR:p._src});return pp.forEach((p,i)=>{let next=pp[i+1],prev=pp[i-1];p!==GLOBSTAR||prev===GLOBSTAR||(prev===void 0?next!==void 0&&next!==GLOBSTAR?pp[i+1]="(?:\\/|"+twoStar+"\\/)?"+next:pp[i]=twoStar:next===void 0?pp[i-1]=prev+"(?:\\/|"+twoStar+")?":next!==GLOBSTAR&&(pp[i-1]=prev+"(?:\\/|\\/"+twoStar+"\\/)"+next,pp[i+1]=GLOBSTAR));}),pp.filter(p=>p!==GLOBSTAR).join("/")}).join("|"),[open,close]=set.length>1?["(?:",")"]:["",""];re="^"+open+re+close+"$",this.negate&&(re="^(?!"+re+").+$");try{this.regexp=new RegExp(re,[...flags].join(""));}catch{this.regexp=!1;}return this.regexp}slashSplit(p){return this.preserveMultipleSlashes?p.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(p)?["",...p.split(/\/+/)]:p.split(/\/+/)}match(f,partial=this.partial){if(this.debug("match",f,this.pattern),this.comment)return !1;if(this.empty)return f==="";if(f==="/"&&partial)return !0;let options=this.options;this.isWindows&&(f=f.split("\\").join("/"));let ff=this.slashSplit(f);this.debug(this.pattern,"split",ff);let set=this.set;this.debug(this.pattern,"set",set);let filename=ff[ff.length-1];if(!filename)for(let i=ff.length-2;!filename&&i>=0;i--)filename=ff[i];for(let i=0;i<set.length;i++){let pattern=set[i],file=ff;if(options.matchBase&&pattern.length===1&&(file=[filename]),this.matchOne(file,pattern,partial))return options.flipNegate?!0:!this.negate}return options.flipNegate?!1:this.negate}static defaults(def){return minimatch.defaults(def).Minimatch}};minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape;minimatch.unescape=unescape;var perf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,warned=new Set,PROCESS=typeof process=="object"&&process?process:{},emitWarning=(msg,type,code,fn)=>{typeof PROCESS.emitWarning=="function"?PROCESS.emitWarning(msg,type,code,fn):console.error(`[${code}] ${type}: ${msg}`);},AC=globalThis.AbortController,AS=globalThis.AbortSignal;if(typeof AC>"u"){AS=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(_,fn){this._onabort.push(fn);}},AC=class{constructor(){warnACPolyfill();}signal=new AS;abort(reason){if(!this.signal.aborted){this.signal.reason=reason,this.signal.aborted=!0;for(let fn of this.signal._onabort)fn(reason);this.signal.onabort?.(reason);}}};let printACPolyfillWarning=PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",warnACPolyfill=()=>{printACPolyfillWarning&&(printACPolyfillWarning=!1,emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill));};}var shouldWarn=code=>!warned.has(code),isPosInt=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),getUintArray=max=>isPosInt(max)?max<=Math.pow(2,8)?Uint8Array:max<=Math.pow(2,16)?Uint16Array:max<=Math.pow(2,32)?Uint32Array:max<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null,ZeroArray=class extends Array{constructor(size){super(size),this.fill(0);}},Stack=class _Stack{heap;length;static#constructing=!1;static create(max){let HeapCls=getUintArray(max);if(!HeapCls)return [];_Stack.#constructing=!0;let s=new _Stack(max,HeapCls);return _Stack.#constructing=!1,s}constructor(max,HeapCls){if(!_Stack.#constructing)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new HeapCls(max),this.length=0;}push(n){this.heap[this.length++]=n;}pop(){return this.heap[--this.length]}},LRUCache=class _LRUCache{#max;#maxSize;#dispose;#disposeAfter;#fetchMethod;#memoMethod;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#size;#calculatedSize;#keyMap;#keyList;#valList;#next;#prev;#head;#tail;#free;#disposed;#sizes;#starts;#ttls;#hasDispose;#hasFetchMethod;#hasDisposeAfter;static unsafeExposeInternals(c){return {starts:c.#starts,ttls:c.#ttls,sizes:c.#sizes,keyMap:c.#keyMap,keyList:c.#keyList,valList:c.#valList,next:c.#next,prev:c.#prev,get head(){return c.#head},get tail(){return c.#tail},free:c.#free,isBackgroundFetch:p=>c.#isBackgroundFetch(p),backgroundFetch:(k,index,options,context)=>c.#backgroundFetch(k,index,options,context),moveToTail:index=>c.#moveToTail(index),indexes:options=>c.#indexes(options),rindexes:options=>c.#rindexes(options),isStale:index=>c.#isStale(index)}}get max(){return this.#max}get maxSize(){return this.#maxSize}get calculatedSize(){return this.#calculatedSize}get size(){return this.#size}get fetchMethod(){return this.#fetchMethod}get memoMethod(){return this.#memoMethod}get dispose(){return this.#dispose}get disposeAfter(){return this.#disposeAfter}constructor(options){let{max=0,ttl,ttlResolution=1,ttlAutopurge,updateAgeOnGet,updateAgeOnHas,allowStale,dispose,disposeAfter,noDisposeOnSet,noUpdateTTL,maxSize=0,maxEntrySize=0,sizeCalculation,fetchMethod,memoMethod,noDeleteOnFetchRejection,noDeleteOnStaleGet,allowStaleOnFetchRejection,allowStaleOnFetchAbort,ignoreFetchAbort}=options;if(max!==0&&!isPosInt(max))throw new TypeError("max option must be a nonnegative integer");let UintArray=max?getUintArray(max):Array;if(!UintArray)throw new Error("invalid max value: "+max);if(this.#max=max,this.#maxSize=maxSize,this.maxEntrySize=maxEntrySize||this.#maxSize,this.sizeCalculation=sizeCalculation,this.sizeCalculation){if(!this.#maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(memoMethod!==void 0&&typeof memoMethod!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#memoMethod=memoMethod,fetchMethod!==void 0&&typeof fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#fetchMethod=fetchMethod,this.#hasFetchMethod=!!fetchMethod,this.#keyMap=new Map,this.#keyList=new Array(max).fill(void 0),this.#valList=new Array(max).fill(void 0),this.#next=new UintArray(max),this.#prev=new UintArray(max),this.#head=0,this.#tail=0,this.#free=Stack.create(max),this.#size=0,this.#calculatedSize=0,typeof dispose=="function"&&(this.#dispose=dispose),typeof disposeAfter=="function"?(this.#disposeAfter=disposeAfter,this.#disposed=[]):(this.#disposeAfter=void 0,this.#disposed=void 0),this.#hasDispose=!!this.#dispose,this.#hasDisposeAfter=!!this.#disposeAfter,this.noDisposeOnSet=!!noDisposeOnSet,this.noUpdateTTL=!!noUpdateTTL,this.noDeleteOnFetchRejection=!!noDeleteOnFetchRejection,this.allowStaleOnFetchRejection=!!allowStaleOnFetchRejection,this.allowStaleOnFetchAbort=!!allowStaleOnFetchAbort,this.ignoreFetchAbort=!!ignoreFetchAbort,this.maxEntrySize!==0){if(this.#maxSize!==0&&!isPosInt(this.#maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#initializeSizeTracking();}if(this.allowStale=!!allowStale,this.noDeleteOnStaleGet=!!noDeleteOnStaleGet,this.updateAgeOnGet=!!updateAgeOnGet,this.updateAgeOnHas=!!updateAgeOnHas,this.ttlResolution=isPosInt(ttlResolution)||ttlResolution===0?ttlResolution:1,this.ttlAutopurge=!!ttlAutopurge,this.ttl=ttl||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#initializeTTLTracking();}if(this.#max===0&&this.ttl===0&&this.#maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#max&&!this.#maxSize){let code="LRU_CACHE_UNBOUNDED";shouldWarn(code)&&(warned.add(code),emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",code,_LRUCache));}}getRemainingTTL(key){return this.#keyMap.has(key)?1/0:0}#initializeTTLTracking(){let ttls=new ZeroArray(this.#max),starts=new ZeroArray(this.#max);this.#ttls=ttls,this.#starts=starts,this.#setItemTTL=(index,ttl,start=perf.now())=>{if(starts[index]=ttl!==0?start:0,ttls[index]=ttl,ttl!==0&&this.ttlAutopurge){let t2=setTimeout(()=>{this.#isStale(index)&&this.#delete(this.#keyList[index],"expire");},ttl+1);t2.unref&&t2.unref();}},this.#updateItemAge=index=>{starts[index]=ttls[index]!==0?perf.now():0;},this.#statusTTL=(status,index)=>{if(ttls[index]){let ttl=ttls[index],start=starts[index];if(!ttl||!start)return;status.ttl=ttl,status.start=start,status.now=cachedNow||getNow();let age=status.now-start;status.remainingTTL=ttl-age;}};let cachedNow=0,getNow=()=>{let n=perf.now();if(this.ttlResolution>0){cachedNow=n;let t2=setTimeout(()=>cachedNow=0,this.ttlResolution);t2.unref&&t2.unref();}return n};this.getRemainingTTL=key=>{let index=this.#keyMap.get(key);if(index===void 0)return 0;let ttl=ttls[index],start=starts[index];if(!ttl||!start)return 1/0;let age=(cachedNow||getNow())-start;return ttl-age},this.#isStale=index=>{let s=starts[index],t2=ttls[index];return !!t2&&!!s&&(cachedNow||getNow())-s>t2};}#updateItemAge=()=>{};#statusTTL=()=>{};#setItemTTL=()=>{};#isStale=()=>!1;#initializeSizeTracking(){let sizes=new ZeroArray(this.#max);this.#calculatedSize=0,this.#sizes=sizes,this.#removeItemSize=index=>{this.#calculatedSize-=sizes[index],sizes[index]=0;},this.#requireSize=(k,v,size,sizeCalculation)=>{if(this.#isBackgroundFetch(v))return 0;if(!isPosInt(size))if(sizeCalculation){if(typeof sizeCalculation!="function")throw new TypeError("sizeCalculation must be a function");if(size=sizeCalculation(v,k),!isPosInt(size))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return size},this.#addItemSize=(index,size,status)=>{if(sizes[index]=size,this.#maxSize){let maxSize=this.#maxSize-sizes[index];for(;this.#calculatedSize>maxSize;)this.#evict(!0);}this.#calculatedSize+=sizes[index],status&&(status.entrySize=size,status.totalCalculatedSize=this.#calculatedSize);};}#removeItemSize=_i=>{};#addItemSize=(_i,_s,_st)=>{};#requireSize=(_k,_v,size,sizeCalculation)=>{if(size||sizeCalculation)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#indexes({allowStale=this.allowStale}={}){if(this.#size)for(let i=this.#tail;!(!this.#isValidIndex(i)||((allowStale||!this.#isStale(i))&&(yield i),i===this.#head));)i=this.#prev[i];}*#rindexes({allowStale=this.allowStale}={}){if(this.#size)for(let i=this.#head;!(!this.#isValidIndex(i)||((allowStale||!this.#isStale(i))&&(yield i),i===this.#tail));)i=this.#next[i];}#isValidIndex(index){return index!==void 0&&this.#keyMap.get(this.#keyList[index])===index}*entries(){for(let i of this.#indexes())this.#valList[i]!==void 0&&this.#keyList[i]!==void 0&&!this.#isBackgroundFetch(this.#valList[i])&&(yield [this.#keyList[i],this.#valList[i]]);}*rentries(){for(let i of this.#rindexes())this.#valList[i]!==void 0&&this.#keyList[i]!==void 0&&!this.#isBackgroundFetch(this.#valList[i])&&(yield [this.#keyList[i],this.#valList[i]]);}*keys(){for(let i of this.#indexes()){let k=this.#keyList[i];k!==void 0&&!this.#isBackgroundFetch(this.#valList[i])&&(yield k);}}*rkeys(){for(let i of this.#rindexes()){let k=this.#keyList[i];k!==void 0&&!this.#isBackgroundFetch(this.#valList[i])&&(yield k);}}*values(){for(let i of this.#indexes())this.#valList[i]!==void 0&&!this.#isBackgroundFetch(this.#valList[i])&&(yield this.#valList[i]);}*rvalues(){for(let i of this.#rindexes())this.#valList[i]!==void 0&&!this.#isBackgroundFetch(this.#valList[i])&&(yield this.#valList[i]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(fn,getOptions={}){for(let i of this.#indexes()){let v=this.#valList[i],value=this.#isBackgroundFetch(v)?v.__staleWhileFetching:v;if(value!==void 0&&fn(value,this.#keyList[i],this))return this.get(this.#keyList[i],getOptions)}}forEach(fn,thisp=this){for(let i of this.#indexes()){let v=this.#valList[i],value=this.#isBackgroundFetch(v)?v.__staleWhileFetching:v;value!==void 0&&fn.call(thisp,value,this.#keyList[i],this);}}rforEach(fn,thisp=this){for(let i of this.#rindexes()){let v=this.#valList[i],value=this.#isBackgroundFetch(v)?v.__staleWhileFetching:v;value!==void 0&&fn.call(thisp,value,this.#keyList[i],this);}}purgeStale(){let deleted=!1;for(let i of this.#rindexes({allowStale:!0}))this.#isStale(i)&&(this.#delete(this.#keyList[i],"expire"),deleted=!0);return deleted}info(key){let i=this.#keyMap.get(key);if(i===void 0)return;let v=this.#valList[i],value=this.#isBackgroundFetch(v)?v.__staleWhileFetching:v;if(value===void 0)return;let entry={value};if(this.#ttls&&this.#starts){let ttl=this.#ttls[i],start=this.#starts[i];if(ttl&&start){let remain=ttl-(perf.now()-start);entry.ttl=remain,entry.start=Date.now();}}return this.#sizes&&(entry.size=this.#sizes[i]),entry}dump(){let arr=[];for(let i of this.#indexes({allowStale:!0})){let key=this.#keyList[i],v=this.#valList[i],value=this.#isBackgroundFetch(v)?v.__staleWhileFetching:v;if(value===void 0||key===void 0)continue;let entry={value};if(this.#ttls&&this.#starts){entry.ttl=this.#ttls[i];let age=perf.now()-this.#starts[i];entry.start=Math.floor(Date.now()-age);}this.#sizes&&(entry.size=this.#sizes[i]),arr.unshift([key,entry]);}return arr}load(arr){this.clear();for(let[key,entry]of arr){if(entry.start){let age=Date.now()-entry.start;entry.start=perf.now()-age;}this.set(key,entry.value,entry);}}set(k,v,setOptions={}){if(v===void 0)return this.delete(k),this;let{ttl=this.ttl,start,noDisposeOnSet=this.noDisposeOnSet,sizeCalculation=this.sizeCalculation,status}=setOptions,{noUpdateTTL=this.noUpdateTTL}=setOptions,size=this.#requireSize(k,v,setOptions.size||0,sizeCalculation);if(this.maxEntrySize&&size>this.maxEntrySize)return status&&(status.set="miss",status.maxEntrySizeExceeded=!0),this.#delete(k,"set"),this;let index=this.#size===0?void 0:this.#keyMap.get(k);if(index===void 0)index=this.#size===0?this.#tail:this.#free.length!==0?this.#free.pop():this.#size===this.#max?this.#evict(!1):this.#size,this.#keyList[index]=k,this.#valList[index]=v,this.#keyMap.set(k,index),this.#next[this.#tail]=index,this.#prev[index]=this.#tail,this.#tail=index,this.#size++,this.#addItemSize(index,size,status),status&&(status.set="add"),noUpdateTTL=!1;else {this.#moveToTail(index);let oldVal=this.#valList[index];if(v!==oldVal){if(this.#hasFetchMethod&&this.#isBackgroundFetch(oldVal)){oldVal.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:s}=oldVal;s!==void 0&&!noDisposeOnSet&&(this.#hasDispose&&this.#dispose?.(s,k,"set"),this.#hasDisposeAfter&&this.#disposed?.push([s,k,"set"]));}else noDisposeOnSet||(this.#hasDispose&&this.#dispose?.(oldVal,k,"set"),this.#hasDisposeAfter&&this.#disposed?.push([oldVal,k,"set"]));if(this.#removeItemSize(index),this.#addItemSize(index,size,status),this.#valList[index]=v,status){status.set="replace";let oldValue=oldVal&&this.#isBackgroundFetch(oldVal)?oldVal.__staleWhileFetching:oldVal;oldValue!==void 0&&(status.oldValue=oldValue);}}else status&&(status.set="update");}if(ttl!==0&&!this.#ttls&&this.#initializeTTLTracking(),this.#ttls&&(noUpdateTTL||this.#setItemTTL(index,ttl,start),status&&this.#statusTTL(status,index)),!noDisposeOnSet&&this.#hasDisposeAfter&&this.#disposed){let dt=this.#disposed,task;for(;task=dt?.shift();)this.#disposeAfter?.(...task);}return this}pop(){try{for(;this.#size;){let val=this.#valList[this.#head];if(this.#evict(!0),this.#isBackgroundFetch(val)){if(val.__staleWhileFetching)return val.__staleWhileFetching}else if(val!==void 0)return val}}finally{if(this.#hasDisposeAfter&&this.#disposed){let dt=this.#disposed,task;for(;task=dt?.shift();)this.#disposeAfter?.(...task);}}}#evict(free){let head=this.#head,k=this.#keyList[head],v=this.#valList[head];return this.#hasFetchMethod&&this.#isBackgroundFetch(v)?v.__abortController.abort(new Error("evicted")):(this.#hasDispose||this.#hasDisposeAfter)&&(this.#hasDispose&&this.#dispose?.(v,k,"evict"),this.#hasDisposeAfter&&this.#disposed?.push([v,k,"evict"])),this.#removeItemSize(head),free&&(this.#keyList[head]=void 0,this.#valList[head]=void 0,this.#free.push(head)),this.#size===1?(this.#head=this.#tail=0,this.#free.length=0):this.#head=this.#next[head],this.#keyMap.delete(k),this.#size--,head}has(k,hasOptions={}){let{updateAgeOnHas=this.updateAgeOnHas,status}=hasOptions,index=this.#keyMap.get(k);if(index!==void 0){let v=this.#valList[index];if(this.#isBackgroundFetch(v)&&v.__staleWhileFetching===void 0)return !1;if(this.#isStale(index))status&&(status.has="stale",this.#statusTTL(status,index));else return updateAgeOnHas&&this.#updateItemAge(index),status&&(status.has="hit",this.#statusTTL(status,index)),!0}else status&&(status.has="miss");return !1}peek(k,peekOptions={}){let{allowStale=this.allowStale}=peekOptions,index=this.#keyMap.get(k);if(index===void 0||!allowStale&&this.#isStale(index))return;let v=this.#valList[index];return this.#isBackgroundFetch(v)?v.__staleWhileFetching:v}#backgroundFetch(k,index,options,context){let v=index===void 0?void 0:this.#valList[index];if(this.#isBackgroundFetch(v))return v;let ac=new AC,{signal}=options;signal?.addEventListener("abort",()=>ac.abort(signal.reason),{signal:ac.signal});let fetchOpts={signal:ac.signal,options,context},cb=(v2,updateCache=!1)=>{let{aborted}=ac.signal,ignoreAbort=options.ignoreFetchAbort&&v2!==void 0;if(options.status&&(aborted&&!updateCache?(options.status.fetchAborted=!0,options.status.fetchError=ac.signal.reason,ignoreAbort&&(options.status.fetchAbortIgnored=!0)):options.status.fetchResolved=!0),aborted&&!ignoreAbort&&!updateCache)return fetchFail(ac.signal.reason);let bf2=p;return this.#valList[index]===p&&(v2===void 0?bf2.__staleWhileFetching?this.#valList[index]=bf2.__staleWhileFetching:this.#delete(k,"fetch"):(options.status&&(options.status.fetchUpdated=!0),this.set(k,v2,fetchOpts.options))),v2},eb=er=>(options.status&&(options.status.fetchRejected=!0,options.status.fetchError=er),fetchFail(er)),fetchFail=er=>{let{aborted}=ac.signal,allowStaleAborted=aborted&&options.allowStaleOnFetchAbort,allowStale=allowStaleAborted||options.allowStaleOnFetchRejection,noDelete=allowStale||options.noDeleteOnFetchRejection,bf2=p;if(this.#valList[index]===p&&(!noDelete||bf2.__staleWhileFetching===void 0?this.#delete(k,"fetch"):allowStaleAborted||(this.#valList[index]=bf2.__staleWhileFetching)),allowStale)return options.status&&bf2.__staleWhileFetching!==void 0&&(options.status.returnedStale=!0),bf2.__staleWhileFetching;if(bf2.__returned===bf2)throw er},pcall=(res,rej)=>{let fmp=this.#fetchMethod?.(k,v,fetchOpts);fmp&&fmp instanceof Promise&&fmp.then(v2=>res(v2===void 0?void 0:v2),rej),ac.signal.addEventListener("abort",()=>{(!options.ignoreFetchAbort||options.allowStaleOnFetchAbort)&&(res(void 0),options.allowStaleOnFetchAbort&&(res=v2=>cb(v2,!0)));});};options.status&&(options.status.fetchDispatched=!0);let p=new Promise(pcall).then(cb,eb),bf=Object.assign(p,{__abortController:ac,__staleWhileFetching:v,__returned:void 0});return index===void 0?(this.set(k,bf,{...fetchOpts.options,status:void 0}),index=this.#keyMap.get(k)):this.#valList[index]=bf,bf}#isBackgroundFetch(p){if(!this.#hasFetchMethod)return !1;let b=p;return !!b&&b instanceof Promise&&b.hasOwnProperty("__staleWhileFetching")&&b.__abortController instanceof AC}async fetch(k,fetchOptions={}){let{allowStale=this.allowStale,updateAgeOnGet=this.updateAgeOnGet,noDeleteOnStaleGet=this.noDeleteOnStaleGet,ttl=this.ttl,noDisposeOnSet=this.noDisposeOnSet,size=0,sizeCalculation=this.sizeCalculation,noUpdateTTL=this.noUpdateTTL,noDeleteOnFetchRejection=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection=this.allowStaleOnFetchRejection,ignoreFetchAbort=this.ignoreFetchAbort,allowStaleOnFetchAbort=this.allowStaleOnFetchAbort,context,forceRefresh=!1,status,signal}=fetchOptions;if(!this.#hasFetchMethod)return status&&(status.fetch="get"),this.get(k,{allowStale,updateAgeOnGet,noDeleteOnStaleGet,status});let options={allowStale,updateAgeOnGet,noDeleteOnStaleGet,ttl,noDisposeOnSet,size,sizeCalculation,noUpdateTTL,noDeleteOnFetchRejection,allowStaleOnFetchRejection,allowStaleOnFetchAbort,ignoreFetchAbort,status,signal},index=this.#keyMap.get(k);if(index===void 0){status&&(status.fetch="miss");let p=this.#backgroundFetch(k,index,options,context);return p.__returned=p}else {let v=this.#valList[index];if(this.#isBackgroundFetch(v)){let stale=allowStale&&v.__staleWhileFetching!==void 0;return status&&(status.fetch="inflight",stale&&(status.returnedStale=!0)),stale?v.__staleWhileFetching:v.__returned=v}let isStale=this.#isStale(index);if(!forceRefresh&&!isStale)return status&&(status.fetch="hit"),this.#moveToTail(index),updateAgeOnGet&&this.#updateItemAge(index),status&&this.#statusTTL(status,index),v;let p=this.#backgroundFetch(k,index,options,context),staleVal=p.__staleWhileFetching!==void 0&&allowStale;return status&&(status.fetch=isStale?"stale":"refresh",staleVal&&isStale&&(status.returnedStale=!0)),staleVal?p.__staleWhileFetching:p.__returned=p}}async forceFetch(k,fetchOptions={}){let v=await this.fetch(k,fetchOptions);if(v===void 0)throw new Error("fetch() returned undefined");return v}memo(k,memoOptions={}){let memoMethod=this.#memoMethod;if(!memoMethod)throw new Error("no memoMethod provided to constructor");let{context,forceRefresh,...options}=memoOptions,v=this.get(k,options);if(!forceRefresh&&v!==void 0)return v;let vv=memoMethod(k,v,{options,context});return this.set(k,vv,options),vv}get(k,getOptions={}){let{allowStale=this.allowStale,updateAgeOnGet=this.updateAgeOnGet,noDeleteOnStaleGet=this.noDeleteOnStaleGet,status}=getOptions,index=this.#keyMap.get(k);if(index!==void 0){let value=this.#valList[index],fetching=this.#isBackgroundFetch(value);return status&&this.#statusTTL(status,index),this.#isStale(index)?(status&&(status.get="stale"),fetching?(status&&allowStale&&value.__staleWhileFetching!==void 0&&(status.returnedStale=!0),allowStale?value.__staleWhileFetching:void 0):(noDeleteOnStaleGet||this.#delete(k,"expire"),status&&allowStale&&(status.returnedStale=!0),allowStale?value:void 0)):(status&&(status.get="hit"),fetching?value.__staleWhileFetching:(this.#moveToTail(index),updateAgeOnGet&&this.#updateItemAge(index),value))}else status&&(status.get="miss");}#connect(p,n){this.#prev[n]=p,this.#next[p]=n;}#moveToTail(index){index!==this.#tail&&(index===this.#head?this.#head=this.#next[index]:this.#connect(this.#prev[index],this.#next[index]),this.#connect(this.#tail,index),this.#tail=index);}delete(k){return this.#delete(k,"delete")}#delete(k,reason){let deleted=!1;if(this.#size!==0){let index=this.#keyMap.get(k);if(index!==void 0)if(deleted=!0,this.#size===1)this.#clear(reason);else {this.#removeItemSize(index);let v=this.#valList[index];if(this.#isBackgroundFetch(v)?v.__abortController.abort(new Error("deleted")):(this.#hasDispose||this.#hasDisposeAfter)&&(this.#hasDispose&&this.#dispose?.(v,k,reason),this.#hasDisposeAfter&&this.#disposed?.push([v,k,reason])),this.#keyMap.delete(k),this.#keyList[index]=void 0,this.#valList[index]=void 0,index===this.#tail)this.#tail=this.#prev[index];else if(index===this.#head)this.#head=this.#next[index];else {let pi=this.#prev[index];this.#next[pi]=this.#next[index];let ni=this.#next[index];this.#prev[ni]=this.#prev[index];}this.#size--,this.#free.push(index);}}if(this.#hasDisposeAfter&&this.#disposed?.length){let dt=this.#disposed,task;for(;task=dt?.shift();)this.#disposeAfter?.(...task);}return deleted}clear(){return this.#clear("delete")}#clear(reason){for(let index of this.#rindexes({allowStale:!0})){let v=this.#valList[index];if(this.#isBackgroundFetch(v))v.__abortController.abort(new Error("deleted"));else {let k=this.#keyList[index];this.#hasDispose&&this.#dispose?.(v,k,reason),this.#hasDisposeAfter&&this.#disposed?.push([v,k,reason]);}}if(this.#keyMap.clear(),this.#valList.fill(void 0),this.#keyList.fill(void 0),this.#ttls&&this.#starts&&(this.#ttls.fill(0),this.#starts.fill(0)),this.#sizes&&this.#sizes.fill(0),this.#head=0,this.#tail=0,this.#free.length=0,this.#calculatedSize=0,this.#size=0,this.#hasDisposeAfter&&this.#disposed){let dt=this.#disposed,task;for(;task=dt?.shift();)this.#disposeAfter?.(...task);}}};var proc=typeof process=="object"&&process?process:{stdout:null,stderr:null},isStream=s=>!!s&&typeof s=="object"&&(s instanceof Minipass||s instanceof Stream||isReadable(s)||isWritable(s)),isReadable=s=>!!s&&typeof s=="object"&&s instanceof EventEmitter&&typeof s.pipe=="function"&&s.pipe!==Stream.Writable.prototype.pipe,isWritable=s=>!!s&&typeof s=="object"&&s instanceof EventEmitter&&typeof s.write=="function"&&typeof s.end=="function",EOF=Symbol("EOF"),MAYBE_EMIT_END=Symbol("maybeEmitEnd"),EMITTED_END=Symbol("emittedEnd"),EMITTING_END=Symbol("emittingEnd"),EMITTED_ERROR=Symbol("emittedError"),CLOSED=Symbol("closed"),READ=Symbol("read"),FLUSH=Symbol("flush"),FLUSHCHUNK=Symbol("flushChunk"),ENCODING=Symbol("encoding"),DECODER=Symbol("decoder"),FLOWING=Symbol("flowing"),PAUSED=Symbol("paused"),RESUME=Symbol("resume"),BUFFER=Symbol("buffer"),PIPES=Symbol("pipes"),BUFFERLENGTH=Symbol("bufferLength"),BUFFERPUSH=Symbol("bufferPush"),BUFFERSHIFT=Symbol("bufferShift"),OBJECTMODE=Symbol("objectMode"),DESTROYED=Symbol("destroyed"),ERROR=Symbol("error"),EMITDATA=Symbol("emitData"),EMITEND=Symbol("emitEnd"),EMITEND2=Symbol("emitEnd2"),ASYNC=Symbol("async"),ABORT=Symbol("abort"),ABORTED=Symbol("aborted"),SIGNAL=Symbol("signal"),DATALISTENERS=Symbol("dataListeners"),DISCARDED=Symbol("discarded"),defer=fn=>Promise.resolve().then(fn),nodefer=fn=>fn(),isEndish=ev=>ev==="end"||ev==="finish"||ev==="prefinish",isArrayBufferLike=b=>b instanceof ArrayBuffer||!!b&&typeof b=="object"&&b.constructor&&b.constructor.name==="ArrayBuffer"&&b.byteLength>=0,isArrayBufferView=b=>!Buffer.isBuffer(b)&&ArrayBuffer.isView(b),Pipe=class{src;dest;opts;ondrain;constructor(src,dest,opts){this.src=src,this.dest=dest,this.opts=opts,this.ondrain=()=>src[RESUME](),this.dest.on("drain",this.ondrain);}unpipe(){this.dest.removeListener("drain",this.ondrain);}proxyErrors(_er){}end(){this.unpipe(),this.opts.end&&this.dest.end();}},PipeProxyErrors=class extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe();}constructor(src,dest,opts){super(src,dest,opts),this.proxyErrors=er=>dest.emit("error",er),src.on("error",this.proxyErrors);}},isObjectModeOptions=o=>!!o.objectMode,isEncodingOptions=o=>!o.objectMode&&!!o.encoding&&o.encoding!=="buffer",Minipass=class extends EventEmitter{[FLOWING]=!1;[PAUSED]=!1;[PIPES]=[];[BUFFER]=[];[OBJECTMODE];[ENCODING];[ASYNC];[DECODER];[EOF]=!1;[EMITTED_END]=!1;[EMITTING_END]=!1;[CLOSED]=!1;[EMITTED_ERROR]=null;[BUFFERLENGTH]=0;[DESTROYED]=!1;[SIGNAL];[ABORTED]=!1;[DATALISTENERS]=0;[DISCARDED]=!1;writable=!0;readable=!0;constructor(...args){let options=args[0]||{};if(super(),options.objectMode&&typeof options.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");isObjectModeOptions(options)?(this[OBJECTMODE]=!0,this[ENCODING]=null):isEncodingOptions(options)?(this[ENCODING]=options.encoding,this[OBJECTMODE]=!1):(this[OBJECTMODE]=!1,this[ENCODING]=null),this[ASYNC]=!!options.async,this[DECODER]=this[ENCODING]?new StringDecoder(this[ENCODING]):null,options&&options.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[BUFFER]}),options&&options.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[PIPES]});let{signal}=options;signal&&(this[SIGNAL]=signal,signal.aborted?this[ABORT]():signal.addEventListener("abort",()=>this[ABORT]()));}get bufferLength(){return this[BUFFERLENGTH]}get encoding(){return this[ENCODING]}set encoding(_enc){throw new Error("Encoding must be set at instantiation time")}setEncoding(_enc){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[OBJECTMODE]}set objectMode(_om){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ASYNC]}set async(a){this[ASYNC]=this[ASYNC]||!!a;}[ABORT](){this[ABORTED]=!0,this.emit("abort",this[SIGNAL]?.reason),this.destroy(this[SIGNAL]?.reason);}get aborted(){return this[ABORTED]}set aborted(_){}write(chunk,encoding,cb){if(this[ABORTED])return !1;if(this[EOF])throw new Error("write after end");if(this[DESTROYED])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof encoding=="function"&&(cb=encoding,encoding="utf8"),encoding||(encoding="utf8");let fn=this[ASYNC]?defer:nodefer;if(!this[OBJECTMODE]&&!Buffer.isBuffer(chunk)){if(isArrayBufferView(chunk))chunk=Buffer.from(chunk.buffer,chunk.byteOffset,chunk.byteLength);else if(isArrayBufferLike(chunk))chunk=Buffer.from(chunk);else if(typeof chunk!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[OBJECTMODE]?(this[FLOWING]&&this[BUFFERLENGTH]!==0&&this[FLUSH](!0),this[FLOWING]?this.emit("data",chunk):this[BUFFERPUSH](chunk),this[BUFFERLENGTH]!==0&&this.emit("readable"),cb&&fn(cb),this[FLOWING]):chunk.length?(typeof chunk=="string"&&!(encoding===this[ENCODING]&&!this[DECODER]?.lastNeed)&&(chunk=Buffer.from(chunk,encoding)),Buffer.isBuffer(chunk)&&this[ENCODING]&&(chunk=this[DECODER].write(chunk)),this[FLOWING]&&this[BUFFERLENGTH]!==0&&this[FLUSH](!0),this[FLOWING]?this.emit("data",chunk):this[BUFFERPUSH](chunk),this[BUFFERLENGTH]!==0&&this.emit("readable"),cb&&fn(cb),this[FLOWING]):(this[BUFFERLENGTH]!==0&&this.emit("readable"),cb&&fn(cb),this[FLOWING])}read(n){if(this[DESTROYED])return null;if(this[DISCARDED]=!1,this[BUFFERLENGTH]===0||n===0||n&&n>this[BUFFERLENGTH])return this[MAYBE_EMIT_END](),null;this[OBJECTMODE]&&(n=null),this[BUFFER].length>1&&!this[OBJECTMODE]&&(this[BUFFER]=[this[ENCODING]?this[BUFFER].join(""):Buffer.concat(this[BUFFER],this[BUFFERLENGTH])]);let ret=this[READ](n||null,this[BUFFER][0]);return this[MAYBE_EMIT_END](),ret}[READ](n,chunk){if(this[OBJECTMODE])this[BUFFERSHIFT]();else {let c=chunk;n===c.length||n===null?this[BUFFERSHIFT]():typeof c=="string"?(this[BUFFER][0]=c.slice(n),chunk=c.slice(0,n),this[BUFFERLENGTH]-=n):(this[BUFFER][0]=c.subarray(n),chunk=c.subarray(0,n),this[BUFFERLENGTH]-=n);}return this.emit("data",chunk),!this[BUFFER].length&&!this[EOF]&&this.emit("drain"),chunk}end(chunk,encoding,cb){return typeof chunk=="function"&&(cb=chunk,chunk=void 0),typeof encoding=="function"&&(cb=encoding,encoding="utf8"),chunk!==void 0&&this.write(chunk,encoding),cb&&this.once("end",cb),this[EOF]=!0,this.writable=!1,(this[FLOWING]||!this[PAUSED])&&this[MAYBE_EMIT_END](),this}[RESUME](){this[DESTROYED]||(!this[DATALISTENERS]&&!this[PIPES].length&&(this[DISCARDED]=!0),this[PAUSED]=!1,this[FLOWING]=!0,this.emit("resume"),this[BUFFER].length?this[FLUSH]():this[EOF]?this[MAYBE_EMIT_END]():this.emit("drain"));}resume(){return this[RESUME]()}pause(){this[FLOWING]=!1,this[PAUSED]=!0,this[DISCARDED]=!1;}get destroyed(){return this[DESTROYED]}get flowing(){return this[FLOWING]}get paused(){return this[PAUSED]}[BUFFERPUSH](chunk){this[OBJECTMODE]?this[BUFFERLENGTH]+=1:this[BUFFERLENGTH]+=chunk.length,this[BUFFER].push(chunk);}[BUFFERSHIFT](){return this[OBJECTMODE]?this[BUFFERLENGTH]-=1:this[BUFFERLENGTH]-=this[BUFFER][0].length,this[BUFFER].shift()}[FLUSH](noDrain=!1){do;while(this[FLUSHCHUNK](this[BUFFERSHIFT]())&&this[BUFFER].length);!noDrain&&!this[BUFFER].length&&!this[EOF]&&this.emit("drain");}[FLUSHCHUNK](chunk){return this.emit("data",chunk),this[FLOWING]}pipe(dest,opts){if(this[DESTROYED])return dest;this[DISCARDED]=!1;let ended=this[EMITTED_END];return opts=opts||{},dest===proc.stdout||dest===proc.stderr?opts.end=!1:opts.end=opts.end!==!1,opts.proxyErrors=!!opts.proxyErrors,ended?opts.end&&dest.end():(this[PIPES].push(opts.proxyErrors?new PipeProxyErrors(this,dest,opts):new Pipe(this,dest,opts)),this[ASYNC]?defer(()=>this[RESUME]()):this[RESUME]()),dest}unpipe(dest){let p=this[PIPES].find(p2=>p2.dest===dest);p&&(this[PIPES].length===1?(this[FLOWING]&&this[DATALISTENERS]===0&&(this[FLOWING]=!1),this[PIPES]=[]):this[PIPES].splice(this[PIPES].indexOf(p),1),p.unpipe());}addListener(ev,handler){return this.on(ev,handler)}on(ev,handler){let ret=super.on(ev,handler);if(ev==="data")this[DISCARDED]=!1,this[DATALISTENERS]++,!this[PIPES].length&&!this[FLOWING]&&this[RESUME]();else if(ev==="readable"&&this[BUFFERLENGTH]!==0)super.emit("readable");else if(isEndish(ev)&&this[EMITTED_END])super.emit(ev),this.removeAllListeners(ev);else if(ev==="error"&&this[EMITTED_ERROR]){let h=handler;this[ASYNC]?defer(()=>h.call(this,this[EMITTED_ERROR])):h.call(this,this[EMITTED_ERROR]);}return ret}removeListener(ev,handler){return this.off(ev,handler)}off(ev,handler){let ret=super.off(ev,handler);return ev==="data"&&(this[DATALISTENERS]=this.listeners("data").length,this[DATALISTENERS]===0&&!this[DISCARDED]&&!this[PIPES].length&&(this[FLOWING]=!1)),ret}removeAllListeners(ev){let ret=super.removeAllListeners(ev);return (ev==="data"||ev===void 0)&&(this[DATALISTENERS]=0,!this[DISCARDED]&&!this[PIPES].length&&(this[FLOWING]=!1)),ret}get emittedEnd(){return this[EMITTED_END]}[MAYBE_EMIT_END](){!this[EMITTING_END]&&!this[EMITTED_END]&&!this[DESTROYED]&&this[BUFFER].length===0&&this[EOF]&&(this[EMITTING_END]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[CLOSED]&&this.emit("close"),this[EMITTING_END]=!1);}emit(ev,...args){let data=args[0];if(ev!=="error"&&ev!=="close"&&ev!==DESTROYED&&this[DESTROYED])return !1;if(ev==="data")return !this[OBJECTMODE]&&!data?!1:this[ASYNC]?(defer(()=>this[EMITDATA](data)),!0):this[EMITDATA](data);if(ev==="end")return this[EMITEND]();if(ev==="close"){if(this[CLOSED]=!0,!this[EMITTED_END]&&!this[DESTROYED])return !1;let ret2=super.emit("close");return this.removeAllListeners("close"),ret2}else if(ev==="error"){this[EMITTED_ERROR]=data,super.emit(ERROR,data);let ret2=!this[SIGNAL]||this.listeners("error").length?super.emit("error",data):!1;return this[MAYBE_EMIT_END](),ret2}else if(ev==="resume"){let ret2=super.emit("resume");return this[MAYBE_EMIT_END](),ret2}else if(ev==="finish"||ev==="prefinish"){let ret2=super.emit(ev);return this.removeAllListeners(ev),ret2}let ret=super.emit(ev,...args);return this[MAYBE_EMIT_END](),ret}[EMITDATA](data){for(let p of this[PIPES])p.dest.write(data)===!1&&this.pause();let ret=this[DISCARDED]?!1:super.emit("data",data);return this[MAYBE_EMIT_END](),ret}[EMITEND](){return this[EMITTED_END]?!1:(this[EMITTED_END]=!0,this.readable=!1,this[ASYNC]?(defer(()=>this[EMITEND2]()),!0):this[EMITEND2]())}[EMITEND2](){if(this[DECODER]){let data=this[DECODER].end();if(data){for(let p of this[PIPES])p.dest.write(data);this[DISCARDED]||super.emit("data",data);}}for(let p of this[PIPES])p.end();let ret=super.emit("end");return this.removeAllListeners("end"),ret}async collect(){let buf=Object.assign([],{dataLength:0});this[OBJECTMODE]||(buf.dataLength=0);let p=this.promise();return this.on("data",c=>{buf.push(c),this[OBJECTMODE]||(buf.dataLength+=c.length);}),await p,buf}async concat(){if(this[OBJECTMODE])throw new Error("cannot concat in objectMode");let buf=await this.collect();return this[ENCODING]?buf.join(""):Buffer.concat(buf,buf.dataLength)}async promise(){return new Promise((resolve,reject)=>{this.on(DESTROYED,()=>reject(new Error("stream destroyed"))),this.on("error",er=>reject(er)),this.on("end",()=>resolve());})}[Symbol.asyncIterator](){this[DISCARDED]=!1;let stopped=!1,stop=async()=>(this.pause(),stopped=!0,{value:void 0,done:!0});return {next:()=>{if(stopped)return stop();let res=this.read();if(res!==null)return Promise.resolve({done:!1,value:res});if(this[EOF])return stop();let resolve,reject,onerr=er=>{this.off("data",ondata),this.off("end",onend),this.off(DESTROYED,ondestroy),stop(),reject(er);},ondata=value=>{this.off("error",onerr),this.off("end",onend),this.off(DESTROYED,ondestroy),this.pause(),resolve({value,done:!!this[EOF]});},onend=()=>{this.off("error",onerr),this.off("data",ondata),this.off(DESTROYED,ondestroy),stop(),resolve({done:!0,value:void 0});},ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise((res2,rej)=>{reject=rej,resolve=res2,this.once(DESTROYED,ondestroy),this.once("error",onerr),this.once("end",onend),this.once("data",ondata);})},throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[DISCARDED]=!1;let stopped=!1,stop=()=>(this.pause(),this.off(ERROR,stop),this.off(DESTROYED,stop),this.off("end",stop),stopped=!0,{done:!0,value:void 0}),next=()=>{if(stopped)return stop();let value=this.read();return value===null?stop():{done:!1,value}};return this.once("end",stop),this.once(ERROR,stop),this.once(DESTROYED,stop),{next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(er){if(this[DESTROYED])return er?this.emit("error",er):this.emit(DESTROYED),this;this[DESTROYED]=!0,this[DISCARDED]=!0,this[BUFFER].length=0,this[BUFFERLENGTH]=0;let wc=this;return typeof wc.close=="function"&&!this[CLOSED]&&wc.close(),er?this.emit("error",er):this.emit(DESTROYED),this}static get isStream(){return isStream}};var realpathSync=realpathSync$1.native,defaultFS={lstatSync,readdir:readdir$1,readdirSync,readlinkSync,realpathSync,promises:{lstat,readdir: readdir$2,readlink,realpath}},fsFromOption=fsOption=>!fsOption||fsOption===defaultFS||fsOption===actualFS?defaultFS:{...defaultFS,...fsOption,promises:{...defaultFS.promises,...fsOption.promises||{}}},uncDriveRegexp=/^\\\\\?\\([a-z]:)\\?$/i,uncToDrive=rootPath=>rootPath.replace(/\//g,"\\").replace(uncDriveRegexp,"$1\\"),eitherSep=/[\\\/]/,UNKNOWN=0,IFIFO=1,IFCHR=2,IFDIR=4,IFBLK=6,IFREG=8,IFLNK=10,IFSOCK=12,IFMT=15,IFMT_UNKNOWN=~IFMT,READDIR_CALLED=16,LSTAT_CALLED=32,ENOTDIR=64,ENOENT=128,ENOREADLINK=256,ENOREALPATH=512,ENOCHILD=ENOTDIR|ENOENT|ENOREALPATH,TYPEMASK=1023,entToType=s=>s.isFile()?IFREG:s.isDirectory()?IFDIR:s.isSymbolicLink()?IFLNK:s.isCharacterDevice()?IFCHR:s.isBlockDevice()?IFBLK:s.isSocket()?IFSOCK:s.isFIFO()?IFIFO:UNKNOWN,normalizeCache=new Map,normalize2=s=>{let c=normalizeCache.get(s);if(c)return c;let n=s.normalize("NFKD");return normalizeCache.set(s,n),n},normalizeNocaseCache=new Map,normalizeNocase=s=>{let c=normalizeNocaseCache.get(s);if(c)return c;let n=normalize2(s.toLowerCase());return normalizeNocaseCache.set(s,n),n},ResolveCache=class extends LRUCache{constructor(){super({max:256});}},ChildrenCache=class extends LRUCache{constructor(maxSize=16*1024){super({maxSize,sizeCalculation:a=>a.length+1});}},setAsCwd=Symbol("PathScurry setAsCwd"),PathBase=class{name;root;roots;parent;nocase;isCWD=!1;#fs;#dev;get dev(){return this.#dev}#mode;get mode(){return this.#mode}#nlink;get nlink(){return this.#nlink}#uid;get uid(){return this.#uid}#gid;get gid(){return this.#gid}#rdev;get rdev(){return this.#rdev}#blksize;get blksize(){return this.#blksize}#ino;get ino(){return this.#ino}#size;get size(){return this.#size}#blocks;get blocks(){return this.#blocks}#atimeMs;get atimeMs(){return this.#atimeMs}#mtimeMs;get mtimeMs(){return this.#mtimeMs}#ctimeMs;get ctimeMs(){return this.#ctimeMs}#birthtimeMs;get birthtimeMs(){return this.#birthtimeMs}#atime;get atime(){return this.#atime}#mtime;get mtime(){return this.#mtime}#ctime;get ctime(){return this.#ctime}#birthtime;get birthtime(){return this.#birthtime}#matchName;#depth;#fullpath;#fullpathPosix;#relative;#relativePosix;#type;#children;#linkTarget;#realpath;get parentPath(){return (this.parent||this).fullpath()}get path(){return this.parentPath}constructor(name,type=UNKNOWN,root,roots,nocase,children,opts){this.name=name,this.#matchName=nocase?normalizeNocase(name):normalize2(name),this.#type=type&TYPEMASK,this.nocase=nocase,this.roots=roots,this.root=root||this,this.#children=children,this.#fullpath=opts.fullpath,this.#relative=opts.relative,this.#relativePosix=opts.relativePosix,this.parent=opts.parent,this.parent?this.#fs=this.parent.#fs:this.#fs=fsFromOption(opts.fs);}depth(){return this.#depth!==void 0?this.#depth:this.parent?this.#depth=this.parent.depth()+1:this.#depth=0}childrenCache(){return this.#children}resolve(path2){if(!path2)return this;let rootPath=this.getRootString(path2),dirParts=path2.substring(rootPath.length).split(this.splitSep);return rootPath?this.getRoot(rootPath).#resolveParts(dirParts):this.#resolveParts(dirParts)}#resolveParts(dirParts){let p=this;for(let part of dirParts)p=p.child(part);return p}children(){let cached=this.#children.get(this);if(cached)return cached;let children=Object.assign([],{provisional:0});return this.#children.set(this,children),this.#type&=~READDIR_CALLED,children}child(pathPart,opts){if(pathPart===""||pathPart===".")return this;if(pathPart==="..")return this.parent||this;let children=this.children(),name=this.nocase?normalizeNocase(pathPart):normalize2(pathPart);for(let p of children)if(p.#matchName===name)return p;let s=this.parent?this.sep:"",fullpath=this.#fullpath?this.#fullpath+s+pathPart:void 0,pchild=this.newChild(pathPart,UNKNOWN,{...opts,parent:this,fullpath});return this.canReaddir()||(pchild.#type|=ENOENT),children.push(pchild),pchild}relative(){if(this.isCWD)return "";if(this.#relative!==void 0)return this.#relative;let name=this.name,p=this.parent;if(!p)return this.#relative=this.name;let pv=p.relative();return pv+(!pv||!p.parent?"":this.sep)+name}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return "";if(this.#relativePosix!==void 0)return this.#relativePosix;let name=this.name,p=this.parent;if(!p)return this.#relativePosix=this.fullpathPosix();let pv=p.relativePosix();return pv+(!pv||!p.parent?"":"/")+name}fullpath(){if(this.#fullpath!==void 0)return this.#fullpath;let name=this.name,p=this.parent;if(!p)return this.#fullpath=this.name;let fp=p.fullpath()+(p.parent?this.sep:"")+name;return this.#fullpath=fp}fullpathPosix(){if(this.#fullpathPosix!==void 0)return this.#fullpathPosix;if(this.sep==="/")return this.#fullpathPosix=this.fullpath();if(!this.parent){let p2=this.fullpath().replace(/\\/g,"/");return /^[a-z]:\//i.test(p2)?this.#fullpathPosix=`//?/${p2}`:this.#fullpathPosix=p2}let p=this.parent,pfpp=p.fullpathPosix(),fpp=pfpp+(!pfpp||!p.parent?"":"/")+this.name;return this.#fullpathPosix=fpp}isUnknown(){return (this.#type&IFMT)===UNKNOWN}isType(type){return this[`is${type}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return (this.#type&IFMT)===IFREG}isDirectory(){return (this.#type&IFMT)===IFDIR}isCharacterDevice(){return (this.#type&IFMT)===IFCHR}isBlockDevice(){return (this.#type&IFMT)===IFBLK}isFIFO(){return (this.#type&IFMT)===IFIFO}isSocket(){return (this.#type&IFMT)===IFSOCK}isSymbolicLink(){return (this.#type&IFLNK)===IFLNK}lstatCached(){return this.#type&LSTAT_CALLED?this:void 0}readlinkCached(){return this.#linkTarget}realpathCached(){return this.#realpath}readdirCached(){let children=this.children();return children.slice(0,children.provisional)}canReadlink(){if(this.#linkTarget)return !0;if(!this.parent)return !1;let ifmt=this.#type&IFMT;return !(ifmt!==UNKNOWN&&ifmt!==IFLNK||this.#type&ENOREADLINK||this.#type&ENOENT)}calledReaddir(){return !!(this.#type&READDIR_CALLED)}isENOENT(){return !!(this.#type&ENOENT)}isNamed(n){return this.nocase?this.#matchName===normalizeNocase(n):this.#matchName===normalize2(n)}async readlink(){let target=this.#linkTarget;if(target)return target;if(this.canReadlink()&&this.parent)try{let read=await this.#fs.promises.readlink(this.fullpath()),linkTarget=(await this.parent.realpath())?.resolve(read);if(linkTarget)return this.#linkTarget=linkTarget}catch(er){this.#readlinkFail(er.code);return}}readlinkSync(){let target=this.#linkTarget;if(target)return target;if(this.canReadlink()&&this.parent)try{let read=this.#fs.readlinkSync(this.fullpath()),linkTarget=this.parent.realpathSync()?.resolve(read);if(linkTarget)return this.#linkTarget=linkTarget}catch(er){this.#readlinkFail(er.code);return}}#readdirSuccess(children){this.#type|=READDIR_CALLED;for(let p=children.provisional;p<children.length;p++){let c=children[p];c&&c.#markENOENT();}}#markENOENT(){this.#type&ENOENT||(this.#type=(this.#type|ENOENT)&IFMT_UNKNOWN,this.#markChildrenENOENT());}#markChildrenENOENT(){let children=this.children();children.provisional=0;for(let p of children)p.#markENOENT();}#markENOREALPATH(){this.#type|=ENOREALPATH,this.#markENOTDIR();}#markENOTDIR(){if(this.#type&ENOTDIR)return;let t2=this.#type;(t2&IFMT)===IFDIR&&(t2&=IFMT_UNKNOWN),this.#type=t2|ENOTDIR,this.#markChildrenENOENT();}#readdirFail(code=""){code==="ENOTDIR"||code==="EPERM"?this.#markENOTDIR():code==="ENOENT"?this.#markENOENT():this.children().provisional=0;}#lstatFail(code=""){code==="ENOTDIR"?this.parent.#markENOTDIR():code==="ENOENT"&&this.#markENOENT();}#readlinkFail(code=""){let ter=this.#type;ter|=ENOREADLINK,code==="ENOENT"&&(ter|=ENOENT),(code==="EINVAL"||code==="UNKNOWN")&&(ter&=IFMT_UNKNOWN),this.#type=ter,code==="ENOTDIR"&&this.parent&&this.parent.#markENOTDIR();}#readdirAddChild(e,c){return this.#readdirMaybePromoteChild(e,c)||this.#readdirAddNewChild(e,c)}#readdirAddNewChild(e,c){let type=entToType(e),child=this.newChild(e.name,type,{parent:this}),ifmt=child.#type&IFMT;return ifmt!==IFDIR&&ifmt!==IFLNK&&ifmt!==UNKNOWN&&(child.#type|=ENOTDIR),c.unshift(child),c.provisional++,child}#readdirMaybePromoteChild(e,c){for(let p=c.provisional;p<c.length;p++){let pchild=c[p];if((this.nocase?normalizeNocase(e.name):normalize2(e.name))===pchild.#matchName)return this.#readdirPromoteChild(e,pchild,p,c)}}#readdirPromoteChild(e,p,index,c){let v=p.name;return p.#type=p.#type&IFMT_UNKNOWN|entToType(e),v!==e.name&&(p.name=e.name),index!==c.provisional&&(index===c.length-1?c.pop():c.splice(index,1),c.unshift(p)),c.provisional++,p}async lstat(){if(!(this.#type&ENOENT))try{return this.#applyStat(await this.#fs.promises.lstat(this.fullpath())),this}catch(er){this.#lstatFail(er.code);}}lstatSync(){if(!(this.#type&ENOENT))try{return this.#applyStat(this.#fs.lstatSync(this.fullpath())),this}catch(er){this.#lstatFail(er.code);}}#applyStat(st){let{atime,atimeMs,birthtime,birthtimeMs,blksize,blocks,ctime,ctimeMs,dev,gid,ino,mode,mtime,mtimeMs,nlink,rdev,size,uid}=st;this.#atime=atime,this.#atimeMs=atimeMs,this.#birthtime=birthtime,this.#birthtimeMs=birthtimeMs,this.#blksize=blksize,this.#blocks=blocks,this.#ctime=ctime,this.#ctimeMs=ctimeMs,this.#dev=dev,this.#gid=gid,this.#ino=ino,this.#mode=mode,this.#mtime=mtime,this.#mtimeMs=mtimeMs,this.#nlink=nlink,this.#rdev=rdev,this.#size=size,this.#uid=uid;let ifmt=entToType(st);this.#type=this.#type&IFMT_UNKNOWN|ifmt|LSTAT_CALLED,ifmt!==UNKNOWN&&ifmt!==IFDIR&&ifmt!==IFLNK&&(this.#type|=ENOTDIR);}#onReaddirCB=[];#readdirCBInFlight=!1;#callOnReaddirCB(children){this.#readdirCBInFlight=!1;let cbs=this.#onReaddirCB.slice();this.#onReaddirCB.length=0,cbs.forEach(cb=>cb(null,children));}readdirCB(cb,allowZalgo=!1){if(!this.canReaddir()){allowZalgo?cb(null,[]):queueMicrotask(()=>cb(null,[]));return}let children=this.children();if(this.calledReaddir()){let c=children.slice(0,children.provisional);allowZalgo?cb(null,c):queueMicrotask(()=>cb(null,c));return}if(this.#onReaddirCB.push(cb),this.#readdirCBInFlight)return;this.#readdirCBInFlight=!0;let fullpath=this.fullpath();this.#fs.readdir(fullpath,{withFileTypes:!0},(er,entries)=>{if(er)this.#readdirFail(er.code),children.provisional=0;else {for(let e of entries)this.#readdirAddChild(e,children);this.#readdirSuccess(children);}this.#callOnReaddirCB(children.slice(0,children.provisional));});}#asyncReaddirInFlight;async readdir(){if(!this.canReaddir())return [];let children=this.children();if(this.calledReaddir())return children.slice(0,children.provisional);let fullpath=this.fullpath();if(this.#asyncReaddirInFlight)await this.#asyncReaddirInFlight;else {let resolve=()=>{};this.#asyncReaddirInFlight=new Promise(res=>resolve=res);try{for(let e of await this.#fs.promises.readdir(fullpath,{withFileTypes:!0}))this.#readdirAddChild(e,children);this.#readdirSuccess(children);}catch(er){this.#readdirFail(er.code),children.provisional=0;}this.#asyncReaddirInFlight=void 0,resolve();}return children.slice(0,children.provisional)}readdirSync(){if(!this.canReaddir())return [];let children=this.children();if(this.calledReaddir())return children.slice(0,children.provisional);let fullpath=this.fullpath();try{for(let e of this.#fs.readdirSync(fullpath,{withFileTypes:!0}))this.#readdirAddChild(e,children);this.#readdirSuccess(children);}catch(er){this.#readdirFail(er.code),children.provisional=0;}return children.slice(0,children.provisional)}canReaddir(){if(this.#type&ENOCHILD)return !1;let ifmt=IFMT&this.#type;return ifmt===UNKNOWN||ifmt===IFDIR||ifmt===IFLNK}shouldWalk(dirs,walkFilter){return (this.#type&IFDIR)===IFDIR&&!(this.#type&ENOCHILD)&&!dirs.has(this)&&(!walkFilter||walkFilter(this))}async realpath(){if(this.#realpath)return this.#realpath;if(!((ENOREALPATH|ENOREADLINK|ENOENT)&this.#type))try{let rp=await this.#fs.promises.realpath(this.fullpath());return this.#realpath=this.resolve(rp)}catch{this.#markENOREALPATH();}}realpathSync(){if(this.#realpath)return this.#realpath;if(!((ENOREALPATH|ENOREADLINK|ENOENT)&this.#type))try{let rp=this.#fs.realpathSync(this.fullpath());return this.#realpath=this.resolve(rp)}catch{this.#markENOREALPATH();}}[setAsCwd](oldCwd){if(oldCwd===this)return;oldCwd.isCWD=!1,this.isCWD=!0;let changed=new Set([]),rp=[],p=this;for(;p&&p.parent;)changed.add(p),p.#relative=rp.join(this.sep),p.#relativePosix=rp.join("/"),p=p.parent,rp.push("..");for(p=oldCwd;p&&p.parent&&!changed.has(p);)p.#relative=void 0,p.#relativePosix=void 0,p=p.parent;}},PathWin32=class _PathWin32 extends PathBase{sep="\\";splitSep=eitherSep;constructor(name,type=UNKNOWN,root,roots,nocase,children,opts){super(name,type,root,roots,nocase,children,opts);}newChild(name,type=UNKNOWN,opts={}){return new _PathWin32(name,type,this.root,this.roots,this.nocase,this.childrenCache(),opts)}getRootString(path2){return win32.parse(path2).root}getRoot(rootPath){if(rootPath=uncToDrive(rootPath.toUpperCase()),rootPath===this.root.name)return this.root;for(let[compare,root]of Object.entries(this.roots))if(this.sameRoot(rootPath,compare))return this.roots[rootPath]=root;return this.roots[rootPath]=new PathScurryWin32(rootPath,this).root}sameRoot(rootPath,compare=this.root.name){return rootPath=rootPath.toUpperCase().replace(/\//g,"\\").replace(uncDriveRegexp,"$1\\"),rootPath===compare}},PathPosix=class _PathPosix extends PathBase{splitSep="/";sep="/";constructor(name,type=UNKNOWN,root,roots,nocase,children,opts){super(name,type,root,roots,nocase,children,opts);}getRootString(path2){return path2.startsWith("/")?"/":""}getRoot(_rootPath){return this.root}newChild(name,type=UNKNOWN,opts={}){return new _PathPosix(name,type,this.root,this.roots,this.nocase,this.childrenCache(),opts)}},PathScurryBase=class{root;rootPath;roots;cwd;#resolveCache;#resolvePosixCache;#children;nocase;#fs;constructor(cwd=process.cwd(),pathImpl,sep2,{nocase,childrenCacheSize=16*1024,fs=defaultFS}={}){this.#fs=fsFromOption(fs),(cwd instanceof URL||cwd.startsWith("file://"))&&(cwd=fileURLToPath(cwd));let cwdPath=pathImpl.resolve(cwd);this.roots=Object.create(null),this.rootPath=this.parseRootPath(cwdPath),this.#resolveCache=new ResolveCache,this.#resolvePosixCache=new ResolveCache,this.#children=new ChildrenCache(childrenCacheSize);let split=cwdPath.substring(this.rootPath.length).split(sep2);if(split.length===1&&!split[0]&&split.pop(),nocase===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=nocase,this.root=this.newRoot(this.#fs),this.roots[this.rootPath]=this.root;let prev=this.root,len=split.length-1,joinSep=pathImpl.sep,abs=this.rootPath,sawFirst=!1;for(let part of split){let l=len--;prev=prev.child(part,{relative:new Array(l).fill("..").join(joinSep),relativePosix:new Array(l).fill("..").join("/"),fullpath:abs+=(sawFirst?"":joinSep)+part}),sawFirst=!0;}this.cwd=prev;}depth(path2=this.cwd){return typeof path2=="string"&&(path2=this.cwd.resolve(path2)),path2.depth()}childrenCache(){return this.#children}resolve(...paths){let r="";for(let i=paths.length-1;i>=0;i--){let p=paths[i];if(!(!p||p===".")&&(r=r?`${p}/${r}`:p,this.isAbsolute(p)))break}let cached=this.#resolveCache.get(r);if(cached!==void 0)return cached;let result=this.cwd.resolve(r).fullpath();return this.#resolveCache.set(r,result),result}resolvePosix(...paths){let r="";for(let i=paths.length-1;i>=0;i--){let p=paths[i];if(!(!p||p===".")&&(r=r?`${p}/${r}`:p,this.isAbsolute(p)))break}let cached=this.#resolvePosixCache.get(r);if(cached!==void 0)return cached;let result=this.cwd.resolve(r).fullpathPosix();return this.#resolvePosixCache.set(r,result),result}relative(entry=this.cwd){return typeof entry=="string"&&(entry=this.cwd.resolve(entry)),entry.relative()}relativePosix(entry=this.cwd){return typeof entry=="string"&&(entry=this.cwd.resolve(entry)),entry.relativePosix()}basename(entry=this.cwd){return typeof entry=="string"&&(entry=this.cwd.resolve(entry)),entry.name}dirname(entry=this.cwd){return typeof entry=="string"&&(entry=this.cwd.resolve(entry)),(entry.parent||entry).fullpath()}async readdir(entry=this.cwd,opts={withFileTypes:!0}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(opts=entry,entry=this.cwd);let{withFileTypes}=opts;if(entry.canReaddir()){let p=await entry.readdir();return withFileTypes?p:p.map(e=>e.name)}else return []}readdirSync(entry=this.cwd,opts={withFileTypes:!0}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(opts=entry,entry=this.cwd);let{withFileTypes=!0}=opts;return entry.canReaddir()?withFileTypes?entry.readdirSync():entry.readdirSync().map(e=>e.name):[]}async lstat(entry=this.cwd){return typeof entry=="string"&&(entry=this.cwd.resolve(entry)),entry.lstat()}lstatSync(entry=this.cwd){return typeof entry=="string"&&(entry=this.cwd.resolve(entry)),entry.lstatSync()}async readlink(entry=this.cwd,{withFileTypes}={withFileTypes:!1}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(withFileTypes=entry.withFileTypes,entry=this.cwd);let e=await entry.readlink();return withFileTypes?e:e?.fullpath()}readlinkSync(entry=this.cwd,{withFileTypes}={withFileTypes:!1}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(withFileTypes=entry.withFileTypes,entry=this.cwd);let e=entry.readlinkSync();return withFileTypes?e:e?.fullpath()}async realpath(entry=this.cwd,{withFileTypes}={withFileTypes:!1}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(withFileTypes=entry.withFileTypes,entry=this.cwd);let e=await entry.realpath();return withFileTypes?e:e?.fullpath()}realpathSync(entry=this.cwd,{withFileTypes}={withFileTypes:!1}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(withFileTypes=entry.withFileTypes,entry=this.cwd);let e=entry.realpathSync();return withFileTypes?e:e?.fullpath()}async walk(entry=this.cwd,opts={}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(opts=entry,entry=this.cwd);let{withFileTypes=!0,follow=!1,filter:filter2,walkFilter}=opts,results=[];(!filter2||filter2(entry))&&results.push(withFileTypes?entry:entry.fullpath());let dirs=new Set,walk=(dir,cb)=>{dirs.add(dir),dir.readdirCB((er,entries)=>{if(er)return cb(er);let len=entries.length;if(!len)return cb();let next=()=>{--len===0&&cb();};for(let e of entries)(!filter2||filter2(e))&&results.push(withFileTypes?e:e.fullpath()),follow&&e.isSymbolicLink()?e.realpath().then(r=>r?.isUnknown()?r.lstat():r).then(r=>r?.shouldWalk(dirs,walkFilter)?walk(r,next):next()):e.shouldWalk(dirs,walkFilter)?walk(e,next):next();},!0);},start=entry;return new Promise((res,rej)=>{walk(start,er=>{if(er)return rej(er);res(results);});})}walkSync(entry=this.cwd,opts={}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(opts=entry,entry=this.cwd);let{withFileTypes=!0,follow=!1,filter:filter2,walkFilter}=opts,results=[];(!filter2||filter2(entry))&&results.push(withFileTypes?entry:entry.fullpath());let dirs=new Set([entry]);for(let dir of dirs){let entries=dir.readdirSync();for(let e of entries){(!filter2||filter2(e))&&results.push(withFileTypes?e:e.fullpath());let r=e;if(e.isSymbolicLink()){if(!(follow&&(r=e.realpathSync())))continue;r.isUnknown()&&r.lstatSync();}r.shouldWalk(dirs,walkFilter)&&dirs.add(r);}}return results}[Symbol.asyncIterator](){return this.iterate()}iterate(entry=this.cwd,options={}){return typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(options=entry,entry=this.cwd),this.stream(entry,options)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(entry=this.cwd,opts={}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(opts=entry,entry=this.cwd);let{withFileTypes=!0,follow=!1,filter:filter2,walkFilter}=opts;(!filter2||filter2(entry))&&(yield withFileTypes?entry:entry.fullpath());let dirs=new Set([entry]);for(let dir of dirs){let entries=dir.readdirSync();for(let e of entries){(!filter2||filter2(e))&&(yield withFileTypes?e:e.fullpath());let r=e;if(e.isSymbolicLink()){if(!(follow&&(r=e.realpathSync())))continue;r.isUnknown()&&r.lstatSync();}r.shouldWalk(dirs,walkFilter)&&dirs.add(r);}}}stream(entry=this.cwd,opts={}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(opts=entry,entry=this.cwd);let{withFileTypes=!0,follow=!1,filter:filter2,walkFilter}=opts,results=new Minipass({objectMode:!0});(!filter2||filter2(entry))&&results.write(withFileTypes?entry:entry.fullpath());let dirs=new Set,queue=[entry],processing=0,process3=()=>{let paused=!1;for(;!paused;){let dir=queue.shift();if(!dir){processing===0&&results.end();return}processing++,dirs.add(dir);let onReaddir=(er,entries,didRealpaths=!1)=>{if(er)return results.emit("error",er);if(follow&&!didRealpaths){let promises=[];for(let e of entries)e.isSymbolicLink()&&promises.push(e.realpath().then(r=>r?.isUnknown()?r.lstat():r));if(promises.length){Promise.all(promises).then(()=>onReaddir(null,entries,!0));return}}for(let e of entries)e&&(!filter2||filter2(e))&&(results.write(withFileTypes?e:e.fullpath())||(paused=!0));processing--;for(let e of entries){let r=e.realpathCached()||e;r.shouldWalk(dirs,walkFilter)&&queue.push(r);}paused&&!results.flowing?results.once("drain",process3):sync2||process3();},sync2=!0;dir.readdirCB(onReaddir,!0),sync2=!1;}};return process3(),results}streamSync(entry=this.cwd,opts={}){typeof entry=="string"?entry=this.cwd.resolve(entry):entry instanceof PathBase||(opts=entry,entry=this.cwd);let{withFileTypes=!0,follow=!1,filter:filter2,walkFilter}=opts,results=new Minipass({objectMode:!0}),dirs=new Set;(!filter2||filter2(entry))&&results.write(withFileTypes?entry:entry.fullpath());let queue=[entry],processing=0,process3=()=>{let paused=!1;for(;!paused;){let dir=queue.shift();if(!dir){processing===0&&results.end();return}processing++,dirs.add(dir);let entries=dir.readdirSync();for(let e of entries)(!filter2||filter2(e))&&(results.write(withFileTypes?e:e.fullpath())||(paused=!0));processing--;for(let e of entries){let r=e;if(e.isSymbolicLink()){if(!(follow&&(r=e.realpathSync())))continue;r.isUnknown()&&r.lstatSync();}r.shouldWalk(dirs,walkFilter)&&queue.push(r);}}paused&&!results.flowing&&results.once("drain",process3);};return process3(),results}chdir(path2=this.cwd){let oldCwd=this.cwd;this.cwd=typeof path2=="string"?this.cwd.resolve(path2):path2,this.cwd[setAsCwd](oldCwd);}},PathScurryWin32=class extends PathScurryBase{sep="\\";constructor(cwd=process.cwd(),opts={}){let{nocase=!0}=opts;super(cwd,win32,"\\",{...opts,nocase}),this.nocase=nocase;for(let p=this.cwd;p;p=p.parent)p.nocase=this.nocase;}parseRootPath(dir){return win32.parse(dir).root.toUpperCase()}newRoot(fs){return new PathWin32(this.rootPath,IFDIR,void 0,this.roots,this.nocase,this.childrenCache(),{fs})}isAbsolute(p){return p.startsWith("/")||p.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(p)}},PathScurryPosix=class extends PathScurryBase{sep="/";constructor(cwd=process.cwd(),opts={}){let{nocase=!1}=opts;super(cwd,posix,"/",{...opts,nocase}),this.nocase=nocase;}parseRootPath(_dir){return "/"}newRoot(fs){return new PathPosix(this.rootPath,IFDIR,void 0,this.roots,this.nocase,this.childrenCache(),{fs})}isAbsolute(p){return p.startsWith("/")}},PathScurryDarwin=class extends PathScurryPosix{constructor(cwd=process.cwd(),opts={}){let{nocase=!0}=opts;super(cwd,{...opts,nocase});}};process.platform==="win32"?PathWin32:PathPosix;var PathScurry=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;var isPatternList=pl=>pl.length>=1,isGlobList=gl=>gl.length>=1,Pattern=class _Pattern{#patternList;#globList;#index;length;#platform;#rest;#globString;#isDrive;#isUNC;#isAbsolute;#followGlobstar=!0;constructor(patternList,globList,index,platform){if(!isPatternList(patternList))throw new TypeError("empty pattern list");if(!isGlobList(globList))throw new TypeError("empty glob list");if(globList.length!==patternList.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=patternList.length,index<0||index>=this.length)throw new TypeError("index out of range");if(this.#patternList=patternList,this.#globList=globList,this.#index=index,this.#platform=platform,this.#index===0){if(this.isUNC()){let[p0,p1,p2,p3,...prest]=this.#patternList,[g0,g1,g2,g3,...grest]=this.#globList;prest[0]===""&&(prest.shift(),grest.shift());let p=[p0,p1,p2,p3,""].join("/"),g=[g0,g1,g2,g3,""].join("/");this.#patternList=[p,...prest],this.#globList=[g,...grest],this.length=this.#patternList.length;}else if(this.isDrive()||this.isAbsolute()){let[p1,...prest]=this.#patternList,[g1,...grest]=this.#globList;prest[0]===""&&(prest.shift(),grest.shift());let p=p1+"/",g=g1+"/";this.#patternList=[p,...prest],this.#globList=[g,...grest],this.length=this.#patternList.length;}}}pattern(){return this.#patternList[this.#index]}isString(){return typeof this.#patternList[this.#index]=="string"}isGlobstar(){return this.#patternList[this.#index]===GLOBSTAR}isRegExp(){return this.#patternList[this.#index]instanceof RegExp}globString(){return this.#globString=this.#globString||(this.#index===0?this.isAbsolute()?this.#globList[0]+this.#globList.slice(1).join("/"):this.#globList.join("/"):this.#globList.slice(this.#index).join("/"))}hasMore(){return this.length>this.#index+1}rest(){return this.#rest!==void 0?this.#rest:this.hasMore()?(this.#rest=new _Pattern(this.#patternList,this.#globList,this.#index+1,this.#platform),this.#rest.#isAbsolute=this.#isAbsolute,this.#rest.#isUNC=this.#isUNC,this.#rest.#isDrive=this.#isDrive,this.#rest):this.#rest=null}isUNC(){let pl=this.#patternList;return this.#isUNC!==void 0?this.#isUNC:this.#isUNC=this.#platform==="win32"&&this.#index===0&&pl[0]===""&&pl[1]===""&&typeof pl[2]=="string"&&!!pl[2]&&typeof pl[3]=="string"&&!!pl[3]}isDrive(){let pl=this.#patternList;return this.#isDrive!==void 0?this.#isDrive:this.#isDrive=this.#platform==="win32"&&this.#index===0&&this.length>1&&typeof pl[0]=="string"&&/^[a-z]:$/i.test(pl[0])}isAbsolute(){let pl=this.#patternList;return this.#isAbsolute!==void 0?this.#isAbsolute:this.#isAbsolute=pl[0]===""&&pl.length>1||this.isDrive()||this.isUNC()}root(){let p=this.#patternList[0];return typeof p=="string"&&this.isAbsolute()&&this.#index===0?p:""}checkFollowGlobstar(){return !(this.#index===0||!this.isGlobstar()||!this.#followGlobstar)}markFollowGlobstar(){return this.#index===0||!this.isGlobstar()||!this.#followGlobstar?!1:(this.#followGlobstar=!1,!0)}};var defaultPlatform2=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ignore=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(ignored,{nobrace,nocase,noext,noglobstar,platform=defaultPlatform2}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=platform,this.mmopts={dot:!0,nobrace,nocase,noext,noglobstar,optimizationLevel:2,platform,nocomment:!0,nonegate:!0};for(let ign of ignored)this.add(ign);}add(ign){let mm=new Minimatch(ign,this.mmopts);for(let i=0;i<mm.set.length;i++){let parsed=mm.set[i],globParts=mm.globParts[i];if(!parsed||!globParts)throw new Error("invalid pattern object");for(;parsed[0]==="."&&globParts[0]===".";)parsed.shift(),globParts.shift();let p=new Pattern(parsed,globParts,0,this.platform),m=new Minimatch(p.globString(),this.mmopts),children=globParts[globParts.length-1]==="**",absolute=p.isAbsolute();absolute?this.absolute.push(m):this.relative.push(m),children&&(absolute?this.absoluteChildren.push(m):this.relativeChildren.push(m));}}ignored(p){let fullpath=p.fullpath(),fullpaths=`${fullpath}/`,relative=p.relative()||".",relatives=`${relative}/`;for(let m of this.relative)if(m.match(relative)||m.match(relatives))return !0;for(let m of this.absolute)if(m.match(fullpath)||m.match(fullpaths))return !0;return !1}childrenIgnored(p){let fullpath=p.fullpath()+"/",relative=(p.relative()||".")+"/";for(let m of this.relativeChildren)if(m.match(relative))return !0;for(let m of this.absoluteChildren)if(m.match(fullpath))return !0;return !1}};var HasWalkedCache=class _HasWalkedCache{store;constructor(store=new Map){this.store=store;}copy(){return new _HasWalkedCache(new Map(this.store))}hasWalked(target,pattern){return this.store.get(target.fullpath())?.has(pattern.globString())}storeWalked(target,pattern){let fullpath=target.fullpath(),cached=this.store.get(fullpath);cached?cached.add(pattern.globString()):this.store.set(fullpath,new Set([pattern.globString()]));}},MatchRecord=class{store=new Map;add(target,absolute,ifDir){let n=(absolute?2:0)|(ifDir?1:0),current=this.store.get(target);this.store.set(target,current===void 0?n:n¤t);}entries(){return [...this.store.entries()].map(([path2,n])=>[path2,!!(n&2),!!(n&1)])}},SubWalks=class{store=new Map;add(target,pattern){if(!target.canReaddir())return;let subs=this.store.get(target);subs?subs.find(p=>p.globString()===pattern.globString())||subs.push(pattern):this.store.set(target,[pattern]);}get(target){let subs=this.store.get(target);if(!subs)throw new Error("attempting to walk unknown path");return subs}entries(){return this.keys().map(k=>[k,this.store.get(k)])}keys(){return [...this.store.keys()].filter(t2=>t2.canReaddir())}},Processor=class _Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(opts,hasWalkedCache){this.opts=opts,this.follow=!!opts.follow,this.dot=!!opts.dot,this.hasWalkedCache=hasWalkedCache?hasWalkedCache.copy():new HasWalkedCache;}processPatterns(target,patterns){this.patterns=patterns;let processingSet=patterns.map(p=>[target,p]);for(let[t2,pattern]of processingSet){this.hasWalkedCache.storeWalked(t2,pattern);let root=pattern.root(),absolute=pattern.isAbsolute()&&this.opts.absolute!==!1;if(root){t2=t2.resolve(root==="/"&&this.opts.root!==void 0?this.opts.root:root);let rest2=pattern.rest();if(rest2)pattern=rest2;else {this.matches.add(t2,!0,!1);continue}}if(t2.isENOENT())continue;let p,rest,changed=!1;for(;typeof(p=pattern.pattern())=="string"&&(rest=pattern.rest());)t2=t2.resolve(p),pattern=rest,changed=!0;if(p=pattern.pattern(),rest=pattern.rest(),changed){if(this.hasWalkedCache.hasWalked(t2,pattern))continue;this.hasWalkedCache.storeWalked(t2,pattern);}if(typeof p=="string"){let ifDir=p===".."||p===""||p===".";this.matches.add(t2.resolve(p),absolute,ifDir);continue}else if(p===GLOBSTAR){(!t2.isSymbolicLink()||this.follow||pattern.checkFollowGlobstar())&&this.subwalks.add(t2,pattern);let rp=rest?.pattern(),rrest=rest?.rest();if(!rest||(rp===""||rp===".")&&!rrest)this.matches.add(t2,absolute,rp===""||rp===".");else if(rp===".."){let tp=t2.parent||t2;rrest?this.hasWalkedCache.hasWalked(tp,rrest)||this.subwalks.add(tp,rrest):this.matches.add(tp,absolute,!0);}}else p instanceof RegExp&&this.subwalks.add(t2,pattern);}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new _Processor(this.opts,this.hasWalkedCache)}filterEntries(parent,entries){let patterns=this.subwalks.get(parent),results=this.child();for(let e of entries)for(let pattern of patterns){let absolute=pattern.isAbsolute(),p=pattern.pattern(),rest=pattern.rest();p===GLOBSTAR?results.testGlobstar(e,pattern,rest,absolute):p instanceof RegExp?results.testRegExp(e,p,rest,absolute):results.testString(e,p,rest,absolute);}return results}testGlobstar(e,pattern,rest,absolute){if((this.dot||!e.name.startsWith("."))&&(pattern.hasMore()||this.matches.add(e,absolute,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,pattern):e.isSymbolicLink()&&(rest&&pattern.checkFollowGlobstar()?this.subwalks.add(e,rest):pattern.markFollowGlobstar()&&this.subwalks.add(e,pattern)))),rest){let rp=rest.pattern();if(typeof rp=="string"&&rp!==".."&&rp!==""&&rp!==".")this.testString(e,rp,rest.rest(),absolute);else if(rp===".."){let ep=e.parent||e;this.subwalks.add(ep,rest);}else rp instanceof RegExp&&this.testRegExp(e,rp,rest.rest(),absolute);}}testRegExp(e,p,rest,absolute){p.test(e.name)&&(rest?this.subwalks.add(e,rest):this.matches.add(e,absolute,!1));}testString(e,p,rest,absolute){e.isNamed(p)&&(rest?this.subwalks.add(e,rest):this.matches.add(e,absolute,!1));}};var makeIgnore=(ignore,opts)=>typeof ignore=="string"?new Ignore([ignore],opts):Array.isArray(ignore)?new Ignore(ignore,opts):ignore,GlobUtil=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#onResume=[];#ignore;#sep;signal;maxDepth;includeChildMatches;constructor(patterns,path2,opts){if(this.patterns=patterns,this.path=path2,this.opts=opts,this.#sep=!opts.posix&&opts.platform==="win32"?"\\":"/",this.includeChildMatches=opts.includeChildMatches!==!1,(opts.ignore||!this.includeChildMatches)&&(this.#ignore=makeIgnore(opts.ignore??[],opts),!this.includeChildMatches&&typeof this.#ignore.add!="function")){let m="cannot ignore child matches, ignore lacks add() method.";throw new Error(m)}this.maxDepth=opts.maxDepth||1/0,opts.signal&&(this.signal=opts.signal,this.signal.addEventListener("abort",()=>{this.#onResume.length=0;}));}#ignored(path2){return this.seen.has(path2)||!!this.#ignore?.ignored?.(path2)}#childrenIgnored(path2){return !!this.#ignore?.childrenIgnored?.(path2)}pause(){this.paused=!0;}resume(){if(this.signal?.aborted)return;this.paused=!1;let fn;for(;!this.paused&&(fn=this.#onResume.shift());)fn();}onResume(fn){this.signal?.aborted||(this.paused?this.#onResume.push(fn):fn());}async matchCheck(e,ifDir){if(ifDir&&this.opts.nodir)return;let rpc;if(this.opts.realpath){if(rpc=e.realpathCached()||await e.realpath(),!rpc)return;e=rpc;}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let target=await s.realpath();target&&(target.isUnknown()||this.opts.stat)&&await target.lstat();}return this.matchCheckTest(s,ifDir)}matchCheckTest(e,ifDir){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!ifDir||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#ignored(e)?e:void 0}matchCheckSync(e,ifDir){if(ifDir&&this.opts.nodir)return;let rpc;if(this.opts.realpath){if(rpc=e.realpathCached()||e.realpathSync(),!rpc)return;e=rpc;}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let target=s.realpathSync();target&&(target?.isUnknown()||this.opts.stat)&&target.lstatSync();}return this.matchCheckTest(s,ifDir)}matchFinish(e,absolute){if(this.#ignored(e))return;if(!this.includeChildMatches&&this.#ignore?.add){let ign=`${e.relativePosix()}/**`;this.#ignore.add(ign);}let abs=this.opts.absolute===void 0?absolute:this.opts.absolute;this.seen.add(e);let mark=this.opts.mark&&e.isDirectory()?this.#sep:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(abs){let abs2=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(abs2+mark);}else {let rel=this.opts.posix?e.relativePosix():e.relative(),pre=this.opts.dotRelative&&!rel.startsWith(".."+this.#sep)?"."+this.#sep:"";this.matchEmit(rel?pre+rel+mark:"."+mark);}}async match(e,absolute,ifDir){let p=await this.matchCheck(e,ifDir);p&&this.matchFinish(p,absolute);}matchSync(e,absolute,ifDir){let p=this.matchCheckSync(e,ifDir);p&&this.matchFinish(p,absolute);}walkCB(target,patterns,cb){this.signal?.aborted&&cb(),this.walkCB2(target,patterns,new Processor(this.opts),cb);}walkCB2(target,patterns,processor,cb){if(this.#childrenIgnored(target))return cb();if(this.signal?.aborted&&cb(),this.paused){this.onResume(()=>this.walkCB2(target,patterns,processor,cb));return}processor.processPatterns(target,patterns);let tasks=1,next=()=>{--tasks===0&&cb();};for(let[m,absolute,ifDir]of processor.matches.entries())this.#ignored(m)||(tasks++,this.match(m,absolute,ifDir).then(()=>next()));for(let t2 of processor.subwalkTargets()){if(this.maxDepth!==1/0&&t2.depth()>=this.maxDepth)continue;tasks++;let childrenCached=t2.readdirCached();t2.calledReaddir()?this.walkCB3(t2,childrenCached,processor,next):t2.readdirCB((_,entries)=>this.walkCB3(t2,entries,processor,next),!0);}next();}walkCB3(target,entries,processor,cb){processor=processor.filterEntries(target,entries);let tasks=1,next=()=>{--tasks===0&&cb();};for(let[m,absolute,ifDir]of processor.matches.entries())this.#ignored(m)||(tasks++,this.match(m,absolute,ifDir).then(()=>next()));for(let[target2,patterns]of processor.subwalks.entries())tasks++,this.walkCB2(target2,patterns,processor.child(),next);next();}walkCBSync(target,patterns,cb){this.signal?.aborted&&cb(),this.walkCB2Sync(target,patterns,new Processor(this.opts),cb);}walkCB2Sync(target,patterns,processor,cb){if(this.#childrenIgnored(target))return cb();if(this.signal?.aborted&&cb(),this.paused){this.onResume(()=>this.walkCB2Sync(target,patterns,processor,cb));return}processor.processPatterns(target,patterns);let tasks=1,next=()=>{--tasks===0&&cb();};for(let[m,absolute,ifDir]of processor.matches.entries())this.#ignored(m)||this.matchSync(m,absolute,ifDir);for(let t2 of processor.subwalkTargets()){if(this.maxDepth!==1/0&&t2.depth()>=this.maxDepth)continue;tasks++;let children=t2.readdirSync();this.walkCB3Sync(t2,children,processor,next);}next();}walkCB3Sync(target,entries,processor,cb){processor=processor.filterEntries(target,entries);let tasks=1,next=()=>{--tasks===0&&cb();};for(let[m,absolute,ifDir]of processor.matches.entries())this.#ignored(m)||this.matchSync(m,absolute,ifDir);for(let[target2,patterns]of processor.subwalks.entries())tasks++,this.walkCB2Sync(target2,patterns,processor.child(),next);next();}},GlobWalker=class extends GlobUtil{matches=new Set;constructor(patterns,path2,opts){super(patterns,path2,opts);}matchEmit(e){this.matches.add(e);}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((res,rej)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?rej(this.signal.reason):res(this.matches);});}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},GlobStream=class extends GlobUtil{results;constructor(patterns,path2,opts){super(patterns,path2,opts),this.results=new Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume());}matchEmit(e){this.results.write(e),this.results.flowing||this.pause();}stream(){let target=this.path;return target.isUnknown()?target.lstat().then(()=>{this.walkCB(target,this.patterns,()=>this.results.end());}):this.walkCB(target,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var defaultPlatform3=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Glob=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(pattern,opts){if(!opts)throw new TypeError("glob options required");if(this.withFileTypes=!!opts.withFileTypes,this.signal=opts.signal,this.follow=!!opts.follow,this.dot=!!opts.dot,this.dotRelative=!!opts.dotRelative,this.nodir=!!opts.nodir,this.mark=!!opts.mark,opts.cwd?(opts.cwd instanceof URL||opts.cwd.startsWith("file://"))&&(opts.cwd=fileURLToPath(opts.cwd)):this.cwd="",this.cwd=opts.cwd||"",this.root=opts.root,this.magicalBraces=!!opts.magicalBraces,this.nobrace=!!opts.nobrace,this.noext=!!opts.noext,this.realpath=!!opts.realpath,this.absolute=opts.absolute,this.includeChildMatches=opts.includeChildMatches!==!1,this.noglobstar=!!opts.noglobstar,this.matchBase=!!opts.matchBase,this.maxDepth=typeof opts.maxDepth=="number"?opts.maxDepth:1/0,this.stat=!!opts.stat,this.ignore=opts.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof pattern=="string"&&(pattern=[pattern]),this.windowsPathsNoEscape=!!opts.windowsPathsNoEscape||opts.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(pattern=pattern.map(p=>p.replace(/\\/g,"/"))),this.matchBase){if(opts.noglobstar)throw new TypeError("base matching requires globstar");pattern=pattern.map(p=>p.includes("/")?p:`./**/${p}`);}if(this.pattern=pattern,this.platform=opts.platform||defaultPlatform3,this.opts={...opts,platform:this.platform},opts.scurry){if(this.scurry=opts.scurry,opts.nocase!==void 0&&opts.nocase!==opts.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else {let Scurry=opts.platform==="win32"?PathScurryWin32:opts.platform==="darwin"?PathScurryDarwin:opts.platform?PathScurryPosix:PathScurry;this.scurry=new Scurry(this.cwd,{nocase:opts.nocase,fs:opts.fs});}this.nocase=this.scurry.nocase;let nocaseMagicOnly=this.platform==="darwin"||this.platform==="win32",mmo={...opts,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},mms=this.pattern.map(p=>new Minimatch(p,mmo)),[matchSet,globParts]=mms.reduce((set,m)=>(set[0].push(...m.set),set[1].push(...m.globParts),set),[[],[]]);this.patterns=matchSet.map((set,i)=>{let g=globParts[i];if(!g)throw new Error("invalid pattern object");return new Pattern(set,g,0,this.platform)});}async walk(){return [...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return [...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var hasMagic=(pattern,options={})=>{Array.isArray(pattern)||(pattern=[pattern]);for(let p of pattern)if(new Minimatch(p,options).hasMagic())return !0;return !1};function globStreamSync(pattern,options={}){return new Glob(pattern,options).streamSync()}function globStream(pattern,options={}){return new Glob(pattern,options).stream()}function globSync(pattern,options={}){return new Glob(pattern,options).walkSync()}async function glob_(pattern,options={}){return new Glob(pattern,options).walk()}function globIterateSync(pattern,options={}){return new Glob(pattern,options).iterateSync()}function globIterate(pattern,options={}){return new Glob(pattern,options).iterate()}var streamSync=globStreamSync,stream=Object.assign(globStream,{sync:globStreamSync}),iterateSync=globIterateSync,iterate=Object.assign(globIterate,{sync:globIterateSync}),sync=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync}),glob=Object.assign(glob_,{glob:glob_,globSync,sync,globStream,stream,globStreamSync,streamSync,globIterate,iterate,globIterateSync,iterateSync,Glob,hasMagic,escape,unescape});glob.glob=glob;var logger11=console,getNextGlob=globString=>{let extGlobsRegex=new RegExp(/(.*\.)(stories\.@.*)(\|mdx|mdx\|)(.*)$/i);if(globString.match(extGlobsRegex))return globString.replace(extGlobsRegex,"$1@(mdx|$2$4)");let allStoriesExtensionsRegex=new RegExp(/(.*\.)(stories\.\*)$/i);return globString.match(allStoriesExtensionsRegex)?globString.replace(allStoriesExtensionsRegex,"$1@(mdx|$2)"):globString.replaceAll(".stories.mdx",".mdx")},mdxToCSF={id:"mdx-to-csf",versionRange:["<7",">=7"],async check({mainConfig}){let existingStoriesEntries=mainConfig.stories;if(!existingStoriesEntries)throw new Error(dedent`
|
|
216
|
+
`},async run({packageManager,dryRun,mainConfigPath,skipInstall}){if(!dryRun){let packageJson=await packageManager.retrievePackageJson(),versionToInstall=getStorybookVersionSpecifier(await packageManager.retrievePackageJson());await packageManager.addDependencies({installAsDevDependencies:!0,skipInstall,packageJson},[`@storybook/addon-mdx-gfm@${versionToInstall}`]),await updateMainConfig({mainConfigPath,dryRun:!!dryRun},async main=>{logger10.info('\u2705 Adding "@storybook/addon-mdx-gfm" addon'),dryRun||main.appendValueToArray(["addons"],"@storybook/addon-mdx-gfm");});}}};var logger11=console,getNextGlob=globString=>{let extGlobsRegex=new RegExp(/(.*\.)(stories\.@.*)(\|mdx|mdx\|)(.*)$/i);if(globString.match(extGlobsRegex))return globString.replace(extGlobsRegex,"$1@(mdx|$2$4)");let allStoriesExtensionsRegex=new RegExp(/(.*\.)(stories\.\*)$/i);return globString.match(allStoriesExtensionsRegex)?globString.replace(allStoriesExtensionsRegex,"$1@(mdx|$2)"):globString.replaceAll(".stories.mdx",".mdx")},mdxToCSF={id:"mdx-to-csf",versionRange:["<7",">=7"],async check({mainConfig}){let existingStoriesEntries=mainConfig.stories;if(!existingStoriesEntries)throw new Error(dedent`
|
|
224
217
|
❌ Unable to determine Storybook stories globs in ${chalk22.blue(mainConfig)}, skipping ${chalk22.cyan(this.id)} fix.
|
|
225
218
|
|
|
226
219
|
In Storybook 7, we have deprecated defining stories in MDX files, and consequently have changed the suffix to simply .mdx.
|
|
@@ -353,7 +346,7 @@ globstar while`,file,fr,pattern,pr,swallowee),this.matchOne(file.slice(fr),patte
|
|
|
353
346
|
${chalk22.yellow("https://github.com/storybookjs/storybook/issues/26606")}
|
|
354
347
|
|
|
355
348
|
Press Y to revert to ${chalk22.cyan("react-docgen-typescript")}, press N to use ${chalk22.cyan("react-docgen")}
|
|
356
|
-
`},async run({dryRun,mainConfigPath,result}){dryRun||await updateMainConfig({mainConfigPath,dryRun:!!dryRun},async main=>{logger15.info("\u2705 Setting typescript.reactDocgen"),main.setFieldValue(["typescript","reactDocgen"],"react-docgen-typescript");});}};var removeArgtypesRegex={id:"remove-argtypes-regex",promptType:"manual",versionRange:["<8.0.0-alpha.0",">=8.0.0-alpha.0"],async check({previewConfigPath}){if(!previewConfigPath)return null;let previewFile=await readFile$1(previewConfigPath,{encoding:"utf-8"}),file=new babel.File({filename:previewConfigPath},{code:previewFile,ast:babelParse(previewFile)}),argTypesRegex;return file.path.traverse({Identifier:
|
|
349
|
+
`},async run({dryRun,mainConfigPath,result}){dryRun||await updateMainConfig({mainConfigPath,dryRun:!!dryRun},async main=>{logger15.info("\u2705 Setting typescript.reactDocgen"),main.setFieldValue(["typescript","reactDocgen"],"react-docgen-typescript");});}};var removeArgtypesRegex={id:"remove-argtypes-regex",promptType:"manual",versionRange:["<8.0.0-alpha.0",">=8.0.0-alpha.0"],async check({previewConfigPath}){if(!previewConfigPath)return null;let previewFile=await readFile$1(previewConfigPath,{encoding:"utf-8"}),file=new babel.File({filename:previewConfigPath},{code:previewFile,ast:babelParse(previewFile)}),argTypesRegex;return file.path.traverse({Identifier:path=>{path.node.name==="argTypesRegex"&&(argTypesRegex=path);}}),argTypesRegex?{argTypesRegex,previewConfigPath}:null},prompt({argTypesRegex,previewConfigPath}){return dedent`
|
|
357
350
|
${chalk22.bold("Attention")}: We've detected that you're using argTypesRegex:
|
|
358
351
|
|
|
359
352
|
${argTypesRegex.buildCodeFrameError(`${previewConfigPath}`).message}
|
|
@@ -519,7 +512,7 @@ ${error}`).join(`
|
|
|
519
512
|
${error.stack}`),fixSummary.failed[f.id]=error.message),fixResults[f.id]="check_failed";}if(result){let promptType=typeof f.promptType=="function"?await f.promptType(result):f.promptType??"auto";logger21.info(`
|
|
520
513
|
\u{1F50E} found a '${chalk22.cyan(f.id)}' migration:`);let message=f.prompt(result),getTitle=()=>{switch(promptType){case"auto":return "Automigration detected";case"manual":return "Manual migration detected";case"notification":return "Migration notification"}};logger21.info(boxen(message,{borderStyle:"round",padding:1,borderColor:"#F1618C",title:getTitle()}));let runAnswer;try{if(dryRun)runAnswer={fix:!1};else if(yes)runAnswer={fix:!0},promptType==="manual"&&(fixResults[f.id]="manual_succeeded",fixSummary.manual.push(f.id));else if(promptType==="manual"){fixResults[f.id]="manual_succeeded",fixSummary.manual.push(f.id),logger21.info();let{shouldContinue}=await prompts5({type:"toggle",name:"shouldContinue",message:"Select continue once you have made the required changes, or quit to exit the migration process",initial:!0,active:"continue",inactive:"quit"},{onCancel:()=>{throw new Error}});if(!shouldContinue){fixResults[f.id]="manual_skipped";break}}else promptType==="auto"?runAnswer=await prompts5({type:"confirm",name:"fix",message:`Do you want to run the '${chalk22.cyan(f.id)}' migration on your project?`,initial:f.promptDefaultValue??!0},{onCancel:()=>{throw new Error}}):promptType==="notification"&&(runAnswer=await prompts5({type:"confirm",name:"fix",message:"Do you want to continue?",initial:!0},{onCancel:()=>{throw new Error}}));}catch{break}if(promptType==="auto")if(invariant2(runAnswer,"runAnswer must be defined if not promptOnly"),runAnswer.fix)try{invariant2(typeof f.run=="function","run method should be available in fix."),invariant2(mainConfigPath,"Main config path should be defined to run migration."),await f.run({result,packageManager,dryRun,mainConfigPath,skipInstall}),logger21.info(`\u2705 ran ${chalk22.cyan(f.id)} migration`),fixResults[f.id]="succeeded",fixSummary.succeeded.push(f.id);}catch(error){fixResults[f.id]="failed",fixSummary.failed[f.id]=error instanceof Error?error.message:"Failed to run migration",logger21.info(`\u274C error when running ${chalk22.cyan(f.id)} migration`),logger21.info(error),logger21.info();}else fixResults[f.id]="skipped",fixSummary.skipped.push(f.id);}else fixResults[f.id]=fixResults[f.id]||"unnecessary";}return {fixResults,fixSummary}}var exec2=async(command2,options={},{startMessage,errorMessage,dryRun}={})=>{if(startMessage&&logger$1.info(startMessage),dryRun){logger$1.info(`
|
|
521
514
|
> ${command2}
|
|
522
|
-
`);return}return logger$1.info(command2),new Promise((resolve,reject)=>{let child=spawn(command2,{...options,shell:!0,stdio:"pipe"});child.stderr.pipe(process.stdout),child.stdout.pipe(process.stdout),child.on("exit",code=>{code===0?resolve(void 0):(logger$1.error(chalk22.red(`An error occurred while executing: \`${command2}\``)),errorMessage&&logger$1.info(errorMessage),reject(new Error(`command exited with code: ${code}: `)));});})},link=async({target,local,start})=>{let storybookDir=process.cwd();try{if((await fse2.readJSON("package.json")).name!=="@storybook/root")throw new Error}catch{throw new Error("Expected to run link from the root of the storybook monorepo")}let reproDir=target,reproName=basename(target);if(!local){let reprosDir=join(storybookDir,"../storybook-repros");logger$1.info(`Ensuring directory ${reprosDir}`),await fse2.ensureDir(reprosDir),logger$1.info(`Cloning ${target}`),await exec2(`git clone ${target}`,{cwd:reprosDir}),reproName=basename(target,extname(target)),reproDir=join(reprosDir,reproName);}let reproPackageJson=await fse2.readJSON(join(reproDir,"package.json")),version=sync
|
|
515
|
+
`);return}return logger$1.info(command2),new Promise((resolve,reject)=>{let child=spawn(command2,{...options,shell:!0,stdio:"pipe"});child.stderr.pipe(process.stdout),child.stdout.pipe(process.stdout),child.on("exit",code=>{code===0?resolve(void 0):(logger$1.error(chalk22.red(`An error occurred while executing: \`${command2}\``)),errorMessage&&logger$1.info(errorMessage),reject(new Error(`command exited with code: ${code}: `)));});})},link=async({target,local,start})=>{let storybookDir=process.cwd();try{if((await fse2.readJSON("package.json")).name!=="@storybook/root")throw new Error}catch{throw new Error("Expected to run link from the root of the storybook monorepo")}let reproDir=target,reproName=basename(target);if(!local){let reprosDir=join(storybookDir,"../storybook-repros");logger$1.info(`Ensuring directory ${reprosDir}`),await fse2.ensureDir(reprosDir),logger$1.info(`Cloning ${target}`),await exec2(`git clone ${target}`,{cwd:reprosDir}),reproName=basename(target,extname(target)),reproDir=join(reprosDir,reproName);}let reproPackageJson=await fse2.readJSON(join(reproDir,"package.json")),version=sync("yarn",["--version"],{cwd:reproDir,stdio:"pipe",shell:!0}).stdout.toString();if(!/^[2-4]\./.test(version)){logger$1.warn(`\u{1F6A8} Expected yarn 2 or higher in ${reproDir}!`),logger$1.warn(""),logger$1.warn("Please set it up with `yarn set version berry`,"),logger$1.warn(`then link '${reproDir}' with the '--local' flag.`);return}logger$1.info(`Linking ${reproDir}`),await exec2(`yarn link --all --relative ${storybookDir}`,{cwd:reproDir}),logger$1.info(`Installing ${reproName}`),await exec2("yarn install",{cwd:reproDir}),reproPackageJson.devDependencies?.vite||await exec2("yarn add -D webpack-hot-middleware",{cwd:reproDir}),await exec2("yarn add @types/node@22",{cwd:reproDir}),start&&(logger$1.info(`Running ${reproName} storybook`),await exec2("yarn run storybook",{cwd:reproDir}));};var logger23=console;async function migrate(migration,{glob:glob2,dryRun,list,rename,parser,configDir:userSpecifiedConfigDir}){if(list)listCodemods().forEach(key=>logger23.log(key));else if(migration){if(migration==="mdx-to-csf"&&!dryRun){let packageManager=JsPackageManagerFactory.getPackageManager(),[packageJson,storybookVersion]=await Promise.all([packageManager.retrievePackageJson(),getCoercedStorybookVersion(packageManager)]),{configDir:inferredConfigDir,mainConfig:mainConfigPath}=getStorybookInfo(packageJson,userSpecifiedConfigDir),configDir=userSpecifiedConfigDir||inferredConfigDir||".storybook";if(!storybookVersion)throw new Error("Could not determine Storybook version");if(!mainConfigPath)throw new Error("Could not determine main config path");await runFixes({fixes:[mdxToCSF],configDir,mainConfigPath,packageManager,storybookVersion,beforeVersion:storybookVersion,isUpgrade:!1}),await addStorybookBlocksPackage();}await runCodemod(migration,{glob:glob2,dryRun,logger:logger23,rename,parser});}else throw new Error("Migrate: please specify a migration name or --list")}async function addStorybookBlocksPackage(){let packageManager=JsPackageManagerFactory.getPackageManager(),packageJson=await packageManager.retrievePackageJson(),versionToInstall=getStorybookVersionSpecifier(await packageManager.retrievePackageJson());logger23.info('\u2705 Adding "@storybook/blocks" package'),await packageManager.addDependencies({installAsDevDependencies:!0,packageJson},[`@storybook/blocks@${versionToInstall}`]);}var baseTemplates={"cra/default-js":{name:"Create React App Latest (Webpack | JavaScript)",script:`
|
|
523
516
|
npx create-react-app {{beforeDir}} && cd {{beforeDir}} && jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json
|
|
524
517
|
`,expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"],modifications:{mainConfig:config=>({stories:config.getFieldValue(["stories"])?.map(s=>typeof s=="string"?s.replace(/\|(tsx?|ts)\b|\b(tsx?|ts)\|/g,""):s)})}},"cra/default-ts":{name:"Create React App Latest (Webpack | TypeScript)",script:`
|
|
525
518
|
npx create-react-app {{beforeDir}} --template typescript && cd {{beforeDir}} && jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json
|
|
@@ -527,7 +520,7 @@ ${error.stack}`),fixSummary.failed[f.id]=error.message),fixResults[f.id]="check_
|
|
|
527
520
|
npm create vite --yes {{beforeDir}} -- --template react-ts && cd {{beforeDir}} && yarn add react@beta react-dom@beta && jq '.resolutions += {"@types/react": "npm:types-react@beta", "@types/react-dom": "npm:types-react-dom@beta"}' package.json > tmp.json && mv tmp.json package.json && yarn add --dev @types/react@npm:types-react@beta @types/react-dom@npm:types-react-dom@beta
|
|
528
521
|
`,expected:{framework:"@storybook/react-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"react-webpack/18-ts":{name:"React Latest (Webpack | TypeScript)",script:"yarn create webpack5-react {{beforeDir}}",expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"react-webpack/17-ts":{name:"React v17 (Webpack | TypeScript)",script:'yarn create webpack5-react {{beforeDir}} --version-react="17" --version-react-dom="17"',expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"react-webpack/prerelease-ts":{name:"React Prerelease (Webpack | TypeScript)",script:`
|
|
529
522
|
yarn create webpack5-react {{beforeDir}} --version-react="beta" --version-react-dom="beta" && cd {{beforeDir}} && jq '.resolutions += {"@types/react": "npm:types-react@beta", "@types/react-dom": "npm:types-react-dom@beta"}' package.json > tmp.json && mv tmp.json package.json && yarn add --dev @types/react@npm:types-react@beta @types/react-dom@npm:types-react-dom@beta
|
|
530
|
-
`,expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"solid-vite/default-js":{name:"SolidJS Latest (Vite | JavaScript)",script:"npx degit solidjs/templates/js {{beforeDir}}",expected:{framework:"storybook-solidjs-vite",renderer:"storybook-solidjs",builder:"@storybook/builder-vite"},inDevelopment:!0,skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"solid-vite/default-ts":{name:"SolidJS Latest (Vite | TypeScript)",script:"npx degit solidjs/templates/ts {{beforeDir}}",expected:{framework:"storybook-solidjs-vite",renderer:"storybook-solidjs",builder:"@storybook/builder-vite"},inDevelopment:!0,skipTasks:["e2e-tests-dev","bench"]},"vue3-vite/default-js":{name:"Vue v3 (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template vue",expected:{framework:"@storybook/vue3-vite",renderer:"@storybook/vue3",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"vue3-vite/default-ts":{name:"Vue v3 (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template vue-ts",expected:{framework:"@storybook/vue3-vite",renderer:"@storybook/vue3",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"html-webpack/default":{name:"HTML Latest (Webpack | JavaScript)",script:"yarn create webpack5-html {{beforeDir}}",expected:{framework:"@storybook/html-webpack5",renderer:"@storybook/html",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"html-vite/default-js":{name:"HTML Latest (Vite | JavaScript)",script:'npm create vite --yes {{beforeDir}} -- --template vanilla && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/html-vite",renderer:"@storybook/html",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"html-vite/default-ts":{name:"HTML Latest (Vite | TypeScript)",script:'npm create vite --yes {{beforeDir}} -- --template vanilla-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/html-vite",renderer:"@storybook/html",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"svelte-vite/default-js":{name:"Svelte Latest (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template svelte",expected:{framework:"@storybook/svelte-vite",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"svelte-vite/default-ts":{name:"Svelte Latest (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template svelte-ts",expected:{framework:"@storybook/svelte-vite",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["smoke-test","e2e-tests-dev","bench"]},"angular-cli/prerelease":{name:"Angular CLI Prerelease (Webpack | TypeScript)",script:"npx -p @angular/cli@next ng new angular-v16 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn --ssr",expected:{framework:"@storybook/angular",renderer:"@storybook/angular",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"angular-cli/default-ts":{name:"Angular CLI Latest (Webpack | TypeScript)",script:"npx -p @angular/cli ng new angular-latest --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn --ssr",expected:{framework:"@storybook/angular",renderer:"@storybook/angular",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"angular-cli/15-ts":{name:"Angular CLI v15 (Webpack | TypeScript)",script:"npx -p @angular/cli@15 ng new angular-v15 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn",expected:{framework:"@storybook/angular",renderer:"@storybook/angular",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"svelte-kit/skeleton-js":{name:"SvelteKit Latest (Vite | JavaScript)",script:"yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory={{beforeDir}} --template=skeleton --types=null --no-prettier --no-eslint --no-playwright --no-vitest --no-svelte5",expected:{framework:"@storybook/sveltekit",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"svelte-kit/skeleton-ts":{name:"SvelteKit Latest (Vite | TypeScript)",script:"yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory={{beforeDir}} --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest --no-svelte5",expected:{framework:"@storybook/sveltekit",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"svelte-kit/prerelease-ts":{name:"SvelteKit Prerelease (Vite | TypeScript)",script:"yarn create svelte-with-args --name=svelte-kit/prerelease-ts --directory={{beforeDir}} --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest --svelte5",expected:{framework:"@storybook/sveltekit",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"lit-vite/default-js":{name:"Lit Latest (Vite | JavaScript)",script:'npm create vite --yes {{beforeDir}} -- --template lit && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/web-components-vite",renderer:"@storybook/web-components",builder:"@storybook/builder-vite"},skipTasks:["smoke-test","e2e-tests-dev","bench","vitest-integration"]},"lit-vite/default-ts":{name:"Lit Latest (Vite | TypeScript)",script:'npm create vite --yes {{beforeDir}} -- --template lit-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/web-components-vite",renderer:"@storybook/web-components",builder:"@storybook/builder-vite"},skipTasks:["smoke-test","e2e-tests-dev","bench","vitest-integration"]},"vue-cli/default-js":{name:"Vue CLI v3 (Webpack | JavaScript)",script:'npx -p @vue/cli vue create {{beforeDir}} --default --packageManager=yarn --force --merge && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',expected:{framework:"@storybook/vue3-webpack5",renderer:"@storybook/vue3",builder:"@storybook/builder-webpack5"},skipTasks:["smoke-test","e2e-tests-dev","bench","vitest-integration"]},"preact-vite/default-js":{name:"Preact Latest (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template preact",expected:{framework:"@storybook/preact-vite",renderer:"@storybook/preact",builder:"@storybook/builder-vite"},modifications:{extraDependencies:["preact-render-to-string"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"preact-vite/default-ts":{name:"Preact Latest (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template preact-ts",expected:{framework:"@storybook/preact-vite",renderer:"@storybook/preact",builder:"@storybook/builder-vite"},modifications:{extraDependencies:["preact-render-to-string"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"qwik-vite/default-ts":{name:"Qwik CLI Latest (Vite | TypeScript)",script:"npm create qwik playground {{beforeDir}}",inDevelopment:!0,expected:{framework:"storybook-framework-qwik",renderer:"storybook-framework-qwik",builder:"storybook-framework-qwik"},skipTasks:["e2e-tests","e2e-tests-dev","bench","vitest-integration"]},"ember/3-js":{name:"Ember v3 (Webpack | JavaScript)",script:"npx --package ember-cli@3.28.1 ember new {{beforeDir}}",inDevelopment:!0,expected:{framework:"@storybook/ember",renderer:"@storybook/ember",builder:"@storybook/builder-webpack5"}},"ember/default-js":{name:"Ember v4 (Webpack | JavaScript)",script:"npx --package ember-cli@4.12.1 ember new {{beforeDir}} --yarn && cd {{beforeDir}} && yarn add --dev @storybook/ember-cli-storybook && yarn build",inDevelopment:!0,expected:{framework:"@storybook/ember",renderer:"@storybook/ember",builder:"@storybook/builder-webpack5"}}},internalTemplates={"internal/react18-webpack-babel":{name:"React with Babel Latest (Webpack | TypeScript)",script:"yarn create webpack5-react {{beforeDir}}",expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{extraDependencies:["@storybook/addon-webpack5-compiler-babel"],editAddons:addons=>[...addons,"@storybook/addon-webpack5-compiler-babel"].filter(a=>a!=="@storybook/addon-webpack5-compiler-swc")},isInternal:!0,skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"internal/react16-webpack":{name:"React 16 (Webpack | TypeScript)",script:"yarn create webpack5-react {{beforeDir}} --version-react=16 --version-react-dom=16 --version-@types/react=16 --version-@types/react-dom=16",expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"],isInternal:!0},"internal/server-webpack5":{name:"Server Webpack5",script:'yarn init -y && echo "module.exports = {}" > webpack.config.js',expected:{framework:"@storybook/server-webpack5",renderer:"@storybook/server",builder:"@storybook/builder-webpack5"},isInternal:!0,skipTasks:["bench","vitest-integration"]}},benchTemplates={"bench/react-vite-default-ts":{...baseTemplates["react-vite/default-ts"],name:"Bench (react-vite/default-ts)",isInternal:!0,modifications:{skipTemplateStories:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","chromatic","vitest-integration"]},"bench/react-webpack-18-ts":{...baseTemplates["react-webpack/18-ts"],name:"Bench (react-webpack/18-ts)",isInternal:!0,modifications:{skipTemplateStories:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","chromatic","vitest-integration"]},"bench/react-vite-default-ts-nodocs":{...baseTemplates["react-vite/default-ts"],name:"Bench (react-vite/default-ts, no docs)",isInternal:!0,modifications:{skipTemplateStories:!0,disableDocs:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","chromatic","vitest-integration"]},"bench/react-vite-default-ts-test-build":{...baseTemplates["react-vite/default-ts"],name:"Bench (react-vite/default-ts, test-build)",isInternal:!0,modifications:{skipTemplateStories:!0,testBuild:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","vitest-integration"]},"bench/react-webpack-18-ts-test-build":{...baseTemplates["react-webpack/18-ts"],name:"Bench (react-webpack/18-ts, test-build)",isInternal:!0,modifications:{skipTemplateStories:!0,testBuild:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","vitest-integration"]}},allTemplates={...baseTemplates,...internalTemplates,...benchTemplates};var logger24=console,toChoices=c=>({title:allTemplates[c].name,value:c}),sandbox=async({output:outputDirectory,filterValue,init,...options})=>{let selectedConfig=allTemplates[filterValue],templateId=selectedConfig?filterValue:null,{packageManager:pkgMgr}=options,packageManager=JsPackageManagerFactory.getPackageManager({force:pkgMgr}),latestVersion=await packageManager.latestVersion("storybook"),nextVersion=await packageManager.latestVersion("storybook@next").catch(e=>"0.0.0"),currentVersion=versions.storybook,isPrerelease=prerelease(currentVersion),isOutdated=lt(currentVersion,isPrerelease?nextVersion:latestVersion),borderColor=isOutdated?"#FC521F":"#F1618C",downloadType=!isOutdated&&init?"after-storybook":"before-storybook",branch=isPrerelease?"next":"main",messages={welcome:`Creating a Storybook ${chalk22.bold(currentVersion)} sandbox..`,notLatest:chalk22.red(dedent`
|
|
523
|
+
`,expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"solid-vite/default-js":{name:"SolidJS Latest (Vite | JavaScript)",script:"npx degit solidjs/templates/js {{beforeDir}}",expected:{framework:"storybook-solidjs-vite",renderer:"storybook-solidjs",builder:"@storybook/builder-vite"},inDevelopment:!0,skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"solid-vite/default-ts":{name:"SolidJS Latest (Vite | TypeScript)",script:"npx degit solidjs/templates/ts {{beforeDir}}",expected:{framework:"storybook-solidjs-vite",renderer:"storybook-solidjs",builder:"@storybook/builder-vite"},inDevelopment:!0,skipTasks:["e2e-tests-dev","bench"]},"vue3-vite/default-js":{name:"Vue v3 (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template vue",expected:{framework:"@storybook/vue3-vite",renderer:"@storybook/vue3",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"vue3-vite/default-ts":{name:"Vue v3 (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template vue-ts",expected:{framework:"@storybook/vue3-vite",renderer:"@storybook/vue3",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"html-webpack/default":{name:"HTML Latest (Webpack | JavaScript)",script:"yarn create webpack5-html {{beforeDir}}",expected:{framework:"@storybook/html-webpack5",renderer:"@storybook/html",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"html-vite/default-js":{name:"HTML Latest (Vite | JavaScript)",script:'npm create vite --yes {{beforeDir}} -- --template vanilla && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/html-vite",renderer:"@storybook/html",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"html-vite/default-ts":{name:"HTML Latest (Vite | TypeScript)",script:'npm create vite --yes {{beforeDir}} -- --template vanilla-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/html-vite",renderer:"@storybook/html",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"svelte-vite/default-js":{name:"Svelte Latest (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template svelte",expected:{framework:"@storybook/svelte-vite",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"svelte-vite/default-ts":{name:"Svelte Latest (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template svelte-ts",expected:{framework:"@storybook/svelte-vite",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["smoke-test","e2e-tests-dev","bench"]},"angular-cli/prerelease":{name:"Angular CLI Prerelease (Webpack | TypeScript)",script:"npx -p @angular/cli@next ng new angular-v16 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn --ssr",expected:{framework:"@storybook/angular",renderer:"@storybook/angular",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"angular-cli/default-ts":{name:"Angular CLI Latest (Webpack | TypeScript)",script:"npx -p @angular/cli ng new angular-latest --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn --ssr",expected:{framework:"@storybook/angular",renderer:"@storybook/angular",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"angular-cli/15-ts":{name:"Angular CLI v15 (Webpack | TypeScript)",script:"npx -p @angular/cli@15 ng new angular-v15 --directory {{beforeDir}} --routing=true --minimal=true --style=scss --strict --skip-git --skip-install --package-manager=yarn",expected:{framework:"@storybook/angular",renderer:"@storybook/angular",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"svelte-kit/skeleton-js":{name:"SvelteKit Latest (Vite | JavaScript)",script:"yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory={{beforeDir}} --template=skeleton --types=null --no-prettier --no-eslint --no-playwright --no-vitest --no-svelte5",expected:{framework:"@storybook/sveltekit",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"svelte-kit/skeleton-ts":{name:"SvelteKit Latest (Vite | TypeScript)",script:"yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory={{beforeDir}} --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest --no-svelte5",expected:{framework:"@storybook/sveltekit",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"svelte-kit/prerelease-ts":{name:"SvelteKit Prerelease (Vite | TypeScript)",script:"yarn create svelte-with-args --name=svelte-kit/prerelease-ts --directory={{beforeDir}} --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest --svelte5",expected:{framework:"@storybook/sveltekit",renderer:"@storybook/svelte",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"lit-vite/default-js":{name:"Lit Latest (Vite | JavaScript)",script:'npm create vite --yes {{beforeDir}} -- --template lit && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/web-components-vite",renderer:"@storybook/web-components",builder:"@storybook/builder-vite"},skipTasks:["smoke-test","e2e-tests-dev","bench","vitest-integration"]},"lit-vite/default-ts":{name:"Lit Latest (Vite | TypeScript)",script:'npm create vite --yes {{beforeDir}} -- --template lit-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js',expected:{framework:"@storybook/web-components-vite",renderer:"@storybook/web-components",builder:"@storybook/builder-vite"},skipTasks:["smoke-test","e2e-tests-dev","bench","vitest-integration"]},"vue-cli/default-js":{name:"Vue CLI v3 (Webpack | JavaScript)",script:'npx -p @vue/cli vue create {{beforeDir}} --default --packageManager=yarn --force --merge && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',expected:{framework:"@storybook/vue3-webpack5",renderer:"@storybook/vue3",builder:"@storybook/builder-webpack5"},skipTasks:["smoke-test","e2e-tests-dev","bench","vitest-integration"]},"preact-vite/default-js":{name:"Preact Latest (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template preact",expected:{framework:"@storybook/preact-vite",renderer:"@storybook/preact",builder:"@storybook/builder-vite"},modifications:{extraDependencies:["preact-render-to-string"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"preact-vite/default-ts":{name:"Preact Latest (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template preact-ts",expected:{framework:"@storybook/preact-vite",renderer:"@storybook/preact",builder:"@storybook/builder-vite"},modifications:{extraDependencies:["preact-render-to-string"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"qwik-vite/default-ts":{name:"Qwik CLI Latest (Vite | TypeScript)",script:"npm create qwik playground {{beforeDir}}",inDevelopment:!0,expected:{framework:"storybook-framework-qwik",renderer:"storybook-framework-qwik",builder:"storybook-framework-qwik"},skipTasks:["e2e-tests","e2e-tests-dev","bench","vitest-integration"]},"ember/3-js":{name:"Ember v3 (Webpack | JavaScript)",script:"npx --package ember-cli@3.28.1 ember new {{beforeDir}}",inDevelopment:!0,expected:{framework:"@storybook/ember",renderer:"@storybook/ember",builder:"@storybook/builder-webpack5"}},"ember/default-js":{name:"Ember v4 (Webpack | JavaScript)",script:"npx --package ember-cli@4.12.1 ember new {{beforeDir}} --yarn && cd {{beforeDir}} && yarn add --dev @storybook/ember-cli-storybook && yarn build",inDevelopment:!0,expected:{framework:"@storybook/ember",renderer:"@storybook/ember",builder:"@storybook/builder-webpack5"}}},internalTemplates={"internal/react18-webpack-babel":{name:"React with Babel Latest (Webpack | TypeScript)",script:"yarn create webpack5-react {{beforeDir}}",expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{extraDependencies:["@storybook/addon-webpack5-compiler-babel"],editAddons:addons=>[...addons,"@storybook/addon-webpack5-compiler-babel"].filter(a=>a!=="@storybook/addon-webpack5-compiler-swc")},isInternal:!0,skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"internal/react16-webpack":{name:"React 16 (Webpack | TypeScript)",script:"yarn create webpack5-react {{beforeDir}} --version-react=16 --version-react-dom=16 --version-@types/react=16 --version-@types/react-dom=16",expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"],isInternal:!0},"internal/server-webpack5":{name:"Server Webpack5",script:'yarn init -y && echo "module.exports = {}" > webpack.config.js',expected:{framework:"@storybook/server-webpack5",renderer:"@storybook/server",builder:"@storybook/builder-webpack5"},isInternal:!0,skipTasks:["bench","vitest-integration"]}},benchTemplates={"bench/react-vite-default-ts":{...baseTemplates["react-vite/default-ts"],name:"Bench (react-vite/default-ts)",isInternal:!0,modifications:{skipTemplateStories:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","chromatic","vitest-integration"]},"bench/react-webpack-18-ts":{...baseTemplates["react-webpack/18-ts"],name:"Bench (react-webpack/18-ts)",isInternal:!0,modifications:{skipTemplateStories:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","chromatic","vitest-integration"]},"bench/react-vite-default-ts-nodocs":{...baseTemplates["react-vite/default-ts"],name:"Bench (react-vite/default-ts, no docs)",isInternal:!0,modifications:{skipTemplateStories:!0,disableDocs:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","chromatic","vitest-integration"]},"bench/react-vite-default-ts-test-build":{...baseTemplates["react-vite/default-ts"],name:"Bench (react-vite/default-ts, test-build)",isInternal:!0,modifications:{skipTemplateStories:!0,testBuild:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","vitest-integration"]},"bench/react-webpack-18-ts-test-build":{...baseTemplates["react-webpack/18-ts"],name:"Bench (react-webpack/18-ts, test-build)",isInternal:!0,modifications:{skipTemplateStories:!0,testBuild:!0},skipTasks:["e2e-tests-dev","test-runner","test-runner-dev","e2e-tests","vitest-integration"]}},allTemplates={...baseTemplates,...internalTemplates,...benchTemplates};var logger24=console,toChoices=c=>({title:allTemplates[c].name,value:c}),sandbox=async({output:outputDirectory,filterValue,init,...options})=>{let selectedConfig=allTemplates[filterValue],templateId=selectedConfig?filterValue:null,{packageManager:pkgMgr}=options,packageManager=JsPackageManagerFactory.getPackageManager({force:pkgMgr}),latestVersion=await packageManager.latestVersion("storybook"),nextVersion=await packageManager.latestVersion("storybook@next").catch(e=>"0.0.0"),currentVersion=versions.storybook,isPrerelease=prerelease(currentVersion),isOutdated=lt(currentVersion,isPrerelease?nextVersion:latestVersion),borderColor=isOutdated?"#FC521F":"#F1618C",downloadType=!isOutdated&&init?"after-storybook":"before-storybook",branch=isPrerelease?"next":"main",messages={welcome:`Creating a Storybook ${chalk22.bold(currentVersion)} sandbox..`,notLatest:chalk22.red(dedent`
|
|
531
524
|
This version is behind the latest release, which is: ${chalk22.bold(latestVersion)}!
|
|
532
525
|
You likely ran the init command through npx, which can use a locally cached version, to get the latest please run:
|
|
533
526
|
${chalk22.bold("npx storybook@latest sandbox")}
|
|
@@ -576,7 +569,7 @@ ${error.stack}`),fixSummary.failed[f.id]=error.message),fixResults[f.id]="check_
|
|
|
576
569
|
|
|
577
570
|
`,autoblock=async(options,list=blockers())=>{if(list.length===0)return null;logger$1.info("Checking for upgrade blockers...");let faults=(await Promise.all(list.map(async i=>{let{blocker}=await i,result=await blocker.check(options);return result?{id:blocker.id,value:!0,log:blocker.log(options,result)}:!1}))).filter(excludesFalse);if(faults.length>0){let messages={welcome:"Storybook has found potential blockers in your project that need to be resolved before upgrading:",reminder:chalk22.yellow("Fix the above issues and try running the upgrade command again.")};return logger$1.plain(boxen([messages.welcome].concat([`
|
|
578
571
|
|
|
579
|
-
`]).concat([faults.map(i=>i.log).join(segmentDivider2)]).concat([segmentDivider2,messages.reminder]).join(""),{borderStyle:"round",padding:1,borderColor:"#FC521F"})),faults[0].id}return logger$1.plain("No blockers found."),logger$1.line(),null};var versionRegex=/(@storybook\/[^@]+)@(\S+)/,getStorybookVersion=line=>{if(line.startsWith("npm "))return null;let
|
|
572
|
+
`]).concat([faults.map(i=>i.log).join(segmentDivider2)]).concat([segmentDivider2,messages.reminder]).join(""),{borderStyle:"round",padding:1,borderColor:"#FC521F"})),faults[0].id}return logger$1.plain("No blockers found."),logger$1.line(),null};var versionRegex=/(@storybook\/[^@]+)@(\S+)/,getStorybookVersion=line=>{if(line.startsWith("npm "))return null;let match=versionRegex.exec(line);return !match||!clean(match[2])?null:{package:match[1],version:match[2]}},getInstalledStorybookVersion=async packageManager=>{let installations=await packageManager.findInstallations(Object.keys(versions));if(installations)return Object.entries(installations.dependencies)[0]?.[1]?.[0].version},deprecatedPackages=[{minVersion:"6.0.0-alpha.0",url:"https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#60-deprecations",deprecations:["@storybook/addon-notes","@storybook/addon-info","@storybook/addon-contexts","@storybook/addon-options","@storybook/addon-centered"]}],formatPackage=pkg2=>`${pkg2.package}@${pkg2.version}`,warnPackages=pkgs=>pkgs.forEach(pkg2=>logger$1.warn(`- ${formatPackage(pkg2)}`)),checkVersionConsistency=()=>{let storybookPackages=sync("npm",["ls"],{stdio:"pipe",shell:!0}).output.toString().split(`
|
|
580
573
|
`).map(getStorybookVersion).filter(item=>!!item).filter(pkg2=>isCorePackage(pkg2.package));if(!storybookPackages.length){logger$1.warn("No storybook core packages found."),logger$1.warn("'npm ls | grep storybook' can show if multiple versions are installed.");return}storybookPackages.sort((a,b)=>semver.rcompare(a.version,b.version));let latestVersion=storybookPackages[0].version,outdated=storybookPackages.filter(pkg2=>pkg2.version!==latestVersion);outdated.length>0&&(logger$1.warn(`Found ${outdated.length} outdated packages (relative to '${formatPackage(storybookPackages[0])}')`),logger$1.warn("Please make sure your packages are updated to ensure a consistent experience."),warnPackages(outdated)),deprecatedPackages.forEach(({minVersion,url,deprecations})=>{if(semver.gte(latestVersion,minVersion)){let deprecated=storybookPackages.filter(pkg2=>deprecations.includes(pkg2.package));deprecated.length>0&&(logger$1.warn(`Found ${deprecated.length} deprecated packages since ${minVersion}`),logger$1.warn(`See ${url}`),warnPackages(deprecated));}});},doUpgrade=async({skipCheck,packageManager:packageManagerName,dryRun,configDir:userSpecifiedConfigDir,yes,...options})=>{let packageManager=JsPackageManagerFactory.getPackageManager({force:packageManagerName}),beforeVersion=await getInstalledStorybookVersion(packageManager)??"0.0.0",currentCLIVersion=versions.storybook,isCanary=currentCLIVersion.startsWith("0.0.0")||beforeVersion.startsWith("portal:")||beforeVersion.startsWith("workspace:");if(!await hasStorybookDependencies(packageManager))throw new UpgradeStorybookInWrongWorkingDirectory;if(!isCanary&<(currentCLIVersion,beforeVersion))throw new UpgradeStorybookToLowerVersionError({beforeVersion,currentVersion:currentCLIVersion});!isCanary&&eq(currentCLIVersion,beforeVersion)&&logger$1.warn(new UpgradeStorybookToSameVersionError({beforeVersion}).message);let[latestCLIVersionOnNPM,packageJson]=await Promise.all([packageManager.latestVersion("storybook"),packageManager.retrievePackageJson()]),isCLIOutdated=lt(currentCLIVersion,latestCLIVersionOnNPM),isCLIExactLatest=currentCLIVersion===latestCLIVersionOnNPM,isCLIPrerelease=prerelease(currentCLIVersion)!==null,isUpgrade=lt(beforeVersion,currentCLIVersion),borderColor=isCLIOutdated?"#FC521F":"#F1618C",messages={welcome:`Upgrading Storybook from version ${chalk22.bold(beforeVersion)} to version ${chalk22.bold(currentCLIVersion)}..`,notLatest:chalk22.red(dedent`
|
|
581
574
|
This version is behind the latest release, which is: ${chalk22.bold(latestCLIVersionOnNPM)}!
|
|
582
575
|
You likely ran the upgrade command through npx, which can use a locally cached version, to upgrade to the latest version please run:
|
|
@@ -586,5 +579,5 @@ ${error.stack}`),fixSummary.failed[f.id]=error.message),fixResults[f.id]="check_
|
|
|
586
579
|
`),prerelease:chalk22.yellow("This is a pre-release version.")};logger$1.plain(boxen([messages.welcome].concat(isCLIOutdated&&!isCLIPrerelease?[messages.notLatest]:[]).concat(isCLIPrerelease?[messages.prerelease]:[]).join(`
|
|
587
580
|
`),{borderStyle:"round",padding:1,borderColor}));let results,{configDir:inferredConfigDir,mainConfig:mainConfigPath}=getStorybookInfo(packageJson,userSpecifiedConfigDir),configDir=userSpecifiedConfigDir||inferredConfigDir||".storybook",mainConfig=await loadMainConfig({configDir});if(!beforeVersion)throw new UpgradeStorybookUnknownCurrentVersionError;if(!results&&typeof mainConfig!="boolean"&&typeof mainConfigPath<"u"&&!options.force){let blockResult=await autoblock({packageManager,configDir,packageJson,mainConfig,mainConfigPath});blockResult&&(results={preCheckFailure:blockResult});}if(!dryRun&&!results){let toUpgradedDependencies=deps=>Object.keys(deps||{}).filter(dependency=>dependency in versions).map(dependency=>{let char="^";return isCLIOutdated&&(char=""),isCanary&&(char=""),`${dependency}@${char}${versions[dependency]}`}),upgradedDependencies=toUpgradedDependencies(packageJson.dependencies),upgradedDevDependencies=toUpgradedDependencies(packageJson.devDependencies);logger$1.info(`Updating dependencies in ${chalk22.cyan("package.json")}..`),upgradedDependencies.length>0&&await packageManager.addDependencies({installAsDevDependencies:!1,skipInstall:!0,packageJson},upgradedDependencies),upgradedDevDependencies.length>0&&await packageManager.addDependencies({installAsDevDependencies:!0,skipInstall:!0,packageJson},upgradedDevDependencies),await packageManager.installDependencies();}if(!skipCheck&&!results&&mainConfigPath&&(checkVersionConsistency(),results=await automigrate({dryRun,yes,packageManager,configDir,mainConfigPath,beforeVersion,storybookVersion:currentCLIVersion,isUpgrade,isLatest:isCLIExactLatest})),!options.disableTelemetry){let{preCheckFailure,fixResults}=results||{};await telemetry("upgrade",{beforeVersion,afterVersion:currentCLIVersion,...{automigrationResults:preCheckFailure?null:fixResults,automigrationPreCheckFailure:preCheckFailure||null}});}};async function upgrade(options){await withTelemetry("upgrade",{cliOptions:options},()=>doUpgrade(options));}addToGlobalContext("cliVersion",versions.storybook);var pkg=findPackageSync(__dirname);invariant2(pkg,"Failed to find the closest package.json file.");var consoleLogger=console,command=name=>program.command(name).option("--disable-telemetry","Disable sending telemetry data",process.env.STORYBOOK_DISABLE_TELEMETRY&&process.env.STORYBOOK_DISABLE_TELEMETRY!=="false").option("--debug","Get more logs in debug mode",!1).option("--enable-crash-reports","Enable sending crash reports to telemetry data");command("add <addon>").description("Add an addon to your Storybook").option("--package-manager <npm|pnpm|yarn1|yarn2>","Force package manager for installing dependencies").option("-c, --config-dir <dir-name>","Directory where to load Storybook configurations from").option("-s --skip-postinstall","Skip package specific postinstall config modifications").action((addonName,options)=>add(addonName,options));command("remove <addon>").description("Remove an addon from your Storybook").option("--package-manager <npm|pnpm|yarn1|yarn2>","Force package manager for installing dependencies").action((addonName,options)=>withTelemetry("remove",{cliOptions:options},async()=>{await removeAddon(addonName,options),options.disableTelemetry||await telemetry("remove",{addon:addonName,source:"cli"});}));command("upgrade").description(`Upgrade your Storybook packages to v${versions.storybook}`).option("--package-manager <npm|pnpm|yarn1|yarn2>","Force package manager for installing dependencies").option("-y --yes","Skip prompting the user").option("-f --force","force the upgrade, skipping autoblockers").option("-n --dry-run","Only check for upgrades, do not install").option("-s --skip-check","Skip postinstall version and automigration checks").option("-c, --config-dir <dir-name>","Directory where to load Storybook configurations from").action(async options=>upgrade(options).catch(()=>process.exit(1)));command("info").description("Prints debugging information about the local environment").action(async()=>{consoleLogger.log(chalk22.bold(`
|
|
588
581
|
Storybook Environment Info:`));let activePackageManager=(await JsPackageManagerFactory.getPackageManager()).type.replace(/\d/,""),output=await envinfo.run({System:["OS","CPU","Shell"],Binaries:["Node","Yarn","npm","pnpm"],Browsers:["Chrome","Edge","Firefox","Safari"],npmPackages:"{@storybook/*,*storybook*,sb,chromatic}",npmGlobalPackages:"{@storybook/*,*storybook*,sb,chromatic}"}),activePackageManagerLine=output.match(new RegExp(`${activePackageManager}:.*`,"i"));consoleLogger.log(output.replace(activePackageManagerLine,chalk22.bold(`${activePackageManagerLine} <----- active`)));});command("migrate [migration]").description("Run a Storybook codemod migration on your source files").option("-l --list","List available migrations").option("-g --glob <glob>","Glob for files upon which to apply the migration","**/*.js").option("-p --parser <babel | babylon | flow | ts | tsx>","jscodeshift parser").option("-c, --config-dir <dir-name>","Directory where to load Storybook configurations from").option("-n --dry-run","Dry run: verify the migration exists and show the files to which it will be applied").option("-r --rename <from-to>",'Rename suffix of matching files after codemod has been applied, e.g. ".js:.ts"').action((migration,{configDir,glob:glob2,dryRun,list,rename,parser})=>{migrate(migration,{configDir,glob:glob2,dryRun,list,rename,parser}).catch(err=>{logger$1.error(err),process.exit(1);});});command("sandbox [filterValue]").alias("repro").description("Create a sandbox from a set of possible templates").option("-o --output <outDir>","Define an output directory").option("--no-init","Whether to download a template without an initialized Storybook",!1).action((filterValue,options)=>sandbox({filterValue,...options}).catch(e=>{logger$1.error(e),process.exit(1);}));command("link <repo-url-or-directory>").description("Pull down a repro from a URL (or a local directory), link it, and run storybook").option("--local","Link a local directory already in your file system").option("--no-start","Start the storybook",!0).action((target,{local,start})=>link({target,local,start}).catch(e=>{logger$1.error(e),process.exit(1);}));command("automigrate [fixId]").description("Check storybook for incompatibilities or migrations and apply fixes").option("-y --yes","Skip prompting the user").option("-n --dry-run","Only check for fixes, do not actually run them").option("--package-manager <npm|pnpm|yarn1|yarn2>","Force package manager").option("-l --list","List available migrations").option("-c, --config-dir <dir-name>","Directory of Storybook configurations to migrate").option("-s --skip-install","Skip installing deps").option("--renderer <renderer-pkg-name>","The renderer package for the framework Storybook is using.").action(async(fixId,options)=>{await doAutomigrate({fixId,...options}).catch(e=>{logger$1.error(e),process.exit(1);});});command("doctor").description("Check Storybook for known problems and provide suggestions or fixes").option("--package-manager <npm|pnpm|yarn1|yarn2>","Force package manager").option("-c, --config-dir <dir-name>","Directory of Storybook configuration").action(async options=>{await doctor(options).catch(e=>{logger$1.error(e),process.exit(1);});});program.on("command:*",([invalidCmd])=>{consoleLogger.error(` Invalid command: %s.
|
|
589
|
-
See --help for a list of available commands.`,invalidCmd);let suggestion=program.commands.map(cmd=>cmd.
|
|
582
|
+
See --help for a list of available commands.`,invalidCmd);let suggestion=program.commands.map(cmd=>cmd.name()).find(cmd=>leven(cmd,invalidCmd)<3);suggestion&&consoleLogger.info(`
|
|
590
583
|
Did you mean ${suggestion}?`),process.exit(1);});program.usage("<command> [options]").version(String(pkg.version)).parse(process.argv);
|