@forsakringskassan/vite-lib-config 4.3.0 → 4.3.1

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.
@@ -7,7 +7,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __commonJS = (cb, mod) => function __require2() {
10
+ var __commonJS = (cb, mod) => function __require() {
11
11
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
@@ -869,10 +869,10 @@ var require_picocolors = __commonJS({
869
869
  } while (~index);
870
870
  return result + string.substring(cursor);
871
871
  };
872
- var createColors = (enabled = isColorSupported) => {
873
- let f = enabled ? formatter : () => String;
872
+ var createColors = (enabled2 = isColorSupported) => {
873
+ let f = enabled2 ? formatter : () => String;
874
874
  return {
875
- isColorSupported: enabled,
875
+ isColorSupported: enabled2,
876
876
  reset: f("\x1B[0m", "\x1B[0m"),
877
877
  bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
878
878
  dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
@@ -1379,7 +1379,7 @@ var require_parse = __commonJS({
1379
1379
  "node_modules/semver/functions/parse.js"(exports, module) {
1380
1380
  "use strict";
1381
1381
  var SemVer = require_semver();
1382
- var parse = (version3, options, throwErrors = false) => {
1382
+ var parse2 = (version3, options, throwErrors = false) => {
1383
1383
  if (version3 instanceof SemVer) {
1384
1384
  return version3;
1385
1385
  }
@@ -1392,7 +1392,7 @@ var require_parse = __commonJS({
1392
1392
  throw er;
1393
1393
  }
1394
1394
  };
1395
- module.exports = parse;
1395
+ module.exports = parse2;
1396
1396
  }
1397
1397
  });
1398
1398
 
@@ -1400,9 +1400,9 @@ var require_parse = __commonJS({
1400
1400
  var require_valid = __commonJS({
1401
1401
  "node_modules/semver/functions/valid.js"(exports, module) {
1402
1402
  "use strict";
1403
- var parse = require_parse();
1403
+ var parse2 = require_parse();
1404
1404
  var valid = (version3, options) => {
1405
- const v = parse(version3, options);
1405
+ const v = parse2(version3, options);
1406
1406
  return v ? v.version : null;
1407
1407
  };
1408
1408
  module.exports = valid;
@@ -1413,9 +1413,9 @@ var require_valid = __commonJS({
1413
1413
  var require_clean = __commonJS({
1414
1414
  "node_modules/semver/functions/clean.js"(exports, module) {
1415
1415
  "use strict";
1416
- var parse = require_parse();
1416
+ var parse2 = require_parse();
1417
1417
  var clean = (version3, options) => {
1418
- const s = parse(version3.trim().replace(/^[=v]+/, ""), options);
1418
+ const s = parse2(version3.trim().replace(/^[=v]+/, ""), options);
1419
1419
  return s ? s.version : null;
1420
1420
  };
1421
1421
  module.exports = clean;
@@ -1450,10 +1450,10 @@ var require_inc = __commonJS({
1450
1450
  var require_diff = __commonJS({
1451
1451
  "node_modules/semver/functions/diff.js"(exports, module) {
1452
1452
  "use strict";
1453
- var parse = require_parse();
1453
+ var parse2 = require_parse();
1454
1454
  var diff = (version1, version22) => {
1455
- const v1 = parse(version1, null, true);
1456
- const v2 = parse(version22, null, true);
1455
+ const v1 = parse2(version1, null, true);
1456
+ const v2 = parse2(version22, null, true);
1457
1457
  const comparison = v1.compare(v2);
1458
1458
  if (comparison === 0) {
1459
1459
  return null;
@@ -1524,9 +1524,9 @@ var require_patch = __commonJS({
1524
1524
  var require_prerelease = __commonJS({
1525
1525
  "node_modules/semver/functions/prerelease.js"(exports, module) {
1526
1526
  "use strict";
1527
- var parse = require_parse();
1527
+ var parse2 = require_parse();
1528
1528
  var prerelease = (version3, options) => {
1529
- const parsed = parse(version3, options);
1529
+ const parsed = parse2(version3, options);
1530
1530
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
1531
1531
  };
1532
1532
  module.exports = prerelease;
@@ -1712,9 +1712,9 @@ var require_coerce = __commonJS({
1712
1712
  "node_modules/semver/functions/coerce.js"(exports, module) {
1713
1713
  "use strict";
1714
1714
  var SemVer = require_semver();
1715
- var parse = require_parse();
1715
+ var parse2 = require_parse();
1716
1716
  var { safeRe: re, t } = require_re();
1717
- var coerce = (version3, options) => {
1717
+ var coerce2 = (version3, options) => {
1718
1718
  if (version3 instanceof SemVer) {
1719
1719
  return version3;
1720
1720
  }
@@ -1747,9 +1747,9 @@ var require_coerce = __commonJS({
1747
1747
  const patch = match2[4] || "0";
1748
1748
  const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
1749
1749
  const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
1750
- return parse(`${major2}.${minor}.${patch}${prerelease}${build}`, options);
1750
+ return parse2(`${major2}.${minor}.${patch}${prerelease}${build}`, options);
1751
1751
  };
1752
- module.exports = coerce;
1752
+ module.exports = coerce2;
1753
1753
  }
1754
1754
  });
1755
1755
 
@@ -2764,7 +2764,7 @@ var require_semver2 = __commonJS({
2764
2764
  var constants = require_constants();
2765
2765
  var SemVer = require_semver();
2766
2766
  var identifiers = require_identifiers();
2767
- var parse = require_parse();
2767
+ var parse2 = require_parse();
2768
2768
  var valid = require_valid();
2769
2769
  var clean = require_clean();
2770
2770
  var inc = require_inc();
@@ -2786,7 +2786,7 @@ var require_semver2 = __commonJS({
2786
2786
  var gte2 = require_gte();
2787
2787
  var lte2 = require_lte();
2788
2788
  var cmp = require_cmp();
2789
- var coerce = require_coerce();
2789
+ var coerce2 = require_coerce();
2790
2790
  var Comparator = require_comparator();
2791
2791
  var Range = require_range();
2792
2792
  var satisfies = require_satisfies();
@@ -2802,7 +2802,7 @@ var require_semver2 = __commonJS({
2802
2802
  var simplifyRange = require_simplify();
2803
2803
  var subset = require_subset();
2804
2804
  module.exports = {
2805
- parse,
2805
+ parse: parse2,
2806
2806
  valid,
2807
2807
  clean,
2808
2808
  inc,
@@ -2824,7 +2824,7 @@ var require_semver2 = __commonJS({
2824
2824
  gte: gte2,
2825
2825
  lte: lte2,
2826
2826
  cmp,
2827
- coerce,
2827
+ coerce: coerce2,
2828
2828
  Comparator,
2829
2829
  Range,
2830
2830
  satisfies,
@@ -2896,31 +2896,9 @@ function makeRegexIdFilterToMatchWithQuery(input) {
2896
2896
  // node_modules/@vitejs/plugin-vue/dist/index.mjs
2897
2897
  import path from "node:path";
2898
2898
  import crypto from "node:crypto";
2899
- var __create2 = Object.create;
2900
- var __defProp2 = Object.defineProperty;
2901
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
2902
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
2903
- var __getProtoOf2 = Object.getPrototypeOf;
2904
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
2905
- var __commonJS2 = (cb, mod) => function() {
2906
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
2907
- };
2908
- var __copyProps2 = (to, from, except, desc) => {
2909
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames2(from), i = 0, n = keys.length, key; i < n; i++) {
2910
- key = keys[i];
2911
- if (!__hasOwnProp2.call(to, key) && key !== except) __defProp2(to, key, {
2912
- get: ((k) => from[k]).bind(null, key),
2913
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
2914
- });
2915
- }
2916
- return to;
2917
- };
2918
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
2919
- value: mod,
2920
- enumerable: true
2921
- }) : target, mod));
2922
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
2923
- var version = "6.0.2";
2899
+ import { isatty } from "node:tty";
2900
+ import { formatWithOptions, inspect } from "node:util";
2901
+ var version = "6.0.3";
2924
2902
  function resolveCompiler(root) {
2925
2903
  const compiler = tryResolveCompiler(root) || tryResolveCompiler();
2926
2904
  if (!compiler) throw new Error("Failed to resolve vue/compiler-sfc.\n@vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.");
@@ -3076,7 +3054,7 @@ function resolveTemplateCompilerOptions(descriptor, options, filename, ssr) {
3076
3054
  const block = descriptor.template;
3077
3055
  if (!block) return;
3078
3056
  const resolvedScript = getResolvedScript(descriptor, ssr);
3079
- const hasScoped = descriptor.styles.some((s$1) => s$1.scoped);
3057
+ const hasScoped = descriptor.styles.some((s) => s.scoped);
3080
3058
  const { id, cssVars } = descriptor;
3081
3059
  let transformAssetUrls = options.template?.transformAssetUrls;
3082
3060
  let assetUrlOptions;
@@ -3195,22 +3173,22 @@ function canInlineMain(descriptor, options) {
3195
3173
  if (lang === "ts" && options.devServer) return true;
3196
3174
  return false;
3197
3175
  }
3198
- var comma$1 = ",".charCodeAt(0);
3199
- var semicolon$1 = ";".charCodeAt(0);
3200
- var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3201
- var intToChar$1 = new Uint8Array(64);
3202
- var charToInt$1 = new Uint8Array(128);
3203
- for (let i = 0; i < chars$1.length; i++) {
3204
- const c = chars$1.charCodeAt(i);
3205
- intToChar$1[i] = c;
3206
- charToInt$1[c] = i;
3176
+ var comma = ",".charCodeAt(0);
3177
+ var semicolon = ";".charCodeAt(0);
3178
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3179
+ var intToChar = new Uint8Array(64);
3180
+ var charToInt = new Uint8Array(128);
3181
+ for (let i = 0; i < chars.length; i++) {
3182
+ const c = chars.charCodeAt(i);
3183
+ intToChar[i] = c;
3184
+ charToInt[c] = i;
3207
3185
  }
3208
3186
  function decodeInteger(reader, relative) {
3209
3187
  let value = 0;
3210
3188
  let shift = 0;
3211
3189
  let integer = 0;
3212
3190
  do {
3213
- integer = charToInt$1[reader.next()];
3191
+ integer = charToInt[reader.next()];
3214
3192
  value |= (integer & 31) << shift;
3215
3193
  shift += 5;
3216
3194
  } while (integer & 32);
@@ -3219,11 +3197,48 @@ function decodeInteger(reader, relative) {
3219
3197
  if (shouldNegate) value = -2147483648 | -value;
3220
3198
  return relative + value;
3221
3199
  }
3200
+ function encodeInteger(builder, num, relative) {
3201
+ let delta = num - relative;
3202
+ delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
3203
+ do {
3204
+ let clamped = delta & 31;
3205
+ delta >>>= 5;
3206
+ if (delta > 0) clamped |= 32;
3207
+ builder.write(intToChar[clamped]);
3208
+ } while (delta > 0);
3209
+ return num;
3210
+ }
3222
3211
  function hasMoreVlq(reader, max) {
3223
3212
  if (reader.pos >= max) return false;
3224
- return reader.peek() !== comma$1;
3213
+ return reader.peek() !== comma;
3225
3214
  }
3226
- var bufLength$1 = 1024 * 16;
3215
+ var bufLength = 1024 * 16;
3216
+ var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
3217
+ return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
3218
+ } } : { decode(buf) {
3219
+ let out = "";
3220
+ for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
3221
+ return out;
3222
+ } };
3223
+ var StringWriter = class {
3224
+ constructor() {
3225
+ this.pos = 0;
3226
+ this.out = "";
3227
+ this.buffer = new Uint8Array(bufLength);
3228
+ }
3229
+ write(v) {
3230
+ const { buffer } = this;
3231
+ buffer[this.pos++] = v;
3232
+ if (this.pos === bufLength) {
3233
+ this.out += td.decode(buffer);
3234
+ this.pos = 0;
3235
+ }
3236
+ }
3237
+ flush() {
3238
+ const { buffer, out, pos } = this;
3239
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
3240
+ }
3241
+ };
3227
3242
  var StringReader = class {
3228
3243
  constructor(buffer) {
3229
3244
  this.pos = 0;
@@ -3296,6 +3311,31 @@ function sort(line) {
3296
3311
  function sortComparator$1(a, b) {
3297
3312
  return a[0] - b[0];
3298
3313
  }
3314
+ function encode(decoded) {
3315
+ const writer = new StringWriter();
3316
+ let sourcesIndex = 0;
3317
+ let sourceLine = 0;
3318
+ let sourceColumn = 0;
3319
+ let namesIndex = 0;
3320
+ for (let i = 0; i < decoded.length; i++) {
3321
+ const line = decoded[i];
3322
+ if (i > 0) writer.write(semicolon);
3323
+ if (line.length === 0) continue;
3324
+ let genColumn = 0;
3325
+ for (let j = 0; j < line.length; j++) {
3326
+ const segment = line[j];
3327
+ if (j > 0) writer.write(comma);
3328
+ genColumn = encodeInteger(writer, segment[0], genColumn);
3329
+ if (segment.length === 1) continue;
3330
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
3331
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
3332
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
3333
+ if (segment.length === 4) continue;
3334
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
3335
+ }
3336
+ }
3337
+ return writer.flush();
3338
+ }
3299
3339
  var schemeRegex = /^[\w+.-]+:\/\//;
3300
3340
  var urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
3301
3341
  var fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
@@ -3479,18 +3519,18 @@ function memoizedState() {
3479
3519
  lastIndex: -1
3480
3520
  };
3481
3521
  }
3482
- function parse$1(map) {
3522
+ function parse(map) {
3483
3523
  return typeof map === "string" ? JSON.parse(map) : map;
3484
3524
  }
3485
3525
  var TraceMap = class {
3486
3526
  constructor(map, mapUrl) {
3487
3527
  const isString = typeof map === "string";
3488
3528
  if (!isString && map._decodedMemo) return map;
3489
- const parsed = parse$1(map);
3490
- const { version: version$1, file, names, sourceRoot, sources, sourcesContent } = parsed;
3529
+ const parsed = parse(map);
3530
+ const { version: version$1, file, names: names$1, sourceRoot, sources, sourcesContent } = parsed;
3491
3531
  this.version = version$1;
3492
3532
  this.file = file;
3493
- this.names = names || [];
3533
+ this.names = names$1 || [];
3494
3534
  this.sourceRoot = sourceRoot;
3495
3535
  this.sources = sources;
3496
3536
  this.sourcesContent = sourcesContent;
@@ -3520,7 +3560,7 @@ function decodedMappings(map) {
3520
3560
  }
3521
3561
  function eachMapping(map, cb) {
3522
3562
  const decoded = decodedMappings(map);
3523
- const { names, resolvedSources } = map;
3563
+ const { names: names$1, resolvedSources } = map;
3524
3564
  for (let i = 0; i < decoded.length; i++) {
3525
3565
  const line = decoded[i];
3526
3566
  for (let j = 0; j < line.length; j++) {
@@ -3536,7 +3576,7 @@ function eachMapping(map, cb) {
3536
3576
  originalLine = seg[2] + 1;
3537
3577
  originalColumn = seg[3];
3538
3578
  }
3539
- if (seg.length === 5) name = names[seg[4]];
3579
+ if (seg.length === 5) name = names$1[seg[4]];
3540
3580
  cb({
3541
3581
  generatedLine,
3542
3582
  generatedColumn,
@@ -3548,79 +3588,6 @@ function eachMapping(map, cb) {
3548
3588
  }
3549
3589
  }
3550
3590
  }
3551
- var comma = ",".charCodeAt(0);
3552
- var semicolon = ";".charCodeAt(0);
3553
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3554
- var intToChar = new Uint8Array(64);
3555
- var charToInt = new Uint8Array(128);
3556
- for (let i = 0; i < 64; i++) {
3557
- const c = chars.charCodeAt(i);
3558
- intToChar[i] = c;
3559
- charToInt[c] = i;
3560
- }
3561
- function encodeInteger(builder, num, relative) {
3562
- let delta = num - relative;
3563
- delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
3564
- do {
3565
- let clamped = delta & 31;
3566
- delta >>>= 5;
3567
- if (delta > 0) clamped |= 32;
3568
- builder.write(intToChar[clamped]);
3569
- } while (delta > 0);
3570
- return num;
3571
- }
3572
- var bufLength = 1024 * 16;
3573
- var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
3574
- return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
3575
- } } : { decode(buf) {
3576
- let out = "";
3577
- for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
3578
- return out;
3579
- } };
3580
- var StringWriter = class {
3581
- constructor() {
3582
- this.pos = 0;
3583
- this.out = "";
3584
- this.buffer = new Uint8Array(bufLength);
3585
- }
3586
- write(v) {
3587
- const { buffer } = this;
3588
- buffer[this.pos++] = v;
3589
- if (this.pos === bufLength) {
3590
- this.out += td.decode(buffer);
3591
- this.pos = 0;
3592
- }
3593
- }
3594
- flush() {
3595
- const { buffer, out, pos } = this;
3596
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
3597
- }
3598
- };
3599
- function encode(decoded) {
3600
- const writer = new StringWriter();
3601
- let sourcesIndex = 0;
3602
- let sourceLine = 0;
3603
- let sourceColumn = 0;
3604
- let namesIndex = 0;
3605
- for (let i = 0; i < decoded.length; i++) {
3606
- const line = decoded[i];
3607
- if (i > 0) writer.write(semicolon);
3608
- if (line.length === 0) continue;
3609
- let genColumn = 0;
3610
- for (let j = 0; j < line.length; j++) {
3611
- const segment = line[j];
3612
- if (j > 0) writer.write(comma);
3613
- genColumn = encodeInteger(writer, segment[0], genColumn);
3614
- if (segment.length === 1) continue;
3615
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
3616
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
3617
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
3618
- if (segment.length === 4) continue;
3619
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
3620
- }
3621
- }
3622
- return writer.flush();
3623
- }
3624
3591
  var SetArray = class {
3625
3592
  constructor() {
3626
3593
  this._indexes = { __proto__: null };
@@ -3663,12 +3630,12 @@ function addMapping(map, mapping2) {
3663
3630
  return addMappingInternal(false, map, mapping2);
3664
3631
  }
3665
3632
  function toDecodedMap(map) {
3666
- const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList$1 } = cast2(map);
3633
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names$1, _ignoreList: ignoreList$1 } = cast2(map);
3667
3634
  removeEmptyFinalLines(mappings);
3668
3635
  return {
3669
3636
  version: 3,
3670
3637
  file: map.file || void 0,
3671
- names: names.array,
3638
+ names: names$1.array,
3672
3639
  sourceRoot: map.sourceRoot || void 0,
3673
3640
  sources: sources.array,
3674
3641
  sourcesContent,
@@ -3694,7 +3661,7 @@ function fromMap(input) {
3694
3661
  return gen;
3695
3662
  }
3696
3663
  function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
3697
- const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast2(map);
3664
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names$1 } = cast2(map);
3698
3665
  const line = getIndex(mappings, genLine);
3699
3666
  const index = getColumnIndex(line, genColumn);
3700
3667
  if (!source) {
@@ -3704,7 +3671,7 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
3704
3671
  assert(sourceLine);
3705
3672
  assert(sourceColumn);
3706
3673
  const sourcesIndex = put(sources, source);
3707
- const namesIndex = name ? put(names, name) : NO_NAME;
3674
+ const namesIndex = name ? put(names$1, name) : NO_NAME;
3708
3675
  if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
3709
3676
  if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) return;
3710
3677
  return insert(line, index, name ? [
@@ -3760,396 +3727,269 @@ function addMappingInternal(skipable, map, mapping2) {
3760
3727
  assert(original);
3761
3728
  return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
3762
3729
  }
3763
- var require_ms = /* @__PURE__ */ __commonJS2({ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js": ((exports, module) => {
3764
- var s = 1e3;
3765
- var m = s * 60;
3766
- var h = m * 60;
3767
- var d = h * 24;
3768
- var w = d * 7;
3769
- var y = d * 365.25;
3770
- module.exports = function(val, options) {
3771
- options = options || {};
3772
- var type = typeof val;
3773
- if (type === "string" && val.length > 0) return parse(val);
3774
- else if (type === "number" && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
3775
- throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
3776
- };
3777
- function parse(str) {
3778
- str = String(str);
3779
- if (str.length > 100) return;
3780
- var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
3781
- if (!match2) return;
3782
- var n = parseFloat(match2[1]);
3783
- switch ((match2[2] || "ms").toLowerCase()) {
3784
- case "years":
3785
- case "year":
3786
- case "yrs":
3787
- case "yr":
3788
- case "y":
3789
- return n * y;
3790
- case "weeks":
3791
- case "week":
3792
- case "w":
3793
- return n * w;
3794
- case "days":
3795
- case "day":
3796
- case "d":
3797
- return n * d;
3798
- case "hours":
3799
- case "hour":
3800
- case "hrs":
3801
- case "hr":
3802
- case "h":
3803
- return n * h;
3804
- case "minutes":
3805
- case "minute":
3806
- case "mins":
3807
- case "min":
3808
- case "m":
3809
- return n * m;
3810
- case "seconds":
3811
- case "second":
3812
- case "secs":
3813
- case "sec":
3814
- case "s":
3815
- return n * s;
3816
- case "milliseconds":
3817
- case "millisecond":
3818
- case "msecs":
3819
- case "msec":
3820
- case "ms":
3821
- return n;
3822
- default:
3823
- return;
3824
- }
3825
- }
3826
- function fmtShort(ms) {
3827
- var msAbs = Math.abs(ms);
3828
- if (msAbs >= d) return Math.round(ms / d) + "d";
3829
- if (msAbs >= h) return Math.round(ms / h) + "h";
3830
- if (msAbs >= m) return Math.round(ms / m) + "m";
3831
- if (msAbs >= s) return Math.round(ms / s) + "s";
3832
- return ms + "ms";
3833
- }
3834
- function fmtLong(ms) {
3835
- var msAbs = Math.abs(ms);
3836
- if (msAbs >= d) return plural(ms, msAbs, d, "day");
3837
- if (msAbs >= h) return plural(ms, msAbs, h, "hour");
3838
- if (msAbs >= m) return plural(ms, msAbs, m, "minute");
3839
- if (msAbs >= s) return plural(ms, msAbs, s, "second");
3840
- return ms + " ms";
3841
- }
3842
- function plural(ms, msAbs, n, name) {
3843
- var isPlural = msAbs >= n * 1.5;
3844
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
3845
- }
3846
- }) });
3847
- var require_common = /* @__PURE__ */ __commonJS2({ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js": ((exports, module) => {
3848
- function setup(env) {
3849
- createDebug.debug = createDebug;
3850
- createDebug.default = createDebug;
3851
- createDebug.coerce = coerce;
3852
- createDebug.disable = disable;
3853
- createDebug.enable = enable;
3854
- createDebug.enabled = enabled;
3855
- createDebug.humanize = require_ms();
3856
- createDebug.destroy = destroy;
3857
- Object.keys(env).forEach((key) => {
3858
- createDebug[key] = env[key];
3859
- });
3860
- createDebug.names = [];
3861
- createDebug.skips = [];
3862
- createDebug.formatters = {};
3863
- function selectColor(namespace) {
3864
- let hash = 0;
3865
- for (let i = 0; i < namespace.length; i++) {
3866
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
3867
- hash |= 0;
3868
- }
3869
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
3870
- }
3871
- createDebug.selectColor = selectColor;
3872
- function createDebug(namespace) {
3873
- let prevTime;
3874
- let enableOverride = null;
3875
- let namespacesCache;
3876
- let enabledCache;
3877
- function debug$1(...args) {
3878
- if (!debug$1.enabled) return;
3879
- const self = debug$1;
3880
- const curr = Number(/* @__PURE__ */ new Date());
3881
- self.diff = curr - (prevTime || curr);
3882
- self.prev = prevTime;
3883
- self.curr = curr;
3884
- prevTime = curr;
3885
- args[0] = createDebug.coerce(args[0]);
3886
- if (typeof args[0] !== "string") args.unshift("%O");
3887
- let index = 0;
3888
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format) => {
3889
- if (match2 === "%%") return "%";
3890
- index++;
3891
- const formatter = createDebug.formatters[format];
3892
- if (typeof formatter === "function") {
3893
- const val = args[index];
3894
- match2 = formatter.call(self, val);
3895
- args.splice(index, 1);
3896
- index--;
3897
- }
3898
- return match2;
3899
- });
3900
- createDebug.formatArgs.call(self, args);
3901
- (self.log || createDebug.log).apply(self, args);
3902
- }
3903
- debug$1.namespace = namespace;
3904
- debug$1.useColors = createDebug.useColors();
3905
- debug$1.color = createDebug.selectColor(namespace);
3906
- debug$1.extend = extend;
3907
- debug$1.destroy = createDebug.destroy;
3908
- Object.defineProperty(debug$1, "enabled", {
3909
- enumerable: true,
3910
- configurable: false,
3911
- get: () => {
3912
- if (enableOverride !== null) return enableOverride;
3913
- if (namespacesCache !== createDebug.namespaces) {
3914
- namespacesCache = createDebug.namespaces;
3915
- enabledCache = createDebug.enabled(namespace);
3916
- }
3917
- return enabledCache;
3918
- },
3919
- set: (v) => {
3920
- enableOverride = v;
3921
- }
3922
- });
3923
- if (typeof createDebug.init === "function") createDebug.init(debug$1);
3924
- return debug$1;
3925
- }
3926
- function extend(namespace, delimiter) {
3927
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
3928
- newDebug.log = this.log;
3929
- return newDebug;
3930
- }
3931
- function enable(namespaces) {
3932
- createDebug.save(namespaces);
3933
- createDebug.namespaces = namespaces;
3934
- createDebug.names = [];
3935
- createDebug.skips = [];
3936
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
3937
- for (const ns of split) if (ns[0] === "-") createDebug.skips.push(ns.slice(1));
3938
- else createDebug.names.push(ns);
3939
- }
3940
- function matchesTemplate(search, template) {
3941
- let searchIndex = 0;
3942
- let templateIndex = 0;
3943
- let starIndex = -1;
3944
- let matchIndex = 0;
3945
- while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
3946
- starIndex = templateIndex;
3947
- matchIndex = searchIndex;
3948
- templateIndex++;
3949
- } else {
3950
- searchIndex++;
3951
- templateIndex++;
3952
- }
3953
- else if (starIndex !== -1) {
3954
- templateIndex = starIndex + 1;
3955
- matchIndex++;
3956
- searchIndex = matchIndex;
3957
- } else return false;
3958
- while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++;
3959
- return templateIndex === template.length;
3960
- }
3961
- function disable() {
3962
- const namespaces = [...createDebug.names, ...createDebug.skips.map((namespace) => "-" + namespace)].join(",");
3963
- createDebug.enable("");
3964
- return namespaces;
3965
- }
3966
- function enabled(name) {
3967
- for (const skip of createDebug.skips) if (matchesTemplate(name, skip)) return false;
3968
- for (const ns of createDebug.names) if (matchesTemplate(name, ns)) return true;
3969
- return false;
3970
- }
3971
- function coerce(val) {
3972
- if (val instanceof Error) return val.stack || val.message;
3973
- return val;
3974
- }
3975
- function destroy() {
3976
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
3977
- }
3978
- createDebug.enable(createDebug.load());
3979
- return createDebug;
3980
- }
3981
- module.exports = setup;
3982
- }) });
3983
- var require_node = /* @__PURE__ */ __commonJS2({ "../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.js": ((exports, module) => {
3984
- const tty = __require("tty");
3985
- const util = __require("util");
3986
- exports.init = init;
3987
- exports.log = log;
3988
- exports.formatArgs = formatArgs;
3989
- exports.save = save;
3990
- exports.load = load;
3991
- exports.useColors = useColors;
3992
- exports.destroy = util.deprecate(() => {
3993
- }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
3994
- exports.colors = [
3995
- 6,
3996
- 2,
3997
- 3,
3998
- 4,
3999
- 5,
4000
- 1
4001
- ];
4002
- try {
4003
- const supportsColor = __require("supports-color");
4004
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
4005
- 20,
4006
- 21,
4007
- 26,
4008
- 27,
4009
- 32,
4010
- 33,
4011
- 38,
4012
- 39,
4013
- 40,
4014
- 41,
4015
- 42,
4016
- 43,
4017
- 44,
4018
- 45,
4019
- 56,
4020
- 57,
4021
- 62,
4022
- 63,
4023
- 68,
4024
- 69,
4025
- 74,
4026
- 75,
4027
- 76,
4028
- 77,
4029
- 78,
4030
- 79,
4031
- 80,
4032
- 81,
4033
- 92,
4034
- 93,
4035
- 98,
4036
- 99,
4037
- 112,
4038
- 113,
4039
- 128,
4040
- 129,
4041
- 134,
4042
- 135,
4043
- 148,
4044
- 149,
4045
- 160,
4046
- 161,
4047
- 162,
4048
- 163,
4049
- 164,
4050
- 165,
4051
- 166,
4052
- 167,
4053
- 168,
4054
- 169,
4055
- 170,
4056
- 171,
4057
- 172,
4058
- 173,
4059
- 178,
4060
- 179,
4061
- 184,
4062
- 185,
4063
- 196,
4064
- 197,
4065
- 198,
4066
- 199,
4067
- 200,
4068
- 201,
4069
- 202,
4070
- 203,
4071
- 204,
4072
- 205,
4073
- 206,
4074
- 207,
4075
- 208,
4076
- 209,
4077
- 214,
4078
- 215,
4079
- 220,
4080
- 221
4081
- ];
4082
- } catch (error) {
4083
- }
4084
- exports.inspectOpts = Object.keys(process.env).filter((key) => {
4085
- return /^debug_/i.test(key);
4086
- }).reduce((obj, key) => {
4087
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
4088
- return k.toUpperCase();
3730
+ function coerce(value) {
3731
+ if (value instanceof Error) return value.stack || value.message;
3732
+ return value;
3733
+ }
3734
+ function selectColor(colors$1, namespace) {
3735
+ let hash = 0;
3736
+ for (let i = 0; i < namespace.length; i++) {
3737
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
3738
+ hash |= 0;
3739
+ }
3740
+ return colors$1[Math.abs(hash) % colors$1.length];
3741
+ }
3742
+ function matchesTemplate(search, template) {
3743
+ let searchIndex = 0;
3744
+ let templateIndex = 0;
3745
+ let starIndex = -1;
3746
+ let matchIndex = 0;
3747
+ while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
3748
+ starIndex = templateIndex;
3749
+ matchIndex = searchIndex;
3750
+ templateIndex++;
3751
+ } else {
3752
+ searchIndex++;
3753
+ templateIndex++;
3754
+ }
3755
+ else if (starIndex !== -1) {
3756
+ templateIndex = starIndex + 1;
3757
+ matchIndex++;
3758
+ searchIndex = matchIndex;
3759
+ } else return false;
3760
+ while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++;
3761
+ return templateIndex === template.length;
3762
+ }
3763
+ function humanize(value) {
3764
+ if (value >= 1e3) return `${(value / 1e3).toFixed(1)}s`;
3765
+ return `${value}ms`;
3766
+ }
3767
+ var globalNamespaces = "";
3768
+ function createDebug$1(namespace, options) {
3769
+ let prevTime;
3770
+ let enableOverride;
3771
+ let namespacesCache;
3772
+ let enabledCache;
3773
+ const debug$1 = (...args) => {
3774
+ if (!debug$1.enabled) return;
3775
+ const curr = Date.now();
3776
+ const diff = curr - (prevTime || curr);
3777
+ prevTime = curr;
3778
+ args[0] = coerce(args[0]);
3779
+ if (typeof args[0] !== "string") args.unshift("%O");
3780
+ let index = 0;
3781
+ args[0] = args[0].replace(/%([a-z%])/gi, (match2, format) => {
3782
+ if (match2 === "%%") return "%";
3783
+ index++;
3784
+ const formatter = options.formatters[format];
3785
+ if (typeof formatter === "function") {
3786
+ const value = args[index];
3787
+ match2 = formatter.call(debug$1, value);
3788
+ args.splice(index, 1);
3789
+ index--;
3790
+ }
3791
+ return match2;
4089
3792
  });
4090
- let val = process.env[key];
4091
- if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
4092
- else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
4093
- else if (val === "null") val = null;
4094
- else val = Number(val);
4095
- obj[prop] = val;
4096
- return obj;
4097
- }, {});
4098
- function useColors() {
4099
- return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
4100
- }
4101
- function formatArgs(args) {
4102
- const { namespace: name, useColors: useColors$1 } = this;
4103
- if (useColors$1) {
4104
- const c = this.color;
4105
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
4106
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
4107
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
4108
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
4109
- } else args[0] = getDate() + name + " " + args[0];
4110
- }
4111
- function getDate() {
4112
- if (exports.inspectOpts.hideDate) return "";
4113
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
4114
- }
4115
- function log(...args) {
4116
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
4117
- }
4118
- function save(namespaces) {
4119
- if (namespaces) process.env.DEBUG = namespaces;
4120
- else delete process.env.DEBUG;
4121
- }
4122
- function load() {
4123
- return process.env.DEBUG;
4124
- }
4125
- function init(debug$1) {
4126
- debug$1.inspectOpts = {};
4127
- const keys = Object.keys(exports.inspectOpts);
4128
- for (let i = 0; i < keys.length; i++) debug$1.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
4129
- }
4130
- module.exports = require_common()(exports);
4131
- const { formatters } = module.exports;
4132
- formatters.o = function(v) {
4133
- this.inspectOpts.colors = this.useColors;
4134
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
3793
+ options.formatArgs.call(debug$1, diff, args);
3794
+ debug$1.log(...args);
4135
3795
  };
4136
- formatters.O = function(v) {
4137
- this.inspectOpts.colors = this.useColors;
4138
- return util.inspect(v, this.inspectOpts);
3796
+ debug$1.extend = function(namespace$1, delimiter = ":") {
3797
+ return createDebug$1(this.namespace + delimiter + namespace$1, {
3798
+ useColors: this.useColors,
3799
+ color: this.color,
3800
+ formatArgs: this.formatArgs,
3801
+ formatters: this.formatters,
3802
+ inspectOpts: this.inspectOpts,
3803
+ log: this.log,
3804
+ humanize: this.humanize
3805
+ });
4139
3806
  };
4140
- }) });
4141
- var import_node = /* @__PURE__ */ __toESM2(require_node(), 1);
4142
- var debug = (0, import_node.default)("vite:hmr");
3807
+ Object.assign(debug$1, options);
3808
+ debug$1.namespace = namespace;
3809
+ Object.defineProperty(debug$1, "enabled", {
3810
+ enumerable: true,
3811
+ configurable: false,
3812
+ get: () => {
3813
+ if (enableOverride != null) return enableOverride;
3814
+ if (namespacesCache !== globalNamespaces) {
3815
+ namespacesCache = globalNamespaces;
3816
+ enabledCache = enabled(namespace);
3817
+ }
3818
+ return enabledCache;
3819
+ },
3820
+ set: (v) => {
3821
+ enableOverride = v;
3822
+ }
3823
+ });
3824
+ return debug$1;
3825
+ }
3826
+ var names = [];
3827
+ var skips = [];
3828
+ function enable(namespaces$1) {
3829
+ globalNamespaces = namespaces$1;
3830
+ names = [];
3831
+ skips = [];
3832
+ const split = globalNamespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
3833
+ for (const ns of split) if (ns[0] === "-") skips.push(ns.slice(1));
3834
+ else names.push(ns);
3835
+ }
3836
+ function enabled(name) {
3837
+ for (const skip of skips) if (matchesTemplate(name, skip)) return false;
3838
+ for (const ns of names) if (matchesTemplate(name, ns)) return true;
3839
+ return false;
3840
+ }
3841
+ var colors = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
3842
+ 20,
3843
+ 21,
3844
+ 26,
3845
+ 27,
3846
+ 32,
3847
+ 33,
3848
+ 38,
3849
+ 39,
3850
+ 40,
3851
+ 41,
3852
+ 42,
3853
+ 43,
3854
+ 44,
3855
+ 45,
3856
+ 56,
3857
+ 57,
3858
+ 62,
3859
+ 63,
3860
+ 68,
3861
+ 69,
3862
+ 74,
3863
+ 75,
3864
+ 76,
3865
+ 77,
3866
+ 78,
3867
+ 79,
3868
+ 80,
3869
+ 81,
3870
+ 92,
3871
+ 93,
3872
+ 98,
3873
+ 99,
3874
+ 112,
3875
+ 113,
3876
+ 128,
3877
+ 129,
3878
+ 134,
3879
+ 135,
3880
+ 148,
3881
+ 149,
3882
+ 160,
3883
+ 161,
3884
+ 162,
3885
+ 163,
3886
+ 164,
3887
+ 165,
3888
+ 166,
3889
+ 167,
3890
+ 168,
3891
+ 169,
3892
+ 170,
3893
+ 171,
3894
+ 172,
3895
+ 173,
3896
+ 178,
3897
+ 179,
3898
+ 184,
3899
+ 185,
3900
+ 196,
3901
+ 197,
3902
+ 198,
3903
+ 199,
3904
+ 200,
3905
+ 201,
3906
+ 202,
3907
+ 203,
3908
+ 204,
3909
+ 205,
3910
+ 206,
3911
+ 207,
3912
+ 208,
3913
+ 209,
3914
+ 214,
3915
+ 215,
3916
+ 220,
3917
+ 221
3918
+ ] : [
3919
+ 6,
3920
+ 2,
3921
+ 3,
3922
+ 4,
3923
+ 5,
3924
+ 1
3925
+ ];
3926
+ var inspectOpts = Object.keys(process.env).filter((key) => /^debug_/i.test(key)).reduce((obj, key) => {
3927
+ const prop = key.slice(6).toLowerCase().replace(/_([a-z])/g, (_, k) => k.toUpperCase());
3928
+ let value = process.env[key];
3929
+ const lowerCase = typeof value === "string" && value.toLowerCase();
3930
+ if (value === "null") value = null;
3931
+ else if (lowerCase === "yes" || lowerCase === "on" || lowerCase === "true" || lowerCase === "enabled") value = true;
3932
+ else if (lowerCase === "no" || lowerCase === "off" || lowerCase === "false" || lowerCase === "disabled") value = false;
3933
+ else value = Number(value);
3934
+ obj[prop] = value;
3935
+ return obj;
3936
+ }, {});
3937
+ function useColors() {
3938
+ return "colors" in inspectOpts ? Boolean(inspectOpts.colors) : isatty(process.stderr.fd);
3939
+ }
3940
+ function getDate() {
3941
+ if (inspectOpts.hideDate) return "";
3942
+ return `${(/* @__PURE__ */ new Date()).toISOString()} `;
3943
+ }
3944
+ function formatArgs(diff, args) {
3945
+ const { namespace: name, useColors: useColors$1 } = this;
3946
+ if (useColors$1) {
3947
+ const c = this.color;
3948
+ const colorCode = `\x1B[3${c < 8 ? c : `8;5;${c}`}`;
3949
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
3950
+ args[0] = prefix + args[0].split("\n").join(`
3951
+ ${prefix}`);
3952
+ args.push(`${colorCode}m+${this.humanize(diff)}\x1B[0m`);
3953
+ } else args[0] = `${getDate()}${name} ${args[0]}`;
3954
+ }
3955
+ function log(...args) {
3956
+ process.stderr.write(`${formatWithOptions(this.inspectOpts, ...args)}
3957
+ `);
3958
+ }
3959
+ var defaultOptions = {
3960
+ useColors: useColors(),
3961
+ formatArgs,
3962
+ formatters: {
3963
+ o(v) {
3964
+ this.inspectOpts.colors = this.useColors;
3965
+ return inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
3966
+ },
3967
+ O(v) {
3968
+ this.inspectOpts.colors = this.useColors;
3969
+ return inspect(v, this.inspectOpts);
3970
+ }
3971
+ },
3972
+ inspectOpts,
3973
+ log,
3974
+ humanize
3975
+ };
3976
+ function createDebug(namespace, options) {
3977
+ var _ref;
3978
+ const color = (_ref = options && options.color) !== null && _ref !== void 0 ? _ref : selectColor(colors, namespace);
3979
+ return createDebug$1(namespace, Object.assign(defaultOptions, { color }, options));
3980
+ }
3981
+ enable(process.env.DEBUG || "");
3982
+ var debug = createDebug("vite:hmr");
4143
3983
  async function handleHotUpdate({ file, modules, read }, options, customElement, typeDepModules) {
4144
3984
  const prevDescriptor = getDescriptor(file, options, false, true);
4145
3985
  if (!prevDescriptor) return;
4146
3986
  const { descriptor } = createDescriptor(file, await read(), options, true);
4147
3987
  let needRerender = false;
4148
- const nonJsModules = modules.filter((m$1) => m$1.type !== "js");
4149
- const jsModules = modules.filter((m$1) => m$1.type === "js");
3988
+ const nonJsModules = modules.filter((m) => m.type !== "js");
3989
+ const jsModules = modules.filter((m) => m.type === "js");
4150
3990
  const affectedModules = new Set(nonJsModules);
4151
3991
  const mainModule = getMainModule(jsModules);
4152
- const templateModule = jsModules.find((m$1) => /type=template/.test(m$1.url));
3992
+ const templateModule = jsModules.find((m) => /type=template/.test(m.url));
4153
3993
  resolveScript(descriptor, options, false, customElement);
4154
3994
  const scriptChanged = hasScriptChanged(prevDescriptor, descriptor);
4155
3995
  if (scriptChanged) affectedModules.add(getScriptModule(jsModules) || mainModule);
@@ -4162,7 +4002,7 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
4162
4002
  const prevStyles = prevDescriptor.styles || [];
4163
4003
  const nextStyles = descriptor.styles || [];
4164
4004
  if (prevDescriptor.cssVars.join("") !== descriptor.cssVars.join("")) affectedModules.add(mainModule);
4165
- if (prevStyles.some((s$1) => s$1.scoped) !== nextStyles.some((s$1) => s$1.scoped)) {
4005
+ if (prevStyles.some((s) => s.scoped) !== nextStyles.some((s) => s.scoped)) {
4166
4006
  affectedModules.add(templateModule);
4167
4007
  affectedModules.add(mainModule);
4168
4008
  }
@@ -4171,7 +4011,7 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
4171
4011
  const next = nextStyles[i];
4172
4012
  if (!prev || !isEqualBlock(prev, next)) {
4173
4013
  didUpdateStyle = true;
4174
- const mod = jsModules.find((m$1) => m$1.url.includes(`type=style&index=${i}`) && m$1.url.endsWith(`.${next.lang || "css"}`));
4014
+ const mod = jsModules.find((m) => m.url.includes(`type=style&index=${i}`) && m.url.endsWith(`.${next.lang || "css"}`));
4175
4015
  if (mod) {
4176
4016
  affectedModules.add(mod);
4177
4017
  if (mod.url.includes("&inline")) affectedModules.add(mainModule);
@@ -4186,7 +4026,7 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
4186
4026
  const prev = prevCustoms[i];
4187
4027
  const next = nextCustoms[i];
4188
4028
  if (!prev || !isEqualBlock(prev, next)) {
4189
- const mod = jsModules.find((m$1) => m$1.url.includes(`type=${prev.type}&index=${i}`));
4029
+ const mod = jsModules.find((m) => m.url.includes(`type=${prev.type}&index=${i}`));
4190
4030
  if (mod) affectedModules.add(mod);
4191
4031
  else affectedModules.add(mainModule);
4192
4032
  }
@@ -4195,7 +4035,7 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
4195
4035
  if (needRerender) {
4196
4036
  updateType.push(`template`);
4197
4037
  if (!templateModule) affectedModules.add(mainModule);
4198
- else if (mainModule && !affectedModules.has(mainModule)) [...mainModule.importers].filter((m$1) => isCSSRequest(m$1.url)).forEach((m$1) => affectedModules.add(m$1));
4038
+ else if (mainModule && !affectedModules.has(mainModule)) [...mainModule.importers].filter((m) => isCSSRequest(m.url)).forEach((m) => affectedModules.add(m));
4199
4039
  }
4200
4040
  if (didUpdateStyle) updateType.push(`style`);
4201
4041
  if (updateType.length) {
@@ -4216,7 +4056,7 @@ function isEqualBlock(a, b) {
4216
4056
  return keysA.every((key) => a.attrs[key] === b.attrs[key]);
4217
4057
  }
4218
4058
  function isOnlyTemplateChanged(prev, next) {
4219
- return !hasScriptChanged(prev, next) && prev.styles.length === next.styles.length && prev.styles.every((s$1, i) => isEqualBlock(s$1, next.styles[i])) && prev.customBlocks.length === next.customBlocks.length && prev.customBlocks.every((s$1, i) => isEqualBlock(s$1, next.customBlocks[i]));
4059
+ return !hasScriptChanged(prev, next) && prev.styles.length === next.styles.length && prev.styles.every((s, i) => isEqualBlock(s, next.styles[i])) && prev.customBlocks.length === next.customBlocks.length && prev.customBlocks.every((s, i) => isEqualBlock(s, next.customBlocks[i]));
4220
4060
  }
4221
4061
  function deepEqual(obj1, obj2, excludeProps = [], deepParentsOfObj1 = []) {
4222
4062
  if (typeof obj1 !== typeof obj2) return false;
@@ -4252,6 +4092,7 @@ function isEqualAst(prev, next) {
4252
4092
  return true;
4253
4093
  }
4254
4094
  function hasScriptChanged(prev, next) {
4095
+ if (prev.vapor !== next.vapor) return true;
4255
4096
  const prevScript = getResolvedScript(prev, false);
4256
4097
  const nextScript = getResolvedScript(next, false);
4257
4098
  if (!isEqualBlock(prev.script, next.script) && !isEqualAst(prevScript?.scriptAst, nextScript?.scriptAst)) return true;
@@ -4261,12 +4102,12 @@ function hasScriptChanged(prev, next) {
4261
4102
  return false;
4262
4103
  }
4263
4104
  function getMainModule(jsModules) {
4264
- return jsModules.filter((m$1) => !/type=/.test(m$1.url) || /type=script/.test(m$1.url)).sort((m1, m2) => {
4105
+ return jsModules.filter((m) => !/type=/.test(m.url) || /type=script/.test(m.url)).sort((m1, m2) => {
4265
4106
  return m1.url.length - m2.url.length;
4266
4107
  })[0];
4267
4108
  }
4268
4109
  function getScriptModule(jsModules) {
4269
- return jsModules.find((m$1) => /type=script.*&lang\.\w+$/.test(m$1.url));
4110
+ return jsModules.find((m) => /type=script.*&lang\.\w+$/.test(m.url));
4270
4111
  }
4271
4112
  function handleTypeDepChange(affectedComponents, { modules, server: { moduleGraph } }) {
4272
4113
  const affected = /* @__PURE__ */ new Set();
@@ -4300,7 +4141,7 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
4300
4141
  return null;
4301
4142
  }
4302
4143
  const attachedProps = [];
4303
- const hasScoped = descriptor.styles.some((s$1) => s$1.scoped);
4144
+ const hasScoped = descriptor.styles.some((s) => s.scoped);
4304
4145
  const { code: scriptCode, map: scriptMap } = await genScriptCode(descriptor, options, pluginContext, ssr, customElement);
4305
4146
  const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, options);
4306
4147
  let templateCode = "";
@@ -4342,17 +4183,17 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
4342
4183
  });
4343
4184
  const tracer = new TraceMap(templateMap);
4344
4185
  const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
4345
- eachMapping(tracer, (m$1) => {
4346
- if (m$1.source == null) return;
4186
+ eachMapping(tracer, (m) => {
4187
+ if (m.source == null) return;
4347
4188
  addMapping(gen, {
4348
- source: m$1.source,
4189
+ source: m.source,
4349
4190
  original: {
4350
- line: m$1.originalLine,
4351
- column: m$1.originalColumn
4191
+ line: m.originalLine,
4192
+ column: m.originalColumn
4352
4193
  },
4353
4194
  generated: {
4354
- line: m$1.generatedLine + offset,
4355
- column: m$1.generatedColumn
4195
+ line: m.generatedLine + offset,
4196
+ column: m.generatedColumn
4356
4197
  }
4357
4198
  });
4358
4199
  });