storybook 10.1.0-alpha.10 → 10.1.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  5. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  6. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  7. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  8. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  9. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-74YHFU5B.js} +44 -109
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/chunk-BE2DAXKJ.js +2966 -0
  15. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  16. package/dist/_browser-chunks/chunk-EBHB6RPS.js +61 -0
  17. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  18. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  19. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  20. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/{chunk-QMY4G4R2.js → chunk-L4RMQ7D7.js} +17 -64
  26. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  27. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  28. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  29. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  30. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  31. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  32. package/dist/_browser-chunks/chunk-WXP2XJ3O.js +950 -0
  33. package/dist/_browser-chunks/chunk-X3DUQ5RA.js +47 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-RJZASWHL.js → syntaxhighlighter-WKBQ5RC7.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-HA7CYFCK.js → builder-manager-YUOHSIUB.js} +475 -1013
  40. package/dist/_node-chunks/camelcase-JREIL7NV.js +18 -0
  41. package/dist/_node-chunks/{chunk-RMHAL25C.js → chunk-2D2IODUU.js} +88 -228
  42. package/dist/_node-chunks/chunk-2DMESZFJ.js +943 -0
  43. package/dist/_node-chunks/chunk-4FT2DHGE.js +3009 -0
  44. package/dist/_node-chunks/chunk-5HV3B5OP.js +45571 -0
  45. package/dist/_node-chunks/{chunk-OVXB5GGT.js → chunk-5KLIDWFN.js} +292 -688
  46. package/dist/_node-chunks/chunk-A4APXFQ2.js +759 -0
  47. package/dist/_node-chunks/chunk-B6JWY6PC.js +37 -0
  48. package/dist/_node-chunks/chunk-CZ5GHJCC.js +603 -0
  49. package/dist/_node-chunks/chunk-DUXPWBOK.js +61 -0
  50. package/dist/_node-chunks/chunk-DWXTZT3D.js +58 -0
  51. package/dist/_node-chunks/chunk-E5FJS66Z.js +20 -0
  52. package/dist/_node-chunks/chunk-EZWWR7AR.js +936 -0
  53. package/dist/_node-chunks/chunk-FDXFVHIL.js +1114 -0
  54. package/dist/_node-chunks/{chunk-F3XOPI6H.js → chunk-FZLRAH4N.js} +469 -983
  55. package/dist/_node-chunks/chunk-HZG65SU3.js +34 -0
  56. package/dist/_node-chunks/chunk-IXVYNBMD.js +18 -0
  57. package/dist/_node-chunks/chunk-JARUEMEP.js +4523 -0
  58. package/dist/_node-chunks/chunk-LIH7MTP7.js +3214 -0
  59. package/dist/_node-chunks/chunk-N5GIRUP5.js +1047 -0
  60. package/dist/_node-chunks/{chunk-X4XU27M6.js → chunk-NAOYEL54.js} +15 -24
  61. package/dist/_node-chunks/chunk-O5DA7YLO.js +3171 -0
  62. package/dist/_node-chunks/chunk-OP3INKUD.js +54 -0
  63. package/dist/_node-chunks/chunk-QCO2ZM7F.js +209 -0
  64. package/dist/_node-chunks/chunk-QYQIZBS6.js +26 -0
  65. package/dist/_node-chunks/chunk-SEMIAAWG.js +1564 -0
  66. package/dist/_node-chunks/chunk-TS2UUH2J.js +301 -0
  67. package/dist/_node-chunks/chunk-WA6KZQZ2.js +119 -0
  68. package/dist/_node-chunks/{chunk-ZHSCUGNP.js → chunk-WFLWJO24.js} +3799 -7849
  69. package/dist/_node-chunks/chunk-WUXQMQCB.js +72 -0
  70. package/dist/_node-chunks/{chunk-VPR5IBMG.js → chunk-XXPJ7XR3.js} +8 -10
  71. package/dist/_node-chunks/chunk-Y4E6IGQF.js +61 -0
  72. package/dist/_node-chunks/chunk-ZL3AFKRX.js +1029 -0
  73. package/dist/_node-chunks/chunk-ZXSD6L3S.js +756 -0
  74. package/dist/_node-chunks/dist-DS2B5A3J.js +121 -0
  75. package/dist/_node-chunks/globby-6THB7HVX.js +3452 -0
  76. package/dist/_node-chunks/lib-5NKX4YGG.js +366 -0
  77. package/dist/_node-chunks/mdx-N42X6CFJ-ZLT3QOFF.js +14329 -0
  78. package/dist/_node-chunks/p-limit-PDMWNG7W.js +116 -0
  79. package/dist/_node-chunks/plugin-6XMWOGPO.js +123 -0
  80. package/dist/_node-chunks/{plugin-6ZPCS4LI.js → plugin-LTOXVT6A.js} +36 -56
  81. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +46582 -0
  82. package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +92 -0
  83. package/dist/actions/decorator.js +21 -42
  84. package/dist/actions/index.js +3 -3
  85. package/dist/babel/index.d.ts +671 -335
  86. package/dist/babel/index.js +11 -11
  87. package/dist/bin/core.js +592 -1546
  88. package/dist/bin/dispatcher.js +26 -37
  89. package/dist/bin/loader.js +23 -34
  90. package/dist/channels/index.js +98 -234
  91. package/dist/cli/index.js +1951 -5308
  92. package/dist/client-logger/index.js +31 -61
  93. package/dist/common/index.js +20 -20
  94. package/dist/components/index.js +4211 -8586
  95. package/dist/core-events/index.js +2 -66
  96. package/dist/core-server/index.js +3054 -7290
  97. package/dist/core-server/presets/common-manager.css +2 -2
  98. package/dist/core-server/presets/common-manager.js +1806 -3427
  99. package/dist/core-server/presets/common-override-preset.js +31 -60
  100. package/dist/core-server/presets/common-preset.js +434 -924
  101. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +15 -19
  102. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +12 -17
  103. package/dist/csf/index.js +534 -1179
  104. package/dist/csf-tools/index.js +9 -9
  105. package/dist/docs-tools/index.js +6 -6
  106. package/dist/highlight/index.js +2 -2
  107. package/dist/instrumenter/index.js +199 -415
  108. package/dist/manager/globals-runtime.js +24150 -47364
  109. package/dist/manager/globals.js +2 -3
  110. package/dist/manager/runtime.js +3961 -8373
  111. package/dist/manager-api/index.js +1231 -2425
  112. package/dist/manager-errors.d.ts +3 -0
  113. package/dist/manager-errors.js +3 -3
  114. package/dist/node-logger/index.js +1253 -2601
  115. package/dist/preview/globals.js +2 -3
  116. package/dist/preview/runtime.js +10364 -21990
  117. package/dist/preview-api/index.d.ts +67 -68
  118. package/dist/preview-api/index.js +13 -13
  119. package/dist/preview-errors.d.ts +3 -0
  120. package/dist/preview-errors.js +4 -4
  121. package/dist/router/index.js +347 -899
  122. package/dist/server-errors.d.ts +3 -0
  123. package/dist/server-errors.js +10 -10
  124. package/dist/telemetry/index.js +24 -24
  125. package/dist/test/index.js +5860 -11645
  126. package/dist/theming/create.js +4 -4
  127. package/dist/theming/index.d.ts +3363 -2597
  128. package/dist/theming/index.js +490 -1086
  129. package/dist/types/index.js +2 -11
  130. package/dist/viewport/index.js +3 -3
  131. package/package.json +5 -5
  132. package/dist/_browser-chunks/Color-FQNEU7YS.js +0 -1695
  133. package/dist/_browser-chunks/WithTooltip-6NHN2GXF.js +0 -2343
  134. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  135. package/dist/_browser-chunks/chunk-AW46NMGV.js +0 -1308
  136. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  137. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  138. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  139. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  140. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  141. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  142. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  143. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  144. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  145. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  146. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  147. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  148. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  149. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  150. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  151. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  152. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  153. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  154. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  155. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  156. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  157. package/dist/_node-chunks/camelcase-QALD4XFE.js +0 -18
  158. package/dist/_node-chunks/chunk-2XY53ALL.js +0 -420
  159. package/dist/_node-chunks/chunk-3CBQMG2A.js +0 -6712
  160. package/dist/_node-chunks/chunk-3WDAPZYQ.js +0 -28
  161. package/dist/_node-chunks/chunk-4ZB555EJ.js +0 -697
  162. package/dist/_node-chunks/chunk-52DXKXY3.js +0 -4272
  163. package/dist/_node-chunks/chunk-5OVB4A6F.js +0 -69
  164. package/dist/_node-chunks/chunk-AGHGNXGH.js +0 -18
  165. package/dist/_node-chunks/chunk-B23X5ZCK.js +0 -1531
  166. package/dist/_node-chunks/chunk-B2DAHWJK.js +0 -220
  167. package/dist/_node-chunks/chunk-CC4PW5MJ.js +0 -34
  168. package/dist/_node-chunks/chunk-D7NIZELR.js +0 -2256
  169. package/dist/_node-chunks/chunk-DO5Q3H4L.js +0 -1250
  170. package/dist/_node-chunks/chunk-ECK7WVFX.js +0 -304
  171. package/dist/_node-chunks/chunk-EUH3NHXA.js +0 -79
  172. package/dist/_node-chunks/chunk-FOQHPHCV.js +0 -1657
  173. package/dist/_node-chunks/chunk-G6EL47NS.js +0 -111
  174. package/dist/_node-chunks/chunk-GFLS4TJB.js +0 -90
  175. package/dist/_node-chunks/chunk-J3XZKWHE.js +0 -1586
  176. package/dist/_node-chunks/chunk-LE63EHJ5.js +0 -1518
  177. package/dist/_node-chunks/chunk-M47XA42S.js +0 -4741
  178. package/dist/_node-chunks/chunk-OOI74AL3.js +0 -61
  179. package/dist/_node-chunks/chunk-PRJHT3GJ.js +0 -61
  180. package/dist/_node-chunks/chunk-Q52PVUSU.js +0 -101
  181. package/dist/_node-chunks/chunk-SDCF5RNN.js +0 -1198
  182. package/dist/_node-chunks/chunk-UJ5SJ23M.js +0 -5029
  183. package/dist/_node-chunks/chunk-UPHK4ETU.js +0 -64658
  184. package/dist/_node-chunks/chunk-V7VURIPB.js +0 -1544
  185. package/dist/_node-chunks/dist-6TXHNR5C.js +0 -175
  186. package/dist/_node-chunks/globby-PBTV6PX6.js +0 -5222
  187. package/dist/_node-chunks/lib-4RTDZVGX.js +0 -518
  188. package/dist/_node-chunks/mdx-N42X6CFJ-COWEH7KR.js +0 -22017
  189. package/dist/_node-chunks/p-limit-PBVZQOFY.js +0 -168
  190. package/dist/_node-chunks/plugin-EOZKYZAG.js +0 -159
  191. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-35HMSMR5.js +0 -69102
  192. package/dist/_node-chunks/webpack-mock-plugin-GT3MA5E2.js +0 -124
@@ -0,0 +1,366 @@
1
+ import CJS_COMPAT_NODE_URL_57ru1wfqqjv from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_57ru1wfqqjv from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_57ru1wfqqjv from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_57ru1wfqqjv.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_57ru1wfqqjv.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ __commonJS,
14
+ __require,
15
+ __toESM
16
+ } from "./chunk-OP3INKUD.js";
17
+
18
+ // ../node_modules/app-root-dir/lib/index.js
19
+ var require_lib = __commonJS({
20
+ "../node_modules/app-root-dir/lib/index.js"(exports) {
21
+ var GLOBAL_KEY = "app-root-dir", _rootDir;
22
+ exports.get = function() {
23
+ var dir = global[GLOBAL_KEY];
24
+ if (dir)
25
+ return dir;
26
+ if (_rootDir === void 0) {
27
+ var fs2 = __require("fs"), path2 = __require("path"), NODE_MODULES = path2.sep + "node_modules" + path2.sep, cwd = process.cwd(), pos = cwd.indexOf(NODE_MODULES);
28
+ pos !== -1 ? _rootDir = cwd.substring(0, pos) : fs2.existsSync(path2.join(cwd, "package.json")) ? _rootDir = cwd : (pos = __dirname.indexOf(NODE_MODULES), pos === -1 ? _rootDir = path2.normalize(path2.join(__dirname, "..")) : _rootDir = __dirname.substring(0, pos));
29
+ }
30
+ return _rootDir;
31
+ };
32
+ exports.set = function(dir) {
33
+ global[GLOBAL_KEY] = _rootDir = dir;
34
+ };
35
+ }
36
+ });
37
+
38
+ // ../node_modules/dotenv/package.json
39
+ var require_package = __commonJS({
40
+ "../node_modules/dotenv/package.json"(exports, module) {
41
+ module.exports = {
42
+ name: "dotenv",
43
+ version: "16.6.1",
44
+ description: "Loads environment variables from .env file",
45
+ main: "lib/main.js",
46
+ types: "lib/main.d.ts",
47
+ exports: {
48
+ ".": {
49
+ types: "./lib/main.d.ts",
50
+ require: "./lib/main.js",
51
+ default: "./lib/main.js"
52
+ },
53
+ "./config": "./config.js",
54
+ "./config.js": "./config.js",
55
+ "./lib/env-options": "./lib/env-options.js",
56
+ "./lib/env-options.js": "./lib/env-options.js",
57
+ "./lib/cli-options": "./lib/cli-options.js",
58
+ "./lib/cli-options.js": "./lib/cli-options.js",
59
+ "./package.json": "./package.json"
60
+ },
61
+ scripts: {
62
+ "dts-check": "tsc --project tests/types/tsconfig.json",
63
+ lint: "standard",
64
+ pretest: "npm run lint && npm run dts-check",
65
+ test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
66
+ "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
67
+ prerelease: "npm test",
68
+ release: "standard-version"
69
+ },
70
+ repository: {
71
+ type: "git",
72
+ url: "git://github.com/motdotla/dotenv.git"
73
+ },
74
+ homepage: "https://github.com/motdotla/dotenv#readme",
75
+ funding: "https://dotenvx.com",
76
+ keywords: [
77
+ "dotenv",
78
+ "env",
79
+ ".env",
80
+ "environment",
81
+ "variables",
82
+ "config",
83
+ "settings"
84
+ ],
85
+ readmeFilename: "README.md",
86
+ license: "BSD-2-Clause",
87
+ devDependencies: {
88
+ "@types/node": "^18.11.3",
89
+ decache: "^4.6.2",
90
+ sinon: "^14.0.1",
91
+ standard: "^17.0.0",
92
+ "standard-version": "^9.5.0",
93
+ tap: "^19.2.0",
94
+ typescript: "^4.8.4"
95
+ },
96
+ engines: {
97
+ node: ">=12"
98
+ },
99
+ browser: {
100
+ fs: !1
101
+ }
102
+ };
103
+ }
104
+ });
105
+
106
+ // ../node_modules/dotenv/lib/main.js
107
+ var require_main = __commonJS({
108
+ "../node_modules/dotenv/lib/main.js"(exports, module) {
109
+ var fs2 = __require("fs"), path2 = __require("path"), os = __require("os"), crypto = __require("crypto"), packageJson = require_package(), version = packageJson.version, LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
110
+ function parse(src) {
111
+ let obj = {}, lines = src.toString();
112
+ lines = lines.replace(/\r\n?/mg, `
113
+ `);
114
+ let match;
115
+ for (; (match = LINE.exec(lines)) != null; ) {
116
+ let key = match[1], value = match[2] || "";
117
+ value = value.trim();
118
+ let maybeQuote = value[0];
119
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), maybeQuote === '"' && (value = value.replace(/\\n/g, `
120
+ `), value = value.replace(/\\r/g, "\r")), obj[key] = value;
121
+ }
122
+ return obj;
123
+ }
124
+ function _parseVault(options) {
125
+ options = options || {};
126
+ let vaultPath = _vaultPath(options);
127
+ options.path = vaultPath;
128
+ let result = DotenvModule.configDotenv(options);
129
+ if (!result.parsed) {
130
+ let err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
131
+ throw err.code = "MISSING_DATA", err;
132
+ }
133
+ let keys = _dotenvKey(options).split(","), length = keys.length, decrypted;
134
+ for (let i = 0; i < length; i++)
135
+ try {
136
+ let key = keys[i].trim(), attrs = _instructions(result, key);
137
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
138
+ break;
139
+ } catch (error) {
140
+ if (i + 1 >= length)
141
+ throw error;
142
+ }
143
+ return DotenvModule.parse(decrypted);
144
+ }
145
+ function _warn(message) {
146
+ console.log(`[dotenv@${version}][WARN] ${message}`);
147
+ }
148
+ function _debug(message) {
149
+ console.log(`[dotenv@${version}][DEBUG] ${message}`);
150
+ }
151
+ function _log(message) {
152
+ console.log(`[dotenv@${version}] ${message}`);
153
+ }
154
+ function _dotenvKey(options) {
155
+ return options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0 ? options.DOTENV_KEY : process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0 ? process.env.DOTENV_KEY : "";
156
+ }
157
+ function _instructions(result, dotenvKey) {
158
+ let uri;
159
+ try {
160
+ uri = new URL(dotenvKey);
161
+ } catch (error) {
162
+ if (error.code === "ERR_INVALID_URL") {
163
+ let err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
164
+ throw err.code = "INVALID_DOTENV_KEY", err;
165
+ }
166
+ throw error;
167
+ }
168
+ let key = uri.password;
169
+ if (!key) {
170
+ let err = new Error("INVALID_DOTENV_KEY: Missing key part");
171
+ throw err.code = "INVALID_DOTENV_KEY", err;
172
+ }
173
+ let environment = uri.searchParams.get("environment");
174
+ if (!environment) {
175
+ let err = new Error("INVALID_DOTENV_KEY: Missing environment part");
176
+ throw err.code = "INVALID_DOTENV_KEY", err;
177
+ }
178
+ let environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`, ciphertext = result.parsed[environmentKey];
179
+ if (!ciphertext) {
180
+ let err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
181
+ throw err.code = "NOT_FOUND_DOTENV_ENVIRONMENT", err;
182
+ }
183
+ return { ciphertext, key };
184
+ }
185
+ function _vaultPath(options) {
186
+ let possibleVaultPath = null;
187
+ if (options && options.path && options.path.length > 0)
188
+ if (Array.isArray(options.path))
189
+ for (let filepath of options.path)
190
+ fs2.existsSync(filepath) && (possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`);
191
+ else
192
+ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
193
+ else
194
+ possibleVaultPath = path2.resolve(process.cwd(), ".env.vault");
195
+ return fs2.existsSync(possibleVaultPath) ? possibleVaultPath : null;
196
+ }
197
+ function _resolveHome(envPath) {
198
+ return envPath[0] === "~" ? path2.join(os.homedir(), envPath.slice(1)) : envPath;
199
+ }
200
+ function _configVault(options) {
201
+ let debug = !!(options && options.debug), quiet = options && "quiet" in options ? options.quiet : !0;
202
+ (debug || !quiet) && _log("Loading env from encrypted .env.vault");
203
+ let parsed = DotenvModule._parseVault(options), processEnv = process.env;
204
+ return options && options.processEnv != null && (processEnv = options.processEnv), DotenvModule.populate(processEnv, parsed, options), { parsed };
205
+ }
206
+ function configDotenv(options) {
207
+ let dotenvPath = path2.resolve(process.cwd(), ".env"), encoding = "utf8", debug = !!(options && options.debug), quiet = options && "quiet" in options ? options.quiet : !0;
208
+ options && options.encoding ? encoding = options.encoding : debug && _debug("No encoding is specified. UTF-8 is used by default");
209
+ let optionPaths = [dotenvPath];
210
+ if (options && options.path)
211
+ if (!Array.isArray(options.path))
212
+ optionPaths = [_resolveHome(options.path)];
213
+ else {
214
+ optionPaths = [];
215
+ for (let filepath of options.path)
216
+ optionPaths.push(_resolveHome(filepath));
217
+ }
218
+ let lastError, parsedAll = {};
219
+ for (let path3 of optionPaths)
220
+ try {
221
+ let parsed = DotenvModule.parse(fs2.readFileSync(path3, { encoding }));
222
+ DotenvModule.populate(parsedAll, parsed, options);
223
+ } catch (e) {
224
+ debug && _debug(`Failed to load ${path3} ${e.message}`), lastError = e;
225
+ }
226
+ let processEnv = process.env;
227
+ if (options && options.processEnv != null && (processEnv = options.processEnv), DotenvModule.populate(processEnv, parsedAll, options), debug || !quiet) {
228
+ let keysCount = Object.keys(parsedAll).length, shortPaths = [];
229
+ for (let filePath of optionPaths)
230
+ try {
231
+ let relative = path2.relative(process.cwd(), filePath);
232
+ shortPaths.push(relative);
233
+ } catch (e) {
234
+ debug && _debug(`Failed to load ${filePath} ${e.message}`), lastError = e;
235
+ }
236
+ _log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
237
+ }
238
+ return lastError ? { parsed: parsedAll, error: lastError } : { parsed: parsedAll };
239
+ }
240
+ function config(options) {
241
+ if (_dotenvKey(options).length === 0)
242
+ return DotenvModule.configDotenv(options);
243
+ let vaultPath = _vaultPath(options);
244
+ return vaultPath ? DotenvModule._configVault(options) : (_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`), DotenvModule.configDotenv(options));
245
+ }
246
+ function decrypt(encrypted, keyStr) {
247
+ let key = Buffer.from(keyStr.slice(-64), "hex"), ciphertext = Buffer.from(encrypted, "base64"), nonce = ciphertext.subarray(0, 12), authTag = ciphertext.subarray(-16);
248
+ ciphertext = ciphertext.subarray(12, -16);
249
+ try {
250
+ let aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
251
+ return aesgcm.setAuthTag(authTag), `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
252
+ } catch (error) {
253
+ let isRange = error instanceof RangeError, invalidKeyLength = error.message === "Invalid key length", decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
254
+ if (isRange || invalidKeyLength) {
255
+ let err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
256
+ throw err.code = "INVALID_DOTENV_KEY", err;
257
+ } else if (decryptionFailed) {
258
+ let err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
259
+ throw err.code = "DECRYPTION_FAILED", err;
260
+ } else
261
+ throw error;
262
+ }
263
+ }
264
+ function populate(processEnv, parsed, options = {}) {
265
+ let debug = !!(options && options.debug), override = !!(options && options.override);
266
+ if (typeof parsed != "object") {
267
+ let err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
268
+ throw err.code = "OBJECT_REQUIRED", err;
269
+ }
270
+ for (let key of Object.keys(parsed))
271
+ Object.prototype.hasOwnProperty.call(processEnv, key) ? (override === !0 && (processEnv[key] = parsed[key]), debug && _debug(override === !0 ? `"${key}" is already defined and WAS overwritten` : `"${key}" is already defined and was NOT overwritten`)) : processEnv[key] = parsed[key];
272
+ }
273
+ var DotenvModule = {
274
+ configDotenv,
275
+ _configVault,
276
+ _parseVault,
277
+ config,
278
+ decrypt,
279
+ parse,
280
+ populate
281
+ };
282
+ module.exports.configDotenv = DotenvModule.configDotenv;
283
+ module.exports._configVault = DotenvModule._configVault;
284
+ module.exports._parseVault = DotenvModule._parseVault;
285
+ module.exports.config = DotenvModule.config;
286
+ module.exports.decrypt = DotenvModule.decrypt;
287
+ module.exports.parse = DotenvModule.parse;
288
+ module.exports.populate = DotenvModule.populate;
289
+ module.exports = DotenvModule;
290
+ }
291
+ });
292
+
293
+ // ../node_modules/lazy-universal-dotenv/node_modules/dotenv-expand/lib/main.js
294
+ var require_main2 = __commonJS({
295
+ "../node_modules/lazy-universal-dotenv/node_modules/dotenv-expand/lib/main.js"(exports, module) {
296
+ "use strict";
297
+ function _searchLast(str, rgx) {
298
+ let matches = Array.from(str.matchAll(rgx));
299
+ return matches.length > 0 ? matches.slice(-1)[0].index : -1;
300
+ }
301
+ function _interpolate(envValue, environment, config) {
302
+ let lastUnescapedDollarSignIndex = _searchLast(envValue, /(?!(?<=\\))\$/g);
303
+ if (lastUnescapedDollarSignIndex === -1) return envValue;
304
+ let rightMostGroup = envValue.slice(lastUnescapedDollarSignIndex), matchGroup = /((?!(?<=\\))\${?([\w]+)(?::-([^}\\]*))?}?)/, match = rightMostGroup.match(matchGroup);
305
+ if (match != null) {
306
+ let [, group, variableName, defaultValue] = match;
307
+ return _interpolate(
308
+ envValue.replace(
309
+ group,
310
+ environment[variableName] || defaultValue || config.parsed[variableName] || ""
311
+ ),
312
+ environment,
313
+ config
314
+ );
315
+ }
316
+ return envValue;
317
+ }
318
+ function _resolveEscapeSequences(value) {
319
+ return value.replace(/\\\$/g, "$");
320
+ }
321
+ function expand(config) {
322
+ let environment = config.ignoreProcessEnv ? {} : process.env;
323
+ for (let configKey in config.parsed) {
324
+ let value = Object.prototype.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config.parsed[configKey];
325
+ config.parsed[configKey] = _resolveEscapeSequences(
326
+ _interpolate(value, environment, config)
327
+ );
328
+ }
329
+ for (let processKey in config.parsed)
330
+ environment[processKey] = config.parsed[processKey];
331
+ return config;
332
+ }
333
+ module.exports.expand = expand;
334
+ }
335
+ });
336
+
337
+ // ../node_modules/lazy-universal-dotenv/lib/index.mjs
338
+ var import_app_root_dir = __toESM(require_lib(), 1), import_dotenv = __toESM(require_main(), 1), import_dotenv_expand = __toESM(require_main2(), 1);
339
+ import fs from "fs";
340
+ import path from "path";
341
+ var dotEnvBase = path.join(import_app_root_dir.default.get(), ".env");
342
+ function getEnvironment({ nodeEnv, buildTarget } = {}) {
343
+ let raw = {}, stringified = {}, webpack = { "process.env": stringified }, NODE_ENV = typeof nodeEnv > "u" ? process.env.NODE_ENV : nodeEnv, BUILD_TARGET = typeof nodeEnv > "u" ? process.env.BUILD_TARGET : buildTarget;
344
+ return [
345
+ BUILD_TARGET && NODE_ENV && `${dotEnvBase}.${BUILD_TARGET}.${NODE_ENV}.local`,
346
+ BUILD_TARGET && NODE_ENV && `${dotEnvBase}.${BUILD_TARGET}.${NODE_ENV}`,
347
+ BUILD_TARGET && NODE_ENV !== "test" && `${dotEnvBase}.${BUILD_TARGET}.local`,
348
+ BUILD_TARGET && `${dotEnvBase}.${BUILD_TARGET}`,
349
+ NODE_ENV && `${dotEnvBase}.${NODE_ENV}.local`,
350
+ NODE_ENV && `${dotEnvBase}.${NODE_ENV}`,
351
+ NODE_ENV !== "test" && `${dotEnvBase}.local`,
352
+ dotEnvBase
353
+ ].filter(Boolean).forEach((dotenvFile) => {
354
+ if (fs.existsSync(dotenvFile)) {
355
+ let config = import_dotenv.default.config({
356
+ path: dotenvFile
357
+ });
358
+ raw = Object.assign({}, raw, import_dotenv_expand.default.expand(config).parsed);
359
+ }
360
+ }), Object.keys(raw).forEach((key) => {
361
+ stringified[key] = JSON.stringify(raw[key]);
362
+ }), { raw, stringified, webpack };
363
+ }
364
+ export {
365
+ getEnvironment
366
+ };