storybook 9.0.0-beta.8 → 9.0.0-rc.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 (75) hide show
  1. package/assets/server/base-preview-head.html +21 -0
  2. package/assets/server/template.ejs +4 -4
  3. package/dist/actions/preview.cjs +1 -1
  4. package/dist/actions/preview.d.ts +501 -0
  5. package/dist/actions/preview.js +1 -1
  6. package/dist/backgrounds/index.d.ts +501 -0
  7. package/dist/backgrounds/preview.d.ts +501 -0
  8. package/dist/bin/index.cjs +61 -61
  9. package/dist/bin/index.js +59 -59
  10. package/dist/builder-manager/index.cjs +208 -203
  11. package/dist/builder-manager/index.js +492 -487
  12. package/dist/channels/index.js +919 -941
  13. package/dist/cli/bin/index.cjs +1032 -1032
  14. package/dist/cli/bin/index.js +1032 -1032
  15. package/dist/cli/index.cjs +33709 -28783
  16. package/dist/cli/index.js +33641 -28711
  17. package/dist/common/index.cjs +2802 -2789
  18. package/dist/common/index.d.ts +2 -1
  19. package/dist/common/index.js +3250 -3237
  20. package/dist/components/index.cjs +711 -711
  21. package/dist/components/index.d.ts +2 -1
  22. package/dist/components/index.js +2266 -2272
  23. package/dist/controls/preview.d.ts +501 -0
  24. package/dist/core-events/index.cjs +55 -52
  25. package/dist/core-events/index.d.ts +3 -1
  26. package/dist/core-events/index.js +52 -49
  27. package/dist/core-server/index.cjs +3066 -3037
  28. package/dist/core-server/index.d.ts +512 -11
  29. package/dist/core-server/index.js +3271 -3241
  30. package/dist/core-server/presets/common-manager.js +4570 -5779
  31. package/dist/core-server/presets/common-override-preset.cjs +10 -12
  32. package/dist/core-server/presets/common-override-preset.js +3 -5
  33. package/dist/core-server/presets/common-preset.cjs +112 -116
  34. package/dist/core-server/presets/common-preset.js +10 -14
  35. package/dist/csf/index.d.ts +1 -1
  36. package/dist/csf-tools/index.cjs +116 -111
  37. package/dist/csf-tools/index.js +33 -28
  38. package/dist/docs-tools/index.js +596 -603
  39. package/dist/highlight/preview.d.ts +501 -0
  40. package/dist/instrumenter/index.js +1851 -3554
  41. package/dist/manager/globals-module-info.cjs +3 -0
  42. package/dist/manager/globals-module-info.js +3 -0
  43. package/dist/manager/globals-runtime.js +21347 -23051
  44. package/dist/manager/runtime.js +2510 -2498
  45. package/dist/manager-api/index.cjs +2302 -8594
  46. package/dist/manager-api/index.d.ts +501 -0
  47. package/dist/manager-api/index.js +2655 -2715
  48. package/dist/manager-errors.js +37 -41
  49. package/dist/measure/index.d.ts +501 -0
  50. package/dist/measure/preview.d.ts +501 -0
  51. package/dist/outline/index.d.ts +501 -0
  52. package/dist/outline/preview.d.ts +501 -0
  53. package/dist/preview/runtime.js +38393 -40149
  54. package/dist/preview-api/index.cjs +1546 -1459
  55. package/dist/preview-api/index.d.ts +8 -5
  56. package/dist/preview-api/index.js +1273 -1203
  57. package/dist/preview-errors.js +152 -173
  58. package/dist/router/index.cjs +5700 -2327
  59. package/dist/router/index.d.ts +622 -243
  60. package/dist/router/index.js +1297 -870
  61. package/dist/test/index.cjs +1810 -1811
  62. package/dist/test/index.d.ts +53 -5
  63. package/dist/test/index.js +7614 -7703
  64. package/dist/test/preview.cjs +51 -15860
  65. package/dist/test/preview.d.ts +520 -13
  66. package/dist/test/preview.js +44 -14491
  67. package/dist/theming/index.cjs +17 -0
  68. package/dist/theming/index.js +17 -0
  69. package/dist/types/index.d.ts +516 -82
  70. package/dist/viewport/index.d.ts +502 -3
  71. package/dist/viewport/preview.d.ts +501 -0
  72. package/package.json +3 -18
  73. package/dist/test/spy.cjs +0 -258
  74. package/dist/test/spy.d.ts +0 -62
  75. package/dist/test/spy.js +0 -240
@@ -1,36 +1,36 @@
1
- var kn = Object.create;
2
- var hr = Object.defineProperty;
3
- var jn = Object.getOwnPropertyDescriptor;
4
- var Mn = Object.getOwnPropertyNames;
5
- var _n = Object.getPrototypeOf, Ln = Object.prototype.hasOwnProperty;
6
- var n = (r, e) => hr(r, "name", { value: e, configurable: !0 }), Ee = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
1
+ var Zn = Object.create;
2
+ var Sr = Object.defineProperty;
3
+ var es = Object.getOwnPropertyDescriptor;
4
+ var rs = Object.getOwnPropertyNames;
5
+ var ts = Object.getPrototypeOf, os = Object.prototype.hasOwnProperty;
6
+ var n = (r, e) => Sr(r, "name", { value: e, configurable: !0 }), Ee = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
7
7
  "u" ? new Proxy(r, {
8
8
  get: (e, t) => (typeof require < "u" ? require : e)[t]
9
9
  }) : r)(function(r) {
10
10
  if (typeof require < "u") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + r + '" is not supported');
12
12
  });
13
- var O = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
14
- var Nn = (r, e, t, o) => {
13
+ var I = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
14
+ var ns = (r, e, t, o) => {
15
15
  if (e && typeof e == "object" || typeof e == "function")
16
- for (let s of Mn(e))
17
- !Ln.call(r, s) && s !== t && hr(r, s, { get: () => e[s], enumerable: !(o = jn(e, s)) || o.enumerable });
16
+ for (let s of rs(e))
17
+ !os.call(r, s) && s !== t && Sr(r, s, { get: () => e[s], enumerable: !(o = es(e, s)) || o.enumerable });
18
18
  return r;
19
19
  };
20
- var ue = (r, e, t) => (t = r != null ? kn(_n(r)) : {}, Nn(
20
+ var ue = (r, e, t) => (t = r != null ? Zn(ts(r)) : {}, ns(
21
21
  // If the importer is in node compatibility mode or this is not an ESM
22
22
  // file that has been converted to a CommonJS file using a Babel-
23
23
  // compatible transform (i.e. "__esModule" has not been set), then set
24
24
  // "default" to the CommonJS "module.exports" for node compatibility.
25
- e || !r || !r.__esModule ? hr(t, "default", { value: r, enumerable: !0 }) : t,
25
+ e || !r || !r.__esModule ? Sr(t, "default", { value: r, enumerable: !0 }) : t,
26
26
  r
27
27
  ));
28
28
 
29
29
  // ../node_modules/memoizerific/memoizerific.js
30
- var Or = O((zt, Ir) => {
30
+ var _r = I((io, Mr) => {
31
31
  (function(r) {
32
- if (typeof zt == "object" && typeof Ir < "u")
33
- Ir.exports = r();
32
+ if (typeof io == "object" && typeof Mr < "u")
33
+ Mr.exports = r();
34
34
  else if (typeof define == "function" && define.amd)
35
35
  define([], r);
36
36
  else {
@@ -160,11 +160,11 @@ var Or = O((zt, Ir) => {
160
160
  });
161
161
 
162
162
  // ../node_modules/picoquery/lib/string-util.js
163
- var Wr = O((Vr) => {
163
+ var lt = I((at) => {
164
164
  "use strict";
165
- Object.defineProperty(Vr, "__esModule", { value: !0 });
166
- Vr.encodeString = Hi;
167
- var z = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), Ui = new Int8Array([
165
+ Object.defineProperty(at, "__esModule", { value: !0 });
166
+ at.encodeString = pa;
167
+ var G = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), da = new Int8Array([
168
168
  0,
169
169
  0,
170
170
  0,
@@ -294,7 +294,7 @@ var Wr = O((Vr) => {
294
294
  1,
295
295
  0
296
296
  ]);
297
- function Hi(r) {
297
+ function pa(r) {
298
298
  let e = r.length;
299
299
  if (e === 0)
300
300
  return "";
@@ -302,107 +302,107 @@ var Wr = O((Vr) => {
302
302
  e: for (; s < e; s++) {
303
303
  let i = r.charCodeAt(s);
304
304
  for (; i < 128; ) {
305
- if (Ui[i] !== 1 && (o < s && (t += r.slice(o, s)), o = s + 1, t += z[i]), ++s === e)
305
+ if (da[i] !== 1 && (o < s && (t += r.slice(o, s)), o = s + 1, t += G[i]), ++s === e)
306
306
  break e;
307
307
  i = r.charCodeAt(s);
308
308
  }
309
309
  if (o < s && (t += r.slice(o, s)), i < 2048) {
310
- o = s + 1, t += z[192 | i >> 6] + z[128 | i & 63];
310
+ o = s + 1, t += G[192 | i >> 6] + G[128 | i & 63];
311
311
  continue;
312
312
  }
313
313
  if (i < 55296 || i >= 57344) {
314
- o = s + 1, t += z[224 | i >> 12] + z[128 | i >> 6 & 63] + z[128 | i & 63];
314
+ o = s + 1, t += G[224 | i >> 12] + G[128 | i >> 6 & 63] + G[128 | i & 63];
315
315
  continue;
316
316
  }
317
317
  if (++s, s >= e)
318
318
  throw new Error("URI malformed");
319
319
  let a = r.charCodeAt(s) & 1023;
320
- o = s + 1, i = 65536 + ((i & 1023) << 10 | a), t += z[240 | i >> 18] + z[128 | i >> 12 & 63] + z[128 | i >> 6 & 63] + z[128 | i & 63];
320
+ o = s + 1, i = 65536 + ((i & 1023) << 10 | a), t += G[240 | i >> 18] + G[128 | i >> 12 & 63] + G[128 | i >> 6 & 63] + G[128 | i & 63];
321
321
  }
322
322
  return o === 0 ? r : o < e ? t + r.slice(o) : t;
323
323
  }
324
- n(Hi, "encodeString");
324
+ n(pa, "encodeString");
325
325
  });
326
326
 
327
327
  // ../node_modules/picoquery/lib/shared.js
328
- var tr = O((G) => {
328
+ var sr = I((U) => {
329
329
  "use strict";
330
- Object.defineProperty(G, "__esModule", { value: !0 });
331
- G.defaultOptions = G.defaultShouldSerializeObject = G.defaultValueSerializer = void 0;
332
- var $r = Wr(), Vi = /* @__PURE__ */ n((r) => {
330
+ Object.defineProperty(U, "__esModule", { value: !0 });
331
+ U.defaultOptions = U.defaultShouldSerializeObject = U.defaultValueSerializer = void 0;
332
+ var ct = lt(), ua = /* @__PURE__ */ n((r) => {
333
333
  switch (typeof r) {
334
334
  case "string":
335
- return (0, $r.encodeString)(r);
335
+ return (0, ct.encodeString)(r);
336
336
  case "bigint":
337
337
  case "boolean":
338
338
  return "" + r;
339
339
  case "number":
340
340
  if (Number.isFinite(r))
341
- return r < 1e21 ? "" + r : (0, $r.encodeString)("" + r);
341
+ return r < 1e21 ? "" + r : (0, ct.encodeString)("" + r);
342
342
  break;
343
343
  }
344
- return r instanceof Date ? (0, $r.encodeString)(r.toISOString()) : "";
344
+ return r instanceof Date ? (0, ct.encodeString)(r.toISOString()) : "";
345
345
  }, "defaultValueSerializer");
346
- G.defaultValueSerializer = Vi;
347
- var Wi = /* @__PURE__ */ n((r) => r instanceof Date, "defaultShouldSerializeObject");
348
- G.defaultShouldSerializeObject = Wi;
349
- var Fo = /* @__PURE__ */ n((r) => r, "identityFunc");
350
- G.defaultOptions = {
346
+ U.defaultValueSerializer = ua;
347
+ var fa = /* @__PURE__ */ n((r) => r instanceof Date, "defaultShouldSerializeObject");
348
+ U.defaultShouldSerializeObject = fa;
349
+ var Ko = /* @__PURE__ */ n((r) => r, "identityFunc");
350
+ U.defaultOptions = {
351
351
  nesting: !0,
352
352
  nestingSyntax: "dot",
353
353
  arrayRepeat: !1,
354
354
  arrayRepeatSyntax: "repeat",
355
355
  delimiter: 38,
356
- valueDeserializer: Fo,
357
- valueSerializer: G.defaultValueSerializer,
358
- keyDeserializer: Fo,
359
- shouldSerializeObject: G.defaultShouldSerializeObject
356
+ valueDeserializer: Ko,
357
+ valueSerializer: U.defaultValueSerializer,
358
+ keyDeserializer: Ko,
359
+ shouldSerializeObject: U.defaultShouldSerializeObject
360
360
  };
361
361
  });
362
362
 
363
363
  // ../node_modules/picoquery/lib/object-util.js
364
- var Yr = O((or) => {
364
+ var dt = I((ir) => {
365
365
  "use strict";
366
- Object.defineProperty(or, "__esModule", { value: !0 });
367
- or.getDeepObject = Ki;
368
- or.stringifyObject = Io;
369
- var ae = tr(), $i = Wr();
370
- function Yi(r) {
366
+ Object.defineProperty(ir, "__esModule", { value: !0 });
367
+ ir.getDeepObject = ha;
368
+ ir.stringifyObject = Xo;
369
+ var ae = sr(), ya = lt();
370
+ function ma(r) {
371
371
  return r === "__proto__" || r === "constructor" || r === "prototype";
372
372
  }
373
- n(Yi, "isPrototypeKey");
374
- function Ki(r, e, t, o, s) {
375
- if (Yi(e))
373
+ n(ma, "isPrototypeKey");
374
+ function ha(r, e, t, o, s) {
375
+ if (ma(e))
376
376
  return r;
377
377
  let i = r[e];
378
378
  return typeof i == "object" && i !== null ? i : !o && (s || typeof t == "number" || typeof t == "string" && t * 0 === 0 && t.indexOf(".") ===
379
379
  -1) ? r[e] = [] : r[e] = {};
380
380
  }
381
- n(Ki, "getDeepObject");
382
- var Xi = 20, Ji = "[]", Qi = "[", Zi = "]", ea = ".";
383
- function Io(r, e, t = 0, o, s) {
381
+ n(ha, "getDeepObject");
382
+ var ga = 20, ba = "[]", Sa = "[", Ta = "]", xa = ".";
383
+ function Xo(r, e, t = 0, o, s) {
384
384
  let { nestingSyntax: i = ae.defaultOptions.nestingSyntax, arrayRepeat: a = ae.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = ae.defaultOptions.
385
385
  arrayRepeatSyntax, nesting: c = ae.defaultOptions.nesting, delimiter: d = ae.defaultOptions.delimiter, valueSerializer: p = ae.defaultOptions.
386
386
  valueSerializer, shouldSerializeObject: u = ae.defaultOptions.shouldSerializeObject } = e, y = typeof d == "number" ? String.fromCharCode(
387
387
  d) : d, h = s === !0 && a, g = i === "dot" || i === "js" && !s;
388
- if (t > Xi)
388
+ if (t > ga)
389
389
  return "";
390
390
  let b = "", m = !0, T = !1;
391
391
  for (let x in r) {
392
392
  let f = r[x], S;
393
- o ? (S = o, h ? l === "bracket" && (S += Ji) : g ? (S += ea, S += x) : (S += Qi, S += x, S += Zi)) : S = x, m || (b += y), typeof f ==
394
- "object" && f !== null && !u(f) ? (T = f.pop !== void 0, (c || a && T) && (b += Io(f, e, t + 1, S, T))) : (b += (0, $i.encodeString)(S),
393
+ o ? (S = o, h ? l === "bracket" && (S += ba) : g ? (S += xa, S += x) : (S += Sa, S += x, S += Ta)) : S = x, m || (b += y), typeof f ==
394
+ "object" && f !== null && !u(f) ? (T = f.pop !== void 0, (c || a && T) && (b += Xo(f, e, t + 1, S, T))) : (b += (0, ya.encodeString)(S),
395
395
  b += "=", b += p(f, x)), m && (m = !1);
396
396
  }
397
397
  return b;
398
398
  }
399
- n(Io, "stringifyObject");
399
+ n(Xo, "stringifyObject");
400
400
  });
401
401
 
402
402
  // ../node_modules/fast-decode-uri-component/index.js
403
- var jo = O((Xu, ko) => {
403
+ var en = I((xf, Zo) => {
404
404
  "use strict";
405
- var Oo = 12, ra = 0, Kr = [
405
+ var Jo = 12, Ra = 0, pt = [
406
406
  // The first part of the table maps bytes to character to a transition.
407
407
  0,
408
408
  0,
@@ -785,18 +785,18 @@ var jo = O((Xu, ko) => {
785
785
  7,
786
786
  7
787
787
  ];
788
- function ta(r) {
788
+ function wa(r) {
789
789
  var e = r.indexOf("%");
790
790
  if (e === -1) return r;
791
- for (var t = r.length, o = "", s = 0, i = 0, a = e, l = Oo; e > -1 && e < t; ) {
792
- var c = Do(r[e + 1], 4), d = Do(r[e + 2], 0), p = c | d, u = Kr[p];
793
- if (l = Kr[256 + l + u], i = i << 6 | p & Kr[364 + u], l === Oo)
791
+ for (var t = r.length, o = "", s = 0, i = 0, a = e, l = Jo; e > -1 && e < t; ) {
792
+ var c = Qo(r[e + 1], 4), d = Qo(r[e + 2], 0), p = c | d, u = pt[p];
793
+ if (l = pt[256 + l + u], i = i << 6 | p & pt[364 + u], l === Jo)
794
794
  o += r.slice(s, a), o += i <= 65535 ? String.fromCharCode(i) : String.fromCharCode(
795
795
  55232 + (i >> 10),
796
796
  56320 + (i & 1023)
797
797
  ), i = 0, s = e + 3, e = a = r.indexOf("%", s);
798
798
  else {
799
- if (l === ra)
799
+ if (l === Ra)
800
800
  return null;
801
801
  if (e += 3, e < t && r.charCodeAt(e) === 37) continue;
802
802
  return null;
@@ -804,8 +804,8 @@ var jo = O((Xu, ko) => {
804
804
  }
805
805
  return o + r.slice(s);
806
806
  }
807
- n(ta, "decodeURIComponent");
808
- var oa = {
807
+ n(wa, "decodeURIComponent");
808
+ var Aa = {
809
809
  0: 0,
810
810
  1: 1,
811
811
  2: 2,
@@ -829,95 +829,95 @@ var jo = O((Xu, ko) => {
829
829
  f: 15,
830
830
  F: 15
831
831
  };
832
- function Do(r, e) {
833
- var t = oa[r];
832
+ function Qo(r, e) {
833
+ var t = Aa[r];
834
834
  return t === void 0 ? 255 : t << e;
835
835
  }
836
- n(Do, "hexCodeToInt");
837
- ko.exports = ta;
836
+ n(Qo, "hexCodeToInt");
837
+ Zo.exports = wa;
838
838
  });
839
839
 
840
840
  // ../node_modules/picoquery/lib/parse.js
841
- var No = O((W) => {
841
+ var nn = I(($) => {
842
842
  "use strict";
843
- var na = W && W.__importDefault || function(r) {
843
+ var Ea = $ && $.__importDefault || function(r) {
844
844
  return r && r.__esModule ? r : { default: r };
845
845
  };
846
- Object.defineProperty(W, "__esModule", { value: !0 });
847
- W.numberValueDeserializer = W.numberKeyDeserializer = void 0;
848
- W.parse = aa;
849
- var nr = Yr(), le = tr(), Mo = na(jo()), sa = /* @__PURE__ */ n((r) => {
846
+ Object.defineProperty($, "__esModule", { value: !0 });
847
+ $.numberValueDeserializer = $.numberKeyDeserializer = void 0;
848
+ $.parse = Pa;
849
+ var ar = dt(), le = sr(), rn = Ea(en()), Ca = /* @__PURE__ */ n((r) => {
850
850
  let e = Number(r);
851
851
  return Number.isNaN(e) ? r : e;
852
852
  }, "numberKeyDeserializer");
853
- W.numberKeyDeserializer = sa;
854
- var ia = /* @__PURE__ */ n((r) => {
853
+ $.numberKeyDeserializer = Ca;
854
+ var va = /* @__PURE__ */ n((r) => {
855
855
  let e = Number(r);
856
856
  return Number.isNaN(e) ? r : e;
857
857
  }, "numberValueDeserializer");
858
- W.numberValueDeserializer = ia;
859
- var _o = /\+/g, Lo = /* @__PURE__ */ n(function() {
858
+ $.numberValueDeserializer = va;
859
+ var tn = /\+/g, on = /* @__PURE__ */ n(function() {
860
860
  }, "Empty");
861
- Lo.prototype = /* @__PURE__ */ Object.create(null);
862
- function sr(r, e, t, o, s) {
861
+ on.prototype = /* @__PURE__ */ Object.create(null);
862
+ function lr(r, e, t, o, s) {
863
863
  let i = r.substring(e, t);
864
- return o && (i = i.replace(_o, " ")), s && (i = (0, Mo.default)(i) || i), i;
864
+ return o && (i = i.replace(tn, " ")), s && (i = (0, rn.default)(i) || i), i;
865
865
  }
866
- n(sr, "computeKeySlice");
867
- function aa(r, e) {
866
+ n(lr, "computeKeySlice");
867
+ function Pa(r, e) {
868
868
  let { valueDeserializer: t = le.defaultOptions.valueDeserializer, keyDeserializer: o = le.defaultOptions.keyDeserializer, arrayRepeatSyntax: s = le.
869
869
  defaultOptions.arrayRepeatSyntax, nesting: i = le.defaultOptions.nesting, arrayRepeat: a = le.defaultOptions.arrayRepeat, nestingSyntax: l = le.
870
870
  defaultOptions.nestingSyntax, delimiter: c = le.defaultOptions.delimiter } = e ?? {}, d = typeof c == "string" ? c.charCodeAt(0) : c, p = l ===
871
- "js", u = new Lo();
871
+ "js", u = new on();
872
872
  if (typeof r != "string")
873
873
  return u;
874
- let y = r.length, h = "", g = -1, b = -1, m = -1, T = u, x, f = "", S = "", R = !1, w = !1, A = !1, F = !1, j = !1, N = !1, pe = !1, C = 0,
875
- B = -1, Re = -1, at = -1;
876
- for (let I = 0; I < y + 1; I++) {
877
- if (C = I !== y ? r.charCodeAt(I) : d, C === d) {
878
- if (pe = b > g, pe || (b = I), m !== b - 1 && (S = sr(r, m + 1, B > -1 ? B : b, A, R), f = o(S), x !== void 0 && (T = (0, nr.getDeepObject)(
879
- T, x, f, p && j, p && N))), pe || f !== "") {
880
- pe && (h = r.slice(b + 1, I), F && (h = h.replace(_o, " ")), w && (h = (0, Mo.default)(h) || h));
881
- let we = t(h, f);
874
+ let y = r.length, h = "", g = -1, b = -1, m = -1, T = u, x, f = "", S = "", R = !1, w = !1, E = !1, D = !1, k = !1, L = !1, pe = !1, q = 0,
875
+ v = -1, z = -1, Ct = -1;
876
+ for (let F = 0; F < y + 1; F++) {
877
+ if (q = F !== y ? r.charCodeAt(F) : d, q === d) {
878
+ if (pe = b > g, pe || (b = F), m !== b - 1 && (S = lr(r, m + 1, v > -1 ? v : b, E, R), f = o(S), x !== void 0 && (T = (0, ar.getDeepObject)(
879
+ T, x, f, p && k, p && L))), pe || f !== "") {
880
+ pe && (h = r.slice(b + 1, F), D && (h = h.replace(tn, " ")), w && (h = (0, rn.default)(h) || h));
881
+ let Ae = t(h, f);
882
882
  if (a) {
883
- let Be = T[f];
884
- Be === void 0 ? B > -1 ? T[f] = [we] : T[f] = we : Be.pop ? Be.push(we) : T[f] = [Be, we];
883
+ let Ge = T[f];
884
+ Ge === void 0 ? v > -1 ? T[f] = [Ae] : T[f] = Ae : Ge.pop ? Ge.push(Ae) : T[f] = [Ge, Ae];
885
885
  } else
886
- T[f] = we;
886
+ T[f] = Ae;
887
887
  }
888
- h = "", g = I, b = I, R = !1, w = !1, A = !1, F = !1, j = !1, N = !1, B = -1, m = I, T = u, x = void 0, f = "";
889
- } else C === 93 ? (a && s === "bracket" && at === 91 && (B = Re), i && (l === "index" || p) && b <= g && (m !== Re && (S = sr(r, m + 1,
890
- I, A, R), f = o(S), x !== void 0 && (T = (0, nr.getDeepObject)(T, x, f, void 0, p)), x = f, A = !1, R = !1), m = I, N = !0, j = !1)) :
891
- C === 46 ? i && (l === "dot" || p) && b <= g && (m !== Re && (S = sr(r, m + 1, I, A, R), f = o(S), x !== void 0 && (T = (0, nr.getDeepObject)(
892
- T, x, f, p)), x = f, A = !1, R = !1), j = !0, N = !1, m = I) : C === 91 ? i && (l === "index" || p) && b <= g && (m !== Re && (S = sr(
893
- r, m + 1, I, A, R), f = o(S), p && x !== void 0 && (T = (0, nr.getDeepObject)(T, x, f, p)), x = f, A = !1, R = !1, j = !1, N = !0), m =
894
- I) : C === 61 ? b <= g ? b = I : w = !0 : C === 43 ? b > g ? F = !0 : A = !0 : C === 37 && (b > g ? w = !0 : R = !0);
895
- Re = I, at = C;
888
+ h = "", g = F, b = F, R = !1, w = !1, E = !1, D = !1, k = !1, L = !1, v = -1, m = F, T = u, x = void 0, f = "";
889
+ } else q === 93 ? (a && s === "bracket" && Ct === 91 && (v = z), i && (l === "index" || p) && b <= g && (m !== z && (S = lr(r, m + 1, F,
890
+ E, R), f = o(S), x !== void 0 && (T = (0, ar.getDeepObject)(T, x, f, void 0, p)), x = f, E = !1, R = !1), m = F, L = !0, k = !1)) : q ===
891
+ 46 ? i && (l === "dot" || p) && b <= g && (m !== z && (S = lr(r, m + 1, F, E, R), f = o(S), x !== void 0 && (T = (0, ar.getDeepObject)(
892
+ T, x, f, p)), x = f, E = !1, R = !1), k = !0, L = !1, m = F) : q === 91 ? i && (l === "index" || p) && b <= g && (m !== z && (S = lr(r,
893
+ m + 1, F, E, R), f = o(S), p && x !== void 0 && (T = (0, ar.getDeepObject)(T, x, f, p)), x = f, E = !1, R = !1, k = !1, L = !0), m = F) :
894
+ q === 61 ? b <= g ? b = F : w = !0 : q === 43 ? b > g ? D = !0 : E = !0 : q === 37 && (b > g ? w = !0 : R = !0);
895
+ z = F, Ct = q;
896
896
  }
897
897
  return u;
898
898
  }
899
- n(aa, "parse");
899
+ n(Pa, "parse");
900
900
  });
901
901
 
902
902
  // ../node_modules/picoquery/lib/stringify.js
903
- var qo = O((Xr) => {
903
+ var sn = I((ut) => {
904
904
  "use strict";
905
- Object.defineProperty(Xr, "__esModule", { value: !0 });
906
- Xr.stringify = ca;
907
- var la = Yr();
908
- function ca(r, e) {
905
+ Object.defineProperty(ut, "__esModule", { value: !0 });
906
+ ut.stringify = Ia;
907
+ var Fa = dt();
908
+ function Ia(r, e) {
909
909
  if (r === null || typeof r != "object")
910
910
  return "";
911
911
  let t = e ?? {};
912
- return (0, la.stringifyObject)(r, t);
912
+ return (0, Fa.stringifyObject)(r, t);
913
913
  }
914
- n(ca, "stringify");
914
+ n(Ia, "stringify");
915
915
  });
916
916
 
917
917
  // ../node_modules/picoquery/lib/main.js
918
- var ir = O((q) => {
918
+ var cr = I((B) => {
919
919
  "use strict";
920
- var da = q && q.__createBinding || (Object.create ? function(r, e, t, o) {
920
+ var Oa = B && B.__createBinding || (Object.create ? function(r, e, t, o) {
921
921
  o === void 0 && (o = t);
922
922
  var s = Object.getOwnPropertyDescriptor(e, t);
923
923
  (!s || ("get" in s ? !e.__esModule : s.writable || s.configurable)) && (s = { enumerable: !0, get: /* @__PURE__ */ n(function() {
@@ -925,25 +925,25 @@ var ir = O((q) => {
925
925
  }, "get") }), Object.defineProperty(r, o, s);
926
926
  } : function(r, e, t, o) {
927
927
  o === void 0 && (o = t), r[o] = e[t];
928
- }), pa = q && q.__exportStar || function(r, e) {
929
- for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && da(e, r, t);
928
+ }), Da = B && B.__exportStar || function(r, e) {
929
+ for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Oa(e, r, t);
930
930
  };
931
- Object.defineProperty(q, "__esModule", { value: !0 });
932
- q.stringify = q.parse = void 0;
933
- var ua = No();
934
- Object.defineProperty(q, "parse", { enumerable: !0, get: /* @__PURE__ */ n(function() {
935
- return ua.parse;
931
+ Object.defineProperty(B, "__esModule", { value: !0 });
932
+ B.stringify = B.parse = void 0;
933
+ var ka = nn();
934
+ Object.defineProperty(B, "parse", { enumerable: !0, get: /* @__PURE__ */ n(function() {
935
+ return ka.parse;
936
936
  }, "get") });
937
- var fa = qo();
938
- Object.defineProperty(q, "stringify", { enumerable: !0, get: /* @__PURE__ */ n(function() {
939
- return fa.stringify;
937
+ var ja = sn();
938
+ Object.defineProperty(B, "stringify", { enumerable: !0, get: /* @__PURE__ */ n(function() {
939
+ return ja.stringify;
940
940
  }, "get") });
941
- pa(tr(), q);
941
+ Da(sr(), B);
942
942
  });
943
943
 
944
944
  // ../node_modules/entities/lib/maps/entities.json
945
- var Zr = O((yf, Ra) => {
946
- Ra.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
945
+ var ht = I((Lf, Ua) => {
946
+ Ua.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
947
947
  \xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}",
948
948
  Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\
949
949
  \u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220",
@@ -1224,8 +1224,8 @@ var Zr = O((yf, Ra) => {
1224
1224
  });
1225
1225
 
1226
1226
  // ../node_modules/entities/lib/maps/legacy.json
1227
- var Wo = O((mf, wa) => {
1228
- wa.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
1227
+ var fn = I((qf, Ha) => {
1228
+ Ha.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
1229
1229
  \xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\
1230
1230
  \xC7", ccedil: "\xE7", cedil: "\xB8", cent: "\xA2", copy: "\xA9", COPY: "\xA9", curren: "\xA4", deg: "\xB0", divide: "\xF7", Eacute: "\xC9",
1231
1231
  eacute: "\xE9", Ecirc: "\xCA", ecirc: "\xEA", Egrave: "\xC8", egrave: "\xE8", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", frac12: "\
@@ -1239,25 +1239,25 @@ var Wo = O((mf, wa) => {
1239
1239
  });
1240
1240
 
1241
1241
  // ../node_modules/entities/lib/maps/xml.json
1242
- var et = O((hf, Ea) => {
1243
- Ea.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
1242
+ var gt = I((Bf, Va) => {
1243
+ Va.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
1244
1244
  });
1245
1245
 
1246
1246
  // ../node_modules/entities/lib/maps/decode.json
1247
- var $o = O((gf, Aa) => {
1248
- Aa.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
1247
+ var yn = I((zf, Wa) => {
1248
+ Wa.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
1249
1249
  "138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212,
1250
1250
  "152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 };
1251
1251
  });
1252
1252
 
1253
1253
  // ../node_modules/entities/lib/decode_codepoint.js
1254
- var Ko = O((qe) => {
1254
+ var hn = I((ze) => {
1255
1255
  "use strict";
1256
- var Ca = qe && qe.__importDefault || function(r) {
1256
+ var $a = ze && ze.__importDefault || function(r) {
1257
1257
  return r && r.__esModule ? r : { default: r };
1258
1258
  };
1259
- Object.defineProperty(qe, "__esModule", { value: !0 });
1260
- var Yo = Ca($o()), va = (
1259
+ Object.defineProperty(ze, "__esModule", { value: !0 });
1260
+ var mn = $a(yn()), Ya = (
1261
1261
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1262
1262
  String.fromCodePoint || function(r) {
1263
1263
  var e = "";
@@ -1265,38 +1265,38 @@ var Ko = O((qe) => {
1265
1265
  e;
1266
1266
  }
1267
1267
  );
1268
- function Pa(r) {
1269
- return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in Yo.default && (r = Yo.default[r]), va(r));
1268
+ function Ka(r) {
1269
+ return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in mn.default && (r = mn.default[r]), Ya(r));
1270
1270
  }
1271
- n(Pa, "decodeCodePoint");
1272
- qe.default = Pa;
1271
+ n(Ka, "decodeCodePoint");
1272
+ ze.default = Ka;
1273
1273
  });
1274
1274
 
1275
1275
  // ../node_modules/entities/lib/decode.js
1276
- var tt = O((U) => {
1276
+ var St = I((H) => {
1277
1277
  "use strict";
1278
- var ar = U && U.__importDefault || function(r) {
1278
+ var dr = H && H.__importDefault || function(r) {
1279
1279
  return r && r.__esModule ? r : { default: r };
1280
1280
  };
1281
- Object.defineProperty(U, "__esModule", { value: !0 });
1282
- U.decodeHTML = U.decodeHTMLStrict = U.decodeXML = void 0;
1283
- var rt = ar(Zr()), Fa = ar(Wo()), Ia = ar(et()), Xo = ar(Ko()), Oa = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
1284
- U.decodeXML = Qo(Ia.default);
1285
- U.decodeHTMLStrict = Qo(rt.default);
1286
- function Qo(r) {
1287
- var e = Zo(r);
1281
+ Object.defineProperty(H, "__esModule", { value: !0 });
1282
+ H.decodeHTML = H.decodeHTMLStrict = H.decodeXML = void 0;
1283
+ var bt = dr(ht()), Xa = dr(fn()), Ja = dr(gt()), gn = dr(hn()), Qa = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
1284
+ H.decodeXML = Sn(Ja.default);
1285
+ H.decodeHTMLStrict = Sn(bt.default);
1286
+ function Sn(r) {
1287
+ var e = Tn(r);
1288
1288
  return function(t) {
1289
- return String(t).replace(Oa, e);
1289
+ return String(t).replace(Qa, e);
1290
1290
  };
1291
1291
  }
1292
- n(Qo, "getStrictDecoder");
1293
- var Jo = /* @__PURE__ */ n(function(r, e) {
1292
+ n(Sn, "getStrictDecoder");
1293
+ var bn = /* @__PURE__ */ n(function(r, e) {
1294
1294
  return r < e ? 1 : -1;
1295
1295
  }, "sorter");
1296
- U.decodeHTML = function() {
1297
- for (var r = Object.keys(Fa.default).sort(Jo), e = Object.keys(rt.default).sort(Jo), t = 0, o = 0; t < e.length; t++)
1296
+ H.decodeHTML = function() {
1297
+ for (var r = Object.keys(Xa.default).sort(bn), e = Object.keys(bt.default).sort(bn), t = 0, o = 0; t < e.length; t++)
1298
1298
  r[o] === e[t] ? (e[t] += ";?", o++) : e[t] += ";";
1299
- var s = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i = Zo(rt.default);
1299
+ var s = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i = Tn(bt.default);
1300
1300
  function a(l) {
1301
1301
  return l.substr(-1) !== ";" && (l += ";"), i(l);
1302
1302
  }
@@ -1304,38 +1304,38 @@ var tt = O((U) => {
1304
1304
  return String(l).replace(s, a);
1305
1305
  };
1306
1306
  }();
1307
- function Zo(r) {
1307
+ function Tn(r) {
1308
1308
  return /* @__PURE__ */ n(function(t) {
1309
1309
  if (t.charAt(1) === "#") {
1310
1310
  var o = t.charAt(2);
1311
- return o === "X" || o === "x" ? Xo.default(parseInt(t.substr(3), 16)) : Xo.default(parseInt(t.substr(2), 10));
1311
+ return o === "X" || o === "x" ? gn.default(parseInt(t.substr(3), 16)) : gn.default(parseInt(t.substr(2), 10));
1312
1312
  }
1313
1313
  return r[t.slice(1, -1)] || t;
1314
1314
  }, "replace");
1315
1315
  }
1316
- n(Zo, "getReplacer");
1316
+ n(Tn, "getReplacer");
1317
1317
  });
1318
1318
 
1319
1319
  // ../node_modules/entities/lib/encode.js
1320
- var nt = O((M) => {
1320
+ var xt = I((M) => {
1321
1321
  "use strict";
1322
- var en = M && M.__importDefault || function(r) {
1322
+ var xn = M && M.__importDefault || function(r) {
1323
1323
  return r && r.__esModule ? r : { default: r };
1324
1324
  };
1325
1325
  Object.defineProperty(M, "__esModule", { value: !0 });
1326
1326
  M.escapeUTF8 = M.escape = M.encodeNonAsciiHTML = M.encodeHTML = M.encodeXML = void 0;
1327
- var Da = en(et()), rn = on(Da.default), tn = nn(rn);
1328
- M.encodeXML = ln(rn);
1329
- var ka = en(Zr()), ot = on(ka.default), ja = nn(ot);
1330
- M.encodeHTML = _a(ot, ja);
1331
- M.encodeNonAsciiHTML = ln(ot);
1332
- function on(r) {
1327
+ var Za = xn(gt()), Rn = An(Za.default), wn = En(Rn);
1328
+ M.encodeXML = Pn(Rn);
1329
+ var el = xn(ht()), Tt = An(el.default), rl = En(Tt);
1330
+ M.encodeHTML = ol(Tt, rl);
1331
+ M.encodeNonAsciiHTML = Pn(Tt);
1332
+ function An(r) {
1333
1333
  return Object.keys(r).sort().reduce(function(e, t) {
1334
1334
  return e[r[t]] = "&" + t + ";", e;
1335
1335
  }, {});
1336
1336
  }
1337
- n(on, "getInverseObj");
1338
- function nn(r) {
1337
+ n(An, "getInverseObj");
1338
+ function En(r) {
1339
1339
  for (var e = [], t = [], o = 0, s = Object.keys(r); o < s.length; o++) {
1340
1340
  var i = s[o];
1341
1341
  i.length === 1 ? e.push("\\" + i) : t.push(i);
@@ -1349,9 +1349,9 @@ var nt = O((M) => {
1349
1349
  }
1350
1350
  return t.unshift("[" + e.join("") + "]"), new RegExp(t.join("|"), "g");
1351
1351
  }
1352
- n(nn, "getInverseReplacer");
1353
- var sn = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,
1354
- Ma = (
1352
+ n(En, "getInverseReplacer");
1353
+ var Cn = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,
1354
+ tl = (
1355
1355
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1356
1356
  String.prototype.codePointAt != null ? (
1357
1357
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -1365,134 +1365,134 @@ var nt = O((M) => {
1365
1365
  }
1366
1366
  )
1367
1367
  );
1368
- function lr(r) {
1369
- return "&#x" + (r.length > 1 ? Ma(r) : r.charCodeAt(0)).toString(16).toUpperCase() + ";";
1368
+ function pr(r) {
1369
+ return "&#x" + (r.length > 1 ? tl(r) : r.charCodeAt(0)).toString(16).toUpperCase() + ";";
1370
1370
  }
1371
- n(lr, "singleCharReplacer");
1372
- function _a(r, e) {
1371
+ n(pr, "singleCharReplacer");
1372
+ function ol(r, e) {
1373
1373
  return function(t) {
1374
1374
  return t.replace(e, function(o) {
1375
1375
  return r[o];
1376
- }).replace(sn, lr);
1376
+ }).replace(Cn, pr);
1377
1377
  };
1378
1378
  }
1379
- n(_a, "getInverse");
1380
- var an = new RegExp(tn.source + "|" + sn.source, "g");
1381
- function La(r) {
1382
- return r.replace(an, lr);
1379
+ n(ol, "getInverse");
1380
+ var vn = new RegExp(wn.source + "|" + Cn.source, "g");
1381
+ function nl(r) {
1382
+ return r.replace(vn, pr);
1383
1383
  }
1384
- n(La, "escape");
1385
- M.escape = La;
1386
- function Na(r) {
1387
- return r.replace(tn, lr);
1384
+ n(nl, "escape");
1385
+ M.escape = nl;
1386
+ function sl(r) {
1387
+ return r.replace(wn, pr);
1388
1388
  }
1389
- n(Na, "escapeUTF8");
1390
- M.escapeUTF8 = Na;
1391
- function ln(r) {
1389
+ n(sl, "escapeUTF8");
1390
+ M.escapeUTF8 = sl;
1391
+ function Pn(r) {
1392
1392
  return function(e) {
1393
- return e.replace(an, function(t) {
1394
- return r[t] || lr(t);
1393
+ return e.replace(vn, function(t) {
1394
+ return r[t] || pr(t);
1395
1395
  });
1396
1396
  };
1397
1397
  }
1398
- n(ln, "getASCIIEncoder");
1398
+ n(Pn, "getASCIIEncoder");
1399
1399
  });
1400
1400
 
1401
1401
  // ../node_modules/entities/lib/index.js
1402
- var dn = O((E) => {
1402
+ var In = I((A) => {
1403
1403
  "use strict";
1404
- Object.defineProperty(E, "__esModule", { value: !0 });
1405
- E.decodeXMLStrict = E.decodeHTML5Strict = E.decodeHTML4Strict = E.decodeHTML5 = E.decodeHTML4 = E.decodeHTMLStrict = E.decodeHTML = E.decodeXML =
1406
- E.encodeHTML5 = E.encodeHTML4 = E.escapeUTF8 = E.escape = E.encodeNonAsciiHTML = E.encodeHTML = E.encodeXML = E.encode = E.decodeStrict = E.
1404
+ Object.defineProperty(A, "__esModule", { value: !0 });
1405
+ A.decodeXMLStrict = A.decodeHTML5Strict = A.decodeHTML4Strict = A.decodeHTML5 = A.decodeHTML4 = A.decodeHTMLStrict = A.decodeHTML = A.decodeXML =
1406
+ A.encodeHTML5 = A.encodeHTML4 = A.escapeUTF8 = A.escape = A.encodeNonAsciiHTML = A.encodeHTML = A.encodeXML = A.encode = A.decodeStrict = A.
1407
1407
  decode = void 0;
1408
- var cr = tt(), cn = nt();
1409
- function qa(r, e) {
1410
- return (!e || e <= 0 ? cr.decodeXML : cr.decodeHTML)(r);
1411
- }
1412
- n(qa, "decode");
1413
- E.decode = qa;
1414
- function Ba(r, e) {
1415
- return (!e || e <= 0 ? cr.decodeXML : cr.decodeHTMLStrict)(r);
1416
- }
1417
- n(Ba, "decodeStrict");
1418
- E.decodeStrict = Ba;
1419
- function za(r, e) {
1420
- return (!e || e <= 0 ? cn.encodeXML : cn.encodeHTML)(r);
1421
- }
1422
- n(za, "encode");
1423
- E.encode = za;
1424
- var ce = nt();
1425
- Object.defineProperty(E, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1408
+ var ur = St(), Fn = xt();
1409
+ function il(r, e) {
1410
+ return (!e || e <= 0 ? ur.decodeXML : ur.decodeHTML)(r);
1411
+ }
1412
+ n(il, "decode");
1413
+ A.decode = il;
1414
+ function al(r, e) {
1415
+ return (!e || e <= 0 ? ur.decodeXML : ur.decodeHTMLStrict)(r);
1416
+ }
1417
+ n(al, "decodeStrict");
1418
+ A.decodeStrict = al;
1419
+ function ll(r, e) {
1420
+ return (!e || e <= 0 ? Fn.encodeXML : Fn.encodeHTML)(r);
1421
+ }
1422
+ n(ll, "encode");
1423
+ A.encode = ll;
1424
+ var ce = xt();
1425
+ Object.defineProperty(A, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1426
1426
  return ce.encodeXML;
1427
1427
  }, "get") });
1428
- Object.defineProperty(E, "encodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1428
+ Object.defineProperty(A, "encodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1429
1429
  return ce.encodeHTML;
1430
1430
  }, "get") });
1431
- Object.defineProperty(E, "encodeNonAsciiHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1431
+ Object.defineProperty(A, "encodeNonAsciiHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1432
1432
  return ce.encodeNonAsciiHTML;
1433
1433
  }, "get") });
1434
- Object.defineProperty(E, "escape", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1434
+ Object.defineProperty(A, "escape", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1435
1435
  return ce.escape;
1436
1436
  }, "get") });
1437
- Object.defineProperty(E, "escapeUTF8", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1437
+ Object.defineProperty(A, "escapeUTF8", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1438
1438
  return ce.escapeUTF8;
1439
1439
  }, "get") });
1440
- Object.defineProperty(E, "encodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1440
+ Object.defineProperty(A, "encodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1441
1441
  return ce.encodeHTML;
1442
1442
  }, "get") });
1443
- Object.defineProperty(E, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1443
+ Object.defineProperty(A, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1444
1444
  return ce.encodeHTML;
1445
1445
  }, "get") });
1446
- var Z = tt();
1447
- Object.defineProperty(E, "decodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1448
- return Z.decodeXML;
1446
+ var ee = St();
1447
+ Object.defineProperty(A, "decodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1448
+ return ee.decodeXML;
1449
1449
  }, "get") });
1450
- Object.defineProperty(E, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1451
- return Z.decodeHTML;
1450
+ Object.defineProperty(A, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1451
+ return ee.decodeHTML;
1452
1452
  }, "get") });
1453
- Object.defineProperty(E, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1454
- return Z.decodeHTMLStrict;
1453
+ Object.defineProperty(A, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1454
+ return ee.decodeHTMLStrict;
1455
1455
  }, "get") });
1456
- Object.defineProperty(E, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1457
- return Z.decodeHTML;
1456
+ Object.defineProperty(A, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1457
+ return ee.decodeHTML;
1458
1458
  }, "get") });
1459
- Object.defineProperty(E, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1460
- return Z.decodeHTML;
1459
+ Object.defineProperty(A, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1460
+ return ee.decodeHTML;
1461
1461
  }, "get") });
1462
- Object.defineProperty(E, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1463
- return Z.decodeHTMLStrict;
1462
+ Object.defineProperty(A, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1463
+ return ee.decodeHTMLStrict;
1464
1464
  }, "get") });
1465
- Object.defineProperty(E, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1466
- return Z.decodeHTMLStrict;
1465
+ Object.defineProperty(A, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1466
+ return ee.decodeHTMLStrict;
1467
1467
  }, "get") });
1468
- Object.defineProperty(E, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1469
- return Z.decodeXML;
1468
+ Object.defineProperty(A, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */ n(function() {
1469
+ return ee.decodeXML;
1470
1470
  }, "get") });
1471
1471
  });
1472
1472
 
1473
1473
  // ../node_modules/ansi-to-html/lib/ansi_to_html.js
1474
- var xn = O((Cf, Tn) => {
1474
+ var zn = I((Xf, Bn) => {
1475
1475
  "use strict";
1476
- function Ga(r, e) {
1476
+ function cl(r, e) {
1477
1477
  if (!(r instanceof e))
1478
1478
  throw new TypeError("Cannot call a class as a function");
1479
1479
  }
1480
- n(Ga, "_classCallCheck");
1481
- function pn(r, e) {
1480
+ n(cl, "_classCallCheck");
1481
+ function On(r, e) {
1482
1482
  for (var t = 0; t < e.length; t++) {
1483
1483
  var o = e[t];
1484
1484
  o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, o.key, o);
1485
1485
  }
1486
1486
  }
1487
- n(pn, "_defineProperties");
1488
- function Ua(r, e, t) {
1489
- return e && pn(r.prototype, e), t && pn(r, t), r;
1487
+ n(On, "_defineProperties");
1488
+ function dl(r, e, t) {
1489
+ return e && On(r.prototype, e), t && On(r, t), r;
1490
1490
  }
1491
- n(Ua, "_createClass");
1492
- function gn(r, e) {
1491
+ n(dl, "_createClass");
1492
+ function Nn(r, e) {
1493
1493
  var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
1494
1494
  if (!t) {
1495
- if (Array.isArray(r) || (t = Ha(r)) || e && r && typeof r.length == "number") {
1495
+ if (Array.isArray(r) || (t = pl(r)) || e && r && typeof r.length == "number") {
1496
1496
  t && (r = t);
1497
1497
  var o = 0, s = /* @__PURE__ */ n(function() {
1498
1498
  }, "F");
@@ -1521,32 +1521,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1521
1521
  }
1522
1522
  }, "f") };
1523
1523
  }
1524
- n(gn, "_createForOfIteratorHelper");
1525
- function Ha(r, e) {
1524
+ n(Nn, "_createForOfIteratorHelper");
1525
+ function pl(r, e) {
1526
1526
  if (r) {
1527
- if (typeof r == "string") return un(r, e);
1527
+ if (typeof r == "string") return Dn(r, e);
1528
1528
  var t = Object.prototype.toString.call(r).slice(8, -1);
1529
1529
  if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
1530
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return un(r, e);
1530
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Dn(r, e);
1531
1531
  }
1532
1532
  }
1533
- n(Ha, "_unsupportedIterableToArray");
1534
- function un(r, e) {
1533
+ n(pl, "_unsupportedIterableToArray");
1534
+ function Dn(r, e) {
1535
1535
  (e == null || e > r.length) && (e = r.length);
1536
1536
  for (var t = 0, o = new Array(e); t < e; t++)
1537
1537
  o[t] = r[t];
1538
1538
  return o;
1539
1539
  }
1540
- n(un, "_arrayLikeToArray");
1541
- var Va = dn(), fn = {
1540
+ n(Dn, "_arrayLikeToArray");
1541
+ var ul = In(), kn = {
1542
1542
  fg: "#FFF",
1543
1543
  bg: "#000",
1544
1544
  newline: !1,
1545
1545
  escapeXML: !1,
1546
1546
  stream: !1,
1547
- colors: Wa()
1547
+ colors: fl()
1548
1548
  };
1549
- function Wa() {
1549
+ function fl() {
1550
1550
  var r = {
1551
1551
  0: "#000",
1552
1552
  1: "#A00",
@@ -1565,35 +1565,35 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1565
1565
  14: "#5FF",
1566
1566
  15: "#FFF"
1567
1567
  };
1568
- return dr(0, 5).forEach(function(e) {
1569
- dr(0, 5).forEach(function(t) {
1570
- dr(0, 5).forEach(function(o) {
1571
- return $a(e, t, o, r);
1568
+ return fr(0, 5).forEach(function(e) {
1569
+ fr(0, 5).forEach(function(t) {
1570
+ fr(0, 5).forEach(function(o) {
1571
+ return yl(e, t, o, r);
1572
1572
  });
1573
1573
  });
1574
- }), dr(0, 23).forEach(function(e) {
1575
- var t = e + 232, o = bn(e * 10 + 8);
1574
+ }), fr(0, 23).forEach(function(e) {
1575
+ var t = e + 232, o = Ln(e * 10 + 8);
1576
1576
  r[t] = "#" + o + o + o;
1577
1577
  }), r;
1578
1578
  }
1579
- n(Wa, "getDefaultColors");
1580
- function $a(r, e, t, o) {
1579
+ n(fl, "getDefaultColors");
1580
+ function yl(r, e, t, o) {
1581
1581
  var s = 16 + r * 36 + e * 6 + t, i = r > 0 ? r * 40 + 55 : 0, a = e > 0 ? e * 40 + 55 : 0, l = t > 0 ? t * 40 + 55 : 0;
1582
- o[s] = Ya([i, a, l]);
1582
+ o[s] = ml([i, a, l]);
1583
1583
  }
1584
- n($a, "setStyleColor");
1585
- function bn(r) {
1584
+ n(yl, "setStyleColor");
1585
+ function Ln(r) {
1586
1586
  for (var e = r.toString(16); e.length < 2; )
1587
1587
  e = "0" + e;
1588
1588
  return e;
1589
1589
  }
1590
- n(bn, "toHexString");
1591
- function Ya(r) {
1592
- var e = [], t = gn(r), o;
1590
+ n(Ln, "toHexString");
1591
+ function ml(r) {
1592
+ var e = [], t = Nn(r), o;
1593
1593
  try {
1594
1594
  for (t.s(); !(o = t.n()).done; ) {
1595
1595
  var s = o.value;
1596
- e.push(bn(s));
1596
+ e.push(Ln(s));
1597
1597
  }
1598
1598
  } catch (i) {
1599
1599
  t.e(i);
@@ -1602,123 +1602,123 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1602
1602
  }
1603
1603
  return "#" + e.join("");
1604
1604
  }
1605
- n(Ya, "toColorHexString");
1606
- function yn(r, e, t, o) {
1605
+ n(ml, "toColorHexString");
1606
+ function jn(r, e, t, o) {
1607
1607
  var s;
1608
- return e === "text" ? s = Qa(t, o) : e === "display" ? s = Xa(r, t, o) : e === "xterm256Foreground" ? s = ur(r, o.colors[t]) : e === "xt\
1609
- erm256Background" ? s = fr(r, o.colors[t]) : e === "rgb" && (s = Ka(r, t)), s;
1608
+ return e === "text" ? s = Sl(t, o) : e === "display" ? s = gl(r, t, o) : e === "xterm256Foreground" ? s = mr(r, o.colors[t]) : e === "xt\
1609
+ erm256Background" ? s = hr(r, o.colors[t]) : e === "rgb" && (s = hl(r, t)), s;
1610
1610
  }
1611
- n(yn, "generateOutput");
1612
- function Ka(r, e) {
1611
+ n(jn, "generateOutput");
1612
+ function hl(r, e) {
1613
1613
  e = e.substring(2).slice(0, -1);
1614
1614
  var t = +e.substr(0, 2), o = e.substring(5).split(";"), s = o.map(function(i) {
1615
1615
  return ("0" + Number(i).toString(16)).substr(-2);
1616
1616
  }).join("");
1617
- return pr(r, (t === 38 ? "color:#" : "background-color:#") + s);
1617
+ return yr(r, (t === 38 ? "color:#" : "background-color:#") + s);
1618
1618
  }
1619
- n(Ka, "handleRgb");
1620
- function Xa(r, e, t) {
1619
+ n(hl, "handleRgb");
1620
+ function gl(r, e, t) {
1621
1621
  e = parseInt(e, 10);
1622
1622
  var o = {
1623
1623
  "-1": /* @__PURE__ */ n(function() {
1624
1624
  return "<br/>";
1625
1625
  }, "_"),
1626
1626
  0: /* @__PURE__ */ n(function() {
1627
- return r.length && Sn(r);
1627
+ return r.length && qn(r);
1628
1628
  }, "_"),
1629
1629
  1: /* @__PURE__ */ n(function() {
1630
- return ee(r, "b");
1630
+ return re(r, "b");
1631
1631
  }, "_"),
1632
1632
  3: /* @__PURE__ */ n(function() {
1633
- return ee(r, "i");
1633
+ return re(r, "i");
1634
1634
  }, "_"),
1635
1635
  4: /* @__PURE__ */ n(function() {
1636
- return ee(r, "u");
1636
+ return re(r, "u");
1637
1637
  }, "_"),
1638
1638
  8: /* @__PURE__ */ n(function() {
1639
- return pr(r, "display:none");
1639
+ return yr(r, "display:none");
1640
1640
  }, "_"),
1641
1641
  9: /* @__PURE__ */ n(function() {
1642
- return ee(r, "strike");
1642
+ return re(r, "strike");
1643
1643
  }, "_"),
1644
1644
  22: /* @__PURE__ */ n(function() {
1645
- return pr(r, "font-weight:normal;text-decoration:none;font-style:normal");
1645
+ return yr(r, "font-weight:normal;text-decoration:none;font-style:normal");
1646
1646
  }, "_"),
1647
1647
  23: /* @__PURE__ */ n(function() {
1648
- return hn(r, "i");
1648
+ return _n(r, "i");
1649
1649
  }, "_"),
1650
1650
  24: /* @__PURE__ */ n(function() {
1651
- return hn(r, "u");
1651
+ return _n(r, "u");
1652
1652
  }, "_"),
1653
1653
  39: /* @__PURE__ */ n(function() {
1654
- return ur(r, t.fg);
1654
+ return mr(r, t.fg);
1655
1655
  }, "_"),
1656
1656
  49: /* @__PURE__ */ n(function() {
1657
- return fr(r, t.bg);
1657
+ return hr(r, t.bg);
1658
1658
  }, "_"),
1659
1659
  53: /* @__PURE__ */ n(function() {
1660
- return pr(r, "text-decoration:overline");
1660
+ return yr(r, "text-decoration:overline");
1661
1661
  }, "_")
1662
1662
  }, s;
1663
- return o[e] ? s = o[e]() : 4 < e && e < 7 ? s = ee(r, "blink") : 29 < e && e < 38 ? s = ur(r, t.colors[e - 30]) : 39 < e && e < 48 ? s =
1664
- fr(r, t.colors[e - 40]) : 89 < e && e < 98 ? s = ur(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (s = fr(r, t.colors[8 + (e - 100)])),
1663
+ return o[e] ? s = o[e]() : 4 < e && e < 7 ? s = re(r, "blink") : 29 < e && e < 38 ? s = mr(r, t.colors[e - 30]) : 39 < e && e < 48 ? s =
1664
+ hr(r, t.colors[e - 40]) : 89 < e && e < 98 ? s = mr(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (s = hr(r, t.colors[8 + (e - 100)])),
1665
1665
  s;
1666
1666
  }
1667
- n(Xa, "handleDisplay");
1668
- function Sn(r) {
1667
+ n(gl, "handleDisplay");
1668
+ function qn(r) {
1669
1669
  var e = r.slice(0);
1670
1670
  return r.length = 0, e.reverse().map(function(t) {
1671
1671
  return "</" + t + ">";
1672
1672
  }).join("");
1673
1673
  }
1674
- n(Sn, "resetStyles");
1675
- function dr(r, e) {
1674
+ n(qn, "resetStyles");
1675
+ function fr(r, e) {
1676
1676
  for (var t = [], o = r; o <= e; o++)
1677
1677
  t.push(o);
1678
1678
  return t;
1679
1679
  }
1680
- n(dr, "range");
1681
- function Ja(r) {
1680
+ n(fr, "range");
1681
+ function bl(r) {
1682
1682
  return function(e) {
1683
1683
  return (r === null || e.category !== r) && r !== "all";
1684
1684
  };
1685
1685
  }
1686
- n(Ja, "notCategory");
1687
- function mn(r) {
1686
+ n(bl, "notCategory");
1687
+ function Mn(r) {
1688
1688
  r = parseInt(r, 10);
1689
1689
  var e = null;
1690
1690
  return r === 0 ? e = "all" : r === 1 ? e = "bold" : 2 < r && r < 5 ? e = "underline" : 4 < r && r < 7 ? e = "blink" : r === 8 ? e = "hid\
1691
1691
  e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ? e = "foreground-color" : (39 < r && r < 48 || r === 49 || 99 <
1692
1692
  r && r < 108) && (e = "background-color"), e;
1693
1693
  }
1694
- n(mn, "categoryForCode");
1695
- function Qa(r, e) {
1696
- return e.escapeXML ? Va.encodeXML(r) : r;
1694
+ n(Mn, "categoryForCode");
1695
+ function Sl(r, e) {
1696
+ return e.escapeXML ? ul.encodeXML(r) : r;
1697
1697
  }
1698
- n(Qa, "pushText");
1699
- function ee(r, e, t) {
1698
+ n(Sl, "pushText");
1699
+ function re(r, e, t) {
1700
1700
  return t || (t = ""), r.push(e), "<".concat(e).concat(t ? ' style="'.concat(t, '"') : "", ">");
1701
1701
  }
1702
- n(ee, "pushTag");
1703
- function pr(r, e) {
1704
- return ee(r, "span", e);
1702
+ n(re, "pushTag");
1703
+ function yr(r, e) {
1704
+ return re(r, "span", e);
1705
1705
  }
1706
- n(pr, "pushStyle");
1707
- function ur(r, e) {
1708
- return ee(r, "span", "color:" + e);
1706
+ n(yr, "pushStyle");
1707
+ function mr(r, e) {
1708
+ return re(r, "span", "color:" + e);
1709
1709
  }
1710
- n(ur, "pushForegroundColor");
1711
- function fr(r, e) {
1712
- return ee(r, "span", "background-color:" + e);
1710
+ n(mr, "pushForegroundColor");
1711
+ function hr(r, e) {
1712
+ return re(r, "span", "background-color:" + e);
1713
1713
  }
1714
- n(fr, "pushBackgroundColor");
1715
- function hn(r, e) {
1714
+ n(hr, "pushBackgroundColor");
1715
+ function _n(r, e) {
1716
1716
  var t;
1717
1717
  if (r.slice(-1)[0] === e && (t = r.pop()), t)
1718
1718
  return "</" + e + ">";
1719
1719
  }
1720
- n(hn, "closeTag");
1721
- function Za(r, e, t) {
1720
+ n(_n, "closeTag");
1721
+ function Tl(r, e, t) {
1722
1722
  var o = !1, s = 3;
1723
1723
  function i() {
1724
1724
  return "";
@@ -1738,16 +1738,16 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1738
1738
  n(c, "newline");
1739
1739
  function d(R, w) {
1740
1740
  o = !0, w.trim().length === 0 && (w = "0"), w = w.trimRight(";").split(";");
1741
- var A = gn(w), F;
1741
+ var E = Nn(w), D;
1742
1742
  try {
1743
- for (A.s(); !(F = A.n()).done; ) {
1744
- var j = F.value;
1745
- t("display", j);
1743
+ for (E.s(); !(D = E.n()).done; ) {
1744
+ var k = D.value;
1745
+ t("display", k);
1746
1746
  }
1747
- } catch (N) {
1748
- A.e(N);
1747
+ } catch (L) {
1748
+ E.e(L);
1749
1749
  } finally {
1750
- A.f();
1750
+ E.f();
1751
1751
  }
1752
1752
  return "";
1753
1753
  }
@@ -1839,61 +1839,61 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
1839
1839
  }
1840
1840
  return g;
1841
1841
  }
1842
- n(Za, "tokenize");
1843
- function el(r, e, t) {
1844
- return e !== "text" && (r = r.filter(Ja(mn(t))), r.push({
1842
+ n(Tl, "tokenize");
1843
+ function xl(r, e, t) {
1844
+ return e !== "text" && (r = r.filter(bl(Mn(t))), r.push({
1845
1845
  token: e,
1846
1846
  data: t,
1847
- category: mn(t)
1847
+ category: Mn(t)
1848
1848
  })), r;
1849
1849
  }
1850
- n(el, "updateStickyStack");
1851
- var rl = /* @__PURE__ */ function() {
1850
+ n(xl, "updateStickyStack");
1851
+ var Rl = /* @__PURE__ */ function() {
1852
1852
  function r(e) {
1853
- Ga(this, r), e = e || {}, e.colors && (e.colors = Object.assign({}, fn.colors, e.colors)), this.options = Object.assign({}, fn, e), this.
1853
+ cl(this, r), e = e || {}, e.colors && (e.colors = Object.assign({}, kn.colors, e.colors)), this.options = Object.assign({}, kn, e), this.
1854
1854
  stack = [], this.stickyStack = [];
1855
1855
  }
1856
- return n(r, "Filter"), Ua(r, [{
1856
+ return n(r, "Filter"), dl(r, [{
1857
1857
  key: "toHtml",
1858
1858
  value: /* @__PURE__ */ n(function(t) {
1859
1859
  var o = this;
1860
1860
  t = typeof t == "string" ? [t] : t;
1861
1861
  var s = this.stack, i = this.options, a = [];
1862
1862
  return this.stickyStack.forEach(function(l) {
1863
- var c = yn(s, l.token, l.data, i);
1863
+ var c = jn(s, l.token, l.data, i);
1864
1864
  c && a.push(c);
1865
- }), Za(t.join(""), i, function(l, c) {
1866
- var d = yn(s, l, c, i);
1867
- d && a.push(d), i.stream && (o.stickyStack = el(o.stickyStack, l, c));
1868
- }), s.length && a.push(Sn(s)), a.join("");
1865
+ }), Tl(t.join(""), i, function(l, c) {
1866
+ var d = jn(s, l, c, i);
1867
+ d && a.push(d), i.stream && (o.stickyStack = xl(o.stickyStack, l, c));
1868
+ }), s.length && a.push(qn(s)), a.join("");
1869
1869
  }, "toHtml")
1870
1870
  }]), r;
1871
1871
  }();
1872
- Tn.exports = rl;
1872
+ Bn.exports = Rl;
1873
1873
  });
1874
1874
 
1875
1875
  // src/preview-api/modules/addons/main.ts
1876
- import { global as br } from "@storybook/global";
1876
+ import { global as xr } from "@storybook/global";
1877
1877
 
1878
1878
  // src/preview-api/modules/addons/storybook-channel-mock.ts
1879
- import { Channel as qn } from "storybook/internal/channels";
1880
- function gr() {
1879
+ import { Channel as ss } from "storybook/internal/channels";
1880
+ function Tr() {
1881
1881
  let r = {
1882
1882
  setHandler: /* @__PURE__ */ n(() => {
1883
1883
  }, "setHandler"),
1884
1884
  send: /* @__PURE__ */ n(() => {
1885
1885
  }, "send")
1886
1886
  };
1887
- return new qn({ transport: r });
1887
+ return new ss({ transport: r });
1888
1888
  }
1889
- n(gr, "mockChannel");
1889
+ n(Tr, "mockChannel");
1890
1890
 
1891
1891
  // src/preview-api/modules/addons/main.ts
1892
- var Tr = class {
1892
+ var Ar = class Ar {
1893
1893
  constructor() {
1894
1894
  this.getChannel = /* @__PURE__ */ n(() => {
1895
1895
  if (!this.channel) {
1896
- let e = gr();
1896
+ let e = Tr();
1897
1897
  return this.setChannel(e), e;
1898
1898
  }
1899
1899
  return this.channel;
@@ -1907,33 +1907,32 @@ var Tr = class {
1907
1907
  this.resolve = () => e(this.getChannel());
1908
1908
  });
1909
1909
  }
1910
- static {
1911
- n(this, "AddonStore");
1912
- }
1913
- }, Sr = "__STORYBOOK_ADDONS_PREVIEW";
1914
- function Bn() {
1915
- return br[Sr] || (br[Sr] = new Tr()), br[Sr];
1910
+ };
1911
+ n(Ar, "AddonStore");
1912
+ var wr = Ar, Rr = "__STORYBOOK_ADDONS_PREVIEW";
1913
+ function is() {
1914
+ return xr[Rr] || (xr[Rr] = new wr()), xr[Rr];
1916
1915
  }
1917
- n(Bn, "getAddonsStore");
1918
- var _ = Bn();
1916
+ n(is, "getAddonsStore");
1917
+ var _ = is();
1919
1918
 
1920
1919
  // src/preview-api/modules/addons/definePreview.ts
1921
- function zn(r) {
1920
+ function as(r) {
1922
1921
  return r;
1923
1922
  }
1924
- n(zn, "definePreview");
1923
+ n(as, "definePreview");
1925
1924
 
1926
1925
  // src/preview-api/modules/addons/hooks.ts
1927
- import { logger as Ae } from "storybook/internal/client-logger";
1926
+ import { logger as Ce } from "storybook/internal/client-logger";
1928
1927
  import {
1929
- FORCE_RE_RENDER as Gn,
1930
- RESET_STORY_ARGS as Un,
1931
- STORY_RENDERED as lt,
1932
- UPDATE_GLOBALS as Hn,
1933
- UPDATE_STORY_ARGS as Vn
1928
+ FORCE_RE_RENDER as ls,
1929
+ RESET_STORY_ARGS as cs,
1930
+ STORY_RENDERED as vt,
1931
+ UPDATE_GLOBALS as ds,
1932
+ UPDATE_STORY_ARGS as ps
1934
1933
  } from "storybook/internal/core-events";
1935
- import { global as ze } from "@storybook/global";
1936
- var re = class {
1934
+ import { global as Ue } from "@storybook/global";
1935
+ var Fr = class Fr {
1937
1936
  constructor() {
1938
1937
  this.hookListsMap = void 0;
1939
1938
  this.mountedDecorators = void 0;
@@ -1951,9 +1950,6 @@ var re = class {
1951
1950
  }, "renderListener");
1952
1951
  this.init();
1953
1952
  }
1954
- static {
1955
- n(this, "HooksContext");
1956
- }
1957
1953
  init() {
1958
1954
  this.hookListsMap = /* @__PURE__ */ new WeakMap(), this.mountedDecorators = /* @__PURE__ */ new Set(), this.prevMountedDecorators = /* @__PURE__ */ new Set(),
1959
1955
  this.currentHooks = [], this.nextHookIndex = 0, this.currentPhase = "NONE", this.currentEffects = [], this.prevEffects = [], this.currentDecoratorName =
@@ -1976,22 +1972,24 @@ var re = class {
1976
1972
  }), this.prevEffects = this.currentEffects, this.currentEffects = [];
1977
1973
  }
1978
1974
  addRenderListeners() {
1979
- this.removeRenderListeners(), _.getChannel().on(lt, this.renderListener);
1975
+ this.removeRenderListeners(), _.getChannel().on(vt, this.renderListener);
1980
1976
  }
1981
1977
  removeRenderListeners() {
1982
- _.getChannel().removeListener(lt, this.renderListener);
1978
+ _.getChannel().removeListener(vt, this.renderListener);
1983
1979
  }
1984
1980
  };
1985
- function ct(r) {
1981
+ n(Fr, "HooksContext");
1982
+ var te = Fr;
1983
+ function Pt(r) {
1986
1984
  let e = /* @__PURE__ */ n((...t) => {
1987
1985
  let { hooks: o } = typeof t[0] == "function" ? t[1] : t[0], s = o.currentPhase, i = o.currentHooks, a = o.nextHookIndex, l = o.currentDecoratorName;
1988
1986
  o.currentDecoratorName = r.name, o.prevMountedDecorators.has(r) ? (o.currentPhase = "UPDATE", o.currentHooks = o.hookListsMap.get(r) || []) :
1989
1987
  (o.currentPhase = "MOUNT", o.currentHooks = [], o.hookListsMap.set(r, o.currentHooks), o.prevMountedDecorators.add(r)), o.nextHookIndex =
1990
1988
  0;
1991
- let c = ze.STORYBOOK_HOOKS_CONTEXT;
1992
- ze.STORYBOOK_HOOKS_CONTEXT = o;
1989
+ let c = Ue.STORYBOOK_HOOKS_CONTEXT;
1990
+ Ue.STORYBOOK_HOOKS_CONTEXT = o;
1993
1991
  let d = r(...t);
1994
- if (ze.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
1992
+ if (Ue.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
1995
1993
  throw new Error(
1996
1994
  "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
1997
1995
  );
@@ -1999,41 +1997,41 @@ function ct(r) {
1999
1997
  }, "hookified");
2000
1998
  return e.originalFn = r, e;
2001
1999
  }
2002
- n(ct, "hookify");
2003
- var xr = 0, Wn = 25, Rr = /* @__PURE__ */ n((r) => (e, t) => {
2000
+ n(Pt, "hookify");
2001
+ var Er = 0, us = 25, Cr = /* @__PURE__ */ n((r) => (e, t) => {
2004
2002
  let o = r(
2005
- ct(e),
2006
- t.map((s) => ct(s))
2003
+ Pt(e),
2004
+ t.map((s) => Pt(s))
2007
2005
  );
2008
2006
  return (s) => {
2009
2007
  let { hooks: i } = s;
2010
2008
  i.prevMountedDecorators ??= /* @__PURE__ */ new Set(), i.mountedDecorators = /* @__PURE__ */ new Set([e, ...t]), i.currentContext = s, i.
2011
2009
  hasUpdates = !1;
2012
2010
  let a = o(s);
2013
- for (xr = 1; i.hasUpdates; )
2014
- if (i.hasUpdates = !1, i.currentEffects = [], a = o(s), xr += 1, xr > Wn)
2011
+ for (Er = 1; i.hasUpdates; )
2012
+ if (i.hasUpdates = !1, i.currentEffects = [], a = o(s), Er += 1, Er > us)
2015
2013
  throw new Error(
2016
2014
  "Too many re-renders. Storybook limits the number of renders to prevent an infinite loop."
2017
2015
  );
2018
2016
  return i.addRenderListeners(), a;
2019
2017
  };
2020
- }, "applyHooks"), $n = /* @__PURE__ */ n((r, e) => r.length === e.length && r.every((t, o) => t === e[o]), "areDepsEqual"), wr = /* @__PURE__ */ n(
2018
+ }, "applyHooks"), fs = /* @__PURE__ */ n((r, e) => r.length === e.length && r.every((t, o) => t === e[o]), "areDepsEqual"), vr = /* @__PURE__ */ n(
2021
2019
  () => new Error("Storybook preview hooks can only be called inside decorators and story functions."), "invalidHooksError");
2022
- function dt() {
2023
- return ze.STORYBOOK_HOOKS_CONTEXT || null;
2020
+ function Ft() {
2021
+ return Ue.STORYBOOK_HOOKS_CONTEXT || null;
2024
2022
  }
2025
- n(dt, "getHooksContextOrNull");
2026
- function Er() {
2027
- let r = dt();
2023
+ n(Ft, "getHooksContextOrNull");
2024
+ function Pr() {
2025
+ let r = Ft();
2028
2026
  if (r == null)
2029
- throw wr();
2027
+ throw vr();
2030
2028
  return r;
2031
2029
  }
2032
- n(Er, "getHooksContextOrThrow");
2033
- function Yn(r, e, t) {
2034
- let o = Er();
2030
+ n(Pr, "getHooksContextOrThrow");
2031
+ function ys(r, e, t) {
2032
+ let o = Pr();
2035
2033
  if (o.currentPhase === "MOUNT") {
2036
- t != null && !Array.isArray(t) && Ae.warn(
2034
+ t != null && !Array.isArray(t) && Ce.warn(
2037
2035
  `${r} received a final argument that is not an array (instead, received ${t}). When specified, the final argument must be an array.`
2038
2036
  );
2039
2037
  let s = { name: r, deps: t };
@@ -2043,22 +2041,22 @@ function Yn(r, e, t) {
2043
2041
  let s = o.getNextHook();
2044
2042
  if (s == null)
2045
2043
  throw new Error("Rendered more hooks than during the previous render.");
2046
- return s.name !== r && Ae.warn(
2044
+ return s.name !== r && Ce.warn(
2047
2045
  `Storybook has detected a change in the order of Hooks${o.currentDecoratorName ? ` called by ${o.currentDecoratorName}` : ""}. This wi\
2048
2046
  ll lead to bugs and errors if not fixed.`
2049
- ), t != null && s.deps == null && Ae.warn(
2047
+ ), t != null && s.deps == null && Ce.warn(
2050
2048
  `${r} received a final argument during this render, but not during the previous render. Even though the final argument is optional, it\
2051
2049
  s type cannot change between renders.`
2052
- ), t != null && s.deps != null && t.length !== s.deps.length && Ae.warn(`The final argument passed to ${r} changed size between renders.\
2050
+ ), t != null && s.deps != null && t.length !== s.deps.length && Ce.warn(`The final argument passed to ${r} changed size between renders.\
2053
2051
  The order and size of this array must remain constant.
2054
2052
  Previous: ${s.deps}
2055
- Incoming: ${t}`), (t == null || s.deps == null || !$n(t, s.deps)) && (e(s), s.deps = t), s;
2053
+ Incoming: ${t}`), (t == null || s.deps == null || !fs(t, s.deps)) && (e(s), s.deps = t), s;
2056
2054
  }
2057
- throw wr();
2055
+ throw vr();
2058
2056
  }
2059
- n(Yn, "useHook");
2060
- function Ge(r, e, t) {
2061
- let { memoizedState: o } = Yn(
2057
+ n(ys, "useHook");
2058
+ function He(r, e, t) {
2059
+ let { memoizedState: o } = ys(
2062
2060
  r,
2063
2061
  (s) => {
2064
2062
  s.memoizedState = e();
@@ -2067,104 +2065,104 @@ function Ge(r, e, t) {
2067
2065
  );
2068
2066
  return o;
2069
2067
  }
2070
- n(Ge, "useMemoLike");
2071
- function Kn(r, e) {
2072
- return Ge("useMemo", r, e);
2068
+ n(He, "useMemoLike");
2069
+ function ms(r, e) {
2070
+ return He("useMemo", r, e);
2073
2071
  }
2074
- n(Kn, "useMemo");
2075
- function Ce(r, e) {
2076
- return Ge("useCallback", () => r, e);
2072
+ n(ms, "useMemo");
2073
+ function ve(r, e) {
2074
+ return He("useCallback", () => r, e);
2077
2075
  }
2078
- n(Ce, "useCallback");
2079
- function pt(r, e) {
2080
- return Ge(r, () => ({ current: e }), []);
2076
+ n(ve, "useCallback");
2077
+ function It(r, e) {
2078
+ return He(r, () => ({ current: e }), []);
2081
2079
  }
2082
- n(pt, "useRefLike");
2083
- function Xn(r) {
2084
- return pt("useRef", r);
2080
+ n(It, "useRefLike");
2081
+ function hs(r) {
2082
+ return It("useRef", r);
2085
2083
  }
2086
- n(Xn, "useRef");
2087
- function Jn() {
2088
- let r = dt();
2084
+ n(hs, "useRef");
2085
+ function gs() {
2086
+ let r = Ft();
2089
2087
  if (r != null && r.currentPhase !== "NONE")
2090
2088
  r.hasUpdates = !0;
2091
2089
  else
2092
2090
  try {
2093
- _.getChannel().emit(Gn);
2091
+ _.getChannel().emit(ls);
2094
2092
  } catch {
2095
- Ae.warn("State updates of Storybook preview hooks work only in browser");
2093
+ Ce.warn("State updates of Storybook preview hooks work only in browser");
2096
2094
  }
2097
2095
  }
2098
- n(Jn, "triggerUpdate");
2099
- function ut(r, e) {
2100
- let t = pt(
2096
+ n(gs, "triggerUpdate");
2097
+ function Ot(r, e) {
2098
+ let t = It(
2101
2099
  r,
2102
2100
  // @ts-expect-error S type should never be function, but there's no way to tell that to TypeScript
2103
2101
  typeof e == "function" ? e() : e
2104
2102
  ), o = /* @__PURE__ */ n((s) => {
2105
- t.current = typeof s == "function" ? s(t.current) : s, Jn();
2103
+ t.current = typeof s == "function" ? s(t.current) : s, gs();
2106
2104
  }, "setState");
2107
2105
  return [t.current, o];
2108
2106
  }
2109
- n(ut, "useStateLike");
2110
- function Qn(r) {
2111
- return ut("useState", r);
2107
+ n(Ot, "useStateLike");
2108
+ function bs(r) {
2109
+ return Ot("useState", r);
2112
2110
  }
2113
- n(Qn, "useState");
2114
- function Zn(r, e, t) {
2115
- let o = t != null ? () => t(e) : e, [s, i] = ut("useReducer", o);
2111
+ n(bs, "useState");
2112
+ function Ss(r, e, t) {
2113
+ let o = t != null ? () => t(e) : e, [s, i] = Ot("useReducer", o);
2116
2114
  return [s, /* @__PURE__ */ n((l) => i((c) => r(c, l)), "dispatch")];
2117
2115
  }
2118
- n(Zn, "useReducer");
2119
- function ft(r, e) {
2120
- let t = Er(), o = Ge("useEffect", () => ({ create: r }), e);
2116
+ n(Ss, "useReducer");
2117
+ function Dt(r, e) {
2118
+ let t = Pr(), o = He("useEffect", () => ({ create: r }), e);
2121
2119
  t.currentEffects.includes(o) || t.currentEffects.push(o);
2122
2120
  }
2123
- n(ft, "useEffect");
2124
- function es(r, e = []) {
2121
+ n(Dt, "useEffect");
2122
+ function Ts(r, e = []) {
2125
2123
  let t = _.getChannel();
2126
- return ft(() => (Object.entries(r).forEach(([o, s]) => t.on(o, s)), () => {
2124
+ return Dt(() => (Object.entries(r).forEach(([o, s]) => t.on(o, s)), () => {
2127
2125
  Object.entries(r).forEach(
2128
2126
  ([o, s]) => t.removeListener(o, s)
2129
2127
  );
2130
- }), [...Object.keys(r), ...e]), Ce(t.emit.bind(t), [t]);
2128
+ }), [...Object.keys(r), ...e]), ve(t.emit.bind(t), [t]);
2131
2129
  }
2132
- n(es, "useChannel");
2133
- function Ue() {
2134
- let { currentContext: r } = Er();
2130
+ n(Ts, "useChannel");
2131
+ function Ve() {
2132
+ let { currentContext: r } = Pr();
2135
2133
  if (r == null)
2136
- throw wr();
2134
+ throw vr();
2137
2135
  return r;
2138
2136
  }
2139
- n(Ue, "useStoryContext");
2140
- function rs(r, e) {
2141
- let { parameters: t } = Ue();
2137
+ n(Ve, "useStoryContext");
2138
+ function xs(r, e) {
2139
+ let { parameters: t } = Ve();
2142
2140
  if (r)
2143
2141
  return t[r] ?? e;
2144
2142
  }
2145
- n(rs, "useParameter");
2146
- function ts() {
2147
- let r = _.getChannel(), { id: e, args: t } = Ue(), o = Ce(
2148
- (i) => r.emit(Vn, { storyId: e, updatedArgs: i }),
2143
+ n(xs, "useParameter");
2144
+ function Rs() {
2145
+ let r = _.getChannel(), { id: e, args: t } = Ve(), o = ve(
2146
+ (i) => r.emit(ps, { storyId: e, updatedArgs: i }),
2149
2147
  [r, e]
2150
- ), s = Ce(
2151
- (i) => r.emit(Un, { storyId: e, argNames: i }),
2148
+ ), s = ve(
2149
+ (i) => r.emit(cs, { storyId: e, argNames: i }),
2152
2150
  [r, e]
2153
2151
  );
2154
2152
  return [t, o, s];
2155
2153
  }
2156
- n(ts, "useArgs");
2157
- function os() {
2158
- let r = _.getChannel(), { globals: e } = Ue(), t = Ce(
2159
- (o) => r.emit(Hn, { globals: o }),
2154
+ n(Rs, "useArgs");
2155
+ function ws() {
2156
+ let r = _.getChannel(), { globals: e } = Ve(), t = ve(
2157
+ (o) => r.emit(ds, { globals: o }),
2160
2158
  [r]
2161
2159
  );
2162
2160
  return [e, t];
2163
2161
  }
2164
- n(os, "useGlobals");
2162
+ n(ws, "useGlobals");
2165
2163
 
2166
2164
  // src/preview-api/modules/addons/make-decorator.ts
2167
- var ns = /* @__PURE__ */ n(({
2165
+ var As = /* @__PURE__ */ n(({
2168
2166
  name: r,
2169
2167
  parameterName: e,
2170
2168
  wrapper: t,
@@ -2189,46 +2187,46 @@ var ns = /* @__PURE__ */ n(({
2189
2187
 
2190
2188
  // src/preview-api/modules/store/StoryStore.ts
2191
2189
  import {
2192
- CalledExtractOnStoreError as Us,
2193
- MissingStoryFromCsfFileError as Hs
2190
+ CalledExtractOnStoreError as di,
2191
+ MissingStoryFromCsfFileError as pi
2194
2192
  } from "storybook/internal/preview-errors";
2195
2193
 
2196
2194
  // ../node_modules/es-toolkit/dist/function/noop.mjs
2197
- function yt() {
2195
+ function kt() {
2198
2196
  }
2199
- n(yt, "noop");
2197
+ n(kt, "noop");
2200
2198
 
2201
2199
  // ../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
2202
- function Ar(r) {
2200
+ function Ir(r) {
2203
2201
  return Object.getOwnPropertySymbols(r).filter((e) => Object.prototype.propertyIsEnumerable.call(r, e));
2204
2202
  }
2205
- n(Ar, "getSymbols");
2203
+ n(Ir, "getSymbols");
2206
2204
 
2207
2205
  // ../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
2208
- function Cr(r) {
2206
+ function Or(r) {
2209
2207
  return r == null ? r === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(r);
2210
2208
  }
2211
- n(Cr, "getTag");
2209
+ n(Or, "getTag");
2212
2210
 
2213
2211
  // ../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
2214
- var mt = "[object RegExp]", ht = "[object String]", gt = "[object Number]", bt = "[object Boolean]", vr = "[object Arguments]", St = "[objec\
2215
- t Symbol]", Tt = "[object Date]", xt = "[object Map]", Rt = "[object Set]", wt = "[object Array]", Et = "[object Function]", At = "[object A\
2216
- rrayBuffer]", He = "[object Object]", Ct = "[object Error]", vt = "[object DataView]", Pt = "[object Uint8Array]", Ft = "[object Uint8Clampe\
2217
- dArray]", It = "[object Uint16Array]", Ot = "[object Uint32Array]", Dt = "[object BigUint64Array]", kt = "[object Int8Array]", jt = "[object\
2218
- Int16Array]", Mt = "[object Int32Array]", _t = "[object BigInt64Array]", Lt = "[object Float32Array]", Nt = "[object Float64Array]";
2212
+ var jt = "[object RegExp]", Mt = "[object String]", _t = "[object Number]", Nt = "[object Boolean]", Dr = "[object Arguments]", Lt = "[objec\
2213
+ t Symbol]", qt = "[object Date]", Bt = "[object Map]", zt = "[object Set]", Gt = "[object Array]", Ut = "[object Function]", Ht = "[object A\
2214
+ rrayBuffer]", We = "[object Object]", Vt = "[object Error]", Wt = "[object DataView]", $t = "[object Uint8Array]", Yt = "[object Uint8Clampe\
2215
+ dArray]", Kt = "[object Uint16Array]", Xt = "[object Uint32Array]", Jt = "[object BigUint64Array]", Qt = "[object Int8Array]", Zt = "[object\
2216
+ Int16Array]", eo = "[object Int32Array]", ro = "[object BigInt64Array]", to = "[object Float32Array]", oo = "[object Float64Array]";
2219
2217
 
2220
2218
  // ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
2221
- function k(r) {
2219
+ function j(r) {
2222
2220
  if (!r || typeof r != "object")
2223
2221
  return !1;
2224
2222
  let e = Object.getPrototypeOf(r);
2225
2223
  return e === null || e === Object.prototype || Object.getPrototypeOf(e) === null ? Object.prototype.toString.call(r) === "[object Object]" :
2226
2224
  !1;
2227
2225
  }
2228
- n(k, "isPlainObject");
2226
+ n(j, "isPlainObject");
2229
2227
 
2230
2228
  // ../node_modules/es-toolkit/dist/object/mapValues.mjs
2231
- function H(r, e) {
2229
+ function V(r, e) {
2232
2230
  let t = {}, o = Object.keys(r);
2233
2231
  for (let s = 0; s < o.length; s++) {
2234
2232
  let i = o[s], a = r[i];
@@ -2236,10 +2234,10 @@ function H(r, e) {
2236
2234
  }
2237
2235
  return t;
2238
2236
  }
2239
- n(H, "mapValues");
2237
+ n(V, "mapValues");
2240
2238
 
2241
2239
  // ../node_modules/es-toolkit/dist/object/pickBy.mjs
2242
- function Pr(r, e) {
2240
+ function kr(r, e) {
2243
2241
  let t = {}, o = Object.keys(r);
2244
2242
  for (let s = 0; s < o.length; s++) {
2245
2243
  let i = o[s], a = r[i];
@@ -2247,20 +2245,20 @@ function Pr(r, e) {
2247
2245
  }
2248
2246
  return t;
2249
2247
  }
2250
- n(Pr, "pickBy");
2248
+ n(kr, "pickBy");
2251
2249
 
2252
2250
  // ../node_modules/es-toolkit/dist/compat/util/eq.mjs
2253
- function qt(r, e) {
2251
+ function no(r, e) {
2254
2252
  return r === e || Number.isNaN(r) && Number.isNaN(e);
2255
2253
  }
2256
- n(qt, "eq");
2254
+ n(no, "eq");
2257
2255
 
2258
2256
  // ../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
2259
- function Bt(r, e, t) {
2260
- return ve(r, e, void 0, void 0, void 0, void 0, t);
2257
+ function so(r, e, t) {
2258
+ return Pe(r, e, void 0, void 0, void 0, void 0, t);
2261
2259
  }
2262
- n(Bt, "isEqualWith");
2263
- function ve(r, e, t, o, s, i, a) {
2260
+ n(so, "isEqualWith");
2261
+ function Pe(r, e, t, o, s, i, a) {
2264
2262
  let l = a(r, e, t, o, s, i);
2265
2263
  if (l !== void 0)
2266
2264
  return l;
@@ -2277,31 +2275,31 @@ function ve(r, e, t, o, s, i, a) {
2277
2275
  case "function":
2278
2276
  return r === e;
2279
2277
  case "object":
2280
- return Pe(r, e, i, a);
2278
+ return Fe(r, e, i, a);
2281
2279
  }
2282
- return Pe(r, e, i, a);
2280
+ return Fe(r, e, i, a);
2283
2281
  }
2284
- n(ve, "isEqualWithImpl");
2285
- function Pe(r, e, t, o) {
2282
+ n(Pe, "isEqualWithImpl");
2283
+ function Fe(r, e, t, o) {
2286
2284
  if (Object.is(r, e))
2287
2285
  return !0;
2288
- let s = Cr(r), i = Cr(e);
2289
- if (s === vr && (s = He), i === vr && (i = He), s !== i)
2286
+ let s = Or(r), i = Or(e);
2287
+ if (s === Dr && (s = We), i === Dr && (i = We), s !== i)
2290
2288
  return !1;
2291
2289
  switch (s) {
2292
- case ht:
2290
+ case Mt:
2293
2291
  return r.toString() === e.toString();
2294
- case gt: {
2292
+ case _t: {
2295
2293
  let c = r.valueOf(), d = e.valueOf();
2296
- return qt(c, d);
2294
+ return no(c, d);
2297
2295
  }
2298
- case bt:
2299
- case Tt:
2300
- case St:
2296
+ case Nt:
2297
+ case qt:
2298
+ case Lt:
2301
2299
  return Object.is(r.valueOf(), e.valueOf());
2302
- case mt:
2300
+ case jt:
2303
2301
  return r.source === e.source && r.flags === e.flags;
2304
- case Et:
2302
+ case Ut:
2305
2303
  return r === e;
2306
2304
  }
2307
2305
  t = t ?? /* @__PURE__ */ new Map();
@@ -2311,55 +2309,55 @@ function Pe(r, e, t, o) {
2311
2309
  t.set(r, e), t.set(e, r);
2312
2310
  try {
2313
2311
  switch (s) {
2314
- case xt: {
2312
+ case Bt: {
2315
2313
  if (r.size !== e.size)
2316
2314
  return !1;
2317
2315
  for (let [c, d] of r.entries())
2318
- if (!e.has(c) || !ve(d, e.get(c), c, r, e, t, o))
2316
+ if (!e.has(c) || !Pe(d, e.get(c), c, r, e, t, o))
2319
2317
  return !1;
2320
2318
  return !0;
2321
2319
  }
2322
- case Rt: {
2320
+ case zt: {
2323
2321
  if (r.size !== e.size)
2324
2322
  return !1;
2325
2323
  let c = Array.from(r.values()), d = Array.from(e.values());
2326
2324
  for (let p = 0; p < c.length; p++) {
2327
- let u = c[p], y = d.findIndex((h) => ve(u, h, void 0, r, e, t, o));
2325
+ let u = c[p], y = d.findIndex((h) => Pe(u, h, void 0, r, e, t, o));
2328
2326
  if (y === -1)
2329
2327
  return !1;
2330
2328
  d.splice(y, 1);
2331
2329
  }
2332
2330
  return !0;
2333
2331
  }
2334
- case wt:
2335
- case Pt:
2336
- case Ft:
2337
- case It:
2338
- case Ot:
2339
- case Dt:
2340
- case kt:
2341
- case jt:
2342
- case Mt:
2343
- case _t:
2344
- case Lt:
2345
- case Nt: {
2332
+ case Gt:
2333
+ case $t:
2334
+ case Yt:
2335
+ case Kt:
2336
+ case Xt:
2337
+ case Jt:
2338
+ case Qt:
2339
+ case Zt:
2340
+ case eo:
2341
+ case ro:
2342
+ case to:
2343
+ case oo: {
2346
2344
  if (typeof Buffer < "u" && Buffer.isBuffer(r) !== Buffer.isBuffer(e) || r.length !== e.length)
2347
2345
  return !1;
2348
2346
  for (let c = 0; c < r.length; c++)
2349
- if (!ve(r[c], e[c], c, r, e, t, o))
2347
+ if (!Pe(r[c], e[c], c, r, e, t, o))
2350
2348
  return !1;
2351
2349
  return !0;
2352
2350
  }
2353
- case At:
2354
- return r.byteLength !== e.byteLength ? !1 : Pe(new Uint8Array(r), new Uint8Array(e), t, o);
2355
- case vt:
2356
- return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 : Pe(new Uint8Array(r), new Uint8Array(e), t, o);
2357
- case Ct:
2351
+ case Ht:
2352
+ return r.byteLength !== e.byteLength ? !1 : Fe(new Uint8Array(r), new Uint8Array(e), t, o);
2353
+ case Wt:
2354
+ return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 : Fe(new Uint8Array(r), new Uint8Array(e), t, o);
2355
+ case Vt:
2358
2356
  return r.name === e.name && r.message === e.message;
2359
- case He: {
2360
- if (!(Pe(r.constructor, e.constructor, t, o) || k(r) && k(e)))
2357
+ case We: {
2358
+ if (!(Fe(r.constructor, e.constructor, t, o) || j(r) && j(e)))
2361
2359
  return !1;
2362
- let d = [...Object.keys(r), ...Ar(r)], p = [...Object.keys(e), ...Ar(e)];
2360
+ let d = [...Object.keys(r), ...Ir(r)], p = [...Object.keys(e), ...Ir(e)];
2363
2361
  if (d.length !== p.length)
2364
2362
  return !1;
2365
2363
  for (let u = 0; u < d.length; u++) {
@@ -2367,7 +2365,7 @@ function Pe(r, e, t, o) {
2367
2365
  if (!Object.hasOwn(e, y))
2368
2366
  return !1;
2369
2367
  let g = e[y];
2370
- if (!ve(h, g, y, r, e, t, o))
2368
+ if (!Pe(h, g, y, r, e, t, o))
2371
2369
  return !1;
2372
2370
  }
2373
2371
  return !0;
@@ -2379,50 +2377,50 @@ function Pe(r, e, t, o) {
2379
2377
  t.delete(r), t.delete(e);
2380
2378
  }
2381
2379
  }
2382
- n(Pe, "areObjectsEqual");
2380
+ n(Fe, "areObjectsEqual");
2383
2381
 
2384
2382
  // ../node_modules/es-toolkit/dist/predicate/isEqual.mjs
2385
- function Fr(r, e) {
2386
- return Bt(r, e, yt);
2383
+ function jr(r, e) {
2384
+ return so(r, e, kt);
2387
2385
  }
2388
- n(Fr, "isEqual");
2386
+ n(jr, "isEqual");
2389
2387
 
2390
2388
  // src/preview-api/modules/store/StoryStore.ts
2391
- var Ze = ue(Or(), 1);
2389
+ var tr = ue(_r(), 1);
2392
2390
 
2393
- // src/preview-api/core-annotations.ts
2394
- import Gt from "storybook/internal/component-testing/preview";
2395
- import Ut from "storybook/actions/preview";
2396
- import Ht from "storybook/backgrounds/preview";
2397
- import Vt from "storybook/highlight/preview";
2398
- import Wt from "storybook/measure/preview";
2399
- import $t from "storybook/outline/preview";
2400
- import Yt from "storybook/test/preview";
2401
- import Kt from "storybook/viewport/preview";
2402
- function te() {
2391
+ // src/shared/preview/core-annotations.ts
2392
+ import ao from "storybook/internal/component-testing/preview";
2393
+ import lo from "storybook/actions/preview";
2394
+ import co from "storybook/backgrounds/preview";
2395
+ import po from "storybook/highlight/preview";
2396
+ import uo from "storybook/measure/preview";
2397
+ import fo from "storybook/outline/preview";
2398
+ import yo from "storybook/test/preview";
2399
+ import mo from "storybook/viewport/preview";
2400
+ function Ie() {
2403
2401
  return [
2404
2402
  // @ts-expect-error CJS fallback
2405
- (Wt.default ?? Wt)(),
2403
+ (uo.default ?? uo)(),
2406
2404
  // @ts-expect-error CJS fallback
2407
- (Ht.default ?? Ht)(),
2405
+ (co.default ?? co)(),
2408
2406
  // @ts-expect-error CJS fallback
2409
- (Vt.default ?? Vt)(),
2407
+ (po.default ?? po)(),
2410
2408
  // @ts-expect-error CJS fallback
2411
- ($t.default ?? $t)(),
2409
+ (fo.default ?? fo)(),
2412
2410
  // @ts-expect-error CJS fallback
2413
- (Kt.default ?? Kt)(),
2411
+ (mo.default ?? mo)(),
2414
2412
  // @ts-expect-error CJS fallback
2415
- (Ut.default ?? Ut)(),
2413
+ (lo.default ?? lo)(),
2416
2414
  // @ts-expect-error CJS fallback
2417
- (Gt.default ?? Gt)(),
2415
+ (ao.default ?? ao)(),
2418
2416
  // @ts-expect-error CJS fallback
2419
- (Yt.default ?? Yt)()
2417
+ (yo.default ?? yo)()
2420
2418
  ];
2421
2419
  }
2422
- n(te, "getCoreAnnotations");
2420
+ n(Ie, "getCoreAnnotations");
2423
2421
 
2424
2422
  // src/preview-api/modules/store/args.ts
2425
- import { once as Dr } from "storybook/internal/client-logger";
2423
+ import { once as Nr } from "storybook/internal/client-logger";
2426
2424
 
2427
2425
  // ../node_modules/ts-dedent/esm/index.js
2428
2426
  function P(r) {
@@ -2460,7 +2458,7 @@ function P(r) {
2460
2458
  n(P, "dedent");
2461
2459
 
2462
2460
  // src/preview-api/modules/store/args.ts
2463
- var fe = Symbol("incompatible"), kr = /* @__PURE__ */ n((r, e) => {
2461
+ var fe = Symbol("incompatible"), Lr = /* @__PURE__ */ n((r, e) => {
2464
2462
  let t = e.type;
2465
2463
  if (r == null || !t || e.mapping)
2466
2464
  return r;
@@ -2475,46 +2473,46 @@ var fe = Symbol("incompatible"), kr = /* @__PURE__ */ n((r, e) => {
2475
2473
  return String(r) === "true";
2476
2474
  case "array":
2477
2475
  return !t.value || !Array.isArray(r) ? fe : r.reduce((o, s, i) => {
2478
- let a = kr(s, { type: t.value });
2476
+ let a = Lr(s, { type: t.value });
2479
2477
  return a !== fe && (o[i] = a), o;
2480
2478
  }, new Array(r.length));
2481
2479
  case "object":
2482
2480
  return typeof r == "string" || typeof r == "number" ? r : !t.value || typeof r != "object" ? fe : Object.entries(r).reduce((o, [s, i]) => {
2483
- let a = kr(i, { type: t.value[s] });
2481
+ let a = Lr(i, { type: t.value[s] });
2484
2482
  return a === fe ? o : Object.assign(o, { [s]: a });
2485
2483
  }, {});
2486
2484
  default:
2487
2485
  return fe;
2488
2486
  }
2489
- }, "map"), Xt = /* @__PURE__ */ n((r, e) => Object.entries(r).reduce((t, [o, s]) => {
2487
+ }, "map"), ho = /* @__PURE__ */ n((r, e) => Object.entries(r).reduce((t, [o, s]) => {
2490
2488
  if (!e[o])
2491
2489
  return t;
2492
- let i = kr(s, e[o]);
2490
+ let i = Lr(s, e[o]);
2493
2491
  return i === fe ? t : Object.assign(t, { [o]: i });
2494
- }, {}), "mapArgsToTypes"), Fe = /* @__PURE__ */ n((r, e) => Array.isArray(r) && Array.isArray(e) ? e.reduce(
2495
- (t, o, s) => (t[s] = Fe(r[s], e[s]), t),
2492
+ }, {}), "mapArgsToTypes"), Oe = /* @__PURE__ */ n((r, e) => Array.isArray(r) && Array.isArray(e) ? e.reduce(
2493
+ (t, o, s) => (t[s] = Oe(r[s], e[s]), t),
2496
2494
  [...r]
2497
- ).filter((t) => t !== void 0) : !k(r) || !k(e) ? e : Object.keys({ ...r, ...e }).reduce((t, o) => {
2495
+ ).filter((t) => t !== void 0) : !j(r) || !j(e) ? e : Object.keys({ ...r, ...e }).reduce((t, o) => {
2498
2496
  if (o in e) {
2499
- let s = Fe(r[o], e[o]);
2497
+ let s = Oe(r[o], e[o]);
2500
2498
  s !== void 0 && (t[o] = s);
2501
2499
  } else
2502
2500
  t[o] = r[o];
2503
2501
  return t;
2504
- }, {}), "combineArgs"), Jt = /* @__PURE__ */ n((r, e) => Object.entries(e).reduce((t, [o, { options: s }]) => {
2502
+ }, {}), "combineArgs"), go = /* @__PURE__ */ n((r, e) => Object.entries(e).reduce((t, [o, { options: s }]) => {
2505
2503
  function i() {
2506
2504
  return o in r && (t[o] = r[o]), t;
2507
2505
  }
2508
2506
  if (n(i, "allowArg"), !s)
2509
2507
  return i();
2510
2508
  if (!Array.isArray(s))
2511
- return Dr.error(P`
2509
+ return Nr.error(P`
2512
2510
  Invalid argType: '${o}.options' should be an array.
2513
2511
 
2514
2512
  More info: https://storybook.js.org/docs/api/arg-types
2515
2513
  `), i();
2516
2514
  if (s.some((u) => u && ["object", "function"].includes(typeof u)))
2517
- return Dr.error(P`
2515
+ return Nr.error(P`
2518
2516
  Invalid argType: '${o}.options' should only contain primitives. Use a 'mapping' for complex values.
2519
2517
 
2520
2518
  More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
@@ -2523,11 +2521,11 @@ var fe = Symbol("incompatible"), kr = /* @__PURE__ */ n((r, e) => {
2523
2521
  if (r[o] === void 0 || s.includes(r[o]) || c)
2524
2522
  return i();
2525
2523
  let d = a ? `${o}[${l}]` : o, p = s.map((u) => typeof u == "string" ? `'${u}'` : String(u)).join(", ");
2526
- return Dr.warn(`Received illegal value for '${d}'. Supported options: ${p}`), t;
2524
+ return Nr.warn(`Received illegal value for '${d}'. Supported options: ${p}`), t;
2527
2525
  }, {}), "validateOptions"), oe = Symbol("Deeply equal"), ye = /* @__PURE__ */ n((r, e) => {
2528
2526
  if (typeof r != typeof e)
2529
2527
  return e;
2530
- if (Fr(r, e))
2528
+ if (jr(r, e))
2531
2529
  return oe;
2532
2530
  if (Array.isArray(r) && Array.isArray(e)) {
2533
2531
  let t = e.reduce((o, s, i) => {
@@ -2536,36 +2534,33 @@ var fe = Symbol("incompatible"), kr = /* @__PURE__ */ n((r, e) => {
2536
2534
  }, new Array(e.length));
2537
2535
  return e.length >= r.length ? t : t.concat(new Array(r.length - e.length).fill(void 0));
2538
2536
  }
2539
- return k(r) && k(e) ? Object.keys({ ...r, ...e }).reduce((t, o) => {
2537
+ return j(r) && j(e) ? Object.keys({ ...r, ...e }).reduce((t, o) => {
2540
2538
  let s = ye(r?.[o], e?.[o]);
2541
2539
  return s === oe ? t : Object.assign(t, { [o]: s });
2542
2540
  }, {}) : e;
2543
- }, "deepDiff"), jr = "UNTARGETED";
2544
- function Qt({
2541
+ }, "deepDiff"), qr = "UNTARGETED";
2542
+ function bo({
2545
2543
  args: r,
2546
2544
  argTypes: e
2547
2545
  }) {
2548
2546
  let t = {};
2549
2547
  return Object.entries(r).forEach(([o, s]) => {
2550
- let { target: i = jr } = e[o] || {};
2548
+ let { target: i = qr } = e[o] || {};
2551
2549
  t[i] = t[i] || {}, t[i][o] = s;
2552
2550
  }), t;
2553
2551
  }
2554
- n(Qt, "groupArgsByTarget");
2552
+ n(bo, "groupArgsByTarget");
2555
2553
 
2556
2554
  // src/preview-api/modules/store/ArgsStore.ts
2557
- function ss(r) {
2555
+ function Es(r) {
2558
2556
  return Object.keys(r).forEach((e) => r[e] === void 0 && delete r[e]), r;
2559
2557
  }
2560
- n(ss, "deleteUndefined");
2561
- var Ve = class {
2558
+ n(Es, "deleteUndefined");
2559
+ var Br = class Br {
2562
2560
  constructor() {
2563
2561
  this.initialArgsByStoryId = {};
2564
2562
  this.argsByStoryId = {};
2565
2563
  }
2566
- static {
2567
- n(this, "ArgsStore");
2568
- }
2569
2564
  get(e) {
2570
2565
  if (!(e in this.argsByStoryId))
2571
2566
  throw new Error(`No args known for ${e} -- has it been rendered yet?`);
@@ -2580,35 +2575,34 @@ var Ve = class {
2580
2575
  }
2581
2576
  }
2582
2577
  updateFromDelta(e, t) {
2583
- let o = Jt(t, e.argTypes);
2584
- this.argsByStoryId[e.id] = Fe(this.argsByStoryId[e.id], o);
2578
+ let o = go(t, e.argTypes);
2579
+ this.argsByStoryId[e.id] = Oe(this.argsByStoryId[e.id], o);
2585
2580
  }
2586
2581
  updateFromPersisted(e, t) {
2587
- let o = Xt(t, e.argTypes);
2582
+ let o = ho(t, e.argTypes);
2588
2583
  return this.updateFromDelta(e, o);
2589
2584
  }
2590
2585
  update(e, t) {
2591
2586
  if (!(e in this.argsByStoryId))
2592
2587
  throw new Error(`No args known for ${e} -- has it been rendered yet?`);
2593
- this.argsByStoryId[e] = ss({
2588
+ this.argsByStoryId[e] = Es({
2594
2589
  ...this.argsByStoryId[e],
2595
2590
  ...t
2596
2591
  });
2597
2592
  }
2598
2593
  };
2594
+ n(Br, "ArgsStore");
2595
+ var $e = Br;
2599
2596
 
2600
2597
  // src/preview-api/modules/store/GlobalsStore.ts
2601
- import { logger as is } from "storybook/internal/client-logger";
2598
+ import { logger as Cs } from "storybook/internal/client-logger";
2602
2599
 
2603
2600
  // src/preview-api/modules/store/csf/getValuesFromArgTypes.ts
2604
- var We = /* @__PURE__ */ n((r = {}) => Object.entries(r).reduce((e, [t, { defaultValue: o }]) => (typeof o < "u" && (e[t] = o), e), {}), "ge\
2601
+ var Ye = /* @__PURE__ */ n((r = {}) => Object.entries(r).reduce((e, [t, { defaultValue: o }]) => (typeof o < "u" && (e[t] = o), e), {}), "ge\
2605
2602
  tValuesFromArgTypes");
2606
2603
 
2607
2604
  // src/preview-api/modules/store/GlobalsStore.ts
2608
- var $e = class {
2609
- static {
2610
- n(this, "GlobalsStore");
2611
- }
2605
+ var zr = class zr {
2612
2606
  constructor({
2613
2607
  globals: e = {},
2614
2608
  globalTypes: t = {}
@@ -2618,11 +2612,11 @@ var $e = class {
2618
2612
  set({ globals: e = {}, globalTypes: t = {} }) {
2619
2613
  let o = this.initialGlobals && ye(this.initialGlobals, this.globals);
2620
2614
  this.allowedGlobalNames = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
2621
- let s = We(t);
2615
+ let s = Ye(t);
2622
2616
  this.initialGlobals = { ...s, ...e }, this.globals = this.initialGlobals, o && o !== oe && this.updateFromPersisted(o);
2623
2617
  }
2624
2618
  filterAllowedGlobals(e) {
2625
- return Object.entries(e).reduce((t, [o, s]) => (this.allowedGlobalNames.has(o) ? t[o] = s : is.warn(
2619
+ return Object.entries(e).reduce((t, [o, s]) => (this.allowedGlobalNames.has(o) ? t[o] = s : Cs.warn(
2626
2620
  `Attempted to set a global (${o}) that is not defined in initial globals or globalTypes`
2627
2621
  ), t), {});
2628
2622
  }
@@ -2635,21 +2629,22 @@ var $e = class {
2635
2629
  }
2636
2630
  update(e) {
2637
2631
  this.globals = { ...this.globals, ...this.filterAllowedGlobals(e) };
2632
+ for (let t in e)
2633
+ e[t] === void 0 && (this.globals[t] = this.initialGlobals[t]);
2638
2634
  }
2639
2635
  };
2636
+ n(zr, "GlobalsStore");
2637
+ var Ke = zr;
2640
2638
 
2641
2639
  // src/preview-api/modules/store/StoryIndexStore.ts
2642
- var Zt = ue(Or(), 1);
2643
- import { MissingStoryAfterHmrError as as } from "storybook/internal/preview-errors";
2644
- var ls = (0, Zt.default)(1)(
2640
+ var So = ue(_r(), 1);
2641
+ import { MissingStoryAfterHmrError as vs } from "storybook/internal/preview-errors";
2642
+ var Ps = (0, So.default)(1)(
2645
2643
  (r) => Object.values(r).reduce(
2646
2644
  (e, t) => (e[t.importPath] = e[t.importPath] || t, e),
2647
2645
  {}
2648
2646
  )
2649
- ), Ye = class {
2650
- static {
2651
- n(this, "StoryIndexStore");
2652
- }
2647
+ ), Gr = class Gr {
2653
2648
  constructor({ entries: e } = { v: 5, entries: {} }) {
2654
2649
  this.entries = e;
2655
2650
  }
@@ -2665,33 +2660,35 @@ var ls = (0, Zt.default)(1)(
2665
2660
  storyIdToEntry(e) {
2666
2661
  let t = this.entries[e];
2667
2662
  if (!t)
2668
- throw new as({ storyId: e });
2663
+ throw new vs({ storyId: e });
2669
2664
  return t;
2670
2665
  }
2671
2666
  importPathToEntry(e) {
2672
- return ls(this.entries)[e];
2667
+ return Ps(this.entries)[e];
2673
2668
  }
2674
2669
  };
2670
+ n(Gr, "StoryIndexStore");
2671
+ var Xe = Gr;
2675
2672
 
2676
2673
  // src/preview-api/modules/store/csf/normalizeInputTypes.ts
2677
- var cs = /* @__PURE__ */ n((r) => typeof r == "string" ? { name: r } : r, "normalizeType"), ds = /* @__PURE__ */ n((r) => typeof r == "strin\
2678
- g" ? { type: r } : r, "normalizeControl"), ps = /* @__PURE__ */ n((r, e) => {
2674
+ var Fs = /* @__PURE__ */ n((r) => typeof r == "string" ? { name: r } : r, "normalizeType"), Is = /* @__PURE__ */ n((r) => typeof r == "strin\
2675
+ g" ? { type: r } : r, "normalizeControl"), Os = /* @__PURE__ */ n((r, e) => {
2679
2676
  let { type: t, control: o, ...s } = r, i = {
2680
2677
  name: e,
2681
2678
  ...s
2682
2679
  };
2683
- return t && (i.type = cs(t)), o ? i.control = ds(o) : o === !1 && (i.control = { disable: !0 }), i;
2684
- }, "normalizeInputType"), ne = /* @__PURE__ */ n((r) => H(r, ps), "normalizeInputTypes");
2680
+ return t && (i.type = Fs(t)), o ? i.control = Is(o) : o === !1 && (i.control = { disable: !0 }), i;
2681
+ }, "normalizeInputType"), ne = /* @__PURE__ */ n((r) => V(r, Os), "normalizeInputTypes");
2685
2682
 
2686
2683
  // src/preview-api/modules/store/csf/normalizeStory.ts
2687
- import { deprecate as us, logger as fs } from "storybook/internal/client-logger";
2688
- import { storyNameFromExport as ys, toId as ms } from "storybook/internal/csf";
2684
+ import { deprecate as Ds, logger as ks } from "storybook/internal/client-logger";
2685
+ import { storyNameFromExport as js, toId as Ms } from "storybook/internal/csf";
2689
2686
 
2690
2687
  // src/preview-api/modules/store/csf/normalizeArrays.ts
2691
- var v = /* @__PURE__ */ n((r) => Array.isArray(r) ? r : r ? [r] : [], "normalizeArrays");
2688
+ var C = /* @__PURE__ */ n((r) => Array.isArray(r) ? r : r ? [r] : [], "normalizeArrays");
2692
2689
 
2693
2690
  // src/preview-api/modules/store/csf/normalizeStory.ts
2694
- var hs = P`
2691
+ var _s = P`
2695
2692
  CSF .story annotations deprecated; annotate story functions directly:
2696
2693
  - StoryFn.story.name => StoryFn.storyName
2697
2694
  - StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
@@ -2699,18 +2696,18 @@ See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-
2699
2696
  `;
2700
2697
  function me(r, e, t) {
2701
2698
  let o = e, s = typeof e == "function" ? e : null, { story: i } = o;
2702
- i && (fs.debug("deprecated story", i), us(hs));
2703
- let a = ys(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
2704
- ...v(o.decorators),
2705
- ...v(i?.decorators)
2706
- ], d = { ...i?.parameters, ...o.parameters }, p = { ...i?.args, ...o.args }, u = { ...i?.argTypes, ...o.argTypes }, y = [...v(o.loaders), ...v(
2699
+ i && (ks.debug("deprecated story", i), Ds(_s));
2700
+ let a = js(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
2701
+ ...C(o.decorators),
2702
+ ...C(i?.decorators)
2703
+ ], d = { ...i?.parameters, ...o.parameters }, p = { ...i?.args, ...o.args }, u = { ...i?.argTypes, ...o.argTypes }, y = [...C(o.loaders), ...C(
2707
2704
  i?.loaders)], h = [
2708
- ...v(o.beforeEach),
2709
- ...v(i?.beforeEach)
2705
+ ...C(o.beforeEach),
2706
+ ...C(i?.beforeEach)
2710
2707
  ], g = [
2711
- ...v(o.experimental_afterEach),
2712
- ...v(i?.experimental_afterEach)
2713
- ], { render: b, play: m, tags: T = [], globals: x = {} } = o, f = d.__id || ms(t.id, a);
2708
+ ...C(o.afterEach),
2709
+ ...C(i?.afterEach)
2710
+ ], { render: b, play: m, tags: T = [], globals: x = {} } = o, f = d.__id || Ms(t.id, a);
2714
2711
  return {
2715
2712
  moduleExport: e,
2716
2713
  id: f,
@@ -2722,7 +2719,7 @@ function me(r, e, t) {
2722
2719
  argTypes: ne(u),
2723
2720
  loaders: y,
2724
2721
  beforeEach: h,
2725
- experimental_afterEach: g,
2722
+ afterEach: g,
2726
2723
  globals: x,
2727
2724
  ...b && { render: b },
2728
2725
  ...s && { userStoryFn: s },
@@ -2732,15 +2729,15 @@ function me(r, e, t) {
2732
2729
  n(me, "normalizeStory");
2733
2730
 
2734
2731
  // src/preview-api/modules/store/csf/processCSFFile.ts
2735
- import { logger as ro } from "storybook/internal/client-logger";
2736
- import { isExportStory as eo, isStory as bs } from "storybook/internal/csf";
2732
+ import { logger as xo } from "storybook/internal/client-logger";
2733
+ import { isExportStory as To, isStory as Ls } from "storybook/internal/csf";
2737
2734
 
2738
2735
  // src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts
2739
- import { sanitize as gs } from "storybook/internal/csf";
2740
- function Ie(r, e = r.title, t) {
2736
+ import { sanitize as Ns } from "storybook/internal/csf";
2737
+ function De(r, e = r.title, t) {
2741
2738
  let { id: o, argTypes: s } = r;
2742
2739
  return {
2743
- id: gs(o || e),
2740
+ id: Ns(o || e),
2744
2741
  ...r,
2745
2742
  title: e,
2746
2743
  ...s && { argTypes: ne(s) },
@@ -2750,76 +2747,76 @@ function Ie(r, e = r.title, t) {
2750
2747
  }
2751
2748
  };
2752
2749
  }
2753
- n(Ie, "normalizeComponentAnnotations");
2750
+ n(De, "normalizeComponentAnnotations");
2754
2751
 
2755
2752
  // src/preview-api/modules/store/csf/processCSFFile.ts
2756
- var Ss = /* @__PURE__ */ n((r) => {
2753
+ var qs = /* @__PURE__ */ n((r) => {
2757
2754
  let { globals: e, globalTypes: t } = r;
2758
- (e || t) && ro.error(
2755
+ (e || t) && xo.error(
2759
2756
  "Global args/argTypes can only be set globally",
2760
2757
  JSON.stringify({
2761
2758
  globals: e,
2762
2759
  globalTypes: t
2763
2760
  })
2764
2761
  );
2765
- }, "checkGlobals"), Ts = /* @__PURE__ */ n((r) => {
2762
+ }, "checkGlobals"), Bs = /* @__PURE__ */ n((r) => {
2766
2763
  let { options: e } = r;
2767
- e?.storySort && ro.error("The storySort option parameter can only be set globally");
2768
- }, "checkStorySort"), Ke = /* @__PURE__ */ n((r) => {
2769
- r && (Ss(r), Ts(r));
2764
+ e?.storySort && xo.error("The storySort option parameter can only be set globally");
2765
+ }, "checkStorySort"), Je = /* @__PURE__ */ n((r) => {
2766
+ r && (qs(r), Bs(r));
2770
2767
  }, "checkDisallowedParameters");
2771
- function to(r, e, t) {
2768
+ function Ro(r, e, t) {
2772
2769
  let { default: o, __namedExportsOrder: s, ...i } = r, a = Object.values(i)[0];
2773
- if (bs(a)) {
2774
- let d = Ie(a.meta.input, t, e);
2775
- Ke(d.parameters);
2770
+ if (Ls(a)) {
2771
+ let d = De(a.meta.input, t, e);
2772
+ Je(d.parameters);
2776
2773
  let p = { meta: d, stories: {}, moduleExports: r };
2777
2774
  return Object.keys(i).forEach((u) => {
2778
- if (eo(u, d)) {
2775
+ if (To(u, d)) {
2779
2776
  let y = me(u, i[u].input, d);
2780
- Ke(y.parameters), p.stories[y.id] = y;
2777
+ Je(y.parameters), p.stories[y.id] = y;
2781
2778
  }
2782
2779
  }), p.projectAnnotations = a.meta.preview.composed, p;
2783
2780
  }
2784
- let l = Ie(
2781
+ let l = De(
2785
2782
  o,
2786
2783
  t,
2787
2784
  e
2788
2785
  );
2789
- Ke(l.parameters);
2786
+ Je(l.parameters);
2790
2787
  let c = { meta: l, stories: {}, moduleExports: r };
2791
2788
  return Object.keys(i).forEach((d) => {
2792
- if (eo(d, l)) {
2789
+ if (To(d, l)) {
2793
2790
  let p = me(d, i[d], l);
2794
- Ke(p.parameters), c.stories[p.id] = p;
2791
+ Je(p.parameters), c.stories[p.id] = p;
2795
2792
  }
2796
2793
  }), c;
2797
2794
  }
2798
- n(to, "processCSFFile");
2795
+ n(Ro, "processCSFFile");
2799
2796
 
2800
2797
  // src/preview-api/modules/store/csf/prepareStory.ts
2801
- import { combineTags as Rs, includeConditionalArg as ws } from "storybook/internal/csf";
2802
- import { NoRenderFunctionError as Es } from "storybook/internal/preview-errors";
2803
- import { global as As } from "@storybook/global";
2804
- import { global as Cs } from "@storybook/global";
2798
+ import { combineTags as Gs, includeConditionalArg as Us } from "storybook/internal/csf";
2799
+ import { NoRenderFunctionError as Hs } from "storybook/internal/preview-errors";
2800
+ import { global as Vs } from "@storybook/global";
2801
+ import { global as Ws } from "@storybook/global";
2805
2802
 
2806
2803
  // src/preview-api/modules/preview-web/render/mount-utils.ts
2807
- function no(r) {
2808
- return r != null && xs(r).includes("mount");
2804
+ function Ao(r) {
2805
+ return r != null && zs(r).includes("mount");
2809
2806
  }
2810
- n(no, "mountDestructured");
2811
- function xs(r) {
2807
+ n(Ao, "mountDestructured");
2808
+ function zs(r) {
2812
2809
  let e = r.toString().match(/[^(]*\(([^)]*)/);
2813
2810
  if (!e)
2814
2811
  return [];
2815
- let t = oo(e[1]);
2812
+ let t = wo(e[1]);
2816
2813
  if (!t.length)
2817
2814
  return [];
2818
2815
  let o = t[0];
2819
- return o.startsWith("{") && o.endsWith("}") ? oo(o.slice(1, -1).replace(/\s/g, "")).map((i) => i.replace(/:.*|=.*/g, "")) : [];
2816
+ return o.startsWith("{") && o.endsWith("}") ? wo(o.slice(1, -1).replace(/\s/g, "")).map((i) => i.replace(/:.*|=.*/g, "")) : [];
2820
2817
  }
2821
- n(xs, "getUsedProps");
2822
- function oo(r) {
2818
+ n(zs, "getUsedProps");
2819
+ function wo(r) {
2823
2820
  let e = [], t = [], o = 0;
2824
2821
  for (let i = 0; i < r.length; i++)
2825
2822
  if (r[i] === "{" || r[i] === "[")
@@ -2833,15 +2830,15 @@ function oo(r) {
2833
2830
  let s = r.substring(o).trim();
2834
2831
  return s && e.push(s), e;
2835
2832
  }
2836
- n(oo, "splitByComma");
2833
+ n(wo, "splitByComma");
2837
2834
 
2838
2835
  // src/preview-api/modules/store/decorators.ts
2839
- function so(r, e, t) {
2836
+ function Eo(r, e, t) {
2840
2837
  let o = t(r);
2841
2838
  return (s) => e(o, s);
2842
2839
  }
2843
- n(so, "decorateStory");
2844
- function io({
2840
+ n(Eo, "decorateStory");
2841
+ function Co({
2845
2842
  componentId: r,
2846
2843
  title: e,
2847
2844
  kind: t,
@@ -2855,87 +2852,87 @@ function io({
2855
2852
  } = {}) {
2856
2853
  return d;
2857
2854
  }
2858
- n(io, "sanitizeStoryContextUpdate");
2859
- function Mr(r, e) {
2855
+ n(Co, "sanitizeStoryContextUpdate");
2856
+ function Ur(r, e) {
2860
2857
  let t = {}, o = /* @__PURE__ */ n((i) => (a) => {
2861
2858
  if (!t.value)
2862
2859
  throw new Error("Decorated function called without init");
2863
2860
  return t.value = {
2864
2861
  ...t.value,
2865
- ...io(a)
2862
+ ...Co(a)
2866
2863
  }, i(t.value);
2867
2864
  }, "bindWithContext"), s = e.reduce(
2868
- (i, a) => so(i, a, o),
2865
+ (i, a) => Eo(i, a, o),
2869
2866
  r
2870
2867
  );
2871
2868
  return (i) => (t.value = i, s(i));
2872
2869
  }
2873
- n(Mr, "defaultDecorateStory");
2870
+ n(Ur, "defaultDecorateStory");
2874
2871
 
2875
2872
  // src/preview-api/modules/store/parameters.ts
2876
- var L = /* @__PURE__ */ n((...r) => {
2873
+ var N = /* @__PURE__ */ n((...r) => {
2877
2874
  let e = {}, t = r.filter(Boolean), o = t.reduce((s, i) => (Object.entries(i).forEach(([a, l]) => {
2878
2875
  let c = s[a];
2879
- Array.isArray(l) || typeof c > "u" ? s[a] = l : k(l) && k(c) ? e[a] = !0 : typeof l < "u" && (s[a] = l);
2876
+ Array.isArray(l) || typeof c > "u" ? s[a] = l : j(l) && j(c) ? e[a] = !0 : typeof l < "u" && (s[a] = l);
2880
2877
  }), s), {});
2881
2878
  return Object.keys(e).forEach((s) => {
2882
2879
  let i = t.filter(Boolean).map((a) => a[s]).filter((a) => typeof a < "u");
2883
- i.every((a) => k(a)) ? o[s] = L(...i) : o[s] = i[i.length - 1];
2880
+ i.every((a) => j(a)) ? o[s] = N(...i) : o[s] = i[i.length - 1];
2884
2881
  }), o;
2885
2882
  }, "combineParameters");
2886
2883
 
2887
2884
  // src/preview-api/modules/store/csf/prepareStory.ts
2888
- function Oe(r, e, t) {
2889
- let { moduleExport: o, id: s, name: i } = r || {}, a = ao(
2885
+ function ke(r, e, t) {
2886
+ let { moduleExport: o, id: s, name: i } = r || {}, a = vo(
2890
2887
  r,
2891
2888
  e,
2892
2889
  t
2893
2890
  ), l = /* @__PURE__ */ n(async (w) => {
2894
- let A = {};
2895
- for (let F of [
2896
- v(t.loaders),
2897
- v(e.loaders),
2898
- v(r.loaders)
2891
+ let E = {};
2892
+ for (let D of [
2893
+ C(t.loaders),
2894
+ C(e.loaders),
2895
+ C(r.loaders)
2899
2896
  ]) {
2900
2897
  if (w.abortSignal.aborted)
2901
- return A;
2902
- let j = await Promise.all(F.map((N) => N(w)));
2903
- Object.assign(A, ...j);
2898
+ return E;
2899
+ let k = await Promise.all(D.map((L) => L(w)));
2900
+ Object.assign(E, ...k);
2904
2901
  }
2905
- return A;
2902
+ return E;
2906
2903
  }, "applyLoaders"), c = /* @__PURE__ */ n(async (w) => {
2907
- let A = new Array();
2908
- for (let F of [
2909
- ...v(t.beforeEach),
2910
- ...v(e.beforeEach),
2911
- ...v(r.beforeEach)
2904
+ let E = new Array();
2905
+ for (let D of [
2906
+ ...C(t.beforeEach),
2907
+ ...C(e.beforeEach),
2908
+ ...C(r.beforeEach)
2912
2909
  ]) {
2913
2910
  if (w.abortSignal.aborted)
2914
- return A;
2915
- let j = await F(w);
2916
- j && A.push(j);
2911
+ return E;
2912
+ let k = await D(w);
2913
+ k && E.push(k);
2917
2914
  }
2918
- return A;
2915
+ return E;
2919
2916
  }, "applyBeforeEach"), d = /* @__PURE__ */ n(async (w) => {
2920
- let A = [
2921
- ...v(t.experimental_afterEach),
2922
- ...v(e.experimental_afterEach),
2923
- ...v(r.experimental_afterEach)
2917
+ let E = [
2918
+ ...C(t.afterEach),
2919
+ ...C(e.afterEach),
2920
+ ...C(r.afterEach)
2924
2921
  ].reverse();
2925
- for (let F of A) {
2922
+ for (let D of E) {
2926
2923
  if (w.abortSignal.aborted)
2927
2924
  return;
2928
- await F(w);
2925
+ await D(w);
2929
2926
  }
2930
- }, "applyAfterEach"), p = /* @__PURE__ */ n((w) => w.originalStoryFn(w.args, w), "undecoratedStoryFn"), { applyDecorators: u = Mr, runStep: y } = t,
2927
+ }, "applyAfterEach"), p = /* @__PURE__ */ n((w) => w.originalStoryFn(w.args, w), "undecoratedStoryFn"), { applyDecorators: u = Ur, runStep: y } = t,
2931
2928
  h = [
2932
- ...v(r?.decorators),
2933
- ...v(e?.decorators),
2934
- ...v(t?.decorators)
2935
- ], g = r?.userStoryFn || r?.render || e.render || t.render, b = Rr(u)(p, h), m = /* @__PURE__ */ n((w) => b(w), "unboundStoryFn"), T = r?.
2936
- play ?? e?.play, x = no(T);
2929
+ ...C(r?.decorators),
2930
+ ...C(e?.decorators),
2931
+ ...C(t?.decorators)
2932
+ ], g = r?.userStoryFn || r?.render || e.render || t.render, b = Cr(u)(p, h), m = /* @__PURE__ */ n((w) => b(w), "unboundStoryFn"), T = r?.
2933
+ play ?? e?.play, x = Ao(T);
2937
2934
  if (!g && !x)
2938
- throw new Es({ id: s });
2935
+ throw new Hs({ id: s });
2939
2936
  let f = /* @__PURE__ */ n((w) => async () => (await w.renderToCanvas(), w.canvas), "defaultMount"), S = r.mount ?? e.mount ?? t.mount ?? f,
2940
2937
  R = t.testingLibraryRender;
2941
2938
  return {
@@ -2959,26 +2956,26 @@ function Oe(r, e, t) {
2959
2956
  usesMount: x
2960
2957
  };
2961
2958
  }
2962
- n(Oe, "prepareStory");
2963
- function _r(r, e, t) {
2959
+ n(ke, "prepareStory");
2960
+ function Hr(r, e, t) {
2964
2961
  return {
2965
- ...ao(void 0, r, e),
2962
+ ...vo(void 0, r, e),
2966
2963
  moduleExport: t
2967
2964
  };
2968
2965
  }
2969
- n(_r, "prepareMeta");
2970
- function ao(r, e, t) {
2971
- let o = ["dev", "test"], s = Cs.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], i = Rs(
2966
+ n(Hr, "prepareMeta");
2967
+ function vo(r, e, t) {
2968
+ let o = ["dev", "test"], s = Ws.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], i = Gs(
2972
2969
  ...o,
2973
2970
  ...s,
2974
2971
  ...t.tags ?? [],
2975
2972
  ...e.tags ?? [],
2976
2973
  ...r?.tags ?? []
2977
- ), a = L(
2974
+ ), a = N(
2978
2975
  t.parameters,
2979
2976
  e.parameters,
2980
2977
  r?.parameters
2981
- ), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = t, d = L(
2978
+ ), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = t, d = N(
2982
2979
  t.argTypes,
2983
2980
  e.argTypes,
2984
2981
  r?.argTypes
@@ -3030,20 +3027,20 @@ function ao(r, e, t) {
3030
3027
  let { name: g, story: b, ...m } = y;
3031
3028
  return m;
3032
3029
  }
3033
- n(ao, "preparePartialAnnotations");
3034
- function Xe(r) {
3030
+ n(vo, "preparePartialAnnotations");
3031
+ function Qe(r) {
3035
3032
  let { args: e } = r, t = {
3036
3033
  ...r,
3037
3034
  allArgs: void 0,
3038
3035
  argsByTarget: void 0
3039
3036
  };
3040
- if (As.FEATURES?.argTypeTargetsV7) {
3041
- let i = Qt(r);
3037
+ if (Vs.FEATURES?.argTypeTargetsV7) {
3038
+ let i = bo(r);
3042
3039
  t = {
3043
3040
  ...r,
3044
3041
  allArgs: r.args,
3045
3042
  argsByTarget: i,
3046
- args: i[jr] || {}
3043
+ args: i[qr] || {}
3047
3044
  };
3048
3045
  }
3049
3046
  let o = Object.entries(t.args).reduce((i, [a, l]) => {
@@ -3056,15 +3053,15 @@ function Xe(r) {
3056
3053
  return i[a] = Array.isArray(l) ? l.map(c) : c(l), i;
3057
3054
  }, {}), s = Object.entries(o).reduce((i, [a, l]) => {
3058
3055
  let c = t.argTypes[a] || {};
3059
- return ws(c, o, t.globals) && (i[a] = l), i;
3056
+ return Us(c, o, t.globals) && (i[a] = l), i;
3060
3057
  }, {});
3061
3058
  return { ...t, unmappedArgs: e, args: s };
3062
3059
  }
3063
- n(Xe, "prepareContext");
3060
+ n(Qe, "prepareContext");
3064
3061
 
3065
3062
  // src/preview-api/modules/store/inferArgTypes.ts
3066
- import { logger as vs } from "storybook/internal/client-logger";
3067
- var Lr = /* @__PURE__ */ n((r, e, t) => {
3063
+ import { logger as $s } from "storybook/internal/client-logger";
3064
+ var Vr = /* @__PURE__ */ n((r, e, t) => {
3068
3065
  let o = typeof r;
3069
3066
  switch (o) {
3070
3067
  case "boolean":
@@ -3076,44 +3073,44 @@ var Lr = /* @__PURE__ */ n((r, e, t) => {
3076
3073
  default:
3077
3074
  break;
3078
3075
  }
3079
- return r ? t.has(r) ? (vs.warn(P`
3076
+ return r ? t.has(r) ? ($s.warn(P`
3080
3077
  We've detected a cycle in arg '${e}'. Args should be JSON-serializable.
3081
3078
 
3082
3079
  Consider using the mapping feature or fully custom args:
3083
3080
  - Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
3084
3081
  - Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
3085
- `), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ? Lr(r[0], e, new Set(
3086
- t)) : { name: "other", value: "unknown" } } : { name: "object", value: H(r, (i) => Lr(i, e, new Set(t))) }) : { name: "object", value: {} };
3087
- }, "inferType"), Nr = /* @__PURE__ */ n((r) => {
3088
- let { id: e, argTypes: t = {}, initialArgs: o = {} } = r, s = H(o, (a, l) => ({
3082
+ `), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ? Vr(r[0], e, new Set(
3083
+ t)) : { name: "other", value: "unknown" } } : { name: "object", value: V(r, (i) => Vr(i, e, new Set(t))) }) : { name: "object", value: {} };
3084
+ }, "inferType"), Wr = /* @__PURE__ */ n((r) => {
3085
+ let { id: e, argTypes: t = {}, initialArgs: o = {} } = r, s = V(o, (a, l) => ({
3089
3086
  name: l,
3090
- type: Lr(a, `${e}.${l}`, /* @__PURE__ */ new Set())
3091
- })), i = H(t, (a, l) => ({
3087
+ type: Vr(a, `${e}.${l}`, /* @__PURE__ */ new Set())
3088
+ })), i = V(t, (a, l) => ({
3092
3089
  name: l
3093
3090
  }));
3094
- return L(s, i, t);
3091
+ return N(s, i, t);
3095
3092
  }, "inferArgTypes");
3096
- Nr.secondPass = !0;
3093
+ Wr.secondPass = !0;
3097
3094
 
3098
3095
  // src/preview-api/modules/store/inferControls.ts
3099
- import { logger as Ps } from "storybook/internal/client-logger";
3096
+ import { logger as Ys } from "storybook/internal/client-logger";
3100
3097
 
3101
3098
  // src/preview-api/modules/store/filterArgTypes.ts
3102
- var lo = /* @__PURE__ */ n((r, e) => Array.isArray(e) ? e.includes(r) : r.match(e), "matches"), Je = /* @__PURE__ */ n((r, e, t) => !e && !t ?
3103
- r : r && Pr(r, (o, s) => {
3099
+ var Po = /* @__PURE__ */ n((r, e) => Array.isArray(e) ? e.includes(r) : r.match(e), "matches"), Ze = /* @__PURE__ */ n((r, e, t) => !e && !t ?
3100
+ r : r && kr(r, (o, s) => {
3104
3101
  let i = o.name || s.toString();
3105
- return !!(!e || lo(i, e)) && (!t || !lo(i, t));
3102
+ return !!(!e || Po(i, e)) && (!t || !Po(i, t));
3106
3103
  }), "filterArgTypes");
3107
3104
 
3108
3105
  // src/preview-api/modules/store/inferControls.ts
3109
- var Fs = /* @__PURE__ */ n((r, e, t) => {
3106
+ var Ks = /* @__PURE__ */ n((r, e, t) => {
3110
3107
  let { type: o, options: s } = r;
3111
3108
  if (o) {
3112
3109
  if (t.color && t.color.test(e)) {
3113
3110
  let i = o.name;
3114
3111
  if (i === "string")
3115
3112
  return { control: { type: "color" } };
3116
- i !== "enum" && Ps.warn(
3113
+ i !== "enum" && Ys.warn(
3117
3114
  `Addon controls: Control of type color only supports string, received "${i}" instead`
3118
3115
  );
3119
3116
  }
@@ -3139,17 +3136,17 @@ var Fs = /* @__PURE__ */ n((r, e, t) => {
3139
3136
  return { control: { type: s ? "select" : "object" } };
3140
3137
  }
3141
3138
  }
3142
- }, "inferControl"), De = /* @__PURE__ */ n((r) => {
3139
+ }, "inferControl"), je = /* @__PURE__ */ n((r) => {
3143
3140
  let {
3144
3141
  argTypes: e,
3145
3142
  parameters: { __isArgsStory: t, controls: { include: o = null, exclude: s = null, matchers: i = {} } = {} }
3146
3143
  } = r;
3147
3144
  if (!t)
3148
3145
  return e;
3149
- let a = Je(e, o, s), l = H(a, (c, d) => c?.type && Fs(c, d.toString(), i));
3150
- return L(l, a);
3146
+ let a = Ze(e, o, s), l = V(a, (c, d) => c?.type && Ks(c, d.toString(), i));
3147
+ return N(l, a);
3151
3148
  }, "inferControls");
3152
- De.secondPass = !0;
3149
+ je.secondPass = !0;
3153
3150
 
3154
3151
  // src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts
3155
3152
  function he({
@@ -3159,20 +3156,20 @@ function he({
3159
3156
  decorators: o,
3160
3157
  loaders: s,
3161
3158
  beforeEach: i,
3162
- experimental_afterEach: a,
3159
+ afterEach: a,
3163
3160
  initialGlobals: l,
3164
3161
  ...c
3165
3162
  }) {
3166
3163
  return {
3167
3164
  ...r && { argTypes: ne(r) },
3168
3165
  ...e && { globalTypes: ne(e) },
3169
- decorators: v(o),
3170
- loaders: v(s),
3171
- beforeEach: v(i),
3172
- experimental_afterEach: v(a),
3166
+ decorators: C(o),
3167
+ loaders: C(s),
3168
+ beforeEach: C(i),
3169
+ afterEach: C(a),
3173
3170
  argTypesEnhancers: [
3174
3171
  ...t || [],
3175
- Nr,
3172
+ Wr,
3176
3173
  // There's an architectural decision to be made regarding embedded addons in core:
3177
3174
  //
3178
3175
  // Option 1: Keep embedded addons but ensure consistency by moving addon-specific code
@@ -3188,7 +3185,7 @@ function he({
3188
3185
  // currently rely on this behavior.
3189
3186
  //
3190
3187
  // TODO: Make an architectural decision on the handling of core addons
3191
- De
3188
+ je
3192
3189
  ],
3193
3190
  initialGlobals: l,
3194
3191
  ...c
@@ -3197,10 +3194,10 @@ function he({
3197
3194
  n(he, "normalizeProjectAnnotations");
3198
3195
 
3199
3196
  // src/preview-api/modules/store/csf/composeConfigs.ts
3200
- import { global as Is } from "@storybook/global";
3197
+ import { global as Xs } from "@storybook/global";
3201
3198
 
3202
3199
  // src/preview-api/modules/store/csf/beforeAll.ts
3203
- var co = /* @__PURE__ */ n((r) => async () => {
3200
+ var Fo = /* @__PURE__ */ n((r) => async () => {
3204
3201
  let e = [];
3205
3202
  for (let t of r) {
3206
3203
  let o = await t();
@@ -3213,7 +3210,7 @@ var co = /* @__PURE__ */ n((r) => async () => {
3213
3210
  }, "composeBeforeAllHooks");
3214
3211
 
3215
3212
  // src/preview-api/modules/store/csf/stepRunners.ts
3216
- function qr(r) {
3213
+ function $r(r) {
3217
3214
  return async (e, t, o) => {
3218
3215
  await r.reduceRight(
3219
3216
  (i, a) => async () => a(e, i, o),
@@ -3221,131 +3218,205 @@ function qr(r) {
3221
3218
  )();
3222
3219
  };
3223
3220
  }
3224
- n(qr, "composeStepRunners");
3221
+ n($r, "composeStepRunners");
3225
3222
 
3226
3223
  // src/preview-api/modules/store/csf/composeConfigs.ts
3227
- function je(r, e) {
3224
+ function _e(r, e) {
3228
3225
  return r.map((t) => t.default?.[e] ?? t[e]).filter(Boolean);
3229
3226
  }
3230
- n(je, "getField");
3231
- function $(r, e, t = {}) {
3232
- return je(r, e).reduce((o, s) => {
3233
- let i = v(s);
3227
+ n(_e, "getField");
3228
+ function Y(r, e, t = {}) {
3229
+ return _e(r, e).reduce((o, s) => {
3230
+ let i = C(s);
3234
3231
  return t.reverseFileOrder ? [...i, ...o] : [...o, ...i];
3235
3232
  }, []);
3236
3233
  }
3237
- n($, "getArrayField");
3238
- function Qe(r, e) {
3239
- return Object.assign({}, ...je(r, e));
3234
+ n(Y, "getArrayField");
3235
+ function er(r, e) {
3236
+ return Object.assign({}, ..._e(r, e));
3240
3237
  }
3241
- n(Qe, "getObjectField");
3242
- function ke(r, e) {
3243
- return je(r, e).pop();
3238
+ n(er, "getObjectField");
3239
+ function Me(r, e) {
3240
+ return _e(r, e).pop();
3244
3241
  }
3245
- n(ke, "getSingletonField");
3246
- function Y(r) {
3247
- let e = [te(), ...r], t = $(e, "argTypesEnhancers"), o = je(e, "runStep"), s = $(e, "beforeAll");
3242
+ n(Me, "getSingletonField");
3243
+ function K(r) {
3244
+ let e = Y(r, "argTypesEnhancers"), t = _e(r, "runStep"), o = Y(r, "beforeAll");
3248
3245
  return {
3249
- parameters: L(...je(e, "parameters")),
3250
- decorators: $(e, "decorators", {
3251
- reverseFileOrder: !(Is.FEATURES?.legacyDecoratorFileOrder ?? !1)
3246
+ parameters: N(..._e(r, "parameters")),
3247
+ decorators: Y(r, "decorators", {
3248
+ reverseFileOrder: !(Xs.FEATURES?.legacyDecoratorFileOrder ?? !1)
3252
3249
  }),
3253
- args: Qe(e, "args"),
3254
- argsEnhancers: $(e, "argsEnhancers"),
3255
- argTypes: Qe(e, "argTypes"),
3250
+ args: er(r, "args"),
3251
+ argsEnhancers: Y(r, "argsEnhancers"),
3252
+ argTypes: er(r, "argTypes"),
3256
3253
  argTypesEnhancers: [
3257
- ...t.filter((i) => !i.secondPass),
3258
- ...t.filter((i) => i.secondPass)
3254
+ ...e.filter((s) => !s.secondPass),
3255
+ ...e.filter((s) => s.secondPass)
3259
3256
  ],
3260
- initialGlobals: Qe(e, "initialGlobals"),
3261
- globalTypes: Qe(e, "globalTypes"),
3262
- loaders: $(e, "loaders"),
3263
- beforeAll: co(s),
3264
- beforeEach: $(e, "beforeEach"),
3265
- experimental_afterEach: $(e, "experimental_afterEach"),
3266
- render: ke(e, "render"),
3267
- renderToCanvas: ke(e, "renderToCanvas"),
3268
- applyDecorators: ke(e, "applyDecorators"),
3269
- runStep: qr(o),
3270
- tags: $(e, "tags"),
3271
- mount: ke(e, "mount"),
3272
- testingLibraryRender: ke(e, "testingLibraryRender")
3257
+ initialGlobals: er(r, "initialGlobals"),
3258
+ globalTypes: er(r, "globalTypes"),
3259
+ loaders: Y(r, "loaders"),
3260
+ beforeAll: Fo(o),
3261
+ beforeEach: Y(r, "beforeEach"),
3262
+ afterEach: Y(r, "afterEach"),
3263
+ render: Me(r, "render"),
3264
+ renderToCanvas: Me(r, "renderToCanvas"),
3265
+ applyDecorators: Me(r, "applyDecorators"),
3266
+ runStep: $r(t),
3267
+ tags: Y(r, "tags"),
3268
+ mount: Me(r, "mount"),
3269
+ testingLibraryRender: Me(r, "testingLibraryRender")
3273
3270
  };
3274
3271
  }
3275
- n(Y, "composeConfigs");
3272
+ n(K, "composeConfigs");
3276
3273
 
3277
3274
  // src/preview-api/modules/store/csf/portable-stories.ts
3278
- import { isExportStory as Ds } from "storybook/internal/csf";
3279
- import { MountMustBeDestructuredError as ks } from "storybook/internal/preview-errors";
3275
+ import { isExportStory as Zs } from "storybook/internal/csf";
3276
+ import { MountMustBeDestructuredError as ei } from "storybook/internal/preview-errors";
3277
+
3278
+ // src/preview-api/modules/preview-web/render/animation-utils.ts
3279
+ function rr() {
3280
+ try {
3281
+ return (
3282
+ // @ts-expect-error this property exists in certain environments
3283
+ !!globalThis.__vitest_browser__ || // @ts-expect-error this property exists in certain environments
3284
+ !!globalThis.__playwright__binding__ || // @ts-expect-error this property exists in certain environments
3285
+ !!import.meta.vitest || // @ts-expect-error this property exists in certain environments
3286
+ import.meta.env.MODE === "test"
3287
+ );
3288
+ } catch {
3289
+ return !1;
3290
+ }
3291
+ }
3292
+ n(rr, "isTestEnvironment");
3293
+ function ge(r = !0) {
3294
+ if (!("document" in globalThis && "createElement" in globalThis.document))
3295
+ return () => {
3296
+ };
3297
+ let e = document.createElement("style");
3298
+ e.textContent = `*, *:before, *:after {
3299
+ animation: none !important;
3300
+ }`, document.head.appendChild(e);
3301
+ let t = document.createElement("style");
3302
+ return t.textContent = `*, *:before, *:after {
3303
+ animation-delay: 0s !important;
3304
+ animation-direction: ${r ? "reverse" : "normal"} !important;
3305
+ animation-play-state: paused !important;
3306
+ transition: none !important;
3307
+ }`, document.head.appendChild(t), document.body.clientHeight, document.head.removeChild(e), () => {
3308
+ t.parentNode?.removeChild(t);
3309
+ };
3310
+ }
3311
+ n(ge, "pauseAnimations");
3312
+ async function be(r) {
3313
+ if (!("document" in globalThis && "getAnimations" in globalThis.document && "querySelectorAll" in globalThis.document))
3314
+ return;
3315
+ let e = !1;
3316
+ await Promise.race([
3317
+ // After 50ms, retrieve any running animations and wait for them to finish
3318
+ // If new animations are created while waiting, we'll wait for them too
3319
+ new Promise((t) => {
3320
+ setTimeout(() => {
3321
+ let o = [globalThis.document, ...Io(globalThis.document)], s = /* @__PURE__ */ n(async () => {
3322
+ if (e || r?.aborted)
3323
+ return;
3324
+ let i = o.flatMap((a) => a?.getAnimations?.() || []).filter((a) => a.playState === "running" && !Js(a));
3325
+ i.length > 0 && (await Promise.all(i.map((a) => a.finished)), await s());
3326
+ }, "checkAnimationsFinished");
3327
+ s().then(t);
3328
+ }, 100);
3329
+ }),
3330
+ // If animations don't finish within the timeout, continue without waiting
3331
+ new Promise(
3332
+ (t) => setTimeout(() => {
3333
+ e = !0, t(void 0);
3334
+ }, 5e3)
3335
+ )
3336
+ ]);
3337
+ }
3338
+ n(be, "waitForAnimations");
3339
+ function Io(r) {
3340
+ return [r, ...r.querySelectorAll("*")].reduce((e, t) => ("shadowRoot" in t && t.shadowRoot && e.push(t.shadowRoot, ...Io(t.shadowRoot)), e),
3341
+ []);
3342
+ }
3343
+ n(Io, "getShadowRoots");
3344
+ function Js(r) {
3345
+ if (r instanceof CSSAnimation && r.effect instanceof KeyframeEffect && r.effect.target) {
3346
+ let e = getComputedStyle(r.effect.target, r.effect.pseudoElement), t = e.animationName?.split(", ").indexOf(r.animationName);
3347
+ return e.animationIterationCount.split(", ")[t] === "infinite";
3348
+ }
3349
+ return !1;
3350
+ }
3351
+ n(Js, "isInfiniteAnimation");
3280
3352
 
3281
3353
  // src/preview-api/modules/store/reporter-api.ts
3282
- var se = class {
3354
+ var Yr = class Yr {
3283
3355
  constructor() {
3284
3356
  this.reports = [];
3285
3357
  }
3286
- static {
3287
- n(this, "ReporterAPI");
3288
- }
3289
3358
  async addReport(e) {
3290
3359
  this.reports.push(e);
3291
3360
  }
3292
3361
  };
3362
+ n(Yr, "ReporterAPI");
3363
+ var se = Yr;
3293
3364
 
3294
3365
  // src/preview-api/modules/store/csf/csf-factory-utils.ts
3295
- import { isStory as Os } from "storybook/internal/csf";
3296
- function Br(r, e, t) {
3297
- return Os(r) ? {
3366
+ import { isStory as Qs } from "storybook/internal/csf";
3367
+ function Kr(r, e, t) {
3368
+ return Qs(r) ? {
3298
3369
  story: r.input,
3299
3370
  meta: r.meta.input,
3300
3371
  preview: r.meta.preview.composed
3301
3372
  } : { story: r, meta: e, preview: t };
3302
3373
  }
3303
- n(Br, "getCsfFactoryAnnotations");
3374
+ n(Kr, "getCsfFactoryAnnotations");
3304
3375
 
3305
3376
  // src/preview-api/modules/store/csf/portable-stories.ts
3306
- function js(r) {
3377
+ function ri(r) {
3307
3378
  globalThis.defaultProjectAnnotations = r;
3308
3379
  }
3309
- n(js, "setDefaultProjectAnnotations");
3310
- var Ms = "ComposedStory", _s = "Unnamed Story";
3311
- function Ls(r) {
3312
- return r ? Y([r]) : {};
3380
+ n(ri, "setDefaultProjectAnnotations");
3381
+ var ti = "ComposedStory", oi = "Unnamed Story";
3382
+ function ni(r) {
3383
+ return r ? K([r]) : {};
3313
3384
  }
3314
- n(Ls, "extractAnnotation");
3315
- function Ns(r) {
3385
+ n(ni, "extractAnnotation");
3386
+ function si(r) {
3316
3387
  let e = Array.isArray(r) ? r : [r];
3317
- return globalThis.globalProjectAnnotations = Y([
3388
+ return globalThis.globalProjectAnnotations = K([
3389
+ ...Ie(),
3318
3390
  globalThis.defaultProjectAnnotations ?? {},
3319
- Y(e.map(Ls))
3391
+ K(e.map(ni))
3320
3392
  ]), globalThis.globalProjectAnnotations ?? {};
3321
3393
  }
3322
- n(Ns, "setProjectAnnotations");
3323
- var K = [];
3324
- function po(r, e, t, o, s) {
3394
+ n(si, "setProjectAnnotations");
3395
+ var X = [];
3396
+ function Oo(r, e, t, o, s) {
3325
3397
  if (r === void 0)
3326
3398
  throw new Error("Expected a story but received undefined.");
3327
- e.title = e.title ?? Ms;
3328
- let i = Ie(e), a = s || r.storyName || r.story?.name || r.name || _s, l = me(
3399
+ e.title = e.title ?? ti;
3400
+ let i = De(e), a = s || r.storyName || r.story?.name || r.name || oi, l = me(
3329
3401
  a,
3330
3402
  r,
3331
3403
  i
3332
3404
  ), c = he(
3333
- Y([
3334
- ...te(),
3405
+ K([
3335
3406
  o ?? globalThis.globalProjectAnnotations ?? {},
3336
3407
  t ?? {}
3337
3408
  ])
3338
- ), d = Oe(
3409
+ ), d = ke(
3339
3410
  l,
3340
3411
  i,
3341
3412
  c
3342
3413
  ), u = {
3343
- ...We(c.globalTypes),
3414
+ ...Ye(c.globalTypes),
3344
3415
  ...c.initialGlobals,
3345
3416
  ...d.storyGlobals
3346
3417
  }, y = new se(), h = /* @__PURE__ */ n(() => {
3347
- let f = Xe({
3348
- hooks: new re(),
3418
+ let f = Qe({
3419
+ hooks: new te(),
3349
3420
  globals: u,
3350
3421
  args: { ...d.initialArgs },
3351
3422
  viewMode: "story",
@@ -3385,14 +3456,14 @@ ${R.description}`);
3385
3456
  },
3386
3457
  f.canvasElement
3387
3458
  );
3388
- S && K.push(S);
3459
+ S && X.push(S);
3389
3460
  }), f.mount = d.mount(f), f;
3390
3461
  }, "initializeContext"), g, b = /* @__PURE__ */ n(async (f) => {
3391
3462
  let S = h();
3392
3463
  return S.canvasElement ??= globalThis?.document?.body, g && (S.loaded = g.loaded), Object.assign(S, f), d.playFunction(S);
3393
3464
  }, "play"), m = /* @__PURE__ */ n((f) => {
3394
3465
  let S = h();
3395
- return Object.assign(S, f), Gs(d, S);
3466
+ return Object.assign(S, f), ci(d, S);
3396
3467
  }, "run"), T = d.playFunction ? b : void 0;
3397
3468
  return Object.assign(
3398
3469
  /* @__PURE__ */ n(function(S) {
@@ -3406,11 +3477,11 @@ ${R.description}`);
3406
3477
  id: d.id,
3407
3478
  storyName: a,
3408
3479
  load: /* @__PURE__ */ n(async () => {
3409
- for (let S of [...K].reverse())
3480
+ for (let S of [...X].reverse())
3410
3481
  await S();
3411
- K.length = 0;
3482
+ X.length = 0;
3412
3483
  let f = h();
3413
- f.loaded = await d.applyLoaders(f), K.push(...(await d.applyBeforeEach(f)).filter(Boolean)), g = f;
3484
+ f.loaded = await d.applyLoaders(f), X.push(...(await d.applyBeforeEach(f)).filter(Boolean)), g = f;
3414
3485
  }, "load"),
3415
3486
  globals: u,
3416
3487
  args: d.initialArgs,
@@ -3423,22 +3494,22 @@ ${R.description}`);
3423
3494
  }
3424
3495
  );
3425
3496
  }
3426
- n(po, "composeStory");
3427
- var qs = /* @__PURE__ */ n((r, e, t, o) => po(r, e, t, {}, o), "defaultComposeStory");
3428
- function Bs(r, e, t = qs) {
3497
+ n(Oo, "composeStory");
3498
+ var ii = /* @__PURE__ */ n((r, e, t, o) => Oo(r, e, t, {}, o), "defaultComposeStory");
3499
+ function ai(r, e, t = ii) {
3429
3500
  let { default: o, __esModule: s, __namedExportsOrder: i, ...a } = r, l = o;
3430
3501
  return Object.entries(a).reduce(
3431
3502
  (d, [p, u]) => {
3432
- let { story: y, meta: h } = Br(u);
3433
- return !l && h && (l = h), Ds(p, l) ? Object.assign(d, {
3503
+ let { story: y, meta: h } = Kr(u);
3504
+ return !l && h && (l = h), Zs(p, l) ? Object.assign(d, {
3434
3505
  [p]: t(y, l, e, p)
3435
3506
  }) : d;
3436
3507
  },
3437
3508
  {}
3438
3509
  );
3439
3510
  }
3440
- n(Bs, "composeStories");
3441
- function zs(r) {
3511
+ n(ai, "composeStories");
3512
+ function li(r) {
3442
3513
  return r.extend({
3443
3514
  mount: /* @__PURE__ */ n(async ({ mount: e, page: t }, o) => {
3444
3515
  await o(async (s, ...i) => {
@@ -3468,39 +3539,40 @@ function zs(r) {
3468
3539
  }, "mount")
3469
3540
  });
3470
3541
  }
3471
- n(zs, "createPlaywrightTest");
3472
- async function Gs(r, e) {
3473
- for (let s of [...K].reverse())
3474
- await s();
3475
- if (K.length = 0, !e.canvasElement) {
3476
- let s = document.createElement("div");
3477
- globalThis?.document?.body?.appendChild(s), e.canvasElement = s, K.push(() => {
3478
- globalThis?.document?.body?.contains(s) && globalThis?.document?.body?.removeChild(s);
3542
+ n(li, "createPlaywrightTest");
3543
+ async function ci(r, e) {
3544
+ for (let i of [...X].reverse())
3545
+ await i();
3546
+ if (X.length = 0, !e.canvasElement) {
3547
+ let i = document.createElement("div");
3548
+ globalThis?.document?.body?.appendChild(i), e.canvasElement = i, X.push(() => {
3549
+ globalThis?.document?.body?.contains(i) && globalThis?.document?.body?.removeChild(i);
3479
3550
  });
3480
3551
  }
3481
3552
  if (e.loaded = await r.applyLoaders(e), e.abortSignal.aborted)
3482
3553
  return;
3483
- K.push(...(await r.applyBeforeEach(e)).filter(Boolean));
3554
+ X.push(...(await r.applyBeforeEach(e)).filter(Boolean));
3484
3555
  let t = r.playFunction, o = r.usesMount;
3485
- o || await e.mount(), !e.abortSignal.aborted && (t && (o || (e.mount = async () => {
3486
- throw new ks({ playFunction: t.toString() });
3487
- }), await t(e)), await r.applyAfterEach(e));
3556
+ if (o || await e.mount(), e.abortSignal.aborted)
3557
+ return;
3558
+ t && (o || (e.mount = async () => {
3559
+ throw new ei({ playFunction: t.toString() });
3560
+ }), await t(e));
3561
+ let s;
3562
+ rr() ? s = ge() : await be(e.abortSignal), await r.applyAfterEach(e), await s?.();
3488
3563
  }
3489
- n(Gs, "runStory");
3564
+ n(ci, "runStory");
3490
3565
 
3491
3566
  // src/preview-api/modules/store/StoryStore.ts
3492
- var uo = 1e3, Vs = 1e4, ge = class {
3567
+ var Do = 1e3, ui = 1e4, Xr = class Xr {
3493
3568
  constructor(e, t, o) {
3494
3569
  this.importFn = t;
3495
- this.storyIndex = new Ye(e), this.projectAnnotations = he(
3496
- Y([...te(), o])
3570
+ this.storyIndex = new Xe(e), this.projectAnnotations = he(
3571
+ K([...Ie(), o])
3497
3572
  );
3498
3573
  let { initialGlobals: s, globalTypes: i } = this.projectAnnotations;
3499
- this.args = new Ve(), this.userGlobals = new $e({ globals: s, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
3500
- (0, Ze.default)(uo)(to), this.prepareMetaWithCache = (0, Ze.default)(uo)(_r), this.prepareStoryWithCache = (0, Ze.default)(Vs)(Oe);
3501
- }
3502
- static {
3503
- n(this, "StoryStore");
3574
+ this.args = new $e(), this.userGlobals = new Ke({ globals: s, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
3575
+ (0, tr.default)(Do)(Ro), this.prepareMetaWithCache = (0, tr.default)(Do)(Hr), this.prepareStoryWithCache = (0, tr.default)(ui)(ke);
3504
3576
  }
3505
3577
  setProjectAnnotations(e) {
3506
3578
  this.projectAnnotations = he(e);
@@ -3564,13 +3636,13 @@ var uo = 1e3, Vs = 1e4, ge = class {
3564
3636
  }) {
3565
3637
  let o = t.stories[e];
3566
3638
  if (!o)
3567
- throw new Hs({ storyId: e });
3639
+ throw new pi({ storyId: e });
3568
3640
  let s = t.meta, i = this.prepareStoryWithCache(
3569
3641
  o,
3570
3642
  s,
3571
3643
  t.projectAnnotations ?? this.projectAnnotations
3572
3644
  );
3573
- return this.args.setInitial(i), this.hooks[i.id] = this.hooks[i.id] || new re(), i;
3645
+ return this.args.setInitial(i), this.hooks[i.id] = this.hooks[i.id] || new te(), i;
3574
3646
  }
3575
3647
  // If we have a CSF file we can get all the stories from it synchronously
3576
3648
  componentStoriesFromCSFFile({
@@ -3592,7 +3664,7 @@ var uo = 1e3, Vs = 1e4, ge = class {
3592
3664
  // and updated separtely to the (immutable) story.
3593
3665
  getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
3594
3666
  let o = this.userGlobals.get(), { initialGlobals: s } = this.userGlobals, i = new se();
3595
- return Xe({
3667
+ return Qe({
3596
3668
  ...e,
3597
3669
  args: t ? e.initialArgs : this.args.get(e.id),
3598
3670
  initialGlobals: s,
@@ -3606,8 +3678,8 @@ var uo = 1e3, Vs = 1e4, ge = class {
3606
3678
  hooks: this.hooks[e.id]
3607
3679
  });
3608
3680
  }
3609
- addCleanupCallbacks(e, t) {
3610
- this.cleanupCallbacks[e.id] = t;
3681
+ addCleanupCallbacks(e, ...t) {
3682
+ this.cleanupCallbacks[e.id] = (this.cleanupCallbacks[e.id] || []).concat(t);
3611
3683
  }
3612
3684
  async cleanupStory(e) {
3613
3685
  this.hooks[e.id].clean();
@@ -3620,7 +3692,7 @@ var uo = 1e3, Vs = 1e4, ge = class {
3620
3692
  extract(e = { includeDocsOnly: !1 }) {
3621
3693
  let { cachedCSFFiles: t } = this;
3622
3694
  if (!t)
3623
- throw new Us();
3695
+ throw new di();
3624
3696
  return Object.entries(this.storyIndex.entries).reduce(
3625
3697
  (o, [s, { type: i, importPath: a }]) => {
3626
3698
  if (i === "docs")
@@ -3644,18 +3716,20 @@ var uo = 1e3, Vs = 1e4, ge = class {
3644
3716
  );
3645
3717
  }
3646
3718
  };
3719
+ n(Xr, "StoryStore");
3720
+ var Se = Xr;
3647
3721
 
3648
3722
  // src/preview-api/modules/store/autoTitle.ts
3649
- import { once as Ws } from "storybook/internal/client-logger";
3723
+ import { once as fi } from "storybook/internal/client-logger";
3650
3724
 
3651
3725
  // ../node_modules/slash/index.js
3652
- function zr(r) {
3726
+ function Jr(r) {
3653
3727
  return r.startsWith("\\\\?\\") ? r : r.replace(/\\/g, "/");
3654
3728
  }
3655
- n(zr, "slash");
3729
+ n(Jr, "slash");
3656
3730
 
3657
3731
  // src/preview-api/modules/store/autoTitle.ts
3658
- var $s = /* @__PURE__ */ n((r) => {
3732
+ var yi = /* @__PURE__ */ n((r) => {
3659
3733
  if (r.length === 0)
3660
3734
  return r;
3661
3735
  let e = r[r.length - 1], t = e?.replace(/(?:[.](?:story|stories))?([.][^.]+)$/i, "");
@@ -3665,28 +3739,28 @@ var $s = /* @__PURE__ */ n((r) => {
3665
3739
  return t && o && t.toLowerCase() === o.toLowerCase() ? [...r.slice(0, -2), t] : t && (/^(story|stories)([.][^.]+)$/i.test(e) || /^index$/i.
3666
3740
  test(t)) ? r.slice(0, -1) : [...r.slice(0, -1), t];
3667
3741
  }, "sanitize");
3668
- function fo(r) {
3742
+ function ko(r) {
3669
3743
  return r.flatMap((e) => e.split("/")).filter(Boolean).join("/");
3670
3744
  }
3671
- n(fo, "pathJoin");
3672
- var yo = /* @__PURE__ */ n((r, e, t) => {
3745
+ n(ko, "pathJoin");
3746
+ var jo = /* @__PURE__ */ n((r, e, t) => {
3673
3747
  let { directory: o, importPathMatcher: s, titlePrefix: i = "" } = e || {};
3674
- typeof r == "number" && Ws.warn(P`
3748
+ typeof r == "number" && fi.warn(P`
3675
3749
  CSF Auto-title received a numeric fileName. This typically happens when
3676
3750
  webpack is mis-configured in production mode. To force webpack to produce
3677
3751
  filenames, set optimization.moduleIds = "named" in your webpack config.
3678
3752
  `);
3679
- let a = zr(String(r));
3753
+ let a = Jr(String(r));
3680
3754
  if (s.exec(a)) {
3681
3755
  if (!t) {
3682
- let l = a.replace(o, ""), c = fo([i, l]).split("/");
3683
- return c = $s(c), c.join("/");
3756
+ let l = a.replace(o, ""), c = ko([i, l]).split("/");
3757
+ return c = yi(c), c.join("/");
3684
3758
  }
3685
- return i ? fo([i, t]) : t;
3759
+ return i ? ko([i, t]) : t;
3686
3760
  }
3687
- }, "userOrAutoTitleFromSpecifier"), Ys = /* @__PURE__ */ n((r, e, t) => {
3761
+ }, "userOrAutoTitleFromSpecifier"), mi = /* @__PURE__ */ n((r, e, t) => {
3688
3762
  for (let o = 0; o < e.length; o += 1) {
3689
- let s = yo(r, e[o], t);
3763
+ let s = jo(r, e[o], t);
3690
3764
  if (s)
3691
3765
  return s;
3692
3766
  }
@@ -3694,10 +3768,10 @@ var yo = /* @__PURE__ */ n((r, e, t) => {
3694
3768
  }, "userOrAutoTitle");
3695
3769
 
3696
3770
  // src/preview-api/modules/store/storySort.ts
3697
- var mo = /\s*\/\s*/, ho = /* @__PURE__ */ n((r = {}) => (e, t) => {
3771
+ var Mo = /\s*\/\s*/, _o = /* @__PURE__ */ n((r = {}) => (e, t) => {
3698
3772
  if (e.title === t.title && !r.includeNames)
3699
3773
  return 0;
3700
- let o = r.method || "configure", s = r.order || [], i = e.title.trim().split(mo), a = t.title.trim().split(mo);
3774
+ let o = r.method || "configure", s = r.order || [], i = e.title.trim().split(Mo), a = t.title.trim().split(Mo);
3701
3775
  r.includeNames && (i.push(e.name), a.push(t.name));
3702
3776
  let l = 0;
3703
3777
  for (; i[l] || a[l]; ) {
@@ -3721,18 +3795,18 @@ var mo = /\s*\/\s*/, ho = /* @__PURE__ */ n((r = {}) => (e, t) => {
3721
3795
  }, "storySort");
3722
3796
 
3723
3797
  // src/preview-api/modules/store/sortStories.ts
3724
- var Ks = /* @__PURE__ */ n((r, e, t) => {
3798
+ var hi = /* @__PURE__ */ n((r, e, t) => {
3725
3799
  if (e) {
3726
3800
  let o;
3727
- typeof e == "function" ? o = e : o = ho(e), r.sort(o);
3801
+ typeof e == "function" ? o = e : o = _o(e), r.sort(o);
3728
3802
  } else
3729
3803
  r.sort(
3730
3804
  (o, s) => t.indexOf(o.importPath) - t.indexOf(s.importPath)
3731
3805
  );
3732
3806
  return r;
3733
- }, "sortStoriesCommon"), Xs = /* @__PURE__ */ n((r, e, t) => {
3807
+ }, "sortStoriesCommon"), gi = /* @__PURE__ */ n((r, e, t) => {
3734
3808
  try {
3735
- return Ks(r, e, t);
3809
+ return hi(r, e, t);
3736
3810
  } catch (o) {
3737
3811
  throw new Error(P`
3738
3812
  Error sorting stories with sort parameter ${e}:
@@ -3747,48 +3821,48 @@ var Ks = /* @__PURE__ */ n((r, e, t) => {
3747
3821
  }, "sortStoriesV7");
3748
3822
 
3749
3823
  // src/preview-api/modules/preview-web/Preview.tsx
3750
- import { deprecate as ti, logger as xo } from "storybook/internal/client-logger";
3824
+ import { deprecate as wi, logger as zo } from "storybook/internal/client-logger";
3751
3825
  import {
3752
- ARGTYPES_INFO_REQUEST as oi,
3753
- ARGTYPES_INFO_RESPONSE as Ro,
3754
- CONFIG_ERROR as ni,
3755
- FORCE_REMOUNT as si,
3756
- FORCE_RE_RENDER as ii,
3757
- GLOBALS_UPDATED as wo,
3758
- RESET_STORY_ARGS as ai,
3759
- SET_GLOBALS as li,
3760
- STORY_ARGS_UPDATED as ci,
3761
- STORY_INDEX_INVALIDATED as di,
3762
- UPDATE_GLOBALS as pi,
3763
- UPDATE_STORY_ARGS as ui
3826
+ ARGTYPES_INFO_REQUEST as Ai,
3827
+ ARGTYPES_INFO_RESPONSE as Go,
3828
+ CONFIG_ERROR as Ei,
3829
+ FORCE_REMOUNT as Ci,
3830
+ FORCE_RE_RENDER as vi,
3831
+ GLOBALS_UPDATED as Uo,
3832
+ RESET_STORY_ARGS as Pi,
3833
+ SET_GLOBALS as Fi,
3834
+ STORY_ARGS_UPDATED as Ii,
3835
+ STORY_INDEX_INVALIDATED as Oi,
3836
+ UPDATE_GLOBALS as Di,
3837
+ UPDATE_STORY_ARGS as ki
3764
3838
  } from "storybook/internal/core-events";
3765
3839
  import {
3766
- CalledPreviewMethodBeforeInitializationError as V,
3767
- MissingRenderToCanvasError as fi,
3768
- StoryIndexFetchError as yi,
3769
- StoryStoreAccessedBeforeInitializationError as mi
3840
+ CalledPreviewMethodBeforeInitializationError as W,
3841
+ MissingRenderToCanvasError as ji,
3842
+ StoryIndexFetchError as Mi,
3843
+ StoryStoreAccessedBeforeInitializationError as _i
3770
3844
  } from "storybook/internal/preview-errors";
3771
- import { global as hi } from "@storybook/global";
3845
+ import { global as Ni } from "@storybook/global";
3772
3846
 
3773
3847
  // src/preview-api/modules/preview-web/render/StoryRender.ts
3774
3848
  import {
3775
- PLAY_FUNCTION_THREW_EXCEPTION as Js,
3776
- STORY_FINISHED as go,
3777
- STORY_RENDERED as Qs,
3778
- STORY_RENDER_PHASE_CHANGED as bo,
3779
- UNHANDLED_ERRORS_WHILE_PLAYING as Zs
3849
+ PLAY_FUNCTION_THREW_EXCEPTION as bi,
3850
+ STORY_FINISHED as No,
3851
+ STORY_RENDERED as Si,
3852
+ STORY_RENDER_PHASE_CHANGED as Lo,
3853
+ UNHANDLED_ERRORS_WHILE_PLAYING as Ti
3780
3854
  } from "storybook/internal/core-events";
3781
3855
  import {
3782
- MountMustBeDestructuredError as ei,
3783
- NoStoryMountedError as ri
3856
+ MountMustBeDestructuredError as xi,
3857
+ NoStoryMountedError as Ri
3784
3858
  } from "storybook/internal/preview-errors";
3785
3859
 
3786
3860
  // src/preview-api/modules/preview-web/render/Render.ts
3787
- var X = new Error("prepareAborted");
3861
+ var J = new Error("prepareAborted");
3788
3862
 
3789
3863
  // src/preview-api/modules/preview-web/render/StoryRender.ts
3790
- var { AbortController: So } = globalThis;
3791
- function To(r) {
3864
+ var { AbortController: qo } = globalThis;
3865
+ function Bo(r) {
3792
3866
  try {
3793
3867
  let { name: e = "Error", message: t = String(r), stack: o } = r;
3794
3868
  return { name: e, message: t, stack: o };
@@ -3796,8 +3870,8 @@ function To(r) {
3796
3870
  return { name: "Error", message: String(r) };
3797
3871
  }
3798
3872
  }
3799
- n(To, "serializeError");
3800
- var ie = class {
3873
+ n(Bo, "serializeError");
3874
+ var Qr = class Qr {
3801
3875
  constructor(e, t, o, s, i, a, l = { autoplay: !0, forceInitialArgs: !1 }, c) {
3802
3876
  this.channel = e;
3803
3877
  this.store = t;
@@ -3813,22 +3887,19 @@ var ie = class {
3813
3887
  this.teardownRender = /* @__PURE__ */ n(() => {
3814
3888
  }, "teardownRender");
3815
3889
  this.torndown = !1;
3816
- this.abortController = new So(), c && (this.story = c, this.phase = "preparing");
3817
- }
3818
- static {
3819
- n(this, "StoryRender");
3890
+ this.abortController = new qo(), c && (this.story = c, this.phase = "preparing");
3820
3891
  }
3821
3892
  async runPhase(e, t, o) {
3822
- this.phase = t, this.channel.emit(bo, { newPhase: this.phase, storyId: this.id }), o && (await o(), this.checkIfAborted(e));
3893
+ this.phase = t, this.channel.emit(Lo, { newPhase: this.phase, storyId: this.id }), o && (await o(), this.checkIfAborted(e));
3823
3894
  }
3824
3895
  checkIfAborted(e) {
3825
- return e.aborted ? (this.phase = "aborted", this.channel.emit(bo, { newPhase: this.phase, storyId: this.id }), !0) : !1;
3896
+ return e.aborted ? (this.phase = "aborted", this.channel.emit(Lo, { newPhase: this.phase, storyId: this.id }), !0) : !1;
3826
3897
  }
3827
3898
  async prepare() {
3828
3899
  if (await this.runPhase(this.abortController.signal, "preparing", async () => {
3829
3900
  this.story = await this.store.loadStory({ storyId: this.id });
3830
3901
  }), this.abortController.signal.aborted)
3831
- throw await this.store.cleanupStory(this.story), X;
3902
+ throw await this.store.cleanupStory(this.story), J;
3832
3903
  }
3833
3904
  // The two story "renders" are equal and have both loaded the same story
3834
3905
  isEqual(e) {
@@ -3874,7 +3945,7 @@ var ie = class {
3874
3945
  playFunction: g,
3875
3946
  runStep: b
3876
3947
  } = s;
3877
- t && !e && (this.cancelRender(), this.abortController = new So());
3948
+ t && !e && (this.cancelRender(), this.abortController = new qo());
3878
3949
  let m = this.abortController.signal, T = !1, x = s.usesMount;
3879
3950
  try {
3880
3951
  let f = {
@@ -3883,13 +3954,13 @@ var ie = class {
3883
3954
  abortSignal: m,
3884
3955
  canvasElement: o,
3885
3956
  loaded: {},
3886
- step: /* @__PURE__ */ n((C, B) => b(C, B, f), "step"),
3957
+ step: /* @__PURE__ */ n((v, z) => b(v, z, f), "step"),
3887
3958
  context: null,
3888
3959
  canvas: {},
3889
3960
  userEvent: {},
3890
3961
  renderToCanvas: /* @__PURE__ */ n(async () => {
3891
- let C = await this.renderToScreen(S, o);
3892
- this.teardownRender = C || (() => {
3962
+ let v = await this.renderToScreen(S, o);
3963
+ this.teardownRender = v || (() => {
3893
3964
  }), T = !0;
3894
3965
  }, "renderToCanvas"),
3895
3966
  // The story provides (set in a renderer) a mount function that is a higher order function
@@ -3897,12 +3968,12 @@ var ie = class {
3897
3968
  //
3898
3969
  // Before assigning it to the context, we resolve the context dependency,
3899
3970
  // so that a user can just call it as await mount(...args) in their play function.
3900
- mount: /* @__PURE__ */ n(async (...C) => {
3971
+ mount: /* @__PURE__ */ n(async (...v) => {
3901
3972
  this.callbacks.showStoryDuringRender?.();
3902
- let B = null;
3973
+ let z = null;
3903
3974
  return await this.runPhase(m, "rendering", async () => {
3904
- B = await s.mount(f)(...C);
3905
- }), x && await this.runPhase(m, "playing"), B;
3975
+ z = await s.mount(f)(...v);
3976
+ }), x && await this.runPhase(m, "playing"), z;
3906
3977
  }, "mount")
3907
3978
  };
3908
3979
  f.context = f;
@@ -3915,8 +3986,8 @@ var ie = class {
3915
3986
  story: c,
3916
3987
  tags: d,
3917
3988
  ...this.callbacks,
3918
- showError: /* @__PURE__ */ n((C) => (this.phase = "errored", this.callbacks.showError(C)), "showError"),
3919
- showException: /* @__PURE__ */ n((C) => (this.phase = "errored", this.callbacks.showException(C)), "showException"),
3989
+ showError: /* @__PURE__ */ n((v) => (this.phase = "errored", this.callbacks.showError(v)), "showError"),
3990
+ showException: /* @__PURE__ */ n((v) => (this.phase = "errored", this.callbacks.showException(v)), "showException"),
3920
3991
  forceRemount: t || this.notYetRendered,
3921
3992
  storyContext: f,
3922
3993
  storyFn: /* @__PURE__ */ n(() => h(f), "storyFn"),
@@ -3927,47 +3998,50 @@ var ie = class {
3927
3998
  }), m.aborted)
3928
3999
  return;
3929
4000
  let R = await u(f);
3930
- if (this.store.addCleanupCallbacks(s, R), this.checkIfAborted(m) || (!T && !x && await f.mount(), this.notYetRendered = !1, m.aborted))
4001
+ if (this.store.addCleanupCallbacks(s, ...R), this.checkIfAborted(m) || (!T && !x && await f.mount(), this.notYetRendered = !1, m.aborted))
3931
4002
  return;
3932
- let w = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, A = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ n((C) => A.
3933
- add("error" in C ? C.error : C.reason), "onError");
4003
+ let w = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, E = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ n((v) => {
4004
+ v.error && E.add(v.error);
4005
+ }, "onError"), k = /* @__PURE__ */ n((v) => {
4006
+ v.reason && E.add(v.reason);
4007
+ }, "onUnhandledRejection");
3934
4008
  if (this.renderOptions.autoplay && t && g && this.phase !== "errored") {
3935
- window.addEventListener("error", F), window.addEventListener("unhandledrejection", F), this.disableKeyListeners = !0;
4009
+ window.addEventListener("error", D), window.addEventListener("unhandledrejection", k), this.disableKeyListeners = !0;
3936
4010
  try {
3937
4011
  if (x ? await g(f) : (f.mount = async () => {
3938
- throw new ei({ playFunction: g.toString() });
4012
+ throw new xi({ playFunction: g.toString() });
3939
4013
  }, await this.runPhase(m, "playing", async () => g(f))), !T)
3940
- throw new ri();
3941
- this.checkIfAborted(m), !w && A.size > 0 ? await this.runPhase(m, "errored") : await this.runPhase(m, "played");
3942
- } catch (C) {
4014
+ throw new Ri();
4015
+ this.checkIfAborted(m), !w && E.size > 0 ? await this.runPhase(m, "errored") : await this.runPhase(m, "played");
4016
+ } catch (v) {
3943
4017
  if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(m, "errored", async () => {
3944
- this.channel.emit(Js, To(C));
4018
+ this.channel.emit(bi, Bo(v));
3945
4019
  }), this.story.parameters.throwPlayFunctionExceptions !== !1)
3946
- throw C;
3947
- console.error(C);
4020
+ throw v;
4021
+ console.error(v);
3948
4022
  }
3949
- if (!w && A.size > 0 && this.channel.emit(
3950
- Zs,
3951
- Array.from(A).map(To)
3952
- ), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection", F), window.removeEventListener("error", F), m.aborted)
4023
+ if (!w && E.size > 0 && this.channel.emit(
4024
+ Ti,
4025
+ Array.from(E).map(Bo)
4026
+ ), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection", k), window.removeEventListener("error", D), m.aborted)
3953
4027
  return;
3954
4028
  }
3955
- await this.runPhase(
3956
- m,
3957
- "completed",
3958
- async () => this.channel.emit(Qs, i)
3959
- ), this.phase !== "errored" && await this.runPhase(m, "afterEach", async () => {
4029
+ await this.runPhase(m, "completing", async () => {
4030
+ rr() ? this.store.addCleanupCallbacks(s, ge()) : await be(m);
4031
+ }), await this.runPhase(m, "completed", async () => {
4032
+ this.channel.emit(Si, i);
4033
+ }), this.phase !== "errored" && await this.runPhase(m, "afterEach", async () => {
3960
4034
  await y(f);
3961
4035
  });
3962
- let j = !w && A.size > 0, N = f.reporting.reports.some(
3963
- (C) => C.status === "failed"
3964
- ), pe = j || N;
4036
+ let L = !w && E.size > 0, pe = f.reporting.reports.some(
4037
+ (v) => v.status === "failed"
4038
+ ), q = L || pe;
3965
4039
  await this.runPhase(
3966
4040
  m,
3967
4041
  "finished",
3968
- async () => this.channel.emit(go, {
4042
+ async () => this.channel.emit(No, {
3969
4043
  storyId: i,
3970
- status: pe ? "error" : "success",
4044
+ status: q ? "error" : "success",
3971
4045
  reporters: f.reporting.reports
3972
4046
  })
3973
4047
  );
@@ -3975,7 +4049,7 @@ var ie = class {
3975
4049
  this.phase = "errored", this.callbacks.showException(f), await this.runPhase(
3976
4050
  m,
3977
4051
  "finished",
3978
- async () => this.channel.emit(go, {
4052
+ async () => this.channel.emit(No, {
3979
4053
  storyId: i,
3980
4054
  status: "error",
3981
4055
  reporters: []
@@ -4020,9 +4094,11 @@ var ie = class {
4020
4094
  });
4021
4095
  }
4022
4096
  };
4097
+ n(Qr, "StoryRender");
4098
+ var ie = Qr;
4023
4099
 
4024
4100
  // src/preview-api/modules/preview-web/Preview.tsx
4025
- var { fetch: gi } = hi, bi = "./index.json", be = class {
4101
+ var { fetch: Li } = Ni, qi = "./index.json", Zr = class Zr {
4026
4102
  constructor(e, t, o = _.getChannel(), s = !0) {
4027
4103
  this.importFn = e;
4028
4104
  this.getProjectAnnotations = t;
@@ -4032,9 +4108,6 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4032
4108
  this.resolveStoreInitializationPromise = i, this.rejectStoreInitializationPromise = a;
4033
4109
  }), s && this.initialize();
4034
4110
  }
4035
- static {
4036
- n(this, "Preview");
4037
- }
4038
4111
  // Create a proxy object for `__STORYBOOK_STORY_STORE__` and `__STORYBOOK_PREVIEW__.storyStore`
4039
4112
  // That proxies through to the store once ready, and errors beforehand. This means we can set
4040
4113
  // `__STORYBOOK_STORY_STORE__ = __STORYBOOK_PREVIEW__.storyStore` without having to wait, and
@@ -4046,8 +4119,8 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4046
4119
  {
4047
4120
  get: /* @__PURE__ */ n((e, t) => {
4048
4121
  if (this.storyStoreValue)
4049
- return ti("Accessing the Story Store is deprecated and will be removed in 9.0"), this.storyStoreValue[t];
4050
- throw new mi();
4122
+ return wi("Accessing the Story Store is deprecated and will be removed in 9.0"), this.storyStoreValue[t];
4123
+ throw new _i();
4051
4124
  }, "get")
4052
4125
  }
4053
4126
  );
@@ -4066,15 +4139,15 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4066
4139
  return this.storeInitializationPromise;
4067
4140
  }
4068
4141
  setupListeners() {
4069
- this.channel.on(di, this.onStoryIndexChanged.bind(this)), this.channel.on(pi, this.onUpdateGlobals.bind(this)), this.channel.on(ui, this.
4070
- onUpdateArgs.bind(this)), this.channel.on(oi, this.onRequestArgTypesInfo.bind(this)), this.channel.on(ai, this.onResetArgs.bind(this)), this.
4071
- channel.on(ii, this.onForceReRender.bind(this)), this.channel.on(si, this.onForceRemount.bind(this));
4142
+ this.channel.on(Oi, this.onStoryIndexChanged.bind(this)), this.channel.on(Di, this.onUpdateGlobals.bind(this)), this.channel.on(ki, this.
4143
+ onUpdateArgs.bind(this)), this.channel.on(Ai, this.onRequestArgTypesInfo.bind(this)), this.channel.on(Pi, this.onResetArgs.bind(this)), this.
4144
+ channel.on(vi, this.onForceReRender.bind(this)), this.channel.on(Ci, this.onForceRemount.bind(this));
4072
4145
  }
4073
4146
  async getProjectAnnotationsOrRenderError() {
4074
4147
  try {
4075
4148
  let e = await this.getProjectAnnotations();
4076
4149
  if (this.renderToCanvas = e.renderToCanvas, !this.renderToCanvas)
4077
- throw new fi();
4150
+ throw new ji();
4078
4151
  return e;
4079
4152
  } catch (e) {
4080
4153
  throw this.renderPreviewEntryError("Error reading preview.js:", e), e;
@@ -4098,16 +4171,16 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4098
4171
  }
4099
4172
  }
4100
4173
  async getStoryIndexFromServer() {
4101
- let e = await gi(bi);
4174
+ let e = await Li(qi);
4102
4175
  if (e.status === 200)
4103
4176
  return e.json();
4104
- throw new yi({ text: await e.text() });
4177
+ throw new Mi({ text: await e.text() });
4105
4178
  }
4106
4179
  // If initialization gets as far as the story index, this function runs.
4107
4180
  initializeWithStoryIndex(e) {
4108
4181
  if (!this.projectAnnotationsBeforeInitialization)
4109
4182
  throw new Error("Cannot call initializeWithStoryIndex until project annotations resolve");
4110
- this.storyStoreValue = new ge(
4183
+ this.storyStoreValue = new Se(
4111
4184
  e,
4112
4185
  this.importFn,
4113
4186
  this.projectAnnotationsBeforeInitialization
@@ -4118,12 +4191,12 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4118
4191
  }
4119
4192
  emitGlobals() {
4120
4193
  if (!this.storyStoreValue)
4121
- throw new V({ methodName: "emitGlobals" });
4194
+ throw new W({ methodName: "emitGlobals" });
4122
4195
  let e = {
4123
4196
  globals: this.storyStoreValue.userGlobals.get() || {},
4124
4197
  globalTypes: this.storyStoreValue.projectAnnotations.globalTypes || {}
4125
4198
  };
4126
- this.channel.emit(li, e);
4199
+ this.channel.emit(Fi, e);
4127
4200
  }
4128
4201
  // EVENT HANDLERS
4129
4202
  // This happens when a config file gets reloaded
@@ -4157,7 +4230,7 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4157
4230
  storyIndex: t
4158
4231
  }) {
4159
4232
  if (!this.storyStoreValue)
4160
- throw new V({ methodName: "onStoriesChanged" });
4233
+ throw new W({ methodName: "onStoriesChanged" });
4161
4234
  await this.storyStoreValue.onStoriesChanged({ importFn: e, storyIndex: t });
4162
4235
  }
4163
4236
  async onUpdateGlobals({
@@ -4165,10 +4238,10 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4165
4238
  currentStory: t
4166
4239
  }) {
4167
4240
  if (this.storyStoreValue || await this.storeInitializationPromise, !this.storyStoreValue)
4168
- throw new V({ methodName: "onUpdateGlobals" });
4241
+ throw new W({ methodName: "onUpdateGlobals" });
4169
4242
  if (this.storyStoreValue.userGlobals.update(e), t) {
4170
4243
  let { initialGlobals: o, storyGlobals: s, userGlobals: i, globals: a } = this.storyStoreValue.getStoryContext(t);
4171
- this.channel.emit(wo, {
4244
+ this.channel.emit(Uo, {
4172
4245
  initialGlobals: o,
4173
4246
  userGlobals: i,
4174
4247
  storyGlobals: s,
@@ -4176,7 +4249,7 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4176
4249
  });
4177
4250
  } else {
4178
4251
  let { initialGlobals: o, globals: s } = this.storyStoreValue.userGlobals;
4179
- this.channel.emit(wo, {
4252
+ this.channel.emit(Uo, {
4180
4253
  initialGlobals: o,
4181
4254
  userGlobals: s,
4182
4255
  storyGlobals: {},
@@ -4187,7 +4260,7 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4187
4260
  }
4188
4261
  async onUpdateArgs({ storyId: e, updatedArgs: t }) {
4189
4262
  if (!this.storyStoreValue)
4190
- throw new V({ methodName: "onUpdateArgs" });
4263
+ throw new W({ methodName: "onUpdateArgs" });
4191
4264
  this.storyStoreValue.args.update(e, t), await Promise.all(
4192
4265
  this.storyRenders.filter((o) => o.id === e && !o.renderOptions.forceInitialArgs).map(
4193
4266
  (o) => (
@@ -4196,7 +4269,7 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4196
4269
  o.story && o.story.usesMount ? o.remount() : o.rerender()
4197
4270
  )
4198
4271
  )
4199
- ), this.channel.emit(ci, {
4272
+ ), this.channel.emit(Ii, {
4200
4273
  storyId: e,
4201
4274
  args: this.storyStoreValue.args.get(e)
4202
4275
  });
@@ -4205,14 +4278,14 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4205
4278
  try {
4206
4279
  await this.storeInitializationPromise;
4207
4280
  let o = await this.storyStoreValue?.loadStory(t);
4208
- this.channel.emit(Ro, {
4281
+ this.channel.emit(Go, {
4209
4282
  id: e,
4210
4283
  success: !0,
4211
4284
  payload: { argTypes: o?.argTypes || {} },
4212
4285
  error: null
4213
4286
  });
4214
4287
  } catch (o) {
4215
- this.channel.emit(Ro, {
4288
+ this.channel.emit(Go, {
4216
4289
  id: e,
4217
4290
  success: !1,
4218
4291
  error: o?.message
@@ -4221,7 +4294,7 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4221
4294
  }
4222
4295
  async onResetArgs({ storyId: e, argNames: t }) {
4223
4296
  if (!this.storyStoreValue)
4224
- throw new V({ methodName: "onResetArgs" });
4297
+ throw new W({ methodName: "onResetArgs" });
4225
4298
  let s = this.storyRenders.find((l) => l.id === e)?.story || await this.storyStoreValue.loadStory({ storyId: e }), a = (t || [
4226
4299
  .../* @__PURE__ */ new Set([
4227
4300
  ...Object.keys(s.initialArgs),
@@ -4245,7 +4318,7 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4245
4318
  // "instant", although async.
4246
4319
  renderStoryToElement(e, t, o, s) {
4247
4320
  if (!this.renderToCanvas || !this.storyStoreValue)
4248
- throw new V({
4321
+ throw new W({
4249
4322
  methodName: "renderStoryToElement"
4250
4323
  });
4251
4324
  let i = new ie(
@@ -4268,74 +4341,76 @@ var { fetch: gi } = hi, bi = "./index.json", be = class {
4268
4341
  // API
4269
4342
  async loadStory({ storyId: e }) {
4270
4343
  if (!this.storyStoreValue)
4271
- throw new V({ methodName: "loadStory" });
4344
+ throw new W({ methodName: "loadStory" });
4272
4345
  return this.storyStoreValue.loadStory({ storyId: e });
4273
4346
  }
4274
4347
  getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
4275
4348
  if (!this.storyStoreValue)
4276
- throw new V({ methodName: "getStoryContext" });
4349
+ throw new W({ methodName: "getStoryContext" });
4277
4350
  return this.storyStoreValue.getStoryContext(e, { forceInitialArgs: t });
4278
4351
  }
4279
4352
  async extract(e) {
4280
4353
  if (!this.storyStoreValue)
4281
- throw new V({ methodName: "extract" });
4354
+ throw new W({ methodName: "extract" });
4282
4355
  if (this.previewEntryError)
4283
4356
  throw this.previewEntryError;
4284
4357
  return await this.storyStoreValue.cacheAllCSFFiles(), this.storyStoreValue.extract(e);
4285
4358
  }
4286
4359
  // UTILITIES
4287
4360
  renderPreviewEntryError(e, t) {
4288
- this.previewEntryError = t, xo.error(e), xo.error(t), this.channel.emit(ni, t);
4361
+ this.previewEntryError = t, zo.error(e), zo.error(t), this.channel.emit(Ei, t);
4289
4362
  }
4290
4363
  };
4364
+ n(Zr, "Preview");
4365
+ var Te = Zr;
4291
4366
 
4292
4367
  // src/preview-api/modules/preview-web/PreviewWeb.tsx
4293
- import { global as nl } from "@storybook/global";
4368
+ import { global as El } from "@storybook/global";
4294
4369
 
4295
4370
  // src/preview-api/modules/preview-web/PreviewWithSelection.tsx
4296
- import { logger as rr } from "storybook/internal/client-logger";
4371
+ import { logger as nr } from "storybook/internal/client-logger";
4297
4372
  import {
4298
- CURRENT_STORY_WAS_SET as Eo,
4299
- DOCS_PREPARED as wi,
4300
- GLOBALS_UPDATED as Ao,
4301
- PRELOAD_ENTRIES as Ei,
4302
- PREVIEW_KEYDOWN as Ai,
4303
- SET_CURRENT_STORY as Ci,
4304
- STORY_CHANGED as vi,
4305
- STORY_ERRORED as Pi,
4306
- STORY_MISSING as Co,
4307
- STORY_PREPARED as Fi,
4308
- STORY_RENDER_PHASE_CHANGED as vo,
4309
- STORY_SPECIFIED as Ii,
4310
- STORY_THREW_EXCEPTION as Oi,
4311
- STORY_UNCHANGED as Di,
4312
- UPDATE_QUERY_PARAMS as ki
4373
+ CURRENT_STORY_WAS_SET as Ho,
4374
+ DOCS_PREPARED as Hi,
4375
+ GLOBALS_UPDATED as Vo,
4376
+ PRELOAD_ENTRIES as Vi,
4377
+ PREVIEW_KEYDOWN as Wi,
4378
+ SET_CURRENT_STORY as $i,
4379
+ STORY_CHANGED as Yi,
4380
+ STORY_ERRORED as Ki,
4381
+ STORY_MISSING as Wo,
4382
+ STORY_PREPARED as Xi,
4383
+ STORY_RENDER_PHASE_CHANGED as $o,
4384
+ STORY_SPECIFIED as Ji,
4385
+ STORY_THREW_EXCEPTION as Qi,
4386
+ STORY_UNCHANGED as Zi,
4387
+ UPDATE_QUERY_PARAMS as ea
4313
4388
  } from "storybook/internal/core-events";
4314
4389
  import {
4315
- CalledPreviewMethodBeforeInitializationError as Ur,
4316
- EmptyIndexError as ji,
4317
- MdxFileWithNoCsfReferencesError as Mi,
4318
- NoStoryMatchError as _i
4390
+ CalledPreviewMethodBeforeInitializationError as nt,
4391
+ EmptyIndexError as ra,
4392
+ MdxFileWithNoCsfReferencesError as ta,
4393
+ NoStoryMatchError as oa
4319
4394
  } from "storybook/internal/preview-errors";
4320
4395
 
4321
4396
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
4322
- var Si = !1, Gr = "Invariant failed";
4323
- function er(r, e) {
4397
+ var Bi = !1, et = "Invariant failed";
4398
+ function or(r, e) {
4324
4399
  if (!r) {
4325
- if (Si)
4326
- throw new Error(Gr);
4327
- var t = typeof e == "function" ? e() : e, o = t ? "".concat(Gr, ": ").concat(t) : Gr;
4400
+ if (Bi)
4401
+ throw new Error(et);
4402
+ var t = typeof e == "function" ? e() : e, o = t ? "".concat(et, ": ").concat(t) : et;
4328
4403
  throw new Error(o);
4329
4404
  }
4330
4405
  }
4331
- n(er, "invariant");
4406
+ n(or, "invariant");
4332
4407
 
4333
4408
  // src/preview-api/modules/preview-web/render/CsfDocsRender.ts
4334
- import { DOCS_RENDERED as xi } from "storybook/internal/core-events";
4409
+ import { DOCS_RENDERED as Gi } from "storybook/internal/core-events";
4335
4410
 
4336
4411
  // src/preview-api/modules/preview-web/docs-context/DocsContext.ts
4337
- import { isStory as Ti } from "storybook/internal/csf";
4338
- var J = class {
4412
+ import { isStory as zi } from "storybook/internal/csf";
4413
+ var rt = class rt {
4339
4414
  constructor(e, t, o, s) {
4340
4415
  this.channel = e;
4341
4416
  this.store = t;
@@ -4374,9 +4449,6 @@ mCSFFile");
4374
4449
  this.referenceCSFFile(i);
4375
4450
  });
4376
4451
  }
4377
- static {
4378
- n(this, "DocsContext");
4379
- }
4380
4452
  // This docs entry references this CSF file and can synchronously load the stories, as well
4381
4453
  // as reference them by module export. If the CSF is part of the "component" stories, they
4382
4454
  // can also be referenced by name and are in the componentStories list.
@@ -4438,7 +4510,7 @@ CSF file?"
4438
4510
  if (t)
4439
4511
  return { type: "meta", csfFile: t };
4440
4512
  let o = this.exportToStory.get(
4441
- Ti(e) ? e.input : e
4513
+ zi(e) ? e.input : e
4442
4514
  );
4443
4515
  return o ? { type: "story", story: o } : { type: "component", component: e };
4444
4516
  }
@@ -4476,9 +4548,11 @@ CSF file?"
4476
4548
  }
4477
4549
  }
4478
4550
  };
4551
+ n(rt, "DocsContext");
4552
+ var Q = rt;
4479
4553
 
4480
4554
  // src/preview-api/modules/preview-web/render/CsfDocsRender.ts
4481
- var Me = class {
4555
+ var tt = class tt {
4482
4556
  constructor(e, t, o, s) {
4483
4557
  this.channel = e;
4484
4558
  this.store = t;
@@ -4491,9 +4565,6 @@ var Me = class {
4491
4565
  this.preparing = !1;
4492
4566
  this.id = o.id;
4493
4567
  }
4494
- static {
4495
- n(this, "CsfDocsRender");
4496
- }
4497
4568
  isPreparing() {
4498
4569
  return this.preparing;
4499
4570
  }
@@ -4501,7 +4572,7 @@ var Me = class {
4501
4572
  this.preparing = !0;
4502
4573
  let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
4503
4574
  if (this.torndown)
4504
- throw X;
4575
+ throw J;
4505
4576
  let { importPath: o, title: s } = this.entry, i = this.store.processCSFFileWithCache(
4506
4577
  e,
4507
4578
  o,
@@ -4515,7 +4586,7 @@ var Me = class {
4515
4586
  docsContext(e) {
4516
4587
  if (!this.csfFiles)
4517
4588
  throw new Error("Cannot render docs before preparing");
4518
- let t = new J(
4589
+ let t = new Q(
4519
4590
  this.channel,
4520
4591
  this.store,
4521
4592
  e,
@@ -4533,7 +4604,7 @@ var Me = class {
4533
4604
  );
4534
4605
  let i = await s.renderer(), { render: a } = i, l = /* @__PURE__ */ n(async () => {
4535
4606
  try {
4536
- await a(o, s, e), this.channel.emit(xi, this.id);
4607
+ await a(o, s, e), this.channel.emit(Gi, this.id);
4537
4608
  } catch (c) {
4538
4609
  this.callbacks.showException(c);
4539
4610
  }
@@ -4546,10 +4617,12 @@ var Me = class {
4546
4617
  this.teardownRender?.({ viewModeChanged: e }), this.torndown = !0;
4547
4618
  }
4548
4619
  };
4620
+ n(tt, "CsfDocsRender");
4621
+ var Ne = tt;
4549
4622
 
4550
4623
  // src/preview-api/modules/preview-web/render/MdxDocsRender.ts
4551
- import { DOCS_RENDERED as Ri } from "storybook/internal/core-events";
4552
- var _e = class {
4624
+ import { DOCS_RENDERED as Ui } from "storybook/internal/core-events";
4625
+ var ot = class ot {
4553
4626
  constructor(e, t, o, s) {
4554
4627
  this.channel = e;
4555
4628
  this.store = t;
@@ -4562,9 +4635,6 @@ var _e = class {
4562
4635
  this.preparing = !1;
4563
4636
  this.id = o.id;
4564
4637
  }
4565
- static {
4566
- n(this, "MdxDocsRender");
4567
- }
4568
4638
  isPreparing() {
4569
4639
  return this.preparing;
4570
4640
  }
@@ -4572,7 +4642,7 @@ var _e = class {
4572
4642
  this.preparing = !0;
4573
4643
  let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
4574
4644
  if (this.torndown)
4575
- throw X;
4645
+ throw J;
4576
4646
  this.csfFiles = t, this.exports = e, this.preparing = !1;
4577
4647
  }
4578
4648
  isEqual(e) {
@@ -4581,7 +4651,7 @@ var _e = class {
4581
4651
  docsContext(e) {
4582
4652
  if (!this.csfFiles)
4583
4653
  throw new Error("Cannot render docs before preparing");
4584
- return new J(
4654
+ return new Q(
4585
4655
  this.channel,
4586
4656
  this.store,
4587
4657
  e,
@@ -4598,7 +4668,7 @@ var _e = class {
4598
4668
  );
4599
4669
  let i = { ...s, page: this.exports.default }, a = await s.renderer(), { render: l } = a, c = /* @__PURE__ */ n(async () => {
4600
4670
  try {
4601
- await l(o, i, e), this.channel.emit(Ri, this.id);
4671
+ await l(o, i, e), this.channel.emit(Ui, this.id);
4602
4672
  } catch (d) {
4603
4673
  this.callbacks.showException(d);
4604
4674
  }
@@ -4611,32 +4681,34 @@ var _e = class {
4611
4681
  this.teardownRender?.({ viewModeChanged: e }), this.torndown = !0;
4612
4682
  }
4613
4683
  };
4684
+ n(ot, "MdxDocsRender");
4685
+ var Le = ot;
4614
4686
 
4615
4687
  // src/preview-api/modules/preview-web/PreviewWithSelection.tsx
4616
- var Li = globalThis;
4617
- function Ni(r) {
4688
+ var na = globalThis;
4689
+ function sa(r) {
4618
4690
  let e = r.composedPath && r.composedPath()[0] || r.target;
4619
4691
  return /input|textarea/i.test(e.tagName) || e.getAttribute("contenteditable") !== null;
4620
4692
  }
4621
- n(Ni, "focusInInput");
4622
- var Po = "attached-mdx", qi = "unattached-mdx";
4623
- function Bi({ tags: r }) {
4624
- return r?.includes(qi) || r?.includes(Po);
4693
+ n(sa, "focusInInput");
4694
+ var Yo = "attached-mdx", ia = "unattached-mdx";
4695
+ function aa({ tags: r }) {
4696
+ return r?.includes(ia) || r?.includes(Yo);
4625
4697
  }
4626
- n(Bi, "isMdxEntry");
4627
- function Hr(r) {
4698
+ n(aa, "isMdxEntry");
4699
+ function st(r) {
4628
4700
  return r.type === "story";
4629
4701
  }
4630
- n(Hr, "isStoryRender");
4631
- function zi(r) {
4702
+ n(st, "isStoryRender");
4703
+ function la(r) {
4632
4704
  return r.type === "docs";
4633
4705
  }
4634
- n(zi, "isDocsRender");
4635
- function Gi(r) {
4636
- return zi(r) && r.subtype === "csf";
4706
+ n(la, "isDocsRender");
4707
+ function ca(r) {
4708
+ return la(r) && r.subtype === "csf";
4637
4709
  }
4638
- n(Gi, "isCsfDocsRender");
4639
- var Se = class extends be {
4710
+ n(ca, "isCsfDocsRender");
4711
+ var it = class it extends Te {
4640
4712
  constructor(t, o, s, i) {
4641
4713
  super(t, o, void 0, !1);
4642
4714
  this.importFn = t;
@@ -4645,16 +4717,13 @@ var Se = class extends be {
4645
4717
  this.view = i;
4646
4718
  this.initialize();
4647
4719
  }
4648
- static {
4649
- n(this, "PreviewWithSelection");
4650
- }
4651
4720
  setupListeners() {
4652
- super.setupListeners(), Li.onkeydown = this.onKeydown.bind(this), this.channel.on(Ci, this.onSetCurrentStory.bind(this)), this.channel.on(
4653
- ki, this.onUpdateQueryParams.bind(this)), this.channel.on(Ei, this.onPreloadStories.bind(this));
4721
+ super.setupListeners(), na.onkeydown = this.onKeydown.bind(this), this.channel.on($i, this.onSetCurrentStory.bind(this)), this.channel.on(
4722
+ ea, this.onUpdateQueryParams.bind(this)), this.channel.on(Vi, this.onPreloadStories.bind(this));
4654
4723
  }
4655
4724
  async setInitialGlobals() {
4656
4725
  if (!this.storyStoreValue)
4657
- throw new Ur({ methodName: "setInitialGlobals" });
4726
+ throw new nt({ methodName: "setInitialGlobals" });
4658
4727
  let { globals: t } = this.selectionStore.selectionSpecifier || {};
4659
4728
  t && this.storyStoreValue.userGlobals.updateFromPersisted(t), this.emitGlobals();
4660
4729
  }
@@ -4665,7 +4734,7 @@ var Se = class extends be {
4665
4734
  // Use the selection specifier to choose a story, then render it
4666
4735
  async selectSpecifiedStory() {
4667
4736
  if (!this.storyStoreValue)
4668
- throw new Ur({
4737
+ throw new nt({
4669
4738
  methodName: "selectSpecifiedStory"
4670
4739
  });
4671
4740
  if (this.selectionStore.selection) {
@@ -4678,14 +4747,14 @@ var Se = class extends be {
4678
4747
  }
4679
4748
  let { storySpecifier: t, args: o } = this.selectionStore.selectionSpecifier, s = this.storyStoreValue.storyIndex.entryFromSpecifier(t);
4680
4749
  if (!s) {
4681
- t === "*" ? this.renderStoryLoadingException(t, new ji()) : this.renderStoryLoadingException(
4750
+ t === "*" ? this.renderStoryLoadingException(t, new ra()) : this.renderStoryLoadingException(
4682
4751
  t,
4683
- new _i({ storySpecifier: t.toString() })
4752
+ new oa({ storySpecifier: t.toString() })
4684
4753
  );
4685
4754
  return;
4686
4755
  }
4687
4756
  let { id: i, type: a } = s;
4688
- this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(Ii, this.selectionStore.selection), this.channel.emit(Eo,
4757
+ this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(Ji, this.selectionStore.selection), this.channel.emit(Ho,
4689
4758
  this.selectionStore.selection), await this.renderSelection({ persistedArgs: o });
4690
4759
  }
4691
4760
  // EVENT HANDLERS
@@ -4704,15 +4773,15 @@ var Se = class extends be {
4704
4773
  selectSpecifiedStory();
4705
4774
  }
4706
4775
  onKeydown(t) {
4707
- if (!this.storyRenders.find((o) => o.disableKeyListeners) && !Ni(t)) {
4776
+ if (!this.storyRenders.find((o) => o.disableKeyListeners) && !sa(t)) {
4708
4777
  let { altKey: o, ctrlKey: s, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d } = t;
4709
- this.channel.emit(Ai, {
4778
+ this.channel.emit(Wi, {
4710
4779
  event: { altKey: o, ctrlKey: s, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d }
4711
4780
  });
4712
4781
  }
4713
4782
  }
4714
4783
  async onSetCurrentStory(t) {
4715
- this.selectionStore.setSelection({ viewMode: "story", ...t }), await this.storeInitializationPromise, this.channel.emit(Eo, this.selectionStore.
4784
+ this.selectionStore.setSelection({ viewMode: "story", ...t }), await this.storeInitializationPromise, this.channel.emit(Ho, this.selectionStore.
4716
4785
  selection), this.renderSelection();
4717
4786
  }
4718
4787
  onUpdateQueryParams(t) {
@@ -4720,7 +4789,7 @@ var Se = class extends be {
4720
4789
  }
4721
4790
  async onUpdateGlobals({ globals: t }) {
4722
4791
  let o = this.currentRender instanceof ie && this.currentRender.story || void 0;
4723
- super.onUpdateGlobals({ globals: t, currentStory: o }), (this.currentRender instanceof _e || this.currentRender instanceof Me) && await this.
4792
+ super.onUpdateGlobals({ globals: t, currentStory: o }), (this.currentRender instanceof Le || this.currentRender instanceof Ne) && await this.
4724
4793
  currentRender.rerender?.();
4725
4794
  }
4726
4795
  async onUpdateArgs({ storyId: t, updatedArgs: o }) {
@@ -4738,7 +4807,7 @@ var Se = class extends be {
4738
4807
  async renderSelection({ persistedArgs: t } = {}) {
4739
4808
  let { renderToCanvas: o } = this;
4740
4809
  if (!this.storyStoreValue || !o)
4741
- throw new Ur({ methodName: "renderSelection" });
4810
+ throw new nt({ methodName: "renderSelection" });
4742
4811
  let { selection: s } = this.selectionStore;
4743
4812
  if (!s)
4744
4813
  throw new Error("Cannot call renderSelection as no selection was made");
@@ -4760,12 +4829,12 @@ var Se = class extends be {
4760
4829
  this.mainStoryCallbacks(i),
4761
4830
  i,
4762
4831
  "story"
4763
- ) : Bi(a) ? d = new _e(
4832
+ ) : aa(a) ? d = new Le(
4764
4833
  this.channel,
4765
4834
  this.storyStoreValue,
4766
4835
  a,
4767
4836
  this.mainStoryCallbacks(i)
4768
- ) : d = new Me(
4837
+ ) : d = new Ne(
4769
4838
  this.channel,
4770
4839
  this.storyStoreValue,
4771
4840
  a,
@@ -4778,16 +4847,16 @@ var Se = class extends be {
4778
4847
  try {
4779
4848
  await d.prepare();
4780
4849
  } catch (h) {
4781
- u && await this.teardownRender(u), h !== X && this.renderStoryLoadingException(i, h);
4850
+ u && await this.teardownRender(u), h !== J && this.renderStoryLoadingException(i, h);
4782
4851
  return;
4783
4852
  }
4784
4853
  let y = !l && u && !d.isEqual(u);
4785
- if (t && Hr(d) && (er(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), u && !u.torndown && !l && !y && !c) {
4786
- this.currentRender = u, this.channel.emit(Di, i), this.view.showMain();
4854
+ if (t && st(d) && (or(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), u && !u.torndown && !l && !y && !c) {
4855
+ this.currentRender = u, this.channel.emit(Zi, i), this.view.showMain();
4787
4856
  return;
4788
4857
  }
4789
- if (u && await this.teardownRender(u, { viewModeChanged: c }), p && (l || c) && this.channel.emit(vi, i), Hr(d)) {
4790
- er(!!d.story);
4858
+ if (u && await this.teardownRender(u, { viewModeChanged: c }), p && (l || c) && this.channel.emit(Yi, i), st(d)) {
4859
+ or(!!d.story);
4791
4860
  let {
4792
4861
  parameters: h,
4793
4862
  initialArgs: g,
@@ -4798,33 +4867,33 @@ var Se = class extends be {
4798
4867
  storyGlobals: f,
4799
4868
  globals: S
4800
4869
  } = this.storyStoreValue.getStoryContext(d.story);
4801
- this.channel.emit(Fi, {
4870
+ this.channel.emit(Xi, {
4802
4871
  id: i,
4803
4872
  parameters: h,
4804
4873
  initialArgs: g,
4805
4874
  argTypes: b,
4806
4875
  args: m
4807
- }), this.channel.emit(Ao, { userGlobals: x, storyGlobals: f, globals: S, initialGlobals: T });
4876
+ }), this.channel.emit(Vo, { userGlobals: x, storyGlobals: f, globals: S, initialGlobals: T });
4808
4877
  } else {
4809
4878
  let { parameters: h } = this.storyStoreValue.projectAnnotations, { initialGlobals: g, globals: b } = this.storyStoreValue.userGlobals;
4810
- if (this.channel.emit(Ao, {
4879
+ if (this.channel.emit(Vo, {
4811
4880
  globals: b,
4812
4881
  initialGlobals: g,
4813
4882
  storyGlobals: {},
4814
4883
  userGlobals: b
4815
- }), Gi(d) || d.entry.tags?.includes(Po)) {
4884
+ }), ca(d) || d.entry.tags?.includes(Yo)) {
4816
4885
  if (!d.csfFiles)
4817
- throw new Mi({ storyId: i });
4886
+ throw new ta({ storyId: i });
4818
4887
  ({ parameters: h } = this.storyStoreValue.preparedMetaFromCSFFile({
4819
4888
  csfFile: d.csfFiles[0]
4820
4889
  }));
4821
4890
  }
4822
- this.channel.emit(wi, {
4891
+ this.channel.emit(Hi, {
4823
4892
  id: i,
4824
4893
  parameters: h
4825
4894
  });
4826
4895
  }
4827
- Hr(d) ? (er(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
4896
+ st(d) ? (or(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
4828
4897
  this.view.prepareForStory(d.story)
4829
4898
  )) : this.currentRender.renderToElement(
4830
4899
  this.view.prepareForDocs(),
@@ -4848,39 +4917,41 @@ var Se = class extends be {
4848
4917
  super.renderPreviewEntryError(t, o), this.view.showErrorDisplay(o);
4849
4918
  }
4850
4919
  renderMissingStory() {
4851
- this.view.showNoPreview(), this.channel.emit(Co);
4920
+ this.view.showNoPreview(), this.channel.emit(Wo);
4852
4921
  }
4853
4922
  renderStoryLoadingException(t, o) {
4854
- rr.error(o), this.view.showErrorDisplay(o), this.channel.emit(Co, t);
4923
+ nr.error(o), this.view.showErrorDisplay(o), this.channel.emit(Wo, t);
4855
4924
  }
4856
4925
  // renderException is used if we fail to render the story and it is uncaught by the app layer
4857
4926
  renderException(t, o) {
4858
4927
  let { name: s = "Error", message: i = String(o), stack: a } = o;
4859
- this.channel.emit(Oi, { name: s, message: i, stack: a }), this.channel.emit(vo, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay(
4860
- o), rr.error(`Error rendering story '${t}':`), rr.error(o);
4928
+ this.channel.emit(Qi, { name: s, message: i, stack: a }), this.channel.emit($o, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay(
4929
+ o), nr.error(`Error rendering story '${t}':`), nr.error(o);
4861
4930
  }
4862
4931
  // renderError is used by the various app layers to inform the user they have done something
4863
4932
  // wrong -- for instance returned the wrong thing from a story
4864
4933
  renderError(t, { title: o, description: s }) {
4865
- rr.error(`Error rendering story ${o}: ${s}`), this.channel.emit(Pi, { title: o, description: s }), this.channel.emit(vo, { newPhase: "er\
4934
+ nr.error(`Error rendering story ${o}: ${s}`), this.channel.emit(Ki, { title: o, description: s }), this.channel.emit($o, { newPhase: "er\
4866
4935
  rored", storyId: t }), this.view.showErrorDisplay({
4867
4936
  message: o,
4868
4937
  stack: s
4869
4938
  });
4870
4939
  }
4871
4940
  };
4941
+ n(it, "PreviewWithSelection");
4942
+ var xe = it;
4872
4943
 
4873
4944
  // src/preview-api/modules/preview-web/UrlStore.ts
4874
- var Ne = ue(ir(), 1);
4875
- import { global as ga } from "@storybook/global";
4945
+ var Be = ue(cr(), 1);
4946
+ import { global as La } from "@storybook/global";
4876
4947
 
4877
4948
  // src/preview-api/modules/preview-web/parseArgsParam.ts
4878
- import { once as ya } from "storybook/internal/client-logger";
4879
- var zo = ue(ir(), 1);
4880
- var Bo = /^[a-zA-Z0-9 _-]*$/, Go = /^-?[0-9]+(\.[0-9]+)?$/, ma = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, Uo = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
4881
- Jr = /* @__PURE__ */ n((r = "", e) => r === null || r === "" || !Bo.test(r) ? !1 : e == null || e instanceof Date || typeof e == "number" ||
4882
- typeof e == "boolean" ? !0 : typeof e == "string" ? Bo.test(e) || Go.test(e) || ma.test(e) || Uo.test(e) : Array.isArray(e) ? e.every((t) => Jr(
4883
- r, t)) : k(e) ? Object.entries(e).every(([t, o]) => Jr(t, o)) : !1, "validateArgs"), ha = {
4949
+ import { once as Ma } from "storybook/internal/client-logger";
4950
+ var ln = ue(cr(), 1);
4951
+ var an = /^[a-zA-Z0-9 _-]*$/, cn = /^-?[0-9]+(\.[0-9]+)?$/, _a = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, dn = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
4952
+ ft = /* @__PURE__ */ n((r = "", e) => r === null || r === "" || !an.test(r) ? !1 : e == null || e instanceof Date || typeof e == "number" ||
4953
+ typeof e == "boolean" ? !0 : typeof e == "string" ? an.test(e) || cn.test(e) || _a.test(e) || dn.test(e) : Array.isArray(e) ? e.every((t) => ft(
4954
+ r, t)) : j(e) ? Object.entries(e).every(([t, o]) => ft(t, o)) : !1, "validateArgs"), Na = {
4884
4955
  delimiter: ";",
4885
4956
  // we're parsing a single query param
4886
4957
  nesting: !0,
@@ -4902,17 +4973,17 @@ r, t)) : k(e) ? Object.entries(e).every(([t, o]) => Jr(t, o)) : !1, "validateArg
4902
4973
  return new Date(r.replaceAll(" ", "+").slice(6, -1));
4903
4974
  if (r.startsWith("!hex(") && r.endsWith(")"))
4904
4975
  return `#${r.slice(5, -1)}`;
4905
- let e = r.slice(1).match(Uo);
4976
+ let e = r.slice(1).match(dn);
4906
4977
  if (e)
4907
4978
  return r.startsWith("!rgba") || r.startsWith("!RGBA") ? `${e[1]}(${e[2]}, ${e[3]}, ${e[4]}, ${e[5]})` : r.startsWith("!hsla") || r.startsWith(
4908
4979
  "!HSLA") ? `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%, ${e[5]})` : r.startsWith("!rgb") || r.startsWith("!RGB") ? `${e[1]}(${e[2]}, ${e[3]}\
4909
4980
  , ${e[4]})` : `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%)`;
4910
4981
  }
4911
- return Go.test(r) ? Number(r) : r;
4982
+ return cn.test(r) ? Number(r) : r;
4912
4983
  }
4913
- }, Qr = /* @__PURE__ */ n((r) => {
4984
+ }, yt = /* @__PURE__ */ n((r) => {
4914
4985
  let e = r.split(";").map((t) => t.replace("=", "~").replace(":", "="));
4915
- return Object.entries((0, zo.parse)(e.join(";"), ha)).reduce((t, [o, s]) => Jr(o, s) ? Object.assign(t, { [o]: s }) : (ya.warn(P`
4986
+ return Object.entries((0, ln.parse)(e.join(";"), Na)).reduce((t, [o, s]) => ft(o, s) ? Object.assign(t, { [o]: s }) : (Ma.warn(P`
4916
4987
  Omitted potentially unsafe URL args.
4917
4988
 
4918
4989
  More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
@@ -4920,89 +4991,88 @@ r, t)) : k(e) ? Object.entries(e).every(([t, o]) => Jr(t, o)) : !1, "validateArg
4920
4991
  }, "parseArgsParam");
4921
4992
 
4922
4993
  // src/preview-api/modules/preview-web/UrlStore.ts
4923
- var { history: Ho, document: Q } = ga;
4924
- function ba(r) {
4994
+ var { history: pn, document: Z } = La;
4995
+ function qa(r) {
4925
4996
  let e = (r || "").match(/^\/story\/(.+)/);
4926
4997
  if (!e)
4927
4998
  throw new Error(`Invalid path '${r}', must start with '/story/'`);
4928
4999
  return e[1];
4929
5000
  }
4930
- n(ba, "pathToId");
4931
- var Vo = /* @__PURE__ */ n(({
5001
+ n(qa, "pathToId");
5002
+ var un = /* @__PURE__ */ n(({
4932
5003
  selection: r,
4933
5004
  extraParams: e
4934
5005
  }) => {
4935
- let t = Q?.location.search.slice(1), { path: o, selectedKind: s, selectedStory: i, ...a } = (0, Ne.parse)(t);
4936
- return `?${(0, Ne.stringify)({
5006
+ let t = Z?.location.search.slice(1), { path: o, selectedKind: s, selectedStory: i, ...a } = (0, Be.parse)(t);
5007
+ return `?${(0, Be.stringify)({
4937
5008
  ...a,
4938
5009
  ...e,
4939
5010
  ...r && { id: r.storyId, viewMode: r.viewMode }
4940
5011
  })}`;
4941
- }, "getQueryString"), Sa = /* @__PURE__ */ n((r) => {
5012
+ }, "getQueryString"), Ba = /* @__PURE__ */ n((r) => {
4942
5013
  if (!r)
4943
5014
  return;
4944
- let e = Vo({ selection: r }), { hash: t = "" } = Q.location;
4945
- Q.title = r.storyId, Ho.replaceState({}, "", `${Q.location.pathname}${e}${t}`);
4946
- }, "setPath"), Ta = /* @__PURE__ */ n((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), Le = /* @__PURE__ */ n(
5015
+ let e = un({ selection: r }), { hash: t = "" } = Z.location;
5016
+ Z.title = r.storyId, pn.replaceState({}, "", `${Z.location.pathname}${e}${t}`);
5017
+ }, "setPath"), za = /* @__PURE__ */ n((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), qe = /* @__PURE__ */ n(
4947
5018
  (r) => {
4948
5019
  if (r !== void 0) {
4949
5020
  if (typeof r == "string")
4950
5021
  return r;
4951
5022
  if (Array.isArray(r))
4952
- return Le(r[0]);
4953
- if (Ta(r))
4954
- return Le(
5023
+ return qe(r[0]);
5024
+ if (za(r))
5025
+ return qe(
4955
5026
  Object.values(r).filter(Boolean)
4956
5027
  );
4957
5028
  }
4958
- }, "getFirstString"), xa = /* @__PURE__ */ n(() => {
4959
- if (typeof Q < "u") {
4960
- let r = Q.location.search.slice(1), e = (0, Ne.parse)(r), t = typeof e.args == "string" ? Qr(e.args) : void 0, o = typeof e.globals == "\
4961
- string" ? Qr(e.globals) : void 0, s = Le(e.viewMode);
5029
+ }, "getFirstString"), Ga = /* @__PURE__ */ n(() => {
5030
+ if (typeof Z < "u") {
5031
+ let r = Z.location.search.slice(1), e = (0, Be.parse)(r), t = typeof e.args == "string" ? yt(e.args) : void 0, o = typeof e.globals == "\
5032
+ string" ? yt(e.globals) : void 0, s = qe(e.viewMode);
4962
5033
  (typeof s != "string" || !s.match(/docs|story/)) && (s = "story");
4963
- let i = Le(e.path), a = i ? ba(i) : Le(e.id);
5034
+ let i = qe(e.path), a = i ? qa(i) : qe(e.id);
4964
5035
  if (a)
4965
5036
  return { storySpecifier: a, args: t, globals: o, viewMode: s };
4966
5037
  }
4967
5038
  return null;
4968
- }, "getSelectionSpecifierFromPath"), Te = class {
4969
- static {
4970
- n(this, "UrlStore");
4971
- }
5039
+ }, "getSelectionSpecifierFromPath"), mt = class mt {
4972
5040
  constructor() {
4973
- this.selectionSpecifier = xa();
5041
+ this.selectionSpecifier = Ga();
4974
5042
  }
4975
5043
  setSelection(e) {
4976
- this.selection = e, Sa(this.selection);
5044
+ this.selection = e, Ba(this.selection);
4977
5045
  }
4978
5046
  setQueryParams(e) {
4979
- let t = Vo({ extraParams: e }), { hash: o = "" } = Q.location;
4980
- Ho.replaceState({}, "", `${Q.location.pathname}${t}${o}`);
5047
+ let t = un({ extraParams: e }), { hash: o = "" } = Z.location;
5048
+ pn.replaceState({}, "", `${Z.location.pathname}${t}${o}`);
4981
5049
  }
4982
5050
  };
5051
+ n(mt, "UrlStore");
5052
+ var Re = mt;
4983
5053
 
4984
5054
  // src/preview-api/modules/preview-web/WebView.ts
4985
- var En = ue(xn(), 1), An = ue(ir(), 1);
4986
- import { logger as tl } from "storybook/internal/client-logger";
4987
- import { global as ol } from "@storybook/global";
4988
- var { document: D } = ol, Rn = 100, Cn = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PREPARING\
4989
- _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Cn || {}), st = {
5055
+ var Hn = ue(zn(), 1), Vn = ue(cr(), 1);
5056
+ import { logger as wl } from "storybook/internal/client-logger";
5057
+ import { global as Al } from "@storybook/global";
5058
+ var { document: O } = Al, Gn = 100, Wn = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PREPARING\
5059
+ _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Wn || {}), Rt = {
4990
5060
  PREPARING_STORY: "sb-show-preparing-story",
4991
5061
  PREPARING_DOCS: "sb-show-preparing-docs",
4992
5062
  MAIN: "sb-show-main",
4993
5063
  NOPREVIEW: "sb-show-nopreview",
4994
5064
  ERROR: "sb-show-errordisplay"
4995
- }, it = {
5065
+ }, wt = {
4996
5066
  centered: "sb-main-centered",
4997
5067
  fullscreen: "sb-main-fullscreen",
4998
5068
  padded: "sb-main-padded"
4999
- }, wn = new En.default({
5069
+ }, Un = new Hn.default({
5000
5070
  escapeXML: !0
5001
- }), xe = class {
5071
+ }), At = class At {
5002
5072
  constructor() {
5003
5073
  this.testing = !1;
5004
- if (typeof D < "u") {
5005
- let { __SPECIAL_TEST_PARAMETER__: e } = (0, An.parse)(D.location.search.slice(1));
5074
+ if (typeof O < "u") {
5075
+ let { __SPECIAL_TEST_PARAMETER__: e } = (0, Vn.parse)(O.location.search.slice(1));
5006
5076
  switch (e) {
5007
5077
  case "preparing-story": {
5008
5078
  this.showPreparingStory(), this.testing = !0;
@@ -5016,51 +5086,48 @@ _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Cn || {}),
5016
5086
  }
5017
5087
  }
5018
5088
  }
5019
- static {
5020
- n(this, "WebView");
5021
- }
5022
5089
  // Get ready to render a story, returning the element to render to
5023
5090
  prepareForStory(e) {
5024
- return this.showStory(), this.applyLayout(e.parameters.layout), D.documentElement.scrollTop = 0, D.documentElement.scrollLeft = 0, this.
5091
+ return this.showStory(), this.applyLayout(e.parameters.layout), O.documentElement.scrollTop = 0, O.documentElement.scrollLeft = 0, this.
5025
5092
  storyRoot();
5026
5093
  }
5027
5094
  storyRoot() {
5028
- return D.getElementById("storybook-root");
5095
+ return O.getElementById("storybook-root");
5029
5096
  }
5030
5097
  prepareForDocs() {
5031
- return this.showMain(), this.showDocs(), this.applyLayout("fullscreen"), D.documentElement.scrollTop = 0, D.documentElement.scrollLeft =
5098
+ return this.showMain(), this.showDocs(), this.applyLayout("fullscreen"), O.documentElement.scrollTop = 0, O.documentElement.scrollLeft =
5032
5099
  0, this.docsRoot();
5033
5100
  }
5034
5101
  docsRoot() {
5035
- return D.getElementById("storybook-docs");
5102
+ return O.getElementById("storybook-docs");
5036
5103
  }
5037
5104
  applyLayout(e = "padded") {
5038
5105
  if (e === "none") {
5039
- D.body.classList.remove(this.currentLayoutClass), this.currentLayoutClass = null;
5106
+ O.body.classList.remove(this.currentLayoutClass), this.currentLayoutClass = null;
5040
5107
  return;
5041
5108
  }
5042
5109
  this.checkIfLayoutExists(e);
5043
- let t = it[e];
5044
- D.body.classList.remove(this.currentLayoutClass), D.body.classList.add(t), this.currentLayoutClass = t;
5110
+ let t = wt[e];
5111
+ O.body.classList.remove(this.currentLayoutClass), O.body.classList.add(t), this.currentLayoutClass = t;
5045
5112
  }
5046
5113
  checkIfLayoutExists(e) {
5047
- it[e] || tl.warn(
5114
+ wt[e] || wl.warn(
5048
5115
  P`
5049
5116
  The desired layout: ${e} is not a valid option.
5050
- The possible options are: ${Object.keys(it).join(", ")}, none.
5117
+ The possible options are: ${Object.keys(wt).join(", ")}, none.
5051
5118
  `
5052
5119
  );
5053
5120
  }
5054
5121
  showMode(e) {
5055
- clearTimeout(this.preparingTimeout), Object.keys(Cn).forEach((t) => {
5056
- t === e ? D.body.classList.add(st[t]) : D.body.classList.remove(st[t]);
5122
+ clearTimeout(this.preparingTimeout), Object.keys(Wn).forEach((t) => {
5123
+ t === e ? O.body.classList.add(Rt[t]) : O.body.classList.remove(Rt[t]);
5057
5124
  });
5058
5125
  }
5059
5126
  showErrorDisplay({ message: e = "", stack: t = "" }) {
5060
5127
  let o = e, s = t, i = e.split(`
5061
5128
  `);
5062
5129
  i.length > 1 && ([o] = i, s = i.slice(1).join(`
5063
- `).replace(/^\n/, "")), D.getElementById("error-message").innerHTML = wn.toHtml(o), D.getElementById("error-stack").innerHTML = wn.toHtml(s),
5130
+ `).replace(/^\n/, "")), O.getElementById("error-message").innerHTML = Un.toHtml(o), O.getElementById("error-stack").innerHTML = Un.toHtml(s),
5064
5131
  this.showMode("ERROR");
5065
5132
  }
5066
5133
  showNoPreview() {
@@ -5070,12 +5137,12 @@ true"));
5070
5137
  showPreparingStory({ immediate: e = !1 } = {}) {
5071
5138
  clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_STORY") : this.preparingTimeout = setTimeout(
5072
5139
  () => this.showMode("PREPARING_STORY"),
5073
- Rn
5140
+ Gn
5074
5141
  );
5075
5142
  }
5076
5143
  showPreparingDocs({ immediate: e = !1 } = {}) {
5077
5144
  clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_DOCS") : this.preparingTimeout = setTimeout(() => this.showMode("PREPA\
5078
- RING_DOCS"), Rn);
5145
+ RING_DOCS"), Gn);
5079
5146
  }
5080
5147
  showMain() {
5081
5148
  this.showMode("MAIN");
@@ -5087,26 +5154,27 @@ RING_DOCS"), Rn);
5087
5154
  this.docsRoot().setAttribute("hidden", "true"), this.storyRoot().removeAttribute("hidden");
5088
5155
  }
5089
5156
  showStoryDuringRender() {
5090
- D.body.classList.add(st.MAIN);
5157
+ O.body.classList.add(Rt.MAIN);
5091
5158
  }
5092
5159
  };
5160
+ n(At, "WebView");
5161
+ var we = At;
5093
5162
 
5094
5163
  // src/preview-api/modules/preview-web/PreviewWeb.tsx
5095
- var yr = class extends Se {
5164
+ var Et = class Et extends xe {
5096
5165
  constructor(t, o) {
5097
- super(t, o, new Te(), new xe());
5166
+ super(t, o, new Re(), new we());
5098
5167
  this.importFn = t;
5099
5168
  this.getProjectAnnotations = o;
5100
- nl.__STORYBOOK_PREVIEW__ = this;
5101
- }
5102
- static {
5103
- n(this, "PreviewWeb");
5169
+ El.__STORYBOOK_PREVIEW__ = this;
5104
5170
  }
5105
5171
  };
5172
+ n(Et, "PreviewWeb");
5173
+ var gr = Et;
5106
5174
 
5107
5175
  // src/preview-api/modules/preview-web/simulate-pageload.ts
5108
- import { global as sl } from "@storybook/global";
5109
- var { document: de } = sl, il = [
5176
+ import { global as Cl } from "@storybook/global";
5177
+ var { document: de } = Cl, vl = [
5110
5178
  "application/javascript",
5111
5179
  "application/ecmascript",
5112
5180
  "application/x-ecmascript",
@@ -5125,103 +5193,105 @@ var { document: de } = sl, il = [
5125
5193
  "text/x-javascript",
5126
5194
  // Support modern javascript
5127
5195
  "module"
5128
- ], al = "script", vn = "scripts-root";
5129
- function mr() {
5196
+ ], Pl = "script", $n = "scripts-root";
5197
+ function br() {
5130
5198
  let r = de.createEvent("Event");
5131
5199
  r.initEvent("DOMContentLoaded", !0, !0), de.dispatchEvent(r);
5132
5200
  }
5133
- n(mr, "simulateDOMContentLoaded");
5134
- function ll(r, e, t) {
5201
+ n(br, "simulateDOMContentLoaded");
5202
+ function Fl(r, e, t) {
5135
5203
  let o = de.createElement("script");
5136
5204
  o.type = r.type === "module" ? "module" : "text/javascript", r.src ? (o.onload = e, o.onerror = e, o.src = r.src) : o.textContent = r.innerText,
5137
5205
  t ? t.appendChild(o) : de.head.appendChild(o), r.parentNode.removeChild(r), r.src || e();
5138
5206
  }
5139
- n(ll, "insertScript");
5140
- function Pn(r, e, t = 0) {
5207
+ n(Fl, "insertScript");
5208
+ function Yn(r, e, t = 0) {
5141
5209
  r[t](() => {
5142
- t++, t === r.length ? e() : Pn(r, e, t);
5210
+ t++, t === r.length ? e() : Yn(r, e, t);
5143
5211
  });
5144
5212
  }
5145
- n(Pn, "insertScriptsSequentially");
5146
- function Fn(r) {
5147
- let e = de.getElementById(vn);
5148
- e ? e.innerHTML = "" : (e = de.createElement("div"), e.id = vn, de.body.appendChild(e));
5149
- let t = Array.from(r.querySelectorAll(al));
5213
+ n(Yn, "insertScriptsSequentially");
5214
+ function Kn(r) {
5215
+ let e = de.getElementById($n);
5216
+ e ? e.innerHTML = "" : (e = de.createElement("div"), e.id = $n, de.body.appendChild(e));
5217
+ let t = Array.from(r.querySelectorAll(Pl));
5150
5218
  if (t.length) {
5151
5219
  let o = [];
5152
5220
  t.forEach((s) => {
5153
5221
  let i = s.getAttribute("type");
5154
- (!i || il.includes(i)) && o.push((a) => ll(s, a, e));
5155
- }), o.length && Pn(o, mr, void 0);
5222
+ (!i || vl.includes(i)) && o.push((a) => Fl(s, a, e));
5223
+ }), o.length && Yn(o, br, void 0);
5156
5224
  } else
5157
- mr();
5225
+ br();
5158
5226
  }
5159
- n(Fn, "simulatePageLoad");
5227
+ n(Kn, "simulatePageLoad");
5160
5228
 
5161
5229
  // src/docs-tools/shared.ts
5162
- var In = "storybook/docs", Gf = `${In}/panel`;
5163
- var On = `${In}/snippet-rendered`;
5230
+ var Xn = "storybook/docs", uy = `${Xn}/panel`;
5231
+ var Jn = `${Xn}/snippet-rendered`;
5164
5232
 
5165
5233
  // src/preview-api/modules/preview-web/emitTransformCode.ts
5166
- async function Dn(r, e) {
5234
+ async function Qn(r, e) {
5167
5235
  let t = e.parameters?.docs?.source?.transform, { id: o, unmappedArgs: s } = e, i = t && r ? t?.(r, e) : r, a = i ? await i : void 0;
5168
- _.getChannel().emit(On, {
5236
+ _.getChannel().emit(Jn, {
5169
5237
  id: o,
5170
5238
  source: a,
5171
5239
  args: s
5172
5240
  });
5173
5241
  }
5174
- n(Dn, "emitTransformCode");
5242
+ n(Qn, "emitTransformCode");
5175
5243
  export {
5176
- J as DocsContext,
5177
- re as HooksContext,
5178
- be as Preview,
5179
- yr as PreviewWeb,
5180
- Se as PreviewWithSelection,
5244
+ Q as DocsContext,
5245
+ te as HooksContext,
5246
+ Te as Preview,
5247
+ gr as PreviewWeb,
5248
+ xe as PreviewWithSelection,
5181
5249
  se as ReporterAPI,
5182
- ge as StoryStore,
5183
- Te as UrlStore,
5184
- xe as WebView,
5250
+ Se as StoryStore,
5251
+ Re as UrlStore,
5252
+ we as WebView,
5185
5253
  _ as addons,
5186
- Rr as applyHooks,
5187
- Fe as combineArgs,
5188
- L as combineParameters,
5189
- Y as composeConfigs,
5190
- qr as composeStepRunners,
5191
- Bs as composeStories,
5192
- po as composeStory,
5193
- zs as createPlaywrightTest,
5194
- so as decorateStory,
5195
- Mr as defaultDecorateStory,
5196
- zn as definePreview,
5197
- Dn as emitTransformCode,
5198
- Je as filterArgTypes,
5199
- te as getCoreAnnotations,
5200
- Br as getCsfFactoryAnnotations,
5201
- De as inferControls,
5202
- ns as makeDecorator,
5203
- gr as mockChannel,
5254
+ Cr as applyHooks,
5255
+ Oe as combineArgs,
5256
+ N as combineParameters,
5257
+ K as composeConfigs,
5258
+ $r as composeStepRunners,
5259
+ ai as composeStories,
5260
+ Oo as composeStory,
5261
+ li as createPlaywrightTest,
5262
+ Eo as decorateStory,
5263
+ Ur as defaultDecorateStory,
5264
+ as as definePreview,
5265
+ Qn as emitTransformCode,
5266
+ Ze as filterArgTypes,
5267
+ Ie as getCoreAnnotations,
5268
+ Kr as getCsfFactoryAnnotations,
5269
+ je as inferControls,
5270
+ As as makeDecorator,
5271
+ Tr as mockChannel,
5204
5272
  he as normalizeProjectAnnotations,
5205
5273
  me as normalizeStory,
5206
- _r as prepareMeta,
5207
- Oe as prepareStory,
5208
- io as sanitizeStoryContextUpdate,
5209
- js as setDefaultProjectAnnotations,
5210
- Ns as setProjectAnnotations,
5211
- mr as simulateDOMContentLoaded,
5212
- Fn as simulatePageLoad,
5213
- Xs as sortStoriesV7,
5214
- ts as useArgs,
5215
- Ce as useCallback,
5216
- es as useChannel,
5217
- ft as useEffect,
5218
- os as useGlobals,
5219
- Kn as useMemo,
5220
- rs as useParameter,
5221
- Zn as useReducer,
5222
- Xn as useRef,
5223
- Qn as useState,
5224
- Ue as useStoryContext,
5225
- Ys as userOrAutoTitle,
5226
- yo as userOrAutoTitleFromSpecifier
5274
+ ge as pauseAnimations,
5275
+ Hr as prepareMeta,
5276
+ ke as prepareStory,
5277
+ Co as sanitizeStoryContextUpdate,
5278
+ ri as setDefaultProjectAnnotations,
5279
+ si as setProjectAnnotations,
5280
+ br as simulateDOMContentLoaded,
5281
+ Kn as simulatePageLoad,
5282
+ gi as sortStoriesV7,
5283
+ Rs as useArgs,
5284
+ ve as useCallback,
5285
+ Ts as useChannel,
5286
+ Dt as useEffect,
5287
+ ws as useGlobals,
5288
+ ms as useMemo,
5289
+ xs as useParameter,
5290
+ Ss as useReducer,
5291
+ hs as useRef,
5292
+ bs as useState,
5293
+ Ve as useStoryContext,
5294
+ mi as userOrAutoTitle,
5295
+ jo as userOrAutoTitleFromSpecifier,
5296
+ be as waitForAnimations
5227
5297
  };