@embeddable.com/sdk-core 3.12.5 → 3.13.0-next.0

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 (46) hide show
  1. package/lib/index.esm.js +112 -239
  2. package/lib/index.esm.js.map +1 -1
  3. package/loader/custom-esm-loader.mjs +16 -11
  4. package/loader/entryPoint.js +1 -1
  5. package/loader/entryPoint.test.js +1 -1
  6. package/package.json +10 -6
  7. package/src/build.test.ts +4 -0
  8. package/src/build.ts +0 -1
  9. package/src/buildTypes.ts +1 -3
  10. package/src/defineConfig.ts +2 -0
  11. package/src/dev.test.ts +7 -1
  12. package/src/dev.ts +7 -14
  13. package/src/generate.ts +1 -1
  14. package/src/logger.test.ts +16 -4
  15. package/src/login.test.ts +2 -2
  16. package/src/push.test.ts +30 -9
  17. package/src/push.ts +8 -11
  18. package/src/types.d.ts +3 -0
  19. package/src/utils.test.ts +24 -5
  20. package/src/utils.ts +13 -3
  21. package/src/validate.test.ts +5 -0
  22. package/src/validate.ts +1 -1
  23. package/lib/index.js +0 -22612
  24. package/lib/index.js.map +0 -1
  25. package/lib/src/build.d.ts +0 -2
  26. package/lib/src/build.test.d.ts +0 -1
  27. package/lib/src/buildTypes.d.ts +0 -4
  28. package/lib/src/buildTypes.test.d.ts +0 -1
  29. package/lib/src/cleanup.d.ts +0 -16
  30. package/lib/src/cleanup.test.d.ts +0 -1
  31. package/lib/src/createContext.d.ts +0 -23
  32. package/lib/src/credentials.d.ts +0 -2
  33. package/lib/src/defineConfig.d.ts +0 -65
  34. package/lib/src/dev.d.ts +0 -2
  35. package/lib/src/generate.d.ts +0 -2
  36. package/lib/src/globalCleanup.d.ts +0 -2
  37. package/lib/src/index.d.ts +0 -5
  38. package/lib/src/login.d.ts +0 -4
  39. package/lib/src/prepare.d.ts +0 -3
  40. package/lib/src/provideConfig.d.ts +0 -2
  41. package/lib/src/provideConfig.test.d.ts +0 -1
  42. package/lib/src/push.d.ts +0 -26
  43. package/lib/src/utils.d.ts +0 -25
  44. package/lib/src/utils.test.d.ts +0 -1
  45. package/lib/src/validate.d.ts +0 -8
  46. package/lib/src/validate.test.d.ts +0 -1
package/lib/index.esm.js CHANGED
@@ -3,12 +3,14 @@ import { readdir, lstat } from 'node:fs/promises';
3
3
  import * as path from 'node:path';
4
4
  import path__default, { join } from 'node:path';
5
5
  import * as vite from 'vite';
6
+ import ora from 'ora';
6
7
  import 'node:child_process';
7
8
  import * as crypto from 'node:crypto';
8
9
  import * as fs$1 from 'node:fs';
9
10
  import { existsSync } from 'node:fs';
10
11
  import { createNodeLogger, createNodeSys } from '@stencil/core/sys/node';
11
12
  import { loadConfig, createCompiler } from '@stencil/core/compiler';
13
+ import * as sorcery from 'sorcery';
12
14
  import * as os from 'node:os';
13
15
  import * as YAML from 'yaml';
14
16
  import * as url from 'node:url';
@@ -17,18 +19,20 @@ import require$$1 from 'os';
17
19
  import require$$3 from 'http';
18
20
  import require$$4 from 'https';
19
21
  import require$$0$1 from 'url';
20
- import * as require$$2$1 from 'fs';
21
- import require$$2__default, { createReadStream } from 'fs';
22
+ import require$$2$1, { createReadStream } from 'fs';
22
23
  import * as path$1 from 'path';
23
24
  import path__default$1, { basename } from 'path';
24
25
  import axios from 'axios';
25
- import * as archiver from 'archiver';
26
+ import archiver from 'archiver';
26
27
  import { select } from '@inquirer/prompts';
27
28
  import * as http from 'node:http';
28
29
  import { WebSocketServer } from 'ws';
29
30
  import * as chokidar from 'chokidar';
31
+ import minimist from 'minimist';
30
32
  import fg from 'fast-glob';
31
33
  import * as dotenv from 'dotenv';
34
+ import finalhandler from 'finalhandler';
35
+ import serveStatic from 'serve-static';
32
36
  import { stat } from 'fs/promises';
33
37
 
34
38
  var findFiles = async (initialSrcDir, regex) => {
@@ -282,7 +286,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
282
286
  var errorUtil$1;
283
287
  (function (errorUtil) {
284
288
  errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
285
- errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
289
+ errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
286
290
  })(errorUtil$1 || (errorUtil$1 = {}));
287
291
  var ZodFirstPartyTypeKind$1;
288
292
  (function (ZodFirstPartyTypeKind) {
@@ -367,11 +371,9 @@ const getContentHash = (contentString) => {
367
371
  .substring(0, 5);
368
372
  };
369
373
 
370
- const oraP$4 = import('ora');
371
374
  const EMB_TYPE_FILE_REGEX = /^(.*)\.type\.emb\.[jt]s$/;
372
375
  const EMB_OPTIONS_FILE_REGEX = /^(.*)\.options\.emb\.[jt]s$/;
373
376
  var buildTypes = async (ctx) => {
374
- const ora = (await oraP$4).default;
375
377
  const progress = ora("Building types...").start();
376
378
  await generate$1(ctx);
377
379
  await build$1(ctx);
@@ -404,7 +406,7 @@ async function build$1(ctx) {
404
406
  outDir: ctx.client.buildDir,
405
407
  },
406
408
  });
407
- if (!((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)) {
409
+ if (!((_a = ctx.dev) === null || _a === undefined ? undefined : _a.watch)) {
408
410
  const fileContent = await fs.readFile(typesFilePath, "utf8");
409
411
  const fileHash = getContentHash(fileContent);
410
412
  const fileName = `embeddable-types-${fileHash}.js`;
@@ -433,7 +435,6 @@ async function createComponentDir(dir) {
433
435
  await fs.mkdir(dir);
434
436
  }
435
437
 
436
- const sorcery = require("sorcery");
437
438
  const STYLE_IMPORTS_TOKEN = "{{STYLES_IMPORT}}";
438
439
  const RENDER_IMPORT_TOKEN = "{{RENDER_IMPORT}}";
439
440
  // stencil doesn't support dynamic component tag name, so we need to replace it manually
@@ -482,8 +483,8 @@ async function addComponentTagName(filePath, bundleHash) {
482
483
  }
483
484
  async function runStencil(ctx) {
484
485
  var _a, _b;
485
- const logger = ((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.logger) || createNodeLogger();
486
- const sys = ((_b = ctx.dev) === null || _b === void 0 ? void 0 : _b.sys) || createNodeSys({ process });
486
+ const logger = ((_a = ctx.dev) === null || _a === undefined ? undefined : _a.logger) || createNodeLogger();
487
+ const sys = ((_b = ctx.dev) === null || _b === undefined ? undefined : _b.sys) || createNodeSys({ process });
487
488
  const devMode = !!ctx.dev;
488
489
  const isWindows = process.platform === "win32";
489
490
  const validated = await loadConfig({
@@ -529,7 +530,7 @@ async function handleStencilBuildOutput(ctx) {
529
530
  var _a;
530
531
  const entryFilePath = path.resolve(ctx.client.stencilBuild, "embeddable-wrapper.esm.js");
531
532
  let fileName = "embeddable-wrapper.esm.js";
532
- if (!((_a = ctx.dev) === null || _a === void 0 ? void 0 : _a.watch)) {
533
+ if (!((_a = ctx.dev) === null || _a === undefined ? undefined : _a.watch)) {
533
534
  const entryFileContent = await fs.readFile(entryFilePath, "utf8");
534
535
  const fileHash = getContentHash(entryFileContent);
535
536
  fileName = `embeddable-wrapper.esm-${fileHash}.js`;
@@ -561,12 +562,16 @@ async function generateSourceMap(ctx, pluginName) {
561
562
  const CREDENTIALS_DIR = path.resolve(os.homedir(), ".embeddable");
562
563
  const CREDENTIALS_FILE = path.resolve(CREDENTIALS_DIR, "credentials");
563
564
 
564
- const oraP$3 = import('ora');
565
565
  const checkNodeVersion = async () => {
566
- const ora = (await oraP$3).default;
567
566
  const spinner = ora("Checking node version...").start();
568
567
  const [major, minor] = process.versions.node.split(".").map(Number);
569
- const packageJson = await Promise.resolve().then(function () { return _package$1; });
568
+ let packageJson;
569
+ try {
570
+ packageJson = JSON.parse(await fs.readFile(path__default.join(import.meta.dirname, "../package.json"), "utf-8"));
571
+ }
572
+ catch (e) {
573
+ throw new Error("Failed to read package.json of core-sdk");
574
+ }
570
575
  const { engines: { node }, } = packageJson;
571
576
  const [minMajor, minMinor] = node
572
577
  .split(".")
@@ -686,13 +691,13 @@ async function createManifest({ ctx, typesFileName, metaFileName, editorsMetaFil
686
691
  const sdkVersions = getSDKVersions();
687
692
  // identify user's package manager and its version
688
693
  let packageManager = "npm";
689
- if ((_a = process.env.npm_config_user_agent) === null || _a === void 0 ? void 0 : _a.includes("yarn")) {
694
+ if ((_a = process.env.npm_config_user_agent) === null || _a === undefined ? undefined : _a.includes("yarn")) {
690
695
  packageManager = "yarn";
691
696
  }
692
- if ((_b = process.env.npm_config_user_agent) === null || _b === void 0 ? void 0 : _b.includes("pnpm")) {
697
+ if ((_b = process.env.npm_config_user_agent) === null || _b === undefined ? undefined : _b.includes("pnpm")) {
693
698
  packageManager = "pnpm";
694
699
  }
695
- const packageManagerVersion = ((_d = (_c = process.env.npm_config_user_agent) === null || _c === void 0 ? void 0 : _c.match(/(\d+\.\d+\.\d+)/)) === null || _d === void 0 ? void 0 : _d[0]) ||
700
+ const packageManagerVersion = ((_d = (_c = process.env.npm_config_user_agent) === null || _c === undefined ? undefined : _c.match(/(\d+\.\d+\.\d+)/)) === null || _d === undefined ? undefined : _d[0]) ||
696
701
  "unknown";
697
702
  // write manifest file with files with hash
698
703
  const manifest = {
@@ -1277,12 +1282,12 @@ PERFORMANCE OF THIS SOFTWARE.
1277
1282
  ***************************************************************************** */
1278
1283
 
1279
1284
  function __classPrivateFieldGet(receiver, state, kind, f) {
1280
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1285
+ if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
1281
1286
  return state.get(receiver);
1282
1287
  }
1283
1288
 
1284
1289
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
1285
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1290
+ if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1286
1291
  return (state.set(receiver, value)), value;
1287
1292
  }
1288
1293
 
@@ -1294,7 +1299,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
1294
1299
  var errorUtil;
1295
1300
  (function (errorUtil) {
1296
1301
  errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
1297
- errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
1302
+ errorUtil.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
1298
1303
  })(errorUtil || (errorUtil = {}));
1299
1304
 
1300
1305
  var _ZodEnum_cache, _ZodNativeEnum_cache;
@@ -1351,14 +1356,14 @@ function processCreateParams(params) {
1351
1356
  var _a, _b;
1352
1357
  const { message } = params;
1353
1358
  if (iss.code === "invalid_enum_value") {
1354
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
1359
+ return { message: message !== null && message !== undefined ? message : ctx.defaultError };
1355
1360
  }
1356
1361
  if (typeof ctx.data === "undefined") {
1357
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
1362
+ return { message: (_a = message !== null && message !== undefined ? message : required_error) !== null && _a !== undefined ? _a : ctx.defaultError };
1358
1363
  }
1359
1364
  if (iss.code !== "invalid_type")
1360
1365
  return { message: ctx.defaultError };
1361
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
1366
+ return { message: (_b = message !== null && message !== undefined ? message : invalid_type_error) !== null && _b !== undefined ? _b : ctx.defaultError };
1362
1367
  };
1363
1368
  return { errorMap: customMap, description };
1364
1369
  }
@@ -1443,10 +1448,10 @@ class ZodType {
1443
1448
  const ctx = {
1444
1449
  common: {
1445
1450
  issues: [],
1446
- async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
1447
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
1451
+ async: (_a = params === null || params === undefined ? undefined : params.async) !== null && _a !== undefined ? _a : false,
1452
+ contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap,
1448
1453
  },
1449
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
1454
+ path: (params === null || params === undefined ? undefined : params.path) || [],
1450
1455
  schemaErrorMap: this._def.errorMap,
1451
1456
  parent: null,
1452
1457
  data,
@@ -1465,10 +1470,10 @@ class ZodType {
1465
1470
  const ctx = {
1466
1471
  common: {
1467
1472
  issues: [],
1468
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
1473
+ contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap,
1469
1474
  async: true,
1470
1475
  },
1471
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
1476
+ path: (params === null || params === undefined ? undefined : params.path) || [],
1472
1477
  schemaErrorMap: this._def.errorMap,
1473
1478
  parent: null,
1474
1479
  data,
@@ -2040,10 +2045,10 @@ class ZodString extends ZodType {
2040
2045
  }
2041
2046
  return this._addCheck({
2042
2047
  kind: "datetime",
2043
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2044
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
2045
- local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
2046
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
2048
+ precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
2049
+ offset: (_a = options === null || options === undefined ? undefined : options.offset) !== null && _a !== undefined ? _a : false,
2050
+ local: (_b = options === null || options === undefined ? undefined : options.local) !== null && _b !== undefined ? _b : false,
2051
+ ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message),
2047
2052
  });
2048
2053
  }
2049
2054
  date(message) {
@@ -2059,8 +2064,8 @@ class ZodString extends ZodType {
2059
2064
  }
2060
2065
  return this._addCheck({
2061
2066
  kind: "time",
2062
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
2063
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
2067
+ precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
2068
+ ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message),
2064
2069
  });
2065
2070
  }
2066
2071
  duration(message) {
@@ -2077,8 +2082,8 @@ class ZodString extends ZodType {
2077
2082
  return this._addCheck({
2078
2083
  kind: "includes",
2079
2084
  value: value,
2080
- position: options === null || options === void 0 ? void 0 : options.position,
2081
- ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),
2085
+ position: options === null || options === undefined ? undefined : options.position,
2086
+ ...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message),
2082
2087
  });
2083
2088
  }
2084
2089
  startsWith(value, message) {
@@ -2209,7 +2214,7 @@ ZodString.create = (params) => {
2209
2214
  return new ZodString({
2210
2215
  checks: [],
2211
2216
  typeName: ZodFirstPartyTypeKind.ZodString,
2212
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
2217
+ coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
2213
2218
  ...processCreateParams(params),
2214
2219
  });
2215
2220
  };
@@ -2463,7 +2468,7 @@ ZodNumber.create = (params) => {
2463
2468
  return new ZodNumber({
2464
2469
  checks: [],
2465
2470
  typeName: ZodFirstPartyTypeKind.ZodNumber,
2466
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2471
+ coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
2467
2472
  ...processCreateParams(params),
2468
2473
  });
2469
2474
  };
@@ -2636,7 +2641,7 @@ ZodBigInt.create = (params) => {
2636
2641
  return new ZodBigInt({
2637
2642
  checks: [],
2638
2643
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
2639
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
2644
+ coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
2640
2645
  ...processCreateParams(params),
2641
2646
  });
2642
2647
  };
@@ -2661,7 +2666,7 @@ class ZodBoolean extends ZodType {
2661
2666
  ZodBoolean.create = (params) => {
2662
2667
  return new ZodBoolean({
2663
2668
  typeName: ZodFirstPartyTypeKind.ZodBoolean,
2664
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2669
+ coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
2665
2670
  ...processCreateParams(params),
2666
2671
  });
2667
2672
  };
@@ -2771,7 +2776,7 @@ class ZodDate extends ZodType {
2771
2776
  ZodDate.create = (params) => {
2772
2777
  return new ZodDate({
2773
2778
  checks: [],
2774
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2779
+ coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
2775
2780
  typeName: ZodFirstPartyTypeKind.ZodDate,
2776
2781
  ...processCreateParams(params),
2777
2782
  });
@@ -3199,10 +3204,10 @@ class ZodObject extends ZodType {
3199
3204
  ? {
3200
3205
  errorMap: (issue, ctx) => {
3201
3206
  var _a, _b, _c, _d;
3202
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
3207
+ const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === undefined ? undefined : _b.call(_a, issue, ctx).message) !== null && _c !== undefined ? _c : ctx.defaultError;
3203
3208
  if (issue.code === "unrecognized_keys")
3204
3209
  return {
3205
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,
3210
+ message: (_d = errorUtil.errToObj(message).message) !== null && _d !== undefined ? _d : defaultError,
3206
3211
  };
3207
3212
  return {
3208
3213
  message: defaultError,
@@ -4212,7 +4217,7 @@ function createZodEnum(values, params) {
4212
4217
  class ZodEnum extends ZodType {
4213
4218
  constructor() {
4214
4219
  super(...arguments);
4215
- _ZodEnum_cache.set(this, void 0);
4220
+ _ZodEnum_cache.set(this, undefined);
4216
4221
  }
4217
4222
  _parse(input) {
4218
4223
  if (typeof input.data !== "string") {
@@ -4282,7 +4287,7 @@ ZodEnum.create = createZodEnum;
4282
4287
  class ZodNativeEnum extends ZodType {
4283
4288
  constructor() {
4284
4289
  super(...arguments);
4285
- _ZodNativeEnum_cache.set(this, void 0);
4290
+ _ZodNativeEnum_cache.set(this, undefined);
4286
4291
  }
4287
4292
  _parse(input) {
4288
4293
  const nativeEnumValues = util$1.getValidEnumValues(this._def.values);
@@ -4766,7 +4771,7 @@ fatal) {
4766
4771
  : typeof params === "string"
4767
4772
  ? { message: params }
4768
4773
  : params;
4769
- const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
4774
+ const _fatal = (_b = (_a = p.fatal) !== null && _a !== undefined ? _a : fatal) !== null && _b !== undefined ? _b : true;
4770
4775
  const p2 = typeof p === "string" ? { message: p } : p;
4771
4776
  ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
4772
4777
  }
@@ -4985,7 +4990,6 @@ const SECURITY_CONTEXT_FILE_REGEX = /^(.*)\.sc\.ya?ml$/;
4985
4990
  const CLIENT_CONTEXT_FILE_REGEX = /^(.*)\.cc\.ya?ml$/;
4986
4991
  var validate = async (ctx) => {
4987
4992
  checkNodeVersion();
4988
- const ora = (await import('ora')).default;
4989
4993
  const spinnerValidate = ora("Data model validation...").start();
4990
4994
  const cubeFilesList = await findFiles(ctx.client.modelsSrc || ctx.client.srcDir, CUBE_YAML_FILE_REGEX);
4991
4995
  const securityContextFilesList = await findFiles(ctx.client.presetsSrc || ctx.client.srcDir, SECURITY_CONTEXT_FILE_REGEX);
@@ -5132,7 +5136,7 @@ const cubeModelSchema = z
5132
5136
  .array()
5133
5137
  .min(1),
5134
5138
  })
5135
- .refine((data) => data.cubes.every((cube) => { var _a, _b; return ((_a = cube.dimensions) === null || _a === void 0 ? void 0 : _a.length) || ((_b = cube.measures) === null || _b === void 0 ? void 0 : _b.length); }), {
5139
+ .refine((data) => data.cubes.every((cube) => { var _a, _b; return ((_a = cube.dimensions) === null || _a === undefined ? undefined : _a.length) || ((_b = cube.measures) === null || _b === undefined ? undefined : _b.length); }), {
5136
5140
  message: "At least one measure or dimension must be defined",
5137
5141
  path: ["cubes"],
5138
5142
  });
@@ -5209,25 +5213,25 @@ function getAugmentedNamespace(n) {
5209
5213
  return a;
5210
5214
  }
5211
5215
 
5212
- var name$1 = "rollbar";
5213
- var version$1 = "2.26.4";
5214
- var repository$1 = {
5216
+ var name = "rollbar";
5217
+ var version = "2.26.4";
5218
+ var repository = {
5215
5219
  type: "git",
5216
5220
  url: "http://github.com/rollbar/rollbar.js"
5217
5221
  };
5218
- var description$1 = "Effortlessly track and debug errors in your JavaScript applications with Rollbar. This package includes advanced error tracking features and an intuitive interface to help you identify and fix issues more quickly.";
5219
- var keywords$1 = [
5222
+ var description = "Effortlessly track and debug errors in your JavaScript applications with Rollbar. This package includes advanced error tracking features and an intuitive interface to help you identify and fix issues more quickly.";
5223
+ var keywords = [
5220
5224
  "error",
5221
5225
  "tracking",
5222
5226
  "logging",
5223
5227
  "debugging",
5224
5228
  "javascript"
5225
5229
  ];
5226
- var license$1 = "MIT";
5227
- var main$1 = "src/server/rollbar.js";
5230
+ var license = "MIT";
5231
+ var main = "src/server/rollbar.js";
5228
5232
  var browser = "dist/rollbar.umd.min.js";
5229
- var types$1 = "./index.d.ts";
5230
- var dependencies$1 = {
5233
+ var types = "./index.d.ts";
5234
+ var dependencies = {
5231
5235
  async: "~3.2.3",
5232
5236
  "console-polyfill": "0.3.0",
5233
5237
  "error-stack-parser": "^2.0.4",
@@ -5236,7 +5240,7 @@ var dependencies$1 = {
5236
5240
  "request-ip": "~3.3.0",
5237
5241
  "source-map": "^0.5.7"
5238
5242
  };
5239
- var devDependencies$1 = {
5243
+ var devDependencies = {
5240
5244
  "@babel/core": "^7.22.11",
5241
5245
  "babel-eslint": "^10.0.3",
5242
5246
  "babel-loader": "^8.0.4",
@@ -5296,7 +5300,7 @@ var devDependencies$1 = {
5296
5300
  var optionalDependencies = {
5297
5301
  decache: "^3.0.5"
5298
5302
  };
5299
- var scripts$1 = {
5303
+ var scripts = {
5300
5304
  build: "./node_modules/.bin/grunt",
5301
5305
  test: "./node_modules/.bin/grunt test",
5302
5306
  "test-browser": "./node_modules/.bin/grunt test-browser",
@@ -5370,19 +5374,19 @@ var plugins = {
5370
5374
  }
5371
5375
  };
5372
5376
  var require$$2 = {
5373
- name: name$1,
5374
- version: version$1,
5375
- repository: repository$1,
5376
- description: description$1,
5377
- keywords: keywords$1,
5378
- license: license$1,
5379
- main: main$1,
5377
+ name: name,
5378
+ version: version,
5379
+ repository: repository,
5380
+ description: description,
5381
+ keywords: keywords,
5382
+ license: license,
5383
+ main: main,
5380
5384
  browser: browser,
5381
- types: types$1,
5382
- dependencies: dependencies$1,
5383
- devDependencies: devDependencies$1,
5385
+ types: types,
5386
+ dependencies: dependencies,
5387
+ devDependencies: devDependencies,
5384
5388
  optionalDependencies: optionalDependencies,
5385
- scripts: scripts$1,
5389
+ scripts: scripts,
5386
5390
  cdn: cdn,
5387
5391
  defaults: defaults,
5388
5392
  plugins: plugins
@@ -17909,7 +17913,7 @@ function requireStackTrace () {
17909
17913
  hasRequiredStackTrace = 1;
17910
17914
  var SourceMapConsumer = requireSourceMap().SourceMapConsumer;
17911
17915
  var path = path__default$1;
17912
- var fs = require$$2__default;
17916
+ var fs = require$$2$1;
17913
17917
 
17914
17918
  /**
17915
17919
  * Uses Node source-map to map transpiled JS stack locations to original
@@ -18117,7 +18121,7 @@ function requireParser () {
18117
18121
 
18118
18122
  var logger = requireLogger();
18119
18123
  var async = require$$0;
18120
- var fs = require$$2__default;
18124
+ var fs = require$$2$1;
18121
18125
  var lru = requireLruCache();
18122
18126
  var util = require$$4$1;
18123
18127
  var stackTrace = requireStackTrace();
@@ -21372,13 +21376,13 @@ var build = async () => {
21372
21376
  }
21373
21377
  };
21374
21378
 
21375
- const oraP$2 = import('ora');
21379
+ const oraP = import('ora');
21376
21380
  const openP = import('open');
21377
21381
  var login = async () => {
21378
21382
  var _a;
21379
21383
  await initLogger("login");
21380
21384
  const breadcrumbs = [];
21381
- const ora = (await oraP$2).default;
21385
+ const ora = (await oraP).default;
21382
21386
  const authenticationSpinner = ora("Waiting for code verification...").start();
21383
21387
  try {
21384
21388
  const open = (await openP).default;
@@ -21478,11 +21482,11 @@ async function getWorkspaces(ctx, token, workspaceSpinner) {
21478
21482
  return (_a = response.data) === null || _a === void 0 ? void 0 : _a.filter((w) => !w.devWorkspace);
21479
21483
  }
21480
21484
  catch (e) {
21481
- if ((_b = ctx.dev) === null || _b === void 0 ? void 0 : _b.watch) {
21485
+ if ((_b = ctx.dev) === null || _b === undefined ? undefined : _b.watch) {
21482
21486
  workspaceSpinner.stop();
21483
21487
  throw e;
21484
21488
  }
21485
- if (((_c = e.response) === null || _c === void 0 ? void 0 : _c.status) === 401) {
21489
+ if (((_c = e.response) === null || _c === undefined ? undefined : _c.status) === 401) {
21486
21490
  workspaceSpinner.fail('Unauthorized. Please login using "embeddable login" command.');
21487
21491
  }
21488
21492
  else {
@@ -21520,12 +21524,10 @@ async function selectWorkspace(ora, ctx, token) {
21520
21524
  return selectedWorkspace;
21521
21525
  }
21522
21526
 
21523
- const oraP$1 = import('ora');
21524
21527
  // grab cube files
21525
21528
  const CUBE_FILES = /^(.*)\.cube\.(ya?ml|js)$/;
21526
21529
  // grab security context and client context files
21527
21530
  const PRESET_FILES = /^(.*)\.(sc|cc)\.ya?ml$/;
21528
- let ora$1;
21529
21531
  var push = async () => {
21530
21532
  var _a;
21531
21533
  await initLogger("push");
@@ -21539,10 +21541,9 @@ var push = async () => {
21539
21541
  console.error("Build failed or not completed. Please run `embeddable:build` first.");
21540
21542
  process.exit(1);
21541
21543
  }
21542
- ora$1 = (await oraP$1).default;
21543
21544
  const config = await provideConfig();
21544
21545
  if (process.argv.includes("--api-key") || process.argv.includes("-k")) {
21545
- spinnerPushing = ora$1("Using API key...").start();
21546
+ spinnerPushing = ora("Using API key...").start();
21546
21547
  breadcrumbs.push("push by api key");
21547
21548
  await pushByApiKey(config, spinnerPushing);
21548
21549
  spinnerPushing.succeed("Published using API key");
@@ -21550,11 +21551,11 @@ var push = async () => {
21550
21551
  }
21551
21552
  breadcrumbs.push("push by standard login");
21552
21553
  const token = await verify(config);
21553
- spinnerPushing = ora$1()
21554
+ spinnerPushing = ora()
21554
21555
  .start()
21555
21556
  .info("No API Key provided. Standard login will be used.");
21556
21557
  breadcrumbs.push("select workspace");
21557
- const { workspaceId, name: workspaceName } = await selectWorkspace(ora$1, config, token);
21558
+ const { workspaceId, name: workspaceName } = await selectWorkspace(ora, config, token);
21558
21559
  const workspacePreviewUrl = `${config.previewBaseUrl}/workspace/${workspaceId}`;
21559
21560
  breadcrumbs.push("build archive");
21560
21561
  await buildArchive(config);
@@ -21564,10 +21565,10 @@ var push = async () => {
21564
21565
  spinnerPushing.succeed(`Published to ${workspaceName} using ${workspacePreviewUrl}`);
21565
21566
  }
21566
21567
  catch (error) {
21567
- spinnerPushing === null || spinnerPushing === void 0 ? void 0 : spinnerPushing.fail("Publishing failed");
21568
+ spinnerPushing === null || spinnerPushing === undefined ? undefined : spinnerPushing.fail("Publishing failed");
21568
21569
  await logError({ command: "push", breadcrumbs, error });
21569
21570
  await reportErrorToRollbar(error);
21570
- console.log(((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || error);
21571
+ console.log(((_a = error.response) === null || _a === undefined ? undefined : _a.data) || error);
21571
21572
  process.exit(1);
21572
21573
  }
21573
21574
  };
@@ -21608,7 +21609,7 @@ async function verify(ctx) {
21608
21609
  return token;
21609
21610
  }
21610
21611
  async function buildArchive(config) {
21611
- const spinnerArchive = ora$1("Building...").start();
21612
+ const spinnerArchive = ora("Building...").start();
21612
21613
  const cubeFilesList = await findFiles(config.client.modelsSrc || config.client.srcDir, CUBE_FILES);
21613
21614
  const contextFilesList = await findFiles(config.client.presetsSrc || config.client.srcDir, PRESET_FILES);
21614
21615
  // Map the files to include their full filenames
@@ -21618,22 +21619,22 @@ async function buildArchive(config) {
21618
21619
  }
21619
21620
  async function archive(ctx, yamlFiles, isDev = false) {
21620
21621
  const output = fs$1.createWriteStream(ctx.client.archiveFile);
21621
- const _archiver = archiver.create("zip", {
21622
+ const archive = archiver.create("zip", {
21622
21623
  zlib: { level: 9 },
21623
21624
  });
21624
- _archiver.pipe(output);
21625
+ archive.pipe(output);
21625
21626
  if (!isDev) {
21626
- _archiver.directory(ctx.client.buildDir, false);
21627
- _archiver.file(ctx.client.globalCss, {
21627
+ archive.directory(ctx.client.buildDir, false);
21628
+ archive.file(ctx.client.globalCss, {
21628
21629
  name: "global.css",
21629
21630
  });
21630
21631
  }
21631
21632
  for (const fileData of yamlFiles) {
21632
- _archiver.file(fileData[1], {
21633
+ archive.file(fileData[1], {
21633
21634
  name: fileData[0],
21634
21635
  });
21635
21636
  }
21636
- await _archiver.finalize();
21637
+ await archive.finalize();
21637
21638
  return new Promise((resolve, _reject) => {
21638
21639
  output.on("close", resolve);
21639
21640
  });
@@ -21649,7 +21650,7 @@ async function sendBuildByApiKey(ctx, { apiKey, email, message }) {
21649
21650
  form.set("metadata", metadataBlob, "metadata.json");
21650
21651
  const response = await uploadFile(form, `${ctx.pushBaseUrl}/api/v1/bundle/upload`, apiKey);
21651
21652
  await fs.rm(ctx.client.archiveFile);
21652
- return { bundleId: (_a = response.data) === null || _a === void 0 ? void 0 : _a.bundleId, email, message };
21653
+ return { bundleId: (_a = response.data) === null || _a === undefined ? undefined : _a.bundleId, email, message };
21653
21654
  }
21654
21655
  async function sendBuild(ctx, { workspaceId, token }) {
21655
21656
  const { FormData } = await import('formdata-node');
@@ -21671,13 +21672,10 @@ async function uploadFile(formData, url, token) {
21671
21672
  });
21672
21673
  }
21673
21674
 
21674
- const minimist = require("minimist");
21675
21675
  dotenv.config();
21676
- const oraP = import('ora');
21677
21676
  let wss;
21678
21677
  let changedFiles = [];
21679
21678
  let browserWindow = null;
21680
- let ora;
21681
21679
  let previewWorkspace;
21682
21680
  const SERVER_PORT = 8926;
21683
21681
  const BUILD_DEV_DIR = ".embeddable-dev-build";
@@ -21687,7 +21685,6 @@ const buildWebComponent = async (config) => {
21687
21685
  };
21688
21686
  const addToGitingore = async () => {
21689
21687
  try {
21690
- const fs = require("fs").promises;
21691
21688
  const gitignorePath = path$1.resolve(process.cwd(), ".gitignore");
21692
21689
  const gitignoreContent = await fs.readFile(gitignorePath, "utf8");
21693
21690
  if (!gitignoreContent.includes(BUILD_DEV_DIR)) {
@@ -21714,7 +21711,6 @@ var dev = async () => {
21714
21711
  breadcrumbs.push("run dev");
21715
21712
  checkNodeVersion();
21716
21713
  addToGitingore();
21717
- ora = (await oraP).default;
21718
21714
  process.on("warning", (e) => console.warn(e.stack));
21719
21715
  const logger = createNodeLogger();
21720
21716
  const sys = createNodeSys({ process });
@@ -21737,8 +21733,6 @@ var dev = async () => {
21737
21733
  };
21738
21734
  breadcrumbs.push("prepare config");
21739
21735
  await prepare(config);
21740
- const finalhandler = require("finalhandler");
21741
- const serveStatic = require("serve-static");
21742
21736
  const serve = serveStatic(config.client.buildDir);
21743
21737
  let workspacePreparation = ora("Preparing workspace...").start();
21744
21738
  breadcrumbs.push("get preview workspace");
@@ -21758,12 +21752,13 @@ var dev = async () => {
21758
21752
  }
21759
21753
  }
21760
21754
  workspacePreparation.succeed("Workspace is ready");
21761
- const server = http.createServer((request, res) => {
21755
+ const server = http.createServer(async (request, res) => {
21762
21756
  var _a;
21763
21757
  res.setHeader("Access-Control-Allow-Origin", "*");
21764
21758
  res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
21765
21759
  res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization");
21766
21760
  if (request.method === "OPTIONS") {
21761
+ // Respond to OPTIONS requests with just the CORS headers and a 200 status code
21767
21762
  res.writeHead(200);
21768
21763
  res.end();
21769
21764
  return;
@@ -21772,7 +21767,7 @@ var dev = async () => {
21772
21767
  try {
21773
21768
  if ((_a = request.url) === null || _a === void 0 ? void 0 : _a.endsWith(GLOBAL_CSS)) {
21774
21769
  res.writeHead(200, { "Content-Type": "text/css" });
21775
- res.end(require$$2$1.readFileSync(config.client.globalCss));
21770
+ res.end(await fs.readFile(config.client.globalCss));
21776
21771
  return;
21777
21772
  }
21778
21773
  }
@@ -21780,21 +21775,7 @@ var dev = async () => {
21780
21775
  serve(request, res, done);
21781
21776
  });
21782
21777
  wss = new WebSocketServer({ server });
21783
- wss.on("connection", (ws) => {
21784
- console.log("🔌 New WebSocket connection established");
21785
- ws.on("error", (error) => {
21786
- console.error("WebSocket error:", error);
21787
- });
21788
- ws.on("close", () => {
21789
- console.log("WebSocket connection closed");
21790
- });
21791
- });
21792
- wss.on("error", (error) => {
21793
- console.error("WebSocket server error:", error);
21794
- });
21795
21778
  server.listen(SERVER_PORT, async () => {
21796
- console.log(`\n�� Dev server running and ready to connect`);
21797
- console.log("ℹ️ Your app will automatically connect to the dev server when you open the workspace");
21798
21779
  const watchers = [];
21799
21780
  if (sys === null || sys === void 0 ? void 0 : sys.onProcessInterrupt) {
21800
21781
  sys.onProcessInterrupt(async () => await onClose(server, sys, watchers, config));
@@ -21850,7 +21831,7 @@ const configureWatcher = async (watcher, ctx) => {
21850
21831
  changedFiles = [];
21851
21832
  }
21852
21833
  if (e.code === "ERROR") {
21853
- sendMessage("componentsBuildError", { error: (_a = e.error) === null || _a === void 0 ? void 0 : _a.message });
21834
+ sendMessage("componentsBuildError", { error: (_a = e.error) === null || _a === undefined ? undefined : _a.message });
21854
21835
  changedFiles = [];
21855
21836
  }
21856
21837
  });
@@ -21931,7 +21912,7 @@ const sendDataModelsAndContextsChanges = async (ctx) => {
21931
21912
  const onClose = async (server, sys, watchers, config) => {
21932
21913
  server.close();
21933
21914
  wss.close();
21934
- browserWindow === null || browserWindow === void 0 ? void 0 : browserWindow.unref();
21915
+ browserWindow === null || browserWindow === undefined ? undefined : browserWindow.unref();
21935
21916
  for (const watcher of watchers) {
21936
21917
  if (watcher.close) {
21937
21918
  await watcher.close();
@@ -22008,6 +21989,7 @@ var defineConfig = ({ plugins, region = "legacy-US", pushBaseUrl, audienceUrl, a
22008
21989
  throw new Error(`Unsupported region: ${region}. Supported regions are: ${Object.keys(REGION_CONFIGS).join(", ")}`);
22009
21990
  }
22010
21991
  const regionConfig = REGION_CONFIGS[region];
21992
+ const __dirname = import.meta.dirname;
22011
21993
  const coreRoot = path.resolve(__dirname, "..");
22012
21994
  const clientRoot = process.cwd();
22013
21995
  if (!path.isAbsolute(componentsSrc)) {
@@ -22055,126 +22037,17 @@ var defineConfig = ({ plugins, region = "legacy-US", pushBaseUrl, audienceUrl, a
22055
22037
  outputOptions: {
22056
22038
  typesEntryPointFilename: "embeddable-types-entry-point.js",
22057
22039
  },
22058
- pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl : regionConfig.pushBaseUrl,
22059
- audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl : regionConfig.audienceUrl,
22060
- previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl : regionConfig.previewBaseUrl,
22061
- authDomain: authDomain !== null && authDomain !== void 0 ? authDomain : regionConfig.authDomain,
22062
- authClientId: authClientId !== null && authClientId !== void 0 ? authClientId : regionConfig.authClientId,
22063
- applicationEnvironment: applicationEnvironment !== null && applicationEnvironment !== void 0 ? applicationEnvironment : "production",
22064
- rollbarAccessToken: rollbarAccessToken !== null && rollbarAccessToken !== void 0 ? rollbarAccessToken : "5c6028038d844bf1835a0f4db5f55d9e",
22040
+ pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== undefined ? pushBaseUrl : regionConfig.pushBaseUrl,
22041
+ audienceUrl: audienceUrl !== null && audienceUrl !== undefined ? audienceUrl : regionConfig.audienceUrl,
22042
+ previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== undefined ? previewBaseUrl : regionConfig.previewBaseUrl,
22043
+ authDomain: authDomain !== null && authDomain !== undefined ? authDomain : regionConfig.authDomain,
22044
+ authClientId: authClientId !== null && authClientId !== undefined ? authClientId : regionConfig.authClientId,
22045
+ applicationEnvironment: applicationEnvironment !== null && applicationEnvironment !== undefined ? applicationEnvironment : "production",
22046
+ rollbarAccessToken: rollbarAccessToken !== null && rollbarAccessToken !== undefined ? rollbarAccessToken : "5c6028038d844bf1835a0f4db5f55d9e",
22065
22047
  plugins,
22066
22048
  };
22067
22049
  };
22068
22050
 
22069
- var name = "@embeddable.com/sdk-core";
22070
- var version = "3.12.4";
22071
- var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
22072
- var keywords = [
22073
- "embeddable",
22074
- "sdk",
22075
- "web-components"
22076
- ];
22077
- var main = "lib/index.js";
22078
- var module = "lib/index.esm.js";
22079
- var types = "lib/index.d.ts";
22080
- var repository = {
22081
- type: "git",
22082
- url: "git+https://github.com/embeddable-hq/embeddable-sdk.git",
22083
- directory: "packages/core-sdk"
22084
- };
22085
- var scripts = {
22086
- build: "rollup -c",
22087
- test: "vitest run",
22088
- "test:watch": "vitest",
22089
- "license-report": "license-report --output=csv --csvHeaders --fields name --fields link --fields licenseType --fields installedVersion --fields author > license-report-sdk-core-sdk.csv"
22090
- };
22091
- var author = "Embeddable.com <engineering@embeddable.com>";
22092
- var files = [
22093
- "bin/",
22094
- "src/",
22095
- "lib/",
22096
- "loader/",
22097
- "templates/",
22098
- "configs/",
22099
- "certs"
22100
- ];
22101
- var bin = {
22102
- embeddable: "bin/embeddable"
22103
- };
22104
- var engines = {
22105
- node: ">=20.0.0"
22106
- };
22107
- var license = "MIT";
22108
- var dependencies = {
22109
- "@embeddable.com/sdk-utils": "0.6.2",
22110
- "@inquirer/prompts": "^7.2.1",
22111
- "@stencil/core": "^4.23.0",
22112
- "@swc-node/register": "^1.10.9",
22113
- archiver: "^5.3.2",
22114
- axios: "^1.7.9",
22115
- chokidar: "^4.0.3",
22116
- dotenv: "^16.4.7",
22117
- "fast-glob": "^3.3.2",
22118
- finalhandler: "^1.3.1",
22119
- "formdata-node": "^6.0.3",
22120
- minimist: "^1.2.8",
22121
- open: "^9.1.0",
22122
- ora: "^8.1.1",
22123
- "serve-static": "^1.16.2",
22124
- sorcery: "^0.11.1",
22125
- vite: "^5.4.11",
22126
- ws: "^8.18.0",
22127
- yaml: "^2.6.1"
22128
- };
22129
- var devDependencies = {
22130
- "@types/archiver": "^5.3.4",
22131
- "@types/ws": "^8.5.13"
22132
- };
22133
- var _package = {
22134
- name: name,
22135
- version: version,
22136
- description: description,
22137
- keywords: keywords,
22138
- main: main,
22139
- module: module,
22140
- types: types,
22141
- repository: repository,
22142
- scripts: scripts,
22143
- author: author,
22144
- files: files,
22145
- bin: bin,
22146
- engines: engines,
22147
- license: license,
22148
- dependencies: dependencies,
22149
- "lint-staged": {
22150
- "*.{js,ts,json}": [
22151
- "prettier --write"
22152
- ]
22153
- },
22154
- devDependencies: devDependencies
22155
- };
22156
-
22157
- var _package$1 = /*#__PURE__*/Object.freeze({
22158
- __proto__: null,
22159
- author: author,
22160
- bin: bin,
22161
- default: _package,
22162
- dependencies: dependencies,
22163
- description: description,
22164
- devDependencies: devDependencies,
22165
- engines: engines,
22166
- files: files,
22167
- keywords: keywords,
22168
- license: license,
22169
- main: main,
22170
- module: module,
22171
- name: name,
22172
- repository: repository,
22173
- scripts: scripts,
22174
- types: types,
22175
- version: version
22176
- });
22177
-
22178
22051
  var __accessCheck = (obj, member, msg) => {
22179
22052
  if (!member.has(obj))
22180
22053
  throw TypeError("Cannot " + msg);
@@ -22358,7 +22231,7 @@ var _Blob = class _Blob {
22358
22231
  __privateSet(this, _size, __privateGet(this, _size) + (ArrayBuffer.isView(part) ? part.byteLength : part.size));
22359
22232
  __privateGet(this, _parts).push(part);
22360
22233
  }
22361
- const type = options.type === void 0 ? "" : String(options.type);
22234
+ const type = options.type === undefined ? "" : String(options.type);
22362
22235
  __privateSet(this, _type, /^[\x20-\x7E]*$/.test(type) ? type : "");
22363
22236
  }
22364
22237
  static [Symbol.hasInstance](value) {
@@ -22464,7 +22337,7 @@ var File = class extends Blob {
22464
22337
  /**
22465
22338
  * Returns the name of the file referenced by the File object.
22466
22339
  */
22467
- __privateAdd(this, _name, void 0);
22340
+ __privateAdd(this, _name, undefined);
22468
22341
  /**
22469
22342
  * The last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
22470
22343
  */
@@ -22475,7 +22348,7 @@ var File = class extends Blob {
22475
22348
  );
22476
22349
  }
22477
22350
  __privateSet(this, _name, String(name));
22478
- const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified);
22351
+ const lastModified = options.lastModified === undefined ? Date.now() : Number(options.lastModified);
22479
22352
  if (!Number.isNaN(lastModified)) {
22480
22353
  __privateSet(this, _lastModified, lastModified);
22481
22354
  }
@@ -22510,8 +22383,8 @@ _lastModified = new WeakMap();
22510
22383
  var _path, _start;
22511
22384
  var _FileFromPath = class _FileFromPath {
22512
22385
  constructor(input) {
22513
- __privateAdd(this, _path, void 0);
22514
- __privateAdd(this, _start, void 0);
22386
+ __privateAdd(this, _path, undefined);
22387
+ __privateAdd(this, _start, undefined);
22515
22388
  __privateSet(this, _path, input.path);
22516
22389
  __privateSet(this, _start, input.start || 0);
22517
22390
  this.name = basename(__privateGet(this, _path));
@@ -22551,7 +22424,7 @@ var FileFromPath = _FileFromPath;
22551
22424
  function createFileFromPath(path, { mtimeMs, size }, filenameOrOptions, options = {}) {
22552
22425
  let filename;
22553
22426
  if (isObject(filenameOrOptions)) {
22554
- [options, filename] = [filenameOrOptions, void 0];
22427
+ [options, filename] = [filenameOrOptions, undefined];
22555
22428
  } else {
22556
22429
  filename = filenameOrOptions;
22557
22430
  }