storybook 9.0.0-alpha.2 → 9.0.0-alpha.20

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 (159) hide show
  1. package/README.md +1 -1
  2. package/assets/docs/addon-backgrounds.gif +0 -0
  3. package/assets/docs/addon-controls-args-annotated.png +0 -0
  4. package/assets/docs/addon-controls-args-background-color.png +0 -0
  5. package/assets/docs/addon-controls-args-background-string.png +0 -0
  6. package/assets/docs/addon-controls-args-docs.png +0 -0
  7. package/assets/docs/addon-controls-args-logging.png +0 -0
  8. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  9. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  10. package/assets/docs/addon-controls-args-reflow.png +0 -0
  11. package/assets/docs/addon-controls-args-template.png +0 -0
  12. package/assets/docs/addon-controls-expanded.png +0 -0
  13. package/assets/docs/addon-controls-hero.gif +0 -0
  14. package/assets/docs/addon-controls-install.png +0 -0
  15. package/assets/docs/hero.gif +0 -0
  16. package/assets/docs/highlight.png +0 -0
  17. package/assets/docs/viewport.png +0 -0
  18. package/bin/index.cjs +2 -2
  19. package/dist/actions/decorator.d.ts +6 -0
  20. package/dist/actions/decorator.js +138 -0
  21. package/dist/actions/index.cjs +126 -0
  22. package/dist/actions/index.d.ts +102 -0
  23. package/dist/actions/index.js +111 -0
  24. package/dist/actions/preview.cjs +164 -0
  25. package/dist/actions/preview.d.ts +54 -0
  26. package/dist/actions/preview.js +155 -0
  27. package/dist/backgrounds/index.cjs +148 -0
  28. package/dist/backgrounds/index.d.ts +91 -0
  29. package/dist/backgrounds/index.js +130 -0
  30. package/dist/backgrounds/preview.cjs +143 -0
  31. package/dist/backgrounds/preview.d.ts +54 -0
  32. package/dist/backgrounds/preview.js +127 -0
  33. package/dist/bin/index.cjs +66 -89
  34. package/dist/bin/index.js +62 -85
  35. package/dist/builder-manager/index.cjs +523 -540
  36. package/dist/builder-manager/index.js +544 -561
  37. package/dist/channels/index.cjs +1026 -981
  38. package/dist/channels/index.js +1194 -1165
  39. package/dist/cli/bin/index.cjs +483 -483
  40. package/dist/cli/bin/index.js +495 -495
  41. package/dist/cli/index.cjs +2279 -2295
  42. package/dist/cli/index.d.ts +4 -8
  43. package/dist/cli/index.js +740 -756
  44. package/dist/client-logger/index.cjs +56 -88
  45. package/dist/client-logger/index.js +41 -47
  46. package/dist/common/index.cjs +2496 -2480
  47. package/dist/common/index.d.ts +5 -29
  48. package/dist/common/index.js +2679 -2663
  49. package/dist/component-testing/index.cjs +23 -0
  50. package/dist/component-testing/index.d.ts +3 -0
  51. package/dist/component-testing/index.js +5 -0
  52. package/dist/component-testing/preview.cjs +40 -0
  53. package/dist/component-testing/preview.d.ts +5 -0
  54. package/dist/component-testing/preview.js +25 -0
  55. package/dist/components/index.cjs +11709 -20418
  56. package/dist/components/index.d.ts +94 -346
  57. package/dist/components/index.js +5827 -19157
  58. package/dist/controls/decorator.d.ts +5 -0
  59. package/dist/controls/decorator.js +8 -0
  60. package/dist/controls/index.cjs +26 -0
  61. package/dist/controls/index.d.ts +39 -0
  62. package/dist/controls/index.js +6 -0
  63. package/dist/controls/preview.cjs +26 -0
  64. package/dist/controls/preview.d.ts +54 -0
  65. package/dist/controls/preview.js +9 -0
  66. package/dist/core-events/index.cjs +91 -106
  67. package/dist/core-events/index.d.ts +139 -104
  68. package/dist/core-events/index.js +79 -94
  69. package/dist/core-server/index.cjs +14413 -13924
  70. package/dist/core-server/index.d.ts +270 -3
  71. package/dist/core-server/index.js +14003 -13519
  72. package/dist/core-server/presets/common-manager.css +170 -0
  73. package/dist/core-server/presets/common-manager.js +12099 -17
  74. package/dist/core-server/presets/common-preset.cjs +2760 -2914
  75. package/dist/core-server/presets/common-preset.js +2852 -3007
  76. package/dist/csf/index.cjs +76 -120
  77. package/dist/csf/index.d.ts +2 -6
  78. package/dist/csf/index.js +69 -113
  79. package/dist/csf-tools/index.cjs +412 -403
  80. package/dist/csf-tools/index.d.ts +0 -4
  81. package/dist/csf-tools/index.js +410 -401
  82. package/dist/docs-tools/index.cjs +2569 -575
  83. package/dist/docs-tools/index.d.ts +2 -2
  84. package/dist/docs-tools/index.js +2557 -564
  85. package/dist/highlight/index.cjs +27 -0
  86. package/dist/highlight/index.d.ts +17 -0
  87. package/dist/highlight/index.js +7 -0
  88. package/dist/highlight/preview.cjs +81 -0
  89. package/dist/highlight/preview.d.ts +54 -0
  90. package/dist/highlight/preview.js +67 -0
  91. package/dist/instrumenter/index.cjs +2207 -2342
  92. package/dist/instrumenter/index.d.ts +8 -7
  93. package/dist/instrumenter/index.js +2438 -2620
  94. package/dist/manager/globals-module-info.cjs +290 -151
  95. package/dist/manager/globals-module-info.d.ts +1 -1
  96. package/dist/manager/globals-module-info.js +274 -135
  97. package/dist/manager/globals-runtime.js +60016 -28331
  98. package/dist/manager/globals.cjs +23 -19
  99. package/dist/manager/globals.d.ts +8 -5
  100. package/dist/manager/globals.js +10 -6
  101. package/dist/manager/runtime.js +4645 -3946
  102. package/dist/manager-api/index.cjs +4228 -3833
  103. package/dist/manager-api/index.d.ts +398 -102
  104. package/dist/manager-api/index.js +3676 -3291
  105. package/dist/manager-errors.d.ts +25 -1
  106. package/dist/manager-errors.js +42 -26
  107. package/dist/measure/index.cjs +474 -0
  108. package/dist/measure/index.d.ts +66 -0
  109. package/dist/measure/index.js +462 -0
  110. package/dist/measure/preview.cjs +464 -0
  111. package/dist/measure/preview.d.ts +59 -0
  112. package/dist/measure/preview.js +448 -0
  113. package/dist/outline/index.cjs +528 -0
  114. package/dist/outline/index.d.ts +66 -0
  115. package/dist/outline/index.js +500 -0
  116. package/dist/outline/preview.cjs +518 -0
  117. package/dist/outline/preview.d.ts +59 -0
  118. package/dist/outline/preview.js +486 -0
  119. package/dist/preview/globals.cjs +21 -17
  120. package/dist/preview/globals.d.ts +4 -1
  121. package/dist/preview/globals.js +6 -2
  122. package/dist/preview/runtime.js +45697 -6618
  123. package/dist/preview-api/index.cjs +1363 -1898
  124. package/dist/preview-api/index.d.ts +449 -498
  125. package/dist/preview-api/index.js +1622 -2095
  126. package/dist/preview-errors.cjs +99 -82
  127. package/dist/preview-errors.d.ts +25 -1
  128. package/dist/preview-errors.js +110 -94
  129. package/dist/router/index.cjs +847 -871
  130. package/dist/router/index.js +193 -199
  131. package/dist/server-errors.cjs +156 -125
  132. package/dist/server-errors.d.ts +28 -2
  133. package/dist/server-errors.js +150 -119
  134. package/dist/telemetry/index.cjs +1050 -1977
  135. package/dist/telemetry/index.d.ts +26 -5
  136. package/dist/telemetry/index.js +1085 -2008
  137. package/dist/test/index.cjs +35686 -0
  138. package/dist/test/index.d.ts +186 -0
  139. package/dist/test/index.js +33752 -0
  140. package/dist/test/preview.cjs +15870 -0
  141. package/dist/test/preview.d.ts +54 -0
  142. package/dist/test/preview.js +14441 -0
  143. package/dist/test/spy.cjs +258 -0
  144. package/dist/test/spy.d.ts +66 -0
  145. package/dist/test/spy.js +240 -0
  146. package/dist/theming/create.cjs +79 -2269
  147. package/dist/theming/create.js +67 -841
  148. package/dist/theming/index.cjs +1065 -3232
  149. package/dist/theming/index.js +951 -1719
  150. package/dist/types/index.cjs +11 -12
  151. package/dist/types/index.d.ts +612 -157
  152. package/dist/types/index.js +1 -2
  153. package/dist/viewport/index.cjs +310 -0
  154. package/dist/viewport/index.d.ts +320 -0
  155. package/dist/viewport/index.js +290 -0
  156. package/dist/viewport/preview.cjs +35 -0
  157. package/dist/viewport/preview.d.ts +68 -0
  158. package/dist/viewport/preview.js +19 -0
  159. package/package.json +359 -12
@@ -1,247 +1,85 @@
1
- var ae = Object.create;
2
- var ut = Object.defineProperty;
3
- var se = Object.getOwnPropertyDescriptor;
4
- var le = Object.getOwnPropertyNames;
5
- var ce = Object.getPrototypeOf, pe = Object.prototype.hasOwnProperty;
6
- var a = (r, t) => ut(r, "name", { value: t, configurable: !0 }), H = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
7
- "u" ? new Proxy(r, {
8
- get: (t, e) => (typeof require < "u" ? require : t)[e]
9
- }) : r)(function(r) {
10
- if (typeof require < "u") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + r + '" is not supported');
12
- });
13
- var ue = (r, t) => () => (t || r((t = { exports: {} }).exports, t), t.exports);
14
- var fe = (r, t, e, n) => {
15
- if (t && typeof t == "object" || typeof t == "function")
16
- for (let o of le(t))
17
- !pe.call(r, o) && o !== e && ut(r, o, { get: () => t[o], enumerable: !(n = se(t, o)) || n.enumerable });
18
- return r;
19
- };
20
- var he = (r, t, e) => (e = r != null ? ae(ce(r)) : {}, fe(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- t || !r || !r.__esModule ? ut(e, "default", { value: r, enumerable: !0 }) : e,
26
- r
27
- ));
28
-
29
- // ../node_modules/memoizerific/memoizerific.js
30
- var xt = ue((It, yt) => {
31
- (function(r) {
32
- if (typeof It == "object" && typeof yt < "u")
33
- yt.exports = r();
34
- else if (typeof define == "function" && define.amd)
35
- define([], r);
36
- else {
37
- var t;
38
- typeof window < "u" ? t = window : typeof global < "u" ? t = global : typeof self < "u" ? t = self : t = this, t.memoizerific = r();
39
- }
40
- })(function() {
41
- var r, t, e;
42
- return (/* @__PURE__ */ a(function n(o, s, l) {
43
- function c(p, u) {
44
- if (!s[p]) {
45
- if (!o[p]) {
46
- var y = typeof H == "function" && H;
47
- if (!u && y) return y(p, !0);
48
- if (i) return i(p, !0);
49
- var v = new Error("Cannot find module '" + p + "'");
50
- throw v.code = "MODULE_NOT_FOUND", v;
51
- }
52
- var d = s[p] = { exports: {} };
53
- o[p][0].call(d.exports, function(m) {
54
- var E = o[p][1][m];
55
- return c(E || m);
56
- }, d, d.exports, n, o, s, l);
57
- }
58
- return s[p].exports;
59
- }
60
- a(c, "s");
61
- for (var i = typeof H == "function" && H, g = 0; g < l.length; g++) c(l[g]);
62
- return c;
63
- }, "e"))({ 1: [function(n, o, s) {
64
- o.exports = function(l) {
65
- if (typeof Map != "function" || l) {
66
- var c = n("./similar");
67
- return new c();
68
- } else
69
- return /* @__PURE__ */ new Map();
70
- };
71
- }, { "./similar": 2 }], 2: [function(n, o, s) {
72
- function l() {
73
- return this.list = [], this.lastItem = void 0, this.size = 0, this;
74
- }
75
- a(l, "Similar"), l.prototype.get = function(c) {
76
- var i;
77
- if (this.lastItem && this.isEqual(this.lastItem.key, c))
78
- return this.lastItem.val;
79
- if (i = this.indexOf(c), i >= 0)
80
- return this.lastItem = this.list[i], this.list[i].val;
81
- }, l.prototype.set = function(c, i) {
82
- var g;
83
- return this.lastItem && this.isEqual(this.lastItem.key, c) ? (this.lastItem.val = i, this) : (g = this.indexOf(c), g >= 0 ? (this.lastItem =
84
- this.list[g], this.list[g].val = i, this) : (this.lastItem = { key: c, val: i }, this.list.push(this.lastItem), this.size++, this));
85
- }, l.prototype.delete = function(c) {
86
- var i;
87
- if (this.lastItem && this.isEqual(this.lastItem.key, c) && (this.lastItem = void 0), i = this.indexOf(c), i >= 0)
88
- return this.size--, this.list.splice(i, 1)[0];
89
- }, l.prototype.has = function(c) {
90
- var i;
91
- return this.lastItem && this.isEqual(this.lastItem.key, c) ? !0 : (i = this.indexOf(c), i >= 0 ? (this.lastItem = this.list[i], !0) :
92
- !1);
93
- }, l.prototype.forEach = function(c, i) {
94
- var g;
95
- for (g = 0; g < this.size; g++)
96
- c.call(i || this, this.list[g].val, this.list[g].key, this);
97
- }, l.prototype.indexOf = function(c) {
98
- var i;
99
- for (i = 0; i < this.size; i++)
100
- if (this.isEqual(this.list[i].key, c))
101
- return i;
102
- return -1;
103
- }, l.prototype.isEqual = function(c, i) {
104
- return c === i || c !== c && i !== i;
105
- }, o.exports = l;
106
- }, {}], 3: [function(n, o, s) {
107
- var l = n("map-or-similar");
108
- o.exports = function(p) {
109
- var u = new l(!1), y = [];
110
- return function(v) {
111
- var d = /* @__PURE__ */ a(function() {
112
- var m = u, E, I, T = arguments.length - 1, R = Array(T + 1), C = !0, N;
113
- if ((d.numArgs || d.numArgs === 0) && d.numArgs !== T + 1)
114
- throw new Error("Memoizerific functions should always be called with the same number of arguments");
115
- for (N = 0; N < T; N++) {
116
- if (R[N] = {
117
- cacheItem: m,
118
- arg: arguments[N]
119
- }, m.has(arguments[N])) {
120
- m = m.get(arguments[N]);
121
- continue;
122
- }
123
- C = !1, E = new l(!1), m.set(arguments[N], E), m = E;
124
- }
125
- return C && (m.has(arguments[T]) ? I = m.get(arguments[T]) : C = !1), C || (I = v.apply(null, arguments), m.set(arguments[T], I)),
126
- p > 0 && (R[T] = {
127
- cacheItem: m,
128
- arg: arguments[T]
129
- }, C ? c(y, R) : y.push(R), y.length > p && i(y.shift())), d.wasMemoized = C, d.numArgs = T + 1, I;
130
- }, "memoizerific");
131
- return d.limit = p, d.wasMemoized = !1, d.cache = u, d.lru = y, d;
132
- };
133
- };
134
- function c(p, u) {
135
- var y = p.length, v = u.length, d, m, E;
136
- for (m = 0; m < y; m++) {
137
- for (d = !0, E = 0; E < v; E++)
138
- if (!g(p[m][E].arg, u[E].arg)) {
139
- d = !1;
140
- break;
141
- }
142
- if (d)
143
- break;
144
- }
145
- p.push(p.splice(m, 1)[0]);
146
- }
147
- a(c, "moveToMostRecentLru");
148
- function i(p) {
149
- var u = p.length, y = p[u - 1], v, d;
150
- for (y.cacheItem.delete(y.arg), d = u - 2; d >= 0 && (y = p[d], v = y.cacheItem.get(y.arg), !v || !v.size); d--)
151
- y.cacheItem.delete(y.arg);
152
- }
153
- a(i, "removeCachedResult");
154
- function g(p, u) {
155
- return p === u || p !== p && u !== u;
156
- }
157
- a(g, "isEqual");
158
- }, { "map-or-similar": 1 }] }, {}, [3])(3);
159
- });
160
- });
1
+ var Ct = Object.defineProperty;
2
+ var s = (r, e) => Ct(r, "name", { value: e, configurable: !0 });
161
3
 
162
- // ../node_modules/@storybook/global/dist/index.mjs
163
- var S = (() => {
164
- let r;
165
- return typeof window < "u" ? r = window : typeof globalThis < "u" ? r = globalThis : typeof global < "u" ? r = global : typeof self < "u" ?
166
- r = self : r = {}, r;
167
- })();
4
+ // src/channels/index.ts
5
+ import { global as Wo } from "@storybook/global";
168
6
 
169
7
  // ../node_modules/ts-dedent/esm/index.js
170
- function F(r) {
171
- for (var t = [], e = 1; e < arguments.length; e++)
172
- t[e - 1] = arguments[e];
8
+ function L(r) {
9
+ for (var e = [], t = 1; t < arguments.length; t++)
10
+ e[t - 1] = arguments[t];
173
11
  var n = Array.from(typeof r == "string" ? [r] : r);
174
12
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
175
13
  var o = n.reduce(function(c, i) {
176
- var g = i.match(/\n([\t ]+|(?!\s).)/g);
177
- return g ? c.concat(g.map(function(p) {
178
- var u, y;
179
- return (y = (u = p.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && y !== void 0 ? y : 0;
14
+ var u = i.match(/\n([\t ]+|(?!\s).)/g);
15
+ return u ? c.concat(u.map(function(y) {
16
+ var f, h;
17
+ return (h = (f = y.match(/[\t ]/g)) === null || f === void 0 ? void 0 : f.length) !== null && h !== void 0 ? h : 0;
180
18
  })) : c;
181
19
  }, []);
182
20
  if (o.length) {
183
- var s = new RegExp(`
21
+ var p = new RegExp(`
184
22
  [ ]{` + Math.min.apply(Math, o) + "}", "g");
185
23
  n = n.map(function(c) {
186
- return c.replace(s, `
24
+ return c.replace(p, `
187
25
  `);
188
26
  });
189
27
  }
190
28
  n[0] = n[0].replace(/^\r?\n/, "");
191
- var l = n[0];
192
- return t.forEach(function(c, i) {
193
- var g = l.match(/(?:^|\n)( *)$/), p = g ? g[1] : "", u = c;
29
+ var a = n[0];
30
+ return e.forEach(function(c, i) {
31
+ var u = a.match(/(?:^|\n)( *)$/), y = u ? u[1] : "", f = c;
194
32
  typeof c == "string" && c.includes(`
195
- `) && (u = String(c).split(`
196
- `).map(function(y, v) {
197
- return v === 0 ? y : "" + p + y;
33
+ `) && (f = String(c).split(`
34
+ `).map(function(h, m) {
35
+ return m === 0 ? h : "" + y + h;
198
36
  }).join(`
199
- `)), l += u + n[i + 1];
200
- }), l;
37
+ `)), a += f + n[i + 1];
38
+ }), a;
201
39
  }
202
- a(F, "dedent");
40
+ s(L, "dedent");
203
41
 
204
42
  // src/shared/universal-store/instances.ts
205
- var ft = /* @__PURE__ */ new Map();
43
+ var ge = /* @__PURE__ */ new Map();
206
44
 
207
45
  // src/shared/universal-store/index.ts
208
- var ye = "UNIVERSAL_STORE:", x = {
46
+ var Nt = "UNIVERSAL_STORE:", w = {
209
47
  PENDING: "PENDING",
210
48
  RESOLVED: "RESOLVED",
211
49
  REJECTED: "REJECTED"
212
- }, h = class h {
213
- constructor(t, e) {
50
+ }, l = class l {
51
+ constructor(e, t) {
214
52
  /** Enable debug logs for this store */
215
53
  this.debugging = !1;
216
54
  // TODO: narrow type of listeners based on event type
217
55
  this.listeners = /* @__PURE__ */ new Map([["*", /* @__PURE__ */ new Set()]]);
218
56
  /** Gets the current state */
219
- this.getState = /* @__PURE__ */ a(() => (this.debug("getState", { state: this.state }), this.state), "getState");
57
+ this.getState = /* @__PURE__ */ s(() => (this.debug("getState", { state: this.state }), this.state), "getState");
220
58
  /**
221
59
  * Subscribes to store events
222
60
  *
223
61
  * @returns A function to unsubscribe
224
62
  */
225
- this.subscribe = /* @__PURE__ */ a((t, e) => {
226
- let n = typeof t == "function", o = n ? "*" : t, s = n ? t : e;
227
- if (this.debug("subscribe", { eventType: o, listener: s }), !s)
63
+ this.subscribe = /* @__PURE__ */ s((e, t) => {
64
+ let n = typeof e == "function", o = n ? "*" : e, p = n ? e : t;
65
+ if (this.debug("subscribe", { eventType: o, listener: p }), !p)
228
66
  throw new TypeError(
229
67
  `Missing first subscribe argument, or second if first is the event type, when subscribing to a UniversalStore with id '${this.id}'`
230
68
  );
231
- return this.listeners.has(o) || this.listeners.set(o, /* @__PURE__ */ new Set()), this.listeners.get(o).add(s), () => {
232
- this.debug("unsubscribe", { eventType: o, listener: s }), this.listeners.has(o) && (this.listeners.get(o).delete(s), this.listeners.
69
+ return this.listeners.has(o) || this.listeners.set(o, /* @__PURE__ */ new Set()), this.listeners.get(o).add(p), () => {
70
+ this.debug("unsubscribe", { eventType: o, listener: p }), this.listeners.has(o) && (this.listeners.get(o).delete(p), this.listeners.
233
71
  get(o)?.size === 0 && this.listeners.delete(o));
234
72
  };
235
73
  }, "subscribe");
236
74
  /** Sends a custom event to the other stores */
237
- this.send = /* @__PURE__ */ a((t) => {
238
- if (this.debug("send", { event: t }), this.status !== h.Status.READY)
75
+ this.send = /* @__PURE__ */ s((e) => {
76
+ if (this.debug("send", { event: e }), this.status !== l.Status.READY)
239
77
  throw new TypeError(
240
- F`Cannot send event before store is ready. You can get the current status with store.status,
78
+ L`Cannot send event before store is ready. You can get the current status with store.status,
241
79
  or await store.readyPromise to wait for the store to be ready before sending events.
242
80
  ${JSON.stringify(
243
81
  {
244
- event: t,
82
+ event: e,
245
83
  id: this.id,
246
84
  actor: this.actor,
247
85
  environment: this.environment
@@ -250,36 +88,34 @@ var ye = "UNIVERSAL_STORE:", x = {
250
88
  2
251
89
  )}`
252
90
  );
253
- this.emitToListeners(t, { actor: this.actor }), this.emitToChannel(t, { actor: this.actor });
91
+ this.emitToListeners(e, { actor: this.actor }), this.emitToChannel(e, { actor: this.actor });
254
92
  }, "send");
255
- if (this.debugging = t.debug ?? !1, !h.isInternalConstructing)
93
+ if (this.debugging = e.debug ?? !1, !l.isInternalConstructing)
256
94
  throw new TypeError(
257
95
  "UniversalStore is not constructable - use UniversalStore.create() instead"
258
96
  );
259
- if (h.isInternalConstructing = !1, this.id = t.id, this.actorId = globalThis.crypto ? globalThis.crypto.randomUUID() : (
260
- // TODO: remove this fallback in SB 9.0 when we no longer support Node 18
261
- Date.now().toString(36) + Math.random().toString(36).substring(2)
262
- ), this.actorType = t.leader ? h.ActorType.LEADER : h.ActorType.FOLLOWER, this.state = t.initialState, this.channelEventName = `${ye}${this.
263
- id}`, this.debug("constructor", {
264
- options: t,
265
- environmentOverrides: e,
97
+ if (l.isInternalConstructing = !1, this.id = e.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.
98
+ actorType = e.leader ? l.ActorType.LEADER : l.ActorType.FOLLOWER, this.state = e.initialState, this.channelEventName = `${Nt}${this.id}`,
99
+ this.debug("constructor", {
100
+ options: e,
101
+ environmentOverrides: t,
266
102
  channelEventName: this.channelEventName
267
- }), this.actor.type === h.ActorType.LEADER)
103
+ }), this.actor.type === l.ActorType.LEADER)
268
104
  this.syncing = {
269
- state: x.RESOLVED,
105
+ state: w.RESOLVED,
270
106
  promise: Promise.resolve()
271
107
  };
272
108
  else {
273
- let n, o, s = new Promise((l, c) => {
274
- n = /* @__PURE__ */ a(() => {
275
- this.syncing.state === x.PENDING && (this.syncing.state = x.RESOLVED, l());
276
- }, "syncingResolve"), o = /* @__PURE__ */ a((i) => {
277
- this.syncing.state === x.PENDING && (this.syncing.state = x.REJECTED, c(i));
109
+ let n, o, p = new Promise((a, c) => {
110
+ n = /* @__PURE__ */ s(() => {
111
+ this.syncing.state === w.PENDING && (this.syncing.state = w.RESOLVED, a());
112
+ }, "syncingResolve"), o = /* @__PURE__ */ s((i) => {
113
+ this.syncing.state === w.PENDING && (this.syncing.state = w.REJECTED, c(i));
278
114
  }, "syncingReject");
279
115
  });
280
116
  this.syncing = {
281
- state: x.PENDING,
282
- promise: s,
117
+ state: w.PENDING,
118
+ promise: p,
283
119
  resolve: n,
284
120
  reject: o
285
121
  };
@@ -287,23 +123,23 @@ var ye = "UNIVERSAL_STORE:", x = {
287
123
  this.getState = this.getState.bind(this), this.setState = this.setState.bind(this), this.subscribe = this.subscribe.bind(this), this.onStateChange =
288
124
  this.onStateChange.bind(this), this.send = this.send.bind(this), this.emitToChannel = this.emitToChannel.bind(this), this.prepareThis = this.
289
125
  prepareThis.bind(this), this.emitToListeners = this.emitToListeners.bind(this), this.handleChannelEvents = this.handleChannelEvents.bind(
290
- this), this.debug = this.debug.bind(this), this.channel = e?.channel ?? h.preparation.channel, this.environment = e?.environment ?? h.preparation.
291
- environment, this.channel && this.environment ? this.prepareThis({ channel: this.channel, environment: this.environment }) : h.preparation.
292
- promise.then(this.prepareThis);
126
+ this), this.debug = this.debug.bind(this), this.channel = t?.channel ?? l.preparation.channel, this.environment = t?.environment ?? l.preparation.
127
+ environment, this.channel && this.environment ? (l.preparation.resolve({ channel: this.channel, environment: this.environment }), this.prepareThis(
128
+ { channel: this.channel, environment: this.environment })) : l.preparation.promise.then(this.prepareThis);
293
129
  }
294
130
  static setupPreparationPromise() {
295
- let t, e, n = new Promise(
296
- (o, s) => {
297
- t = /* @__PURE__ */ a((l) => {
298
- o(l);
299
- }, "resolveRef"), e = /* @__PURE__ */ a((...l) => {
300
- s(l);
131
+ let e, t, n = new Promise(
132
+ (o, p) => {
133
+ e = /* @__PURE__ */ s((a) => {
134
+ o(a);
135
+ }, "resolveRef"), t = /* @__PURE__ */ s((...a) => {
136
+ p(a);
301
137
  }, "rejectRef");
302
138
  }
303
139
  );
304
- h.preparation = {
305
- resolve: t,
306
- reject: e,
140
+ l.preparation = {
141
+ resolve: e,
142
+ reject: t,
307
143
  promise: n
308
144
  };
309
145
  }
@@ -312,7 +148,7 @@ var ye = "UNIVERSAL_STORE:", x = {
312
148
  return Object.freeze({
313
149
  id: this.actorId,
314
150
  type: this.actorType,
315
- environment: this.environment ?? h.Environment.UNKNOWN
151
+ environment: this.environment ?? l.Environment.UNKNOWN
316
152
  });
317
153
  }
318
154
  /**
@@ -321,16 +157,16 @@ var ye = "UNIVERSAL_STORE:", x = {
321
157
  */
322
158
  get status() {
323
159
  if (!this.channel || !this.environment)
324
- return h.Status.UNPREPARED;
160
+ return l.Status.UNPREPARED;
325
161
  switch (this.syncing?.state) {
326
- case x.PENDING:
162
+ case w.PENDING:
327
163
  case void 0:
328
- return h.Status.SYNCING;
329
- case x.REJECTED:
330
- return h.Status.ERROR;
331
- case x.RESOLVED:
164
+ return l.Status.SYNCING;
165
+ case w.REJECTED:
166
+ return l.Status.ERROR;
167
+ case w.RESOLVED:
332
168
  default:
333
- return h.Status.READY;
169
+ return l.Status.READY;
334
170
  }
335
171
  }
336
172
  /**
@@ -341,24 +177,24 @@ var ye = "UNIVERSAL_STORE:", x = {
341
177
  * hundred milliseconds.
342
178
  */
343
179
  untilReady() {
344
- return Promise.all([h.preparation.promise, this.syncing?.promise]);
180
+ return Promise.all([l.preparation.promise, this.syncing?.promise]);
345
181
  }
346
182
  /** Creates a new instance of UniversalStore */
347
- static create(t) {
348
- if (!t || typeof t?.id != "string")
183
+ static create(e) {
184
+ if (!e || typeof e?.id != "string")
349
185
  throw new TypeError("id is required and must be a string, when creating a UniversalStore");
350
- t.debug && console.debug(
351
- F`[UniversalStore]
186
+ e.debug && console.debug(
187
+ L`[UniversalStore]
352
188
  create`,
353
- { options: t }
189
+ { options: e }
354
190
  );
355
- let e = ft.get(t.id);
356
- if (e)
357
- return console.warn(F`UniversalStore with id "${t.id}" already exists in this environment, re-using existing.
358
- You should reuse the existing instance instead of trying to create a new one.`), e;
359
- h.isInternalConstructing = !0;
360
- let n = new h(t);
361
- return ft.set(t.id, n), n;
191
+ let t = ge.get(e.id);
192
+ if (t)
193
+ return console.warn(L`UniversalStore with id "${e.id}" already exists in this environment, re-using existing.
194
+ You should reuse the existing instance instead of trying to create a new one.`), t;
195
+ l.isInternalConstructing = !0;
196
+ let n = new l(e);
197
+ return ge.set(e.id, n), n;
362
198
  }
363
199
  /**
364
200
  * Used by Storybook to set the channel for all instances of UniversalStore in the given
@@ -366,19 +202,19 @@ var ye = "UNIVERSAL_STORE:", x = {
366
202
  *
367
203
  * @internal
368
204
  */
369
- static __prepare(t, e) {
370
- h.preparation.channel = t, h.preparation.environment = e, h.preparation.resolve({ channel: t, environment: e });
205
+ static __prepare(e, t) {
206
+ l.preparation.channel = e, l.preparation.environment = t, l.preparation.resolve({ channel: e, environment: t });
371
207
  }
372
208
  /**
373
209
  * Updates the store's state
374
210
  *
375
211
  * Either a new state or a state updater function can be passed to the method.
376
212
  */
377
- setState(t) {
378
- let e = this.state, n = typeof t == "function" ? t(e) : t;
379
- if (this.debug("setState", { newState: n, previousState: e, updater: t }), this.status !== h.Status.READY)
213
+ setState(e) {
214
+ let t = this.state, n = typeof e == "function" ? e(t) : e;
215
+ if (this.debug("setState", { newState: n, previousState: t, updater: e }), this.status !== l.Status.READY)
380
216
  throw new TypeError(
381
- F`Cannot set state before store is ready. You can get the current status with store.status,
217
+ L`Cannot set state before store is ready. You can get the current status with store.status,
382
218
  or await store.readyPromise to wait for the store to be ready before sending events.
383
219
  ${JSON.stringify(
384
220
  {
@@ -393,10 +229,10 @@ var ye = "UNIVERSAL_STORE:", x = {
393
229
  );
394
230
  this.state = n;
395
231
  let o = {
396
- type: h.InternalEventType.SET_STATE,
232
+ type: l.InternalEventType.SET_STATE,
397
233
  payload: {
398
234
  state: n,
399
- previousState: e
235
+ previousState: t
400
236
  }
401
237
  };
402
238
  this.emitToChannel(o, { actor: this.actor }), this.emitToListeners(o, { actor: this.actor });
@@ -406,33 +242,33 @@ var ye = "UNIVERSAL_STORE:", x = {
406
242
  *
407
243
  * @returns Unsubscribe function
408
244
  */
409
- onStateChange(t) {
410
- return this.debug("onStateChange", { listener: t }), this.subscribe(
411
- h.InternalEventType.SET_STATE,
412
- ({ payload: e }, n) => {
413
- t(e.state, e.previousState, n);
245
+ onStateChange(e) {
246
+ return this.debug("onStateChange", { listener: e }), this.subscribe(
247
+ l.InternalEventType.SET_STATE,
248
+ ({ payload: t }, n) => {
249
+ e(t.state, t.previousState, n);
414
250
  }
415
251
  );
416
252
  }
417
- emitToChannel(t, e) {
418
- this.debug("emitToChannel", { event: t, eventInfo: e, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
419
- event: t,
420
- eventInfo: e
253
+ emitToChannel(e, t) {
254
+ this.debug("emitToChannel", { event: e, eventInfo: t, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
255
+ event: e,
256
+ eventInfo: t
421
257
  });
422
258
  }
423
259
  prepareThis({
424
- channel: t,
425
- environment: e
260
+ channel: e,
261
+ environment: t
426
262
  }) {
427
- this.channel = t, this.environment = e, this.debug("prepared", { channel: !!t, environment: e }), this.channel.on(this.channelEventName,
428
- this.handleChannelEvents), this.actor.type === h.ActorType.LEADER ? this.emitToChannel(
429
- { type: h.InternalEventType.LEADER_CREATED },
263
+ this.channel = e, this.environment = t, this.debug("prepared", { channel: !!e, environment: t }), this.channel.on(this.channelEventName,
264
+ this.handleChannelEvents), this.actor.type === l.ActorType.LEADER ? this.emitToChannel(
265
+ { type: l.InternalEventType.LEADER_CREATED },
430
266
  { actor: this.actor }
431
267
  ) : (this.emitToChannel(
432
- { type: h.InternalEventType.FOLLOWER_CREATED },
268
+ { type: l.InternalEventType.FOLLOWER_CREATED },
433
269
  { actor: this.actor }
434
270
  ), this.emitToChannel(
435
- { type: h.InternalEventType.EXISTING_STATE_REQUEST },
271
+ { type: l.InternalEventType.EXISTING_STATE_REQUEST },
436
272
  { actor: this.actor }
437
273
  ), setTimeout(() => {
438
274
  this.syncing.reject(
@@ -443,44 +279,44 @@ var ye = "UNIVERSAL_STORE:", x = {
443
279
  );
444
280
  }, 1e3));
445
281
  }
446
- emitToListeners(t, e) {
447
- let n = this.listeners.get(t.type), o = this.listeners.get("*");
282
+ emitToListeners(e, t) {
283
+ let n = this.listeners.get(e.type), o = this.listeners.get("*");
448
284
  this.debug("emitToListeners", {
449
- event: t,
450
- eventInfo: e,
285
+ event: e,
286
+ eventInfo: t,
451
287
  eventTypeListeners: n,
452
288
  everythingListeners: o
453
289
  }), [...n ?? [], ...o ?? []].forEach(
454
- (s) => s(t, e)
290
+ (p) => p(e, t)
455
291
  );
456
292
  }
457
- handleChannelEvents(t) {
458
- let { event: e, eventInfo: n } = t;
293
+ handleChannelEvents(e) {
294
+ let { event: t, eventInfo: n } = e;
459
295
  if ([n.actor.id, n.forwardingActor?.id].includes(this.actor.id)) {
460
- this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: t });
296
+ this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: e });
461
297
  return;
462
- } else if (this.syncing?.state === x.PENDING && e.type !== h.InternalEventType.EXISTING_STATE_RESPONSE) {
463
- this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: t });
298
+ } else if (this.syncing?.state === w.PENDING && t.type !== l.InternalEventType.EXISTING_STATE_RESPONSE) {
299
+ this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: e });
464
300
  return;
465
301
  }
466
- if (this.debug("handleChannelEvents", { channelEvent: t }), this.actor.type === h.ActorType.LEADER) {
302
+ if (this.debug("handleChannelEvents", { channelEvent: e }), this.actor.type === l.ActorType.LEADER) {
467
303
  let o = !0;
468
- switch (e.type) {
469
- case h.InternalEventType.EXISTING_STATE_REQUEST:
304
+ switch (t.type) {
305
+ case l.InternalEventType.EXISTING_STATE_REQUEST:
470
306
  o = !1;
471
- let s = {
472
- type: h.InternalEventType.EXISTING_STATE_RESPONSE,
307
+ let p = {
308
+ type: l.InternalEventType.EXISTING_STATE_RESPONSE,
473
309
  payload: this.state
474
310
  };
475
311
  this.debug("handleChannelEvents: responding to existing state request", {
476
- responseEvent: s
477
- }), this.emitToChannel(s, { actor: this.actor });
312
+ responseEvent: p
313
+ }), this.emitToChannel(p, { actor: this.actor }), this.emitToListeners(p, { actor: this.actor });
478
314
  break;
479
- case h.InternalEventType.LEADER_CREATED:
480
- o = !1, this.syncing.state = x.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", {
481
- event: e
315
+ case l.InternalEventType.LEADER_CREATED:
316
+ o = !1, this.syncing.state = w.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", {
317
+ event: t
482
318
  }), console.error(
483
- F`Detected multiple UniversalStore leaders created with the same id "${this.id}".
319
+ L`Detected multiple UniversalStore leaders created with the same id "${this.id}".
484
320
  Only one leader can exists at a time, your stores are now in an invalid state.
485
321
  Leaders detected:
486
322
  this: ${JSON.stringify(this.actor, null, 2)}
@@ -488,41 +324,41 @@ var ye = "UNIVERSAL_STORE:", x = {
488
324
  );
489
325
  break;
490
326
  }
491
- o && (this.debug("handleChannelEvents: forwarding event", { channelEvent: t }), this.emitToChannel(e, { actor: n.actor, forwardingActor: this.
327
+ o && (this.debug("handleChannelEvents: forwarding event", { channelEvent: e }), this.emitToChannel(t, { actor: n.actor, forwardingActor: this.
492
328
  actor }));
493
329
  }
494
- if (this.actor.type === h.ActorType.FOLLOWER)
495
- switch (e.type) {
496
- case h.InternalEventType.EXISTING_STATE_RESPONSE:
330
+ if (this.actor.type === l.ActorType.FOLLOWER)
331
+ switch (t.type) {
332
+ case l.InternalEventType.EXISTING_STATE_RESPONSE:
497
333
  if (this.debug("handleChannelEvents: Setting state from leader's existing state response", {
498
- event: e
499
- }), this.syncing?.state !== x.PENDING)
334
+ event: t
335
+ }), this.syncing?.state !== w.PENDING)
500
336
  break;
501
337
  this.syncing.resolve?.();
502
338
  let o = {
503
- type: h.InternalEventType.SET_STATE,
339
+ type: l.InternalEventType.SET_STATE,
504
340
  payload: {
505
- state: e.payload,
341
+ state: t.payload,
506
342
  previousState: this.state
507
343
  }
508
344
  };
509
- this.state = e.payload, this.emitToListeners(o, n);
345
+ this.state = t.payload, this.emitToListeners(o, n);
510
346
  break;
511
347
  }
512
- switch (e.type) {
513
- case h.InternalEventType.SET_STATE:
514
- this.debug("handleChannelEvents: Setting state", { event: e }), this.state = e.payload.state;
348
+ switch (t.type) {
349
+ case l.InternalEventType.SET_STATE:
350
+ this.debug("handleChannelEvents: Setting state", { event: t }), this.state = t.payload.state;
515
351
  break;
516
352
  }
517
- this.emitToListeners(e, { actor: n.actor });
353
+ this.emitToListeners(t, { actor: n.actor });
518
354
  }
519
- debug(t, e) {
355
+ debug(e, t) {
520
356
  this.debugging && console.debug(
521
- F`[UniversalStore::${this.id}::${this.environment ?? h.Environment.UNKNOWN}]
522
- ${t}`,
357
+ L`[UniversalStore::${this.id}::${this.environment ?? l.Environment.UNKNOWN}]
358
+ ${e}`,
523
359
  JSON.stringify(
524
360
  {
525
- data: e,
361
+ data: t,
526
362
  actor: this.actor,
527
363
  state: this.state,
528
364
  status: this.status
@@ -538,15 +374,15 @@ var ye = "UNIVERSAL_STORE:", x = {
538
374
  * @internal
539
375
  */
540
376
  static __reset() {
541
- h.preparation.reject(new Error("reset")), h.setupPreparationPromise(), h.isInternalConstructing = !1;
377
+ l.preparation.reject(new Error("reset")), l.setupPreparationPromise(), l.isInternalConstructing = !1;
542
378
  }
543
379
  };
544
- a(h, "UniversalStore"), /**
380
+ s(l, "UniversalStore"), /**
545
381
  * Defines the possible actor types in the store system
546
382
  *
547
383
  * @readonly
548
384
  */
549
- h.ActorType = {
385
+ l.ActorType = {
550
386
  LEADER: "LEADER",
551
387
  FOLLOWER: "FOLLOWER"
552
388
  }, /**
@@ -554,7 +390,7 @@ h.ActorType = {
554
390
  *
555
391
  * @readonly
556
392
  */
557
- h.Environment = {
393
+ l.Environment = {
558
394
  SERVER: "SERVER",
559
395
  MANAGER: "MANAGER",
560
396
  PREVIEW: "PREVIEW",
@@ -565,112 +401,117 @@ h.Environment = {
565
401
  *
566
402
  * @readonly
567
403
  */
568
- h.InternalEventType = {
404
+ l.InternalEventType = {
569
405
  EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
570
406
  EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
571
407
  SET_STATE: "__SET_STATE",
572
408
  LEADER_CREATED: "__LEADER_CREATED",
573
409
  FOLLOWER_CREATED: "__FOLLOWER_CREATED"
574
- }, h.Status = {
410
+ }, l.Status = {
575
411
  UNPREPARED: "UNPREPARED",
576
412
  SYNCING: "SYNCING",
577
413
  READY: "READY",
578
414
  ERROR: "ERROR"
579
415
  }, // This is used to check if constructor was called from the static factory create()
580
- h.isInternalConstructing = !1, h.setupPreparationPromise();
581
- var $ = h;
416
+ l.isInternalConstructing = !1, l.setupPreparationPromise();
417
+ var U = l;
582
418
 
583
419
  // src/channels/main.ts
584
- var de = /* @__PURE__ */ a((r) => r.transports !== void 0, "isMulti"), ge = /* @__PURE__ */ a(() => Math.random().toString(16).slice(2), "ge\
585
- nerateRandomId"), ht = class ht {
586
- constructor(t = {}) {
587
- this.sender = ge();
420
+ var It = /* @__PURE__ */ s((r) => r.transports !== void 0, "isMulti"), Rt = /* @__PURE__ */ s(() => Math.random().toString(16).slice(2), "ge\
421
+ nerateRandomId"), me = class me {
422
+ constructor(e = {}) {
423
+ this.sender = Rt();
588
424
  this.events = {};
589
425
  this.data = {};
590
426
  this.transports = [];
591
- this.isAsync = t.async || !1, de(t) ? (this.transports = t.transports || [], this.transports.forEach((e) => {
592
- e.setHandler((n) => this.handleEvent(n));
593
- })) : this.transports = t.transport ? [t.transport] : [], this.transports.forEach((e) => {
594
- e.setHandler((n) => this.handleEvent(n));
427
+ this.isAsync = e.async || !1, It(e) ? (this.transports = e.transports || [], this.transports.forEach((t) => {
428
+ t.setHandler((n) => this.handleEvent(n));
429
+ })) : this.transports = e.transport ? [e.transport] : [], this.transports.forEach((t) => {
430
+ t.setHandler((n) => this.handleEvent(n));
595
431
  });
596
432
  }
597
433
  get hasTransport() {
598
434
  return this.transports.length > 0;
599
435
  }
600
- addListener(t, e) {
601
- this.events[t] = this.events[t] || [], this.events[t].push(e);
436
+ addListener(e, t) {
437
+ this.events[e] = this.events[e] || [], this.events[e].push(t);
602
438
  }
603
- emit(t, ...e) {
604
- let n = { type: t, args: e, from: this.sender }, o = {};
605
- e.length >= 1 && e[0] && e[0].options && (o = e[0].options);
606
- let s = /* @__PURE__ */ a(() => {
607
- this.transports.forEach((l) => {
608
- l.send(n, o);
439
+ emit(e, ...t) {
440
+ let n = { type: e, args: t, from: this.sender }, o = {};
441
+ t.length >= 1 && t[0] && t[0].options && (o = t[0].options);
442
+ let p = /* @__PURE__ */ s(() => {
443
+ this.transports.forEach((a) => {
444
+ a.send(n, o);
609
445
  }), this.handleEvent(n);
610
446
  }, "handler");
611
- this.isAsync ? setImmediate(s) : s();
447
+ this.isAsync ? setImmediate(p) : p();
612
448
  }
613
- last(t) {
614
- return this.data[t];
449
+ last(e) {
450
+ return this.data[e];
615
451
  }
616
452
  eventNames() {
617
453
  return Object.keys(this.events);
618
454
  }
619
- listenerCount(t) {
620
- let e = this.listeners(t);
621
- return e ? e.length : 0;
455
+ listenerCount(e) {
456
+ let t = this.listeners(e);
457
+ return t ? t.length : 0;
622
458
  }
623
- listeners(t) {
624
- return this.events[t] || void 0;
459
+ listeners(e) {
460
+ return this.events[e] || void 0;
625
461
  }
626
- once(t, e) {
627
- let n = this.onceListener(t, e);
628
- this.addListener(t, n);
462
+ once(e, t) {
463
+ let n = this.onceListener(e, t);
464
+ this.addListener(e, n);
629
465
  }
630
- removeAllListeners(t) {
631
- t ? this.events[t] && delete this.events[t] : this.events = {};
466
+ removeAllListeners(e) {
467
+ e ? this.events[e] && delete this.events[e] : this.events = {};
632
468
  }
633
- removeListener(t, e) {
634
- let n = this.listeners(t);
635
- n && (this.events[t] = n.filter((o) => o !== e));
469
+ removeListener(e, t) {
470
+ let n = this.listeners(e);
471
+ n && (this.events[e] = n.filter((o) => o !== t));
636
472
  }
637
- on(t, e) {
638
- this.addListener(t, e);
473
+ on(e, t) {
474
+ this.addListener(e, t);
639
475
  }
640
- off(t, e) {
641
- this.removeListener(t, e);
476
+ off(e, t) {
477
+ this.removeListener(e, t);
642
478
  }
643
- handleEvent(t) {
644
- let e = this.listeners(t.type);
645
- e && e.length && e.forEach((n) => {
646
- n.apply(t, t.args);
647
- }), this.data[t.type] = t.args;
479
+ handleEvent(e) {
480
+ let t = this.listeners(e.type);
481
+ t && t.length && t.forEach((n) => {
482
+ n.apply(e, e.args);
483
+ }), this.data[e.type] = e.args;
648
484
  }
649
- onceListener(t, e) {
650
- let n = /* @__PURE__ */ a((...o) => (this.removeListener(t, n), e(...o)), "onceListener");
485
+ onceListener(e, t) {
486
+ let n = /* @__PURE__ */ s((...o) => (this.removeListener(e, n), t(...o)), "onceListener");
651
487
  return n;
652
488
  }
653
489
  };
654
- a(ht, "Channel");
655
- var B = ht;
490
+ s(me, "Channel");
491
+ var z = me;
656
492
 
657
493
  // src/channels/postmessage/index.ts
658
- import { logger as Kt, pretty as Yt } from "storybook/internal/client-logger";
659
- import * as so from "storybook/internal/core-events";
494
+ import { logger as ct, pretty as lt } from "storybook/internal/client-logger";
495
+ import * as Uo from "storybook/internal/core-events";
496
+ import { global as S } from "@storybook/global";
660
497
 
661
- // ../node_modules/telejson/dist/chunk-465TF3XA.mjs
662
- var ve = Object.create, Ot = Object.defineProperty, me = Object.getOwnPropertyDescriptor, Ct = Object.getOwnPropertyNames, Ee = Object.getPrototypeOf,
663
- be = Object.prototype.hasOwnProperty, P = /* @__PURE__ */ a((r, t) => /* @__PURE__ */ a(function() {
664
- return t || (0, r[Ct(r)[0]])((t = { exports: {} }).exports, t), t.exports;
665
- }, "__require"), "__commonJS"), Se = /* @__PURE__ */ a((r, t, e, n) => {
666
- if (t && typeof t == "object" || typeof t == "function")
667
- for (let o of Ct(t))
668
- !be.call(r, o) && o !== e && Ot(r, o, { get: /* @__PURE__ */ a(() => t[o], "get"), enumerable: !(n = me(t, o)) || n.enumerable });
498
+ // ../node_modules/telejson/dist/chunk-EAFQLD22.mjs
499
+ var jt = Object.create, Fe = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, Me = Object.getOwnPropertyNames, Dt = Object.getPrototypeOf,
500
+ $t = Object.prototype.hasOwnProperty, d = /* @__PURE__ */ s((r, e) => /* @__PURE__ */ s(function() {
501
+ return e || (0, r[Me(r)[0]])((e = { exports: {} }).exports, e), e.exports;
502
+ }, "__require"), "__commonJS"), Ft = /* @__PURE__ */ s((r, e, t, n) => {
503
+ if (e && typeof e == "object" || typeof e == "function")
504
+ for (let o of Me(e))
505
+ !$t.call(r, o) && o !== t && Fe(r, o, { get: /* @__PURE__ */ s(() => e[o], "get"), enumerable: !(n = Lt(e, o)) || n.enumerable });
669
506
  return r;
670
- }, "__copyProps"), ot = /* @__PURE__ */ a((r, t, e) => (e = r != null ? ve(Ee(r)) : {}, Se(
671
- t || !r || !r.__esModule ? Ot(e, "default", { value: r, enumerable: !0 }) : e,
507
+ }, "__copyProps"), pe = /* @__PURE__ */ s((r, e, t) => (t = r != null ? jt(Dt(r)) : {}, Ft(
508
+ // If the importer is in node compatibility mode or this is not an ESM
509
+ // file that has been converted to a CommonJS file using a Babel-
510
+ // compatible transform (i.e. "__esModule" has not been set), then set
511
+ // "default" to the CommonJS "module.exports" for node compatibility.
512
+ e || !r || !r.__esModule ? Fe(t, "default", { value: r, enumerable: !0 }) : t,
672
513
  r
673
- )), "__toESM"), _e = [
514
+ )), "__toESM"), Mt = [
674
515
  "bubbles",
675
516
  "cancelBubble",
676
517
  "cancelable",
@@ -684,210 +525,441 @@ be = Object.prototype.hasOwnProperty, P = /* @__PURE__ */ a((r, t) => /* @__PURE
684
525
  "target",
685
526
  "timeStamp",
686
527
  "type"
687
- ], Te = ["detail"];
688
- function Pt(r) {
689
- let t = _e.filter((e) => r[e] !== void 0).reduce((e, n) => ({ ...e, [n]: r[n] }), {});
690
- return r instanceof CustomEvent && Te.filter((e) => r[e] !== void 0).forEach((e) => {
691
- t[e] = r[e];
692
- }), t;
528
+ ], Ut = ["detail"];
529
+ function Ue(r) {
530
+ let e = Mt.filter((t) => r[t] !== void 0).reduce((t, n) => (t[n] = r[n], t), {});
531
+ if (r instanceof CustomEvent)
532
+ for (let t of Ut.filter(
533
+ (n) => r[n] !== void 0
534
+ ))
535
+ e[t] = r[t];
536
+ return e;
693
537
  }
694
- a(Pt, "extractEventHiddenProperties");
538
+ s(Ue, "extractEventHiddenProperties");
695
539
 
696
540
  // ../node_modules/telejson/dist/index.mjs
697
- var Bt = he(xt(), 1);
698
- var Ft = P({
699
- "node_modules/has-symbols/shams.js"(r, t) {
541
+ var He = d({
542
+ "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(r, e) {
700
543
  "use strict";
701
- t.exports = /* @__PURE__ */ a(function() {
544
+ e.exports = Object;
545
+ }
546
+ }), Gt = d({
547
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(r, e) {
548
+ "use strict";
549
+ e.exports = Error;
550
+ }
551
+ }), kt = d({
552
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(r, e) {
553
+ "use strict";
554
+ e.exports = EvalError;
555
+ }
556
+ }), Wt = d({
557
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(r, e) {
558
+ "use strict";
559
+ e.exports = RangeError;
560
+ }
561
+ }), qt = d({
562
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(r, e) {
563
+ "use strict";
564
+ e.exports = ReferenceError;
565
+ }
566
+ }), Bt = d({
567
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(r, e) {
568
+ "use strict";
569
+ e.exports = SyntaxError;
570
+ }
571
+ }), Ee = d({
572
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(r, e) {
573
+ "use strict";
574
+ e.exports = TypeError;
575
+ }
576
+ }), Ht = d({
577
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(r, e) {
578
+ "use strict";
579
+ e.exports = URIError;
580
+ }
581
+ }), Vt = d({
582
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(r, e) {
583
+ "use strict";
584
+ e.exports = Math.abs;
585
+ }
586
+ }), Jt = d({
587
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(r, e) {
588
+ "use strict";
589
+ e.exports = Math.floor;
590
+ }
591
+ }), zt = d({
592
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(r, e) {
593
+ "use strict";
594
+ e.exports = Math.max;
595
+ }
596
+ }), Yt = d({
597
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(r, e) {
598
+ "use strict";
599
+ e.exports = Math.min;
600
+ }
601
+ }), Kt = d({
602
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(r, e) {
603
+ "use strict";
604
+ e.exports = Math.pow;
605
+ }
606
+ }), Xt = d({
607
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(r, e) {
608
+ "use strict";
609
+ e.exports = Math.round;
610
+ }
611
+ }), Qt = d({
612
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(r, e) {
613
+ "use strict";
614
+ e.exports = Number.isNaN || /* @__PURE__ */ s(function(n) {
615
+ return n !== n;
616
+ }, "isNaN2");
617
+ }
618
+ }), Zt = d({
619
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(r, e) {
620
+ "use strict";
621
+ var t = Qt();
622
+ e.exports = /* @__PURE__ */ s(function(o) {
623
+ return t(o) || o === 0 ? o : o < 0 ? -1 : 1;
624
+ }, "sign");
625
+ }
626
+ }), er = d({
627
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(r, e) {
628
+ "use strict";
629
+ e.exports = Object.getOwnPropertyDescriptor;
630
+ }
631
+ }), _e = d({
632
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(r, e) {
633
+ "use strict";
634
+ var t = er();
635
+ if (t)
636
+ try {
637
+ t([], "length");
638
+ } catch {
639
+ t = null;
640
+ }
641
+ e.exports = t;
642
+ }
643
+ }), tr = d({
644
+ "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(r, e) {
645
+ "use strict";
646
+ var t = Object.defineProperty || !1;
647
+ if (t)
648
+ try {
649
+ t({}, "a", { value: 1 });
650
+ } catch {
651
+ t = !1;
652
+ }
653
+ e.exports = t;
654
+ }
655
+ }), Ve = d({
656
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(r, e) {
657
+ "use strict";
658
+ e.exports = /* @__PURE__ */ s(function() {
702
659
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
703
660
  return !1;
704
661
  if (typeof Symbol.iterator == "symbol")
705
662
  return !0;
706
- var n = {}, o = Symbol("test"), s = Object(o);
707
- if (typeof o == "string" || Object.prototype.toString.call(o) !== "[object Symbol]" || Object.prototype.toString.call(s) !== "[object \
663
+ var n = {}, o = Symbol("test"), p = Object(o);
664
+ if (typeof o == "string" || Object.prototype.toString.call(o) !== "[object Symbol]" || Object.prototype.toString.call(p) !== "[object \
708
665
  Symbol]")
709
666
  return !1;
710
- var l = 42;
711
- n[o] = l;
712
- for (o in n)
667
+ var a = 42;
668
+ n[o] = a;
669
+ for (var c in n)
713
670
  return !1;
714
671
  if (typeof Object.keys == "function" && Object.keys(n).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(
715
672
  n).length !== 0)
716
673
  return !1;
717
- var c = Object.getOwnPropertySymbols(n);
718
- if (c.length !== 1 || c[0] !== o || !Object.prototype.propertyIsEnumerable.call(n, o))
674
+ var i = Object.getOwnPropertySymbols(n);
675
+ if (i.length !== 1 || i[0] !== o || !Object.prototype.propertyIsEnumerable.call(n, o))
719
676
  return !1;
720
677
  if (typeof Object.getOwnPropertyDescriptor == "function") {
721
- var i = Object.getOwnPropertyDescriptor(n, o);
722
- if (i.value !== l || i.enumerable !== !0)
678
+ var u = (
679
+ /** @type {PropertyDescriptor} */
680
+ Object.getOwnPropertyDescriptor(n, o)
681
+ );
682
+ if (u.value !== a || u.enumerable !== !0)
723
683
  return !1;
724
684
  }
725
685
  return !0;
726
686
  }, "hasSymbols");
727
687
  }
728
- }), Mt = P({
729
- "node_modules/has-symbols/index.js"(r, t) {
688
+ }), Je = d({
689
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(r, e) {
730
690
  "use strict";
731
- var e = typeof Symbol < "u" && Symbol, n = Ft();
732
- t.exports = /* @__PURE__ */ a(function() {
733
- return typeof e != "function" || typeof Symbol != "function" || typeof e("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
691
+ var t = typeof Symbol < "u" && Symbol, n = Ve();
692
+ e.exports = /* @__PURE__ */ s(function() {
693
+ return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
734
694
  n();
735
695
  }, "hasNativeSymbols");
736
696
  }
737
- }), Ae = P({
738
- "node_modules/function-bind/implementation.js"(r, t) {
697
+ }), ze = d({
698
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(r, e) {
699
+ "use strict";
700
+ e.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
701
+ }
702
+ }), Ye = d({
703
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(r, e) {
739
704
  "use strict";
740
- var e = "Function.prototype.bind called on incompatible ", n = Array.prototype.slice, o = Object.prototype.toString, s = "[object Functi\
741
- on]";
742
- t.exports = /* @__PURE__ */ a(function(c) {
743
- var i = this;
744
- if (typeof i != "function" || o.call(i) !== s)
745
- throw new TypeError(e + i);
746
- for (var g = n.call(arguments, 1), p, u = /* @__PURE__ */ a(function() {
747
- if (this instanceof p) {
748
- var E = i.apply(
705
+ var t = He();
706
+ e.exports = t.getPrototypeOf || null;
707
+ }
708
+ }), rr = d({
709
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(r, e) {
710
+ "use strict";
711
+ var t = "Function.prototype.bind called on incompatible ", n = Object.prototype.toString, o = Math.max, p = "[object Function]", a = /* @__PURE__ */ s(
712
+ function(y, f) {
713
+ for (var h = [], m = 0; m < y.length; m += 1)
714
+ h[m] = y[m];
715
+ for (var g = 0; g < f.length; g += 1)
716
+ h[g + y.length] = f[g];
717
+ return h;
718
+ }, "concatty2"), c = /* @__PURE__ */ s(function(y, f) {
719
+ for (var h = [], m = f || 0, g = 0; m < y.length; m += 1, g += 1)
720
+ h[g] = y[m];
721
+ return h;
722
+ }, "slicy2"), i = /* @__PURE__ */ s(function(u, y) {
723
+ for (var f = "", h = 0; h < u.length; h += 1)
724
+ f += u[h], h + 1 < u.length && (f += y);
725
+ return f;
726
+ }, "joiny");
727
+ e.exports = /* @__PURE__ */ s(function(y) {
728
+ var f = this;
729
+ if (typeof f != "function" || n.apply(f) !== p)
730
+ throw new TypeError(t + f);
731
+ for (var h = c(arguments, 1), m, g = /* @__PURE__ */ s(function() {
732
+ if (this instanceof m) {
733
+ var R = f.apply(
749
734
  this,
750
- g.concat(n.call(arguments))
735
+ a(h, arguments)
751
736
  );
752
- return Object(E) === E ? E : this;
753
- } else
754
- return i.apply(
755
- c,
756
- g.concat(n.call(arguments))
757
- );
758
- }, "binder"), y = Math.max(0, i.length - g.length), v = [], d = 0; d < y; d++)
759
- v.push("$" + d);
760
- if (p = Function("binder", "return function (" + v.join(",") + "){ return binder.apply(this,arguments); }")(u), i.prototype) {
761
- var m = /* @__PURE__ */ a(function() {
737
+ return Object(R) === R ? R : this;
738
+ }
739
+ return f.apply(
740
+ y,
741
+ a(h, arguments)
742
+ );
743
+ }, "binder"), N = o(0, f.length - h.length), P = [], x = 0; x < N; x++)
744
+ P[x] = "$" + x;
745
+ if (m = Function("binder", "return function (" + i(P, ",") + "){ return binder.apply(this,arguments); }")(g), f.prototype) {
746
+ var D = /* @__PURE__ */ s(function() {
762
747
  }, "Empty2");
763
- m.prototype = i.prototype, p.prototype = new m(), m.prototype = null;
748
+ D.prototype = f.prototype, m.prototype = new D(), D.prototype = null;
764
749
  }
765
- return p;
750
+ return m;
766
751
  }, "bind");
767
752
  }
768
- }), gt = P({
769
- "node_modules/function-bind/index.js"(r, t) {
753
+ }), ce = d({
754
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(r, e) {
770
755
  "use strict";
771
- var e = Ae();
772
- t.exports = Function.prototype.bind || e;
756
+ var t = rr();
757
+ e.exports = Function.prototype.bind || t;
773
758
  }
774
- }), we = P({
775
- "node_modules/has/src/index.js"(r, t) {
759
+ }), be = d({
760
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(r, e) {
776
761
  "use strict";
777
- var e = gt();
778
- t.exports = e.call(Function.call, Object.prototype.hasOwnProperty);
762
+ e.exports = Function.prototype.call;
779
763
  }
780
- }), $t = P({
781
- "node_modules/get-intrinsic/index.js"(r, t) {
764
+ }), Ke = d({
765
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(r, e) {
782
766
  "use strict";
783
- var e, n = SyntaxError, o = Function, s = TypeError, l = /* @__PURE__ */ a(function(j) {
784
- try {
785
- return o('"use strict"; return (' + j + ").constructor;")();
786
- } catch {
787
- }
788
- }, "getEvalledConstructor"), c = Object.getOwnPropertyDescriptor;
789
- if (c)
767
+ e.exports = Function.prototype.apply;
768
+ }
769
+ }), nr = d({
770
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(r, e) {
771
+ "use strict";
772
+ e.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
773
+ }
774
+ }), or = d({
775
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(r, e) {
776
+ "use strict";
777
+ var t = ce(), n = Ke(), o = be(), p = nr();
778
+ e.exports = p || t.call(o, n);
779
+ }
780
+ }), Xe = d({
781
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(r, e) {
782
+ "use strict";
783
+ var t = ce(), n = Ee(), o = be(), p = or();
784
+ e.exports = /* @__PURE__ */ s(function(c) {
785
+ if (c.length < 1 || typeof c[0] != "function")
786
+ throw new n("a function is required");
787
+ return p(t, o, c);
788
+ }, "callBindBasic");
789
+ }
790
+ }), sr = d({
791
+ "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(r, e) {
792
+ "use strict";
793
+ var t = Xe(), n = _e(), o;
794
+ try {
795
+ o = /** @type {{ __proto__?: typeof Array.prototype }} */
796
+ [].__proto__ === Array.prototype;
797
+ } catch (i) {
798
+ if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
799
+ throw i;
800
+ }
801
+ var p = !!o && n && n(
802
+ Object.prototype,
803
+ /** @type {keyof typeof Object.prototype} */
804
+ "__proto__"
805
+ ), a = Object, c = a.getPrototypeOf;
806
+ e.exports = p && typeof p.get == "function" ? t([p.get]) : typeof c == "function" ? (
807
+ /** @type {import('./get')} */
808
+ /* @__PURE__ */ s(function(u) {
809
+ return c(u == null ? u : a(u));
810
+ }, "getDunder")
811
+ ) : !1;
812
+ }
813
+ }), ir = d({
814
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(r, e) {
815
+ "use strict";
816
+ var t = ze(), n = Ye(), o = sr();
817
+ e.exports = t ? /* @__PURE__ */ s(function(a) {
818
+ return t(a);
819
+ }, "getProto") : n ? /* @__PURE__ */ s(function(a) {
820
+ if (!a || typeof a != "object" && typeof a != "function")
821
+ throw new TypeError("getProto: not an object");
822
+ return n(a);
823
+ }, "getProto") : o ? /* @__PURE__ */ s(function(a) {
824
+ return o(a);
825
+ }, "getProto") : null;
826
+ }
827
+ }), Qe = d({
828
+ "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(r, e) {
829
+ "use strict";
830
+ var t = Function.prototype.call, n = Object.prototype.hasOwnProperty, o = ce();
831
+ e.exports = o.call(t, n);
832
+ }
833
+ }), ar = d({
834
+ "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(r, e) {
835
+ "use strict";
836
+ var t, n = He(), o = Gt(), p = kt(), a = Wt(), c = qt(), i = Bt(), u = Ee(), y = Ht(), f = Vt(), h = Jt(), m = zt(), g = Yt(), N = Kt(),
837
+ P = Xt(), x = Zt(), D = Function, R = /* @__PURE__ */ s(function(O) {
790
838
  try {
791
- c({}, "");
839
+ return D('"use strict"; return (' + O + ").constructor;")();
792
840
  } catch {
793
- c = null;
794
841
  }
795
- var i = /* @__PURE__ */ a(function() {
796
- throw new s();
797
- }, "throwTypeError"), g = c ? function() {
842
+ }, "getEvalledConstructor"), B = _e(), gt = tr(), ye = /* @__PURE__ */ s(function() {
843
+ throw new u();
844
+ }, "throwTypeError"), mt = B ? function() {
798
845
  try {
799
- return arguments.callee, i;
846
+ return arguments.callee, ye;
800
847
  } catch {
801
848
  try {
802
- return c(arguments, "callee").get;
849
+ return B(arguments, "callee").get;
803
850
  } catch {
804
- return i;
851
+ return ye;
805
852
  }
806
853
  }
807
- }() : i, p = Mt()(), u = Object.getPrototypeOf || function(j) {
808
- return j.__proto__;
809
- }, y = {}, v = typeof Uint8Array > "u" ? e : u(Uint8Array), d = {
810
- "%AggregateError%": typeof AggregateError > "u" ? e : AggregateError,
854
+ }() : ye, $ = Je()(), _ = ir(), vt = Ye(), Et = ze(), je = Ke(), H = be(), F = {}, _t = typeof Uint8Array > "u" || !_ ? t : _(Uint8Array),
855
+ j = {
856
+ __proto__: null,
857
+ "%AggregateError%": typeof AggregateError > "u" ? t : AggregateError,
811
858
  "%Array%": Array,
812
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? e : ArrayBuffer,
813
- "%ArrayIteratorPrototype%": p ? u([][Symbol.iterator]()) : e,
814
- "%AsyncFromSyncIteratorPrototype%": e,
815
- "%AsyncFunction%": y,
816
- "%AsyncGenerator%": y,
817
- "%AsyncGeneratorFunction%": y,
818
- "%AsyncIteratorPrototype%": y,
819
- "%Atomics%": typeof Atomics > "u" ? e : Atomics,
820
- "%BigInt%": typeof BigInt > "u" ? e : BigInt,
859
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? t : ArrayBuffer,
860
+ "%ArrayIteratorPrototype%": $ && _ ? _([][Symbol.iterator]()) : t,
861
+ "%AsyncFromSyncIteratorPrototype%": t,
862
+ "%AsyncFunction%": F,
863
+ "%AsyncGenerator%": F,
864
+ "%AsyncGeneratorFunction%": F,
865
+ "%AsyncIteratorPrototype%": F,
866
+ "%Atomics%": typeof Atomics > "u" ? t : Atomics,
867
+ "%BigInt%": typeof BigInt > "u" ? t : BigInt,
868
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? t : BigInt64Array,
869
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? t : BigUint64Array,
821
870
  "%Boolean%": Boolean,
822
- "%DataView%": typeof DataView > "u" ? e : DataView,
871
+ "%DataView%": typeof DataView > "u" ? t : DataView,
823
872
  "%Date%": Date,
824
873
  "%decodeURI%": decodeURI,
825
874
  "%decodeURIComponent%": decodeURIComponent,
826
875
  "%encodeURI%": encodeURI,
827
876
  "%encodeURIComponent%": encodeURIComponent,
828
- "%Error%": Error,
877
+ "%Error%": o,
829
878
  "%eval%": eval,
830
- "%EvalError%": EvalError,
831
- "%Float32Array%": typeof Float32Array > "u" ? e : Float32Array,
832
- "%Float64Array%": typeof Float64Array > "u" ? e : Float64Array,
833
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? e : FinalizationRegistry,
834
- "%Function%": o,
835
- "%GeneratorFunction%": y,
836
- "%Int8Array%": typeof Int8Array > "u" ? e : Int8Array,
837
- "%Int16Array%": typeof Int16Array > "u" ? e : Int16Array,
838
- "%Int32Array%": typeof Int32Array > "u" ? e : Int32Array,
879
+ // eslint-disable-line no-eval
880
+ "%EvalError%": p,
881
+ "%Float16Array%": typeof Float16Array > "u" ? t : Float16Array,
882
+ "%Float32Array%": typeof Float32Array > "u" ? t : Float32Array,
883
+ "%Float64Array%": typeof Float64Array > "u" ? t : Float64Array,
884
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? t : FinalizationRegistry,
885
+ "%Function%": D,
886
+ "%GeneratorFunction%": F,
887
+ "%Int8Array%": typeof Int8Array > "u" ? t : Int8Array,
888
+ "%Int16Array%": typeof Int16Array > "u" ? t : Int16Array,
889
+ "%Int32Array%": typeof Int32Array > "u" ? t : Int32Array,
839
890
  "%isFinite%": isFinite,
840
891
  "%isNaN%": isNaN,
841
- "%IteratorPrototype%": p ? u(u([][Symbol.iterator]())) : e,
842
- "%JSON%": typeof JSON == "object" ? JSON : e,
843
- "%Map%": typeof Map > "u" ? e : Map,
844
- "%MapIteratorPrototype%": typeof Map > "u" || !p ? e : u((/* @__PURE__ */ new Map())[Symbol.iterator]()),
892
+ "%IteratorPrototype%": $ && _ ? _(_([][Symbol.iterator]())) : t,
893
+ "%JSON%": typeof JSON == "object" ? JSON : t,
894
+ "%Map%": typeof Map > "u" ? t : Map,
895
+ "%MapIteratorPrototype%": typeof Map > "u" || !$ || !_ ? t : _((/* @__PURE__ */ new Map())[Symbol.iterator]()),
845
896
  "%Math%": Math,
846
897
  "%Number%": Number,
847
- "%Object%": Object,
898
+ "%Object%": n,
899
+ "%Object.getOwnPropertyDescriptor%": B,
848
900
  "%parseFloat%": parseFloat,
849
901
  "%parseInt%": parseInt,
850
- "%Promise%": typeof Promise > "u" ? e : Promise,
851
- "%Proxy%": typeof Proxy > "u" ? e : Proxy,
852
- "%RangeError%": RangeError,
853
- "%ReferenceError%": ReferenceError,
854
- "%Reflect%": typeof Reflect > "u" ? e : Reflect,
902
+ "%Promise%": typeof Promise > "u" ? t : Promise,
903
+ "%Proxy%": typeof Proxy > "u" ? t : Proxy,
904
+ "%RangeError%": a,
905
+ "%ReferenceError%": c,
906
+ "%Reflect%": typeof Reflect > "u" ? t : Reflect,
855
907
  "%RegExp%": RegExp,
856
- "%Set%": typeof Set > "u" ? e : Set,
857
- "%SetIteratorPrototype%": typeof Set > "u" || !p ? e : u((/* @__PURE__ */ new Set())[Symbol.iterator]()),
858
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? e : SharedArrayBuffer,
908
+ "%Set%": typeof Set > "u" ? t : Set,
909
+ "%SetIteratorPrototype%": typeof Set > "u" || !$ || !_ ? t : _((/* @__PURE__ */ new Set())[Symbol.iterator]()),
910
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? t : SharedArrayBuffer,
859
911
  "%String%": String,
860
- "%StringIteratorPrototype%": p ? u(""[Symbol.iterator]()) : e,
861
- "%Symbol%": p ? Symbol : e,
862
- "%SyntaxError%": n,
863
- "%ThrowTypeError%": g,
864
- "%TypedArray%": v,
865
- "%TypeError%": s,
866
- "%Uint8Array%": typeof Uint8Array > "u" ? e : Uint8Array,
867
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? e : Uint8ClampedArray,
868
- "%Uint16Array%": typeof Uint16Array > "u" ? e : Uint16Array,
869
- "%Uint32Array%": typeof Uint32Array > "u" ? e : Uint32Array,
870
- "%URIError%": URIError,
871
- "%WeakMap%": typeof WeakMap > "u" ? e : WeakMap,
872
- "%WeakRef%": typeof WeakRef > "u" ? e : WeakRef,
873
- "%WeakSet%": typeof WeakSet > "u" ? e : WeakSet
874
- }, m = /* @__PURE__ */ a(function j(b) {
875
- var A;
876
- if (b === "%AsyncFunction%")
877
- A = l("async function () {}");
878
- else if (b === "%GeneratorFunction%")
879
- A = l("function* () {}");
880
- else if (b === "%AsyncGeneratorFunction%")
881
- A = l("async function* () {}");
882
- else if (b === "%AsyncGenerator%") {
883
- var _ = j("%AsyncGeneratorFunction%");
884
- _ && (A = _.prototype);
885
- } else if (b === "%AsyncIteratorPrototype%") {
886
- var w = j("%AsyncGenerator%");
887
- w && (A = u(w.prototype));
912
+ "%StringIteratorPrototype%": $ && _ ? _(""[Symbol.iterator]()) : t,
913
+ "%Symbol%": $ ? Symbol : t,
914
+ "%SyntaxError%": i,
915
+ "%ThrowTypeError%": mt,
916
+ "%TypedArray%": _t,
917
+ "%TypeError%": u,
918
+ "%Uint8Array%": typeof Uint8Array > "u" ? t : Uint8Array,
919
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? t : Uint8ClampedArray,
920
+ "%Uint16Array%": typeof Uint16Array > "u" ? t : Uint16Array,
921
+ "%Uint32Array%": typeof Uint32Array > "u" ? t : Uint32Array,
922
+ "%URIError%": y,
923
+ "%WeakMap%": typeof WeakMap > "u" ? t : WeakMap,
924
+ "%WeakRef%": typeof WeakRef > "u" ? t : WeakRef,
925
+ "%WeakSet%": typeof WeakSet > "u" ? t : WeakSet,
926
+ "%Function.prototype.call%": H,
927
+ "%Function.prototype.apply%": je,
928
+ "%Object.defineProperty%": gt,
929
+ "%Object.getPrototypeOf%": vt,
930
+ "%Math.abs%": f,
931
+ "%Math.floor%": h,
932
+ "%Math.max%": m,
933
+ "%Math.min%": g,
934
+ "%Math.pow%": N,
935
+ "%Math.round%": P,
936
+ "%Math.sign%": x,
937
+ "%Reflect.getPrototypeOf%": Et
938
+ };
939
+ if (_)
940
+ try {
941
+ null.error;
942
+ } catch (O) {
943
+ Le = _(_(O)), j["%Error.prototype%"] = Le;
944
+ }
945
+ var Le, bt = /* @__PURE__ */ s(function O(v) {
946
+ var b;
947
+ if (v === "%AsyncFunction%")
948
+ b = R("async function () {}");
949
+ else if (v === "%GeneratorFunction%")
950
+ b = R("function* () {}");
951
+ else if (v === "%AsyncGeneratorFunction%")
952
+ b = R("async function* () {}");
953
+ else if (v === "%AsyncGenerator%") {
954
+ var E = O("%AsyncGeneratorFunction%");
955
+ E && (b = E.prototype);
956
+ } else if (v === "%AsyncIteratorPrototype%") {
957
+ var T = O("%AsyncGenerator%");
958
+ T && _ && (b = _(T.prototype));
888
959
  }
889
- return d[b] = A, A;
890
- }, "doEval2"), E = {
960
+ return j[v] = b, b;
961
+ }, "doEval2"), De = {
962
+ __proto__: null,
891
963
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
892
964
  "%ArrayPrototype%": ["Array", "prototype"],
893
965
  "%ArrayProto_entries%": ["Array", "prototype", "entries"],
@@ -939,255 +1011,256 @@ on]";
939
1011
  "%URIErrorPrototype%": ["URIError", "prototype"],
940
1012
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
941
1013
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
942
- }, I = gt(), T = we(), R = I.call(Function.call, Array.prototype.concat), C = I.call(Function.apply, Array.prototype.splice), N = I.call(
943
- Function.call, String.prototype.replace), Q = I.call(Function.call, String.prototype.slice), ee = I.call(Function.call, RegExp.prototype.
944
- exec), re = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ne = /\\(\\)?/g, oe = /* @__PURE__ */ a(
945
- function(b) {
946
- var A = Q(b, 0, 1), _ = Q(b, -1);
947
- if (A === "%" && _ !== "%")
948
- throw new n("invalid intrinsic syntax, expected closing `%`");
949
- if (_ === "%" && A !== "%")
950
- throw new n("invalid intrinsic syntax, expected opening `%`");
951
- var w = [];
952
- return N(b, re, function(L, M, O, Z) {
953
- w[w.length] = O ? N(Z, ne, "$1") : M || L;
954
- }), w;
955
- }, "stringToPath3"), ie = /* @__PURE__ */ a(function(b, A) {
956
- var _ = b, w;
957
- if (T(E, _) && (w = E[_], _ = "%" + w[0] + "%"), T(d, _)) {
958
- var L = d[_];
959
- if (L === y && (L = m(_)), typeof L > "u" && !A)
960
- throw new s("intrinsic " + b + " exists, but is not available. Please file an issue!");
1014
+ }, V = ce(), te = Qe(), St = V.call(H, Array.prototype.concat), Tt = V.call(je, Array.prototype.splice), $e = V.call(H, String.prototype.
1015
+ replace), re = V.call(H, String.prototype.slice), At = V.call(H, RegExp.prototype.exec), xt = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
1016
+ wt = /\\(\\)?/g, Pt = /* @__PURE__ */ s(function(v) {
1017
+ var b = re(v, 0, 1), E = re(v, -1);
1018
+ if (b === "%" && E !== "%")
1019
+ throw new i("invalid intrinsic syntax, expected closing `%`");
1020
+ if (E === "%" && b !== "%")
1021
+ throw new i("invalid intrinsic syntax, expected opening `%`");
1022
+ var T = [];
1023
+ return $e(v, xt, function(C, M, A, ne) {
1024
+ T[T.length] = A ? $e(ne, wt, "$1") : M || C;
1025
+ }), T;
1026
+ }, "stringToPath3"), Ot = /* @__PURE__ */ s(function(v, b) {
1027
+ var E = v, T;
1028
+ if (te(De, E) && (T = De[E], E = "%" + T[0] + "%"), te(j, E)) {
1029
+ var C = j[E];
1030
+ if (C === F && (C = bt(E)), typeof C > "u" && !b)
1031
+ throw new u("intrinsic " + v + " exists, but is not available. Please file an issue!");
961
1032
  return {
962
- alias: w,
963
- name: _,
964
- value: L
1033
+ alias: T,
1034
+ name: E,
1035
+ value: C
965
1036
  };
966
1037
  }
967
- throw new n("intrinsic " + b + " does not exist!");
1038
+ throw new i("intrinsic " + v + " does not exist!");
968
1039
  }, "getBaseIntrinsic2");
969
- t.exports = /* @__PURE__ */ a(function(b, A) {
970
- if (typeof b != "string" || b.length === 0)
971
- throw new s("intrinsic name must be a non-empty string");
972
- if (arguments.length > 1 && typeof A != "boolean")
973
- throw new s('"allowMissing" argument must be a boolean');
974
- if (ee(/^%?[^%]*%?$/, b) === null)
975
- throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
976
- var _ = oe(b), w = _.length > 0 ? _[0] : "", L = ie("%" + w + "%", A), M = L.name, O = L.value, Z = !1, pt = L.alias;
977
- pt && (w = pt[0], C(_, R([0, 1], pt)));
978
- for (var tt = 1, z = !0; tt < _.length; tt += 1) {
979
- var D = _[tt], et = Q(D, 0, 1), rt = Q(D, -1);
980
- if ((et === '"' || et === "'" || et === "`" || rt === '"' || rt === "'" || rt === "`") && et !== rt)
981
- throw new n("property names with quotes must have matching quotes");
982
- if ((D === "constructor" || !z) && (Z = !0), w += "." + D, M = "%" + w + "%", T(d, M))
983
- O = d[M];
984
- else if (O != null) {
985
- if (!(D in O)) {
986
- if (!A)
987
- throw new s("base intrinsic for " + b + " exists, but the property is not available.");
1040
+ e.exports = /* @__PURE__ */ s(function(v, b) {
1041
+ if (typeof v != "string" || v.length === 0)
1042
+ throw new u("intrinsic name must be a non-empty string");
1043
+ if (arguments.length > 1 && typeof b != "boolean")
1044
+ throw new u('"allowMissing" argument must be a boolean');
1045
+ if (At(/^%?[^%]*%?$/, v) === null)
1046
+ throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1047
+ var E = Pt(v), T = E.length > 0 ? E[0] : "", C = Ot("%" + T + "%", b), M = C.name, A = C.value, ne = !1, he = C.alias;
1048
+ he && (T = he[0], Tt(E, St([0, 1], he)));
1049
+ for (var oe = 1, J = !0; oe < E.length; oe += 1) {
1050
+ var I = E[oe], se = re(I, 0, 1), ie = re(I, -1);
1051
+ if ((se === '"' || se === "'" || se === "`" || ie === '"' || ie === "'" || ie === "`") && se !== ie)
1052
+ throw new i("property names with quotes must have matching quotes");
1053
+ if ((I === "constructor" || !J) && (ne = !0), T += "." + I, M = "%" + T + "%", te(j, M))
1054
+ A = j[M];
1055
+ else if (A != null) {
1056
+ if (!(I in A)) {
1057
+ if (!b)
1058
+ throw new u("base intrinsic for " + v + " exists, but the property is not available.");
988
1059
  return;
989
1060
  }
990
- if (c && tt + 1 >= _.length) {
991
- var nt = c(O, D);
992
- z = !!nt, z && "get" in nt && !("originalValue" in nt.get) ? O = nt.get : O = O[D];
1061
+ if (B && oe + 1 >= E.length) {
1062
+ var ae = B(A, I);
1063
+ J = !!ae, J && "get" in ae && !("originalValue" in ae.get) ? A = ae.get : A = A[I];
993
1064
  } else
994
- z = T(O, D), O = O[D];
995
- z && !Z && (d[M] = O);
1065
+ J = te(A, I), A = A[I];
1066
+ J && !ne && (j[M] = A);
996
1067
  }
997
1068
  }
998
- return O;
1069
+ return A;
999
1070
  }, "GetIntrinsic");
1000
1071
  }
1001
- }), Oe = P({
1002
- "node_modules/call-bind/index.js"(r, t) {
1003
- "use strict";
1004
- var e = gt(), n = $t(), o = n("%Function.prototype.apply%"), s = n("%Function.prototype.call%"), l = n("%Reflect.apply%", !0) || e.call(
1005
- s, o), c = n("%Object.getOwnPropertyDescriptor%", !0), i = n("%Object.defineProperty%", !0), g = n("%Math.max%");
1006
- if (i)
1007
- try {
1008
- i({}, "a", { value: 1 });
1009
- } catch {
1010
- i = null;
1011
- }
1012
- t.exports = /* @__PURE__ */ a(function(y) {
1013
- var v = l(e, s, arguments);
1014
- if (c && i) {
1015
- var d = c(v, "length");
1016
- d.configurable && i(
1017
- v,
1018
- "length",
1019
- { value: 1 + g(0, y.length - (arguments.length - 1)) }
1020
- );
1021
- }
1022
- return v;
1023
- }, "callBind");
1024
- var p = /* @__PURE__ */ a(function() {
1025
- return l(e, o, arguments);
1026
- }, "applyBind2");
1027
- i ? i(t.exports, "apply", { value: p }) : t.exports.apply = p;
1028
- }
1029
- }), Ce = P({
1030
- "node_modules/call-bind/callBound.js"(r, t) {
1072
+ }), Se = d({
1073
+ "node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(r, e) {
1031
1074
  "use strict";
1032
- var e = $t(), n = Oe(), o = n(e("String.prototype.indexOf"));
1033
- t.exports = /* @__PURE__ */ a(function(l, c) {
1034
- var i = e(l, !!c);
1035
- return typeof i == "function" && o(l, ".prototype.") > -1 ? n(i) : i;
1075
+ var t = ar(), n = Xe(), o = n([t("%String.prototype.indexOf%")]);
1076
+ e.exports = /* @__PURE__ */ s(function(a, c) {
1077
+ var i = (
1078
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1079
+ t(a, !!c)
1080
+ );
1081
+ return typeof i == "function" && o(a, ".prototype.") > -1 ? n(
1082
+ /** @type {const} */
1083
+ [i]
1084
+ ) : i;
1036
1085
  }, "callBoundIntrinsic");
1037
1086
  }
1038
- }), Pe = P({
1039
- "node_modules/has-tostringtag/shams.js"(r, t) {
1087
+ }), pr = d({
1088
+ "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(r, e) {
1040
1089
  "use strict";
1041
- var e = Ft();
1042
- t.exports = /* @__PURE__ */ a(function() {
1043
- return e() && !!Symbol.toStringTag;
1090
+ var t = Ve();
1091
+ e.exports = /* @__PURE__ */ s(function() {
1092
+ return t() && !!Symbol.toStringTag;
1044
1093
  }, "hasToStringTagShams");
1045
1094
  }
1046
- }), Ie = P({
1047
- "node_modules/is-regex/index.js"(r, t) {
1095
+ }), Ze = d({
1096
+ "node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js"(r, e) {
1048
1097
  "use strict";
1049
- var e = Ce(), n = Pe()(), o, s, l, c;
1050
- n && (o = e("Object.prototype.hasOwnProperty"), s = e("RegExp.prototype.exec"), l = {}, i = /* @__PURE__ */ a(function() {
1051
- throw l;
1052
- }, "throwRegexMarker"), c = {
1053
- toString: i,
1054
- valueOf: i
1055
- }, typeof Symbol.toPrimitive == "symbol" && (c[Symbol.toPrimitive] = i));
1056
- var i, g = e("Object.prototype.toString"), p = Object.getOwnPropertyDescriptor, u = "[object RegExp]";
1057
- t.exports = /* @__PURE__ */ a(n ? function(v) {
1058
- if (!v || typeof v != "object")
1098
+ var t = Se(), n = pr()(), o = Qe(), p = _e(), a;
1099
+ n ? (c = t("RegExp.prototype.exec"), i = {}, u = /* @__PURE__ */ s(function() {
1100
+ throw i;
1101
+ }, "throwRegexMarker"), y = {
1102
+ toString: u,
1103
+ valueOf: u
1104
+ }, typeof Symbol.toPrimitive == "symbol" && (y[Symbol.toPrimitive] = u), a = /* @__PURE__ */ s(function(g) {
1105
+ if (!g || typeof g != "object")
1059
1106
  return !1;
1060
- var d = p(v, "lastIndex"), m = d && o(d, "value");
1061
- if (!m)
1107
+ var N = (
1108
+ /** @type {NonNullable<typeof gOPD>} */
1109
+ p(
1110
+ /** @type {{ lastIndex?: unknown }} */
1111
+ g,
1112
+ "lastIndex"
1113
+ )
1114
+ ), P = N && o(N, "value");
1115
+ if (!P)
1062
1116
  return !1;
1063
1117
  try {
1064
- s(v, c);
1065
- } catch (E) {
1066
- return E === l;
1118
+ c(
1119
+ g,
1120
+ /** @type {string} */
1121
+ /** @type {unknown} */
1122
+ y
1123
+ );
1124
+ } catch (x) {
1125
+ return x === i;
1067
1126
  }
1068
- } : function(v) {
1069
- return !v || typeof v != "object" && typeof v != "function" ? !1 : g(v) === u;
1070
- }, "isRegex");
1071
- }
1072
- }), xe = P({
1073
- "node_modules/is-function/index.js"(r, t) {
1074
- t.exports = n;
1075
- var e = Object.prototype.toString;
1127
+ }, "isRegex")) : (f = t("Object.prototype.toString"), h = "[object RegExp]", a = /* @__PURE__ */ s(function(g) {
1128
+ return !g || typeof g != "object" && typeof g != "function" ? !1 : f(g) === h;
1129
+ }, "isRegex"));
1130
+ var c, i, u, y, f, h;
1131
+ e.exports = a;
1132
+ }
1133
+ }), cr = d({
1134
+ "node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js"(r, e) {
1135
+ e.exports = n;
1136
+ var t = Object.prototype.toString;
1076
1137
  function n(o) {
1077
1138
  if (!o)
1078
1139
  return !1;
1079
- var s = e.call(o);
1080
- return s === "[object Function]" || typeof o == "function" && s !== "[object RegExp]" || typeof window < "u" && (o === window.setTimeout ||
1081
- o === window.alert || o === window.confirm || o === window.prompt);
1140
+ var p = t.call(o);
1141
+ return p === "[object Function]" || typeof o == "function" && p !== "[object RegExp]" || typeof window < "u" && // IE8 and below
1142
+ (o === window.setTimeout || o === window.alert || o === window.confirm || o === window.prompt);
1082
1143
  }
1083
- a(n, "isFunction3");
1144
+ s(n, "isFunction3");
1084
1145
  }
1085
- }), Re = P({
1086
- "node_modules/is-symbol/index.js"(r, t) {
1146
+ }), lr = d({
1147
+ "node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js"(r, e) {
1087
1148
  "use strict";
1088
- var e = Object.prototype.toString, n = Mt()();
1089
- n ? (o = Symbol.prototype.toString, s = /^Symbol\(.*\)$/, l = /* @__PURE__ */ a(function(i) {
1090
- return typeof i.valueOf() != "symbol" ? !1 : s.test(o.call(i));
1091
- }, "isRealSymbolObject"), t.exports = /* @__PURE__ */ a(function(i) {
1092
- if (typeof i == "symbol")
1149
+ var t = Se(), n = Ze(), o = t("RegExp.prototype.exec"), p = Ee();
1150
+ e.exports = /* @__PURE__ */ s(function(c) {
1151
+ if (!n(c))
1152
+ throw new p("`regex` must be a RegExp");
1153
+ return /* @__PURE__ */ s(function(u) {
1154
+ return o(c, u) !== null;
1155
+ }, "test");
1156
+ }, "regexTester");
1157
+ }
1158
+ }), ur = d({
1159
+ "node_modules/.pnpm/is-symbol@1.1.1/node_modules/is-symbol/index.js"(r, e) {
1160
+ "use strict";
1161
+ var t = Se(), n = t("Object.prototype.toString"), o = Je()(), p = lr();
1162
+ o ? (a = t("Symbol.prototype.toString"), c = p(/^Symbol\(.*\)$/), i = /* @__PURE__ */ s(function(y) {
1163
+ return typeof y.valueOf() != "symbol" ? !1 : c(a(y));
1164
+ }, "isRealSymbolObject"), e.exports = /* @__PURE__ */ s(function(y) {
1165
+ if (typeof y == "symbol")
1093
1166
  return !0;
1094
- if (e.call(i) !== "[object Symbol]")
1167
+ if (!y || typeof y != "object" || n(y) !== "[object Symbol]")
1095
1168
  return !1;
1096
1169
  try {
1097
- return l(i);
1170
+ return i(y);
1098
1171
  } catch {
1099
1172
  return !1;
1100
1173
  }
1101
- }, "isSymbol3")) : t.exports = /* @__PURE__ */ a(function(i) {
1174
+ }, "isSymbol3")) : e.exports = /* @__PURE__ */ s(function(y) {
1102
1175
  return !1;
1103
1176
  }, "isSymbol3");
1104
- var o, s, l;
1177
+ var a, c, i;
1105
1178
  }
1106
- }), Ne = ot(Ie()), je = ot(xe()), Le = ot(Re());
1107
- function De(r) {
1179
+ }), fr = pe(Ze()), dr = pe(cr()), yr = pe(ur());
1180
+ function hr(r) {
1108
1181
  return r != null && typeof r == "object" && Array.isArray(r) === !1;
1109
1182
  }
1110
- a(De, "isObject");
1111
- var Fe = typeof global == "object" && global && global.Object === Object && global, Me = Fe, $e = typeof self == "object" && self && self.Object ===
1112
- Object && self, Ue = Me || $e || Function("return this")(), vt = Ue, ke = vt.Symbol, U = ke, Ut = Object.prototype, Ge = Ut.hasOwnProperty, We = Ut.
1113
- toString, q = U ? U.toStringTag : void 0;
1114
- function ze(r) {
1115
- var t = Ge.call(r, q), e = r[q];
1183
+ s(hr, "isObject");
1184
+ var gr = typeof global == "object" && global && global.Object === Object && global, mr = gr, vr = typeof self == "object" && self && self.Object ===
1185
+ Object && self, Er = mr || vr || Function("return this")(), Te = Er, _r = Te.Symbol, G = _r, et = Object.prototype, br = et.hasOwnProperty, Sr = et.
1186
+ toString, Y = G ? G.toStringTag : void 0;
1187
+ function Tr(r) {
1188
+ var e = br.call(r, Y), t = r[Y];
1116
1189
  try {
1117
- r[q] = void 0;
1190
+ r[Y] = void 0;
1118
1191
  var n = !0;
1119
1192
  } catch {
1120
1193
  }
1121
- var o = We.call(r);
1122
- return n && (t ? r[q] = e : delete r[q]), o;
1194
+ var o = Sr.call(r);
1195
+ return n && (e ? r[Y] = t : delete r[Y]), o;
1123
1196
  }
1124
- a(ze, "getRawTag");
1125
- var He = ze, Be = Object.prototype, qe = Be.toString;
1126
- function Ve(r) {
1127
- return qe.call(r);
1197
+ s(Tr, "getRawTag");
1198
+ var Ar = Tr, xr = Object.prototype, wr = xr.toString;
1199
+ function Pr(r) {
1200
+ return wr.call(r);
1128
1201
  }
1129
- a(Ve, "objectToString");
1130
- var Je = Ve, Ke = "[object Null]", Ye = "[object Undefined]", Rt = U ? U.toStringTag : void 0;
1131
- function Xe(r) {
1132
- return r == null ? r === void 0 ? Ye : Ke : Rt && Rt in Object(r) ? He(r) : Je(r);
1202
+ s(Pr, "objectToString");
1203
+ var Or = Pr, Cr = "[object Null]", Nr = "[object Undefined]", Ge = G ? G.toStringTag : void 0;
1204
+ function Ir(r) {
1205
+ return r == null ? r === void 0 ? Nr : Cr : Ge && Ge in Object(r) ? Ar(r) : Or(r);
1133
1206
  }
1134
- a(Xe, "baseGetTag");
1135
- var kt = Xe;
1136
- function Qe(r) {
1207
+ s(Ir, "baseGetTag");
1208
+ var tt = Ir;
1209
+ function Rr(r) {
1137
1210
  return r != null && typeof r == "object";
1138
1211
  }
1139
- a(Qe, "isObjectLike");
1140
- var Ze = Qe, tr = "[object Symbol]";
1141
- function er(r) {
1142
- return typeof r == "symbol" || Ze(r) && kt(r) == tr;
1212
+ s(Rr, "isObjectLike");
1213
+ var jr = Rr, Lr = "[object Symbol]";
1214
+ function Dr(r) {
1215
+ return typeof r == "symbol" || jr(r) && tt(r) == Lr;
1143
1216
  }
1144
- a(er, "isSymbol");
1145
- var mt = er;
1146
- function rr(r, t) {
1147
- for (var e = -1, n = r == null ? 0 : r.length, o = Array(n); ++e < n; )
1148
- o[e] = t(r[e], e, r);
1217
+ s(Dr, "isSymbol");
1218
+ var Ae = Dr;
1219
+ function $r(r, e) {
1220
+ for (var t = -1, n = r == null ? 0 : r.length, o = Array(n); ++t < n; )
1221
+ o[t] = e(r[t], t, r);
1149
1222
  return o;
1150
1223
  }
1151
- a(rr, "arrayMap");
1152
- var nr = rr, or = Array.isArray, Et = or, ir = 1 / 0, Nt = U ? U.prototype : void 0, jt = Nt ? Nt.toString : void 0;
1153
- function Gt(r) {
1224
+ s($r, "arrayMap");
1225
+ var Fr = $r, Mr = Array.isArray, xe = Mr, Ur = 1 / 0, ke = G ? G.prototype : void 0, We = ke ? ke.toString : void 0;
1226
+ function rt(r) {
1154
1227
  if (typeof r == "string")
1155
1228
  return r;
1156
- if (Et(r))
1157
- return nr(r, Gt) + "";
1158
- if (mt(r))
1159
- return jt ? jt.call(r) : "";
1160
- var t = r + "";
1161
- return t == "0" && 1 / r == -ir ? "-0" : t;
1229
+ if (xe(r))
1230
+ return Fr(r, rt) + "";
1231
+ if (Ae(r))
1232
+ return We ? We.call(r) : "";
1233
+ var e = r + "";
1234
+ return e == "0" && 1 / r == -Ur ? "-0" : e;
1162
1235
  }
1163
- a(Gt, "baseToString");
1164
- var ar = Gt;
1165
- function sr(r) {
1166
- var t = typeof r;
1167
- return r != null && (t == "object" || t == "function");
1236
+ s(rt, "baseToString");
1237
+ var Gr = rt;
1238
+ function kr(r) {
1239
+ var e = typeof r;
1240
+ return r != null && (e == "object" || e == "function");
1168
1241
  }
1169
- a(sr, "isObject2");
1170
- var Wt = sr, lr = "[object AsyncFunction]", cr = "[object Function]", pr = "[object GeneratorFunction]", ur = "[object Proxy]";
1171
- function fr(r) {
1172
- if (!Wt(r))
1242
+ s(kr, "isObject2");
1243
+ var nt = kr, Wr = "[object AsyncFunction]", qr = "[object Function]", Br = "[object GeneratorFunction]", Hr = "[object Proxy]";
1244
+ function Vr(r) {
1245
+ if (!nt(r))
1173
1246
  return !1;
1174
- var t = kt(r);
1175
- return t == cr || t == pr || t == lr || t == ur;
1247
+ var e = tt(r);
1248
+ return e == qr || e == Br || e == Wr || e == Hr;
1176
1249
  }
1177
- a(fr, "isFunction");
1178
- var hr = fr, yr = vt["__core-js_shared__"], dt = yr, Lt = function() {
1179
- var r = /[^.]+$/.exec(dt && dt.keys && dt.keys.IE_PROTO || "");
1250
+ s(Vr, "isFunction");
1251
+ var Jr = Vr, zr = Te["__core-js_shared__"], ve = zr, qe = function() {
1252
+ var r = /[^.]+$/.exec(ve && ve.keys && ve.keys.IE_PROTO || "");
1180
1253
  return r ? "Symbol(src)_1." + r : "";
1181
1254
  }();
1182
- function dr(r) {
1183
- return !!Lt && Lt in r;
1255
+ function Yr(r) {
1256
+ return !!qe && qe in r;
1184
1257
  }
1185
- a(dr, "isMasked");
1186
- var gr = dr, vr = Function.prototype, mr = vr.toString;
1187
- function Er(r) {
1258
+ s(Yr, "isMasked");
1259
+ var Kr = Yr, Xr = Function.prototype, Qr = Xr.toString;
1260
+ function Zr(r) {
1188
1261
  if (r != null) {
1189
1262
  try {
1190
- return mr.call(r);
1263
+ return Qr.call(r);
1191
1264
  } catch {
1192
1265
  }
1193
1266
  try {
@@ -1197,343 +1270,317 @@ function Er(r) {
1197
1270
  }
1198
1271
  return "";
1199
1272
  }
1200
- a(Er, "toSource");
1201
- var br = Er, Sr = /[\\^$.*+?()[\]{}|]/g, _r = /^\[object .+?Constructor\]$/, Tr = Function.prototype, Ar = Object.prototype, wr = Tr.toString,
1202
- Or = Ar.hasOwnProperty, Cr = RegExp(
1203
- "^" + wr.call(Or).replace(Sr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1273
+ s(Zr, "toSource");
1274
+ var en = Zr, tn = /[\\^$.*+?()[\]{}|]/g, rn = /^\[object .+?Constructor\]$/, nn = Function.prototype, on = Object.prototype, sn = nn.toString,
1275
+ an = on.hasOwnProperty, pn = RegExp(
1276
+ "^" + sn.call(an).replace(tn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1204
1277
  );
1205
- function Pr(r) {
1206
- if (!Wt(r) || gr(r))
1278
+ function cn(r) {
1279
+ if (!nt(r) || Kr(r))
1207
1280
  return !1;
1208
- var t = hr(r) ? Cr : _r;
1209
- return t.test(br(r));
1281
+ var e = Jr(r) ? pn : rn;
1282
+ return e.test(en(r));
1210
1283
  }
1211
- a(Pr, "baseIsNative");
1212
- var Ir = Pr;
1213
- function xr(r, t) {
1214
- return r?.[t];
1284
+ s(cn, "baseIsNative");
1285
+ var ln = cn;
1286
+ function un(r, e) {
1287
+ return r?.[e];
1215
1288
  }
1216
- a(xr, "getValue");
1217
- var Rr = xr;
1218
- function Nr(r, t) {
1219
- var e = Rr(r, t);
1220
- return Ir(e) ? e : void 0;
1289
+ s(un, "getValue");
1290
+ var fn = un;
1291
+ function dn(r, e) {
1292
+ var t = fn(r, e);
1293
+ return ln(t) ? t : void 0;
1221
1294
  }
1222
- a(Nr, "getNative");
1223
- var zt = Nr;
1224
- function jr(r, t) {
1225
- return r === t || r !== r && t !== t;
1295
+ s(dn, "getNative");
1296
+ var ot = dn;
1297
+ function yn(r, e) {
1298
+ return r === e || r !== r && e !== e;
1226
1299
  }
1227
- a(jr, "eq");
1228
- var Lr = jr, Dr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Fr = /^\w*$/;
1229
- function Mr(r, t) {
1230
- if (Et(r))
1300
+ s(yn, "eq");
1301
+ var hn = yn, gn = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, mn = /^\w*$/;
1302
+ function vn(r, e) {
1303
+ if (xe(r))
1231
1304
  return !1;
1232
- var e = typeof r;
1233
- return e == "number" || e == "symbol" || e == "boolean" || r == null || mt(r) ? !0 : Fr.test(r) || !Dr.test(r) || t != null && r in Object(
1234
- t);
1305
+ var t = typeof r;
1306
+ return t == "number" || t == "symbol" || t == "boolean" || r == null || Ae(r) ? !0 : mn.test(r) || !gn.test(r) || e != null && r in Object(
1307
+ e);
1235
1308
  }
1236
- a(Mr, "isKey");
1237
- var $r = Mr, Ur = zt(Object, "create"), V = Ur;
1238
- function kr() {
1239
- this.__data__ = V ? V(null) : {}, this.size = 0;
1309
+ s(vn, "isKey");
1310
+ var En = vn, _n = ot(Object, "create"), K = _n;
1311
+ function bn() {
1312
+ this.__data__ = K ? K(null) : {}, this.size = 0;
1240
1313
  }
1241
- a(kr, "hashClear");
1242
- var Gr = kr;
1243
- function Wr(r) {
1244
- var t = this.has(r) && delete this.__data__[r];
1245
- return this.size -= t ? 1 : 0, t;
1314
+ s(bn, "hashClear");
1315
+ var Sn = bn;
1316
+ function Tn(r) {
1317
+ var e = this.has(r) && delete this.__data__[r];
1318
+ return this.size -= e ? 1 : 0, e;
1246
1319
  }
1247
- a(Wr, "hashDelete");
1248
- var zr = Wr, Hr = "__lodash_hash_undefined__", Br = Object.prototype, qr = Br.hasOwnProperty;
1249
- function Vr(r) {
1250
- var t = this.__data__;
1251
- if (V) {
1252
- var e = t[r];
1253
- return e === Hr ? void 0 : e;
1320
+ s(Tn, "hashDelete");
1321
+ var An = Tn, xn = "__lodash_hash_undefined__", wn = Object.prototype, Pn = wn.hasOwnProperty;
1322
+ function On(r) {
1323
+ var e = this.__data__;
1324
+ if (K) {
1325
+ var t = e[r];
1326
+ return t === xn ? void 0 : t;
1254
1327
  }
1255
- return qr.call(t, r) ? t[r] : void 0;
1256
- }
1257
- a(Vr, "hashGet");
1258
- var Jr = Vr, Kr = Object.prototype, Yr = Kr.hasOwnProperty;
1259
- function Xr(r) {
1260
- var t = this.__data__;
1261
- return V ? t[r] !== void 0 : Yr.call(t, r);
1328
+ return Pn.call(e, r) ? e[r] : void 0;
1262
1329
  }
1263
- a(Xr, "hashHas");
1264
- var Qr = Xr, Zr = "__lodash_hash_undefined__";
1265
- function tn(r, t) {
1330
+ s(On, "hashGet");
1331
+ var Cn = On, Nn = Object.prototype, In = Nn.hasOwnProperty;
1332
+ function Rn(r) {
1266
1333
  var e = this.__data__;
1267
- return this.size += this.has(r) ? 0 : 1, e[r] = V && t === void 0 ? Zr : t, this;
1334
+ return K ? e[r] !== void 0 : In.call(e, r);
1268
1335
  }
1269
- a(tn, "hashSet");
1270
- var en = tn;
1336
+ s(Rn, "hashHas");
1337
+ var jn = Rn, Ln = "__lodash_hash_undefined__";
1338
+ function Dn(r, e) {
1339
+ var t = this.__data__;
1340
+ return this.size += this.has(r) ? 0 : 1, t[r] = K && e === void 0 ? Ln : e, this;
1341
+ }
1342
+ s(Dn, "hashSet");
1343
+ var $n = Dn;
1271
1344
  function k(r) {
1272
- var t = -1, e = r == null ? 0 : r.length;
1273
- for (this.clear(); ++t < e; ) {
1274
- var n = r[t];
1345
+ var e = -1, t = r == null ? 0 : r.length;
1346
+ for (this.clear(); ++e < t; ) {
1347
+ var n = r[e];
1275
1348
  this.set(n[0], n[1]);
1276
1349
  }
1277
1350
  }
1278
- a(k, "Hash");
1279
- k.prototype.clear = Gr;
1280
- k.prototype.delete = zr;
1281
- k.prototype.get = Jr;
1282
- k.prototype.has = Qr;
1283
- k.prototype.set = en;
1284
- var Dt = k;
1285
- function rn() {
1351
+ s(k, "Hash");
1352
+ k.prototype.clear = Sn;
1353
+ k.prototype.delete = An;
1354
+ k.prototype.get = Cn;
1355
+ k.prototype.has = jn;
1356
+ k.prototype.set = $n;
1357
+ var Be = k;
1358
+ function Fn() {
1286
1359
  this.__data__ = [], this.size = 0;
1287
1360
  }
1288
- a(rn, "listCacheClear");
1289
- var nn = rn;
1290
- function on(r, t) {
1291
- for (var e = r.length; e--; )
1292
- if (Lr(r[e][0], t))
1293
- return e;
1361
+ s(Fn, "listCacheClear");
1362
+ var Mn = Fn;
1363
+ function Un(r, e) {
1364
+ for (var t = r.length; t--; )
1365
+ if (hn(r[t][0], e))
1366
+ return t;
1294
1367
  return -1;
1295
1368
  }
1296
- a(on, "assocIndexOf");
1297
- var at = on, an = Array.prototype, sn = an.splice;
1298
- function ln(r) {
1299
- var t = this.__data__, e = at(t, r);
1300
- if (e < 0)
1369
+ s(Un, "assocIndexOf");
1370
+ var le = Un, Gn = Array.prototype, kn = Gn.splice;
1371
+ function Wn(r) {
1372
+ var e = this.__data__, t = le(e, r);
1373
+ if (t < 0)
1301
1374
  return !1;
1302
- var n = t.length - 1;
1303
- return e == n ? t.pop() : sn.call(t, e, 1), --this.size, !0;
1375
+ var n = e.length - 1;
1376
+ return t == n ? e.pop() : kn.call(e, t, 1), --this.size, !0;
1304
1377
  }
1305
- a(ln, "listCacheDelete");
1306
- var cn = ln;
1307
- function pn(r) {
1308
- var t = this.__data__, e = at(t, r);
1309
- return e < 0 ? void 0 : t[e][1];
1378
+ s(Wn, "listCacheDelete");
1379
+ var qn = Wn;
1380
+ function Bn(r) {
1381
+ var e = this.__data__, t = le(e, r);
1382
+ return t < 0 ? void 0 : e[t][1];
1310
1383
  }
1311
- a(pn, "listCacheGet");
1312
- var un = pn;
1313
- function fn(r) {
1314
- return at(this.__data__, r) > -1;
1384
+ s(Bn, "listCacheGet");
1385
+ var Hn = Bn;
1386
+ function Vn(r) {
1387
+ return le(this.__data__, r) > -1;
1315
1388
  }
1316
- a(fn, "listCacheHas");
1317
- var hn = fn;
1318
- function yn(r, t) {
1319
- var e = this.__data__, n = at(e, r);
1320
- return n < 0 ? (++this.size, e.push([r, t])) : e[n][1] = t, this;
1389
+ s(Vn, "listCacheHas");
1390
+ var Jn = Vn;
1391
+ function zn(r, e) {
1392
+ var t = this.__data__, n = le(t, r);
1393
+ return n < 0 ? (++this.size, t.push([r, e])) : t[n][1] = e, this;
1321
1394
  }
1322
- a(yn, "listCacheSet");
1323
- var dn = yn;
1324
- function G(r) {
1325
- var t = -1, e = r == null ? 0 : r.length;
1326
- for (this.clear(); ++t < e; ) {
1327
- var n = r[t];
1395
+ s(zn, "listCacheSet");
1396
+ var Yn = zn;
1397
+ function W(r) {
1398
+ var e = -1, t = r == null ? 0 : r.length;
1399
+ for (this.clear(); ++e < t; ) {
1400
+ var n = r[e];
1328
1401
  this.set(n[0], n[1]);
1329
1402
  }
1330
1403
  }
1331
- a(G, "ListCache");
1332
- G.prototype.clear = nn;
1333
- G.prototype.delete = cn;
1334
- G.prototype.get = un;
1335
- G.prototype.has = hn;
1336
- G.prototype.set = dn;
1337
- var gn = G, vn = zt(vt, "Map"), mn = vn;
1338
- function En() {
1404
+ s(W, "ListCache");
1405
+ W.prototype.clear = Mn;
1406
+ W.prototype.delete = qn;
1407
+ W.prototype.get = Hn;
1408
+ W.prototype.has = Jn;
1409
+ W.prototype.set = Yn;
1410
+ var Kn = W, Xn = ot(Te, "Map"), Qn = Xn;
1411
+ function Zn() {
1339
1412
  this.size = 0, this.__data__ = {
1340
- hash: new Dt(),
1341
- map: new (mn || gn)(),
1342
- string: new Dt()
1413
+ hash: new Be(),
1414
+ map: new (Qn || Kn)(),
1415
+ string: new Be()
1343
1416
  };
1344
1417
  }
1345
- a(En, "mapCacheClear");
1346
- var bn = En;
1347
- function Sn(r) {
1348
- var t = typeof r;
1349
- return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? r !== "__proto__" : r === null;
1418
+ s(Zn, "mapCacheClear");
1419
+ var eo = Zn;
1420
+ function to(r) {
1421
+ var e = typeof r;
1422
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? r !== "__proto__" : r === null;
1350
1423
  }
1351
- a(Sn, "isKeyable");
1352
- var _n = Sn;
1353
- function Tn(r, t) {
1354
- var e = r.__data__;
1355
- return _n(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
1424
+ s(to, "isKeyable");
1425
+ var ro = to;
1426
+ function no(r, e) {
1427
+ var t = r.__data__;
1428
+ return ro(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
1356
1429
  }
1357
- a(Tn, "getMapData");
1358
- var st = Tn;
1359
- function An(r) {
1360
- var t = st(this, r).delete(r);
1361
- return this.size -= t ? 1 : 0, t;
1430
+ s(no, "getMapData");
1431
+ var ue = no;
1432
+ function oo(r) {
1433
+ var e = ue(this, r).delete(r);
1434
+ return this.size -= e ? 1 : 0, e;
1362
1435
  }
1363
- a(An, "mapCacheDelete");
1364
- var wn = An;
1365
- function On(r) {
1366
- return st(this, r).get(r);
1436
+ s(oo, "mapCacheDelete");
1437
+ var so = oo;
1438
+ function io(r) {
1439
+ return ue(this, r).get(r);
1367
1440
  }
1368
- a(On, "mapCacheGet");
1369
- var Cn = On;
1370
- function Pn(r) {
1371
- return st(this, r).has(r);
1441
+ s(io, "mapCacheGet");
1442
+ var ao = io;
1443
+ function po(r) {
1444
+ return ue(this, r).has(r);
1372
1445
  }
1373
- a(Pn, "mapCacheHas");
1374
- var In = Pn;
1375
- function xn(r, t) {
1376
- var e = st(this, r), n = e.size;
1377
- return e.set(r, t), this.size += e.size == n ? 0 : 1, this;
1446
+ s(po, "mapCacheHas");
1447
+ var co = po;
1448
+ function lo(r, e) {
1449
+ var t = ue(this, r), n = t.size;
1450
+ return t.set(r, e), this.size += t.size == n ? 0 : 1, this;
1378
1451
  }
1379
- a(xn, "mapCacheSet");
1380
- var Rn = xn;
1381
- function W(r) {
1382
- var t = -1, e = r == null ? 0 : r.length;
1383
- for (this.clear(); ++t < e; ) {
1384
- var n = r[t];
1452
+ s(lo, "mapCacheSet");
1453
+ var uo = lo;
1454
+ function q(r) {
1455
+ var e = -1, t = r == null ? 0 : r.length;
1456
+ for (this.clear(); ++e < t; ) {
1457
+ var n = r[e];
1385
1458
  this.set(n[0], n[1]);
1386
1459
  }
1387
1460
  }
1388
- a(W, "MapCache");
1389
- W.prototype.clear = bn;
1390
- W.prototype.delete = wn;
1391
- W.prototype.get = Cn;
1392
- W.prototype.has = In;
1393
- W.prototype.set = Rn;
1394
- var Ht = W, Nn = "Expected a function";
1395
- function bt(r, t) {
1396
- if (typeof r != "function" || t != null && typeof t != "function")
1397
- throw new TypeError(Nn);
1398
- var e = /* @__PURE__ */ a(function() {
1399
- var n = arguments, o = t ? t.apply(this, n) : n[0], s = e.cache;
1400
- if (s.has(o))
1401
- return s.get(o);
1402
- var l = r.apply(this, n);
1403
- return e.cache = s.set(o, l) || s, l;
1461
+ s(q, "MapCache");
1462
+ q.prototype.clear = eo;
1463
+ q.prototype.delete = so;
1464
+ q.prototype.get = ao;
1465
+ q.prototype.has = co;
1466
+ q.prototype.set = uo;
1467
+ var st = q, fo = "Expected a function";
1468
+ function we(r, e) {
1469
+ if (typeof r != "function" || e != null && typeof e != "function")
1470
+ throw new TypeError(fo);
1471
+ var t = /* @__PURE__ */ s(function() {
1472
+ var n = arguments, o = e ? e.apply(this, n) : n[0], p = t.cache;
1473
+ if (p.has(o))
1474
+ return p.get(o);
1475
+ var a = r.apply(this, n);
1476
+ return t.cache = p.set(o, a) || p, a;
1404
1477
  }, "memoized");
1405
- return e.cache = new (bt.Cache || Ht)(), e;
1478
+ return t.cache = new (we.Cache || st)(), t;
1406
1479
  }
1407
- a(bt, "memoize");
1408
- bt.Cache = Ht;
1409
- var jn = bt, Ln = 500;
1410
- function Dn(r) {
1411
- var t = jn(r, function(n) {
1412
- return e.size === Ln && e.clear(), n;
1413
- }), e = t.cache;
1414
- return t;
1480
+ s(we, "memoize");
1481
+ we.Cache = st;
1482
+ var yo = we, ho = 500;
1483
+ function go(r) {
1484
+ var e = yo(r, function(n) {
1485
+ return t.size === ho && t.clear(), n;
1486
+ }), t = e.cache;
1487
+ return e;
1415
1488
  }
1416
- a(Dn, "memoizeCapped");
1417
- var Fn = Dn, Mn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, $n = /\\(\\)?/g, Un = Fn(
1489
+ s(go, "memoizeCapped");
1490
+ var mo = go, vo = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Eo = /\\(\\)?/g, _o = mo(
1418
1491
  function(r) {
1419
- var t = [];
1420
- return r.charCodeAt(0) === 46 && t.push(""), r.replace(Mn, function(e, n, o, s) {
1421
- t.push(o ? s.replace($n, "$1") : n || e);
1422
- }), t;
1423
- }), kn = Un;
1424
- function Gn(r) {
1425
- return r == null ? "" : ar(r);
1492
+ var e = [];
1493
+ return r.charCodeAt(0) === 46 && e.push(""), r.replace(vo, function(t, n, o, p) {
1494
+ e.push(o ? p.replace(Eo, "$1") : n || t);
1495
+ }), e;
1496
+ }), bo = _o;
1497
+ function So(r) {
1498
+ return r == null ? "" : Gr(r);
1426
1499
  }
1427
- a(Gn, "toString");
1428
- var Wn = Gn;
1429
- function zn(r, t) {
1430
- return Et(r) ? r : $r(r, t) ? [r] : kn(Wn(r));
1500
+ s(So, "toString");
1501
+ var To = So;
1502
+ function Ao(r, e) {
1503
+ return xe(r) ? r : En(r, e) ? [r] : bo(To(r));
1431
1504
  }
1432
- a(zn, "castPath");
1433
- var Hn = zn, Bn = 1 / 0;
1434
- function qn(r) {
1435
- if (typeof r == "string" || mt(r))
1505
+ s(Ao, "castPath");
1506
+ var xo = Ao, wo = 1 / 0;
1507
+ function Po(r) {
1508
+ if (typeof r == "string" || Ae(r))
1436
1509
  return r;
1437
- var t = r + "";
1438
- return t == "0" && 1 / r == -Bn ? "-0" : t;
1510
+ var e = r + "";
1511
+ return e == "0" && 1 / r == -wo ? "-0" : e;
1439
1512
  }
1440
- a(qn, "toKey");
1441
- var Vn = qn;
1442
- function Jn(r, t) {
1443
- t = Hn(t, r);
1444
- for (var e = 0, n = t.length; r != null && e < n; )
1445
- r = r[Vn(t[e++])];
1446
- return e && e == n ? r : void 0;
1513
+ s(Po, "toKey");
1514
+ var Oo = Po;
1515
+ function Co(r, e) {
1516
+ e = xo(e, r);
1517
+ for (var t = 0, n = e.length; r != null && t < n; )
1518
+ r = r[Oo(e[t++])];
1519
+ return t && t == n ? r : void 0;
1447
1520
  }
1448
- a(Jn, "baseGet");
1449
- var Kn = Jn;
1450
- function Yn(r, t, e) {
1451
- var n = r == null ? void 0 : Kn(r, t);
1452
- return n === void 0 ? e : n;
1521
+ s(Co, "baseGet");
1522
+ var No = Co;
1523
+ function Io(r, e, t) {
1524
+ var n = r == null ? void 0 : No(r, e);
1525
+ return n === void 0 ? t : n;
1453
1526
  }
1454
- a(Yn, "get");
1455
- var Xn = Yn, it = De, Qn = /* @__PURE__ */ a((r) => {
1456
- let t = null, e = !1, n = !1, o = !1, s = "";
1457
- if (r.indexOf("//") >= 0 || r.indexOf("/*") >= 0)
1458
- for (let l = 0; l < r.length; l += 1)
1459
- !t && !e && !n && !o ? r[l] === '"' || r[l] === "'" || r[l] === "`" ? t = r[l] : r[l] === "/" && r[l + 1] === "*" ? e = !0 : r[l] === "\
1460
- /" && r[l + 1] === "/" ? n = !0 : r[l] === "/" && r[l + 1] !== "/" && (o = !0) : (t && (r[l] === t && r[l - 1] !== "\\" || r[l] === `
1461
- ` && t !== "`") && (t = null), o && (r[l] === "/" && r[l - 1] !== "\\" || r[l] === `
1462
- `) && (o = !1), e && r[l - 1] === "/" && r[l - 2] === "*" && (e = !1), n && r[l] === `
1463
- ` && (n = !1)), !e && !n && (s += r[l]);
1464
- else
1465
- s = r;
1466
- return s;
1467
- }, "removeCodeComments"), Zn = (0, Bt.default)(1e4)(
1468
- (r) => Qn(r).replace(/\n\s*/g, "").trim()
1469
- ), to = /* @__PURE__ */ a(function(t, e) {
1470
- let n = e.slice(0, e.indexOf("{")), o = e.slice(e.indexOf("{"));
1471
- if (n.includes("=>") || n.includes("function"))
1472
- return e;
1473
- let s = n;
1474
- return s = s.replace(t, "function"), s + o;
1475
- }, "convertShorthandMethods2"), eo = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, J = /* @__PURE__ */ a((r) => r.match(/^[\[\{\"\}].*[\]\}\"]$/),
1527
+ s(Io, "get");
1528
+ var Ro = Io, Pe = hr, jo = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, X = /* @__PURE__ */ s((r) => r.match(/^[\[\{\"\}].*[\]\}\"]$/),
1476
1529
  "isJSON");
1477
- function qt(r) {
1478
- if (!it(r))
1530
+ function it(r) {
1531
+ if (!Pe(r))
1479
1532
  return r;
1480
- let t = r, e = !1;
1481
- return typeof Event < "u" && r instanceof Event && (t = Pt(t), e = !0), t = Object.keys(t).reduce((n, o) => {
1533
+ let e = r, t = !1;
1534
+ return typeof Event < "u" && r instanceof Event && (e = Ue(e), t = !0), e = Object.keys(e).reduce((n, o) => {
1482
1535
  try {
1483
- t[o] && t[o].toJSON, n[o] = t[o];
1536
+ e[o] && e[o].toJSON, n[o] = e[o];
1484
1537
  } catch {
1485
- e = !0;
1538
+ t = !0;
1486
1539
  }
1487
1540
  return n;
1488
- }, {}), e ? t : r;
1541
+ }, {}), t ? e : r;
1489
1542
  }
1490
- a(qt, "convertUnconventionalData");
1491
- var ro = /* @__PURE__ */ a(function(t) {
1492
- let e, n, o, s;
1493
- return /* @__PURE__ */ a(function(c, i) {
1543
+ s(it, "convertUnconventionalData");
1544
+ var Lo = /* @__PURE__ */ s(function(e) {
1545
+ let t, n, o, p;
1546
+ return /* @__PURE__ */ s(function(c, i) {
1494
1547
  try {
1495
1548
  if (c === "")
1496
- return s = [], e = /* @__PURE__ */ new Map([[i, "[]"]]), n = /* @__PURE__ */ new Map(), o = [], i;
1497
- let g = n.get(this) || this;
1498
- for (; o.length && g !== o[0]; )
1499
- o.shift(), s.pop();
1549
+ return p = [], t = /* @__PURE__ */ new Map([[i, "[]"]]), n = /* @__PURE__ */ new Map(), o = [], i;
1550
+ let u = n.get(this) || this;
1551
+ for (; o.length && u !== o[0]; )
1552
+ o.shift(), p.pop();
1500
1553
  if (typeof i == "boolean")
1501
1554
  return i;
1502
1555
  if (i === void 0)
1503
- return t.allowUndefined ? "_undefined_" : void 0;
1556
+ return e.allowUndefined ? "_undefined_" : void 0;
1504
1557
  if (i === null)
1505
1558
  return null;
1506
1559
  if (typeof i == "number")
1507
- return i === -1 / 0 ? "_-Infinity_" : i === 1 / 0 ? "_Infinity_" : Number.isNaN(i) ? "_NaN_" : i;
1560
+ return i === Number.NEGATIVE_INFINITY ? "_-Infinity_" : i === Number.POSITIVE_INFINITY ? "_Infinity_" : Number.isNaN(i) ? "_NaN_" : i;
1508
1561
  if (typeof i == "bigint")
1509
1562
  return `_bigint_${i.toString()}`;
1510
1563
  if (typeof i == "string")
1511
- return eo.test(i) ? t.allowDate ? `_date_${i}` : void 0 : i;
1512
- if ((0, Ne.default)(i))
1513
- return t.allowRegExp ? `_regexp_${i.flags}|${i.source}` : void 0;
1514
- if ((0, je.default)(i)) {
1515
- if (!t.allowFunction)
1516
- return;
1517
- let { name: u } = i, y = i.toString();
1518
- return y.match(
1519
- /(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/
1520
- ) ? `_function_${u}|${(() => {
1521
- }).toString()}` : `_function_${u}|${Zn(to(c, y))}`;
1522
- }
1523
- if ((0, Le.default)(i)) {
1524
- if (!t.allowSymbol)
1564
+ return jo.test(i) ? e.allowDate ? `_date_${i}` : void 0 : i;
1565
+ if ((0, fr.default)(i))
1566
+ return e.allowRegExp ? `_regexp_${i.flags}|${i.source}` : void 0;
1567
+ if ((0, dr.default)(i))
1568
+ return;
1569
+ if ((0, yr.default)(i)) {
1570
+ if (!e.allowSymbol)
1525
1571
  return;
1526
- let u = Symbol.keyFor(i);
1527
- return u !== void 0 ? `_gsymbol_${u}` : `_symbol_${i.toString().slice(7, -1)}`;
1572
+ let f = Symbol.keyFor(i);
1573
+ return f !== void 0 ? `_gsymbol_${f}` : `_symbol_${i.toString().slice(7, -1)}`;
1528
1574
  }
1529
- if (o.length >= t.maxDepth)
1575
+ if (o.length >= e.maxDepth)
1530
1576
  return Array.isArray(i) ? `[Array(${i.length})]` : "[Object]";
1531
1577
  if (i === this)
1532
- return `_duplicate_${JSON.stringify(s)}`;
1533
- if (i instanceof Error && t.allowError)
1578
+ return `_duplicate_${JSON.stringify(p)}`;
1579
+ if (i instanceof Error && e.allowError)
1534
1580
  return {
1535
1581
  __isConvertedError__: !0,
1536
1582
  errorProperties: {
1583
+ // @ts-expect-error cause is not defined in the current tsconfig target(es2020)
1537
1584
  ...i.cause ? { cause: i.cause } : {},
1538
1585
  ...i,
1539
1586
  name: i.name,
@@ -1542,152 +1589,140 @@ var ro = /* @__PURE__ */ a(function(t) {
1542
1589
  "_constructor-name_": i.constructor.name
1543
1590
  }
1544
1591
  };
1545
- if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && !t.allowClass)
1546
- return;
1547
- let p = e.get(i);
1548
- if (!p) {
1549
- let u = Array.isArray(i) ? i : qt(i);
1550
- if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && t.allowClass)
1551
- try {
1552
- Object.assign(u, { "_constructor-name_": i.constructor.name });
1553
- } catch {
1554
- }
1555
- return s.push(c), o.unshift(u), e.set(i, JSON.stringify(s)), i !== u && n.set(i, u), u;
1592
+ if (i?.constructor?.name && i.constructor.name !== "Object" && !Array.isArray(i)) {
1593
+ let f = t.get(i);
1594
+ if (!f) {
1595
+ let h = {
1596
+ __isClassInstance__: !0,
1597
+ __className__: i.constructor.name,
1598
+ ...Object.getOwnPropertyNames(i).reduce(
1599
+ (m, g) => {
1600
+ try {
1601
+ m[g] = i[g];
1602
+ } catch {
1603
+ }
1604
+ return m;
1605
+ },
1606
+ {}
1607
+ )
1608
+ };
1609
+ return p.push(c), o.unshift(h), t.set(i, JSON.stringify(p)), i !== h && n.set(i, h), h;
1610
+ }
1611
+ return `_duplicate_${f}`;
1556
1612
  }
1557
- return `_duplicate_${p}`;
1613
+ let y = t.get(i);
1614
+ if (!y) {
1615
+ let f = Array.isArray(i) ? i : it(i);
1616
+ return p.push(c), o.unshift(f), t.set(i, JSON.stringify(p)), i !== f && n.set(i, f), f;
1617
+ }
1618
+ return `_duplicate_${y}`;
1558
1619
  } catch {
1559
1620
  return;
1560
1621
  }
1561
1622
  }, "replace");
1562
- }, "replacer2"), no = /* @__PURE__ */ a(function reviver(options) {
1563
- let refs = [], root;
1564
- return /* @__PURE__ */ a(function revive(key, value) {
1565
- if (key === "" && (root = value, refs.forEach(({ target: r, container: t, replacement: e }) => {
1566
- let n = J(e) ? JSON.parse(e) : e.split(".");
1567
- n.length === 0 ? t[r] = root : t[r] = Xn(root, n);
1568
- })), key === "_constructor-name_")
1569
- return value;
1570
- if (it(value) && value.__isConvertedError__) {
1571
- let { message: r, ...t } = value.errorProperties, e = new Error(r);
1572
- return Object.assign(e, t), e;
1573
- }
1574
- if (it(value) && value["_constructor-name_"] && options.allowFunction) {
1575
- let r = value["_constructor-name_"];
1576
- if (r !== "Object") {
1577
- let t = new Function(`return function ${r.replace(/[^a-zA-Z0-9$_]+/g, "")}(){}`)();
1578
- Object.setPrototypeOf(value, new t());
1579
- }
1580
- return delete value["_constructor-name_"], value;
1581
- }
1582
- if (typeof value == "string" && value.startsWith("_function_") && options.allowFunction) {
1583
- let [, name, source] = value.match(/_function_([^|]*)\|(.*)/) || [], sourceSanitized = source.replace(/[(\(\))|\\| |\]|`]*$/, "");
1584
- if (!options.lazyEval)
1585
- return eval(`(${sourceSanitized})`);
1586
- let result = /* @__PURE__ */ a((...args) => {
1587
- let f = eval(`(${sourceSanitized})`);
1588
- return f(...args);
1589
- }, "result");
1590
- return Object.defineProperty(result, "toString", {
1591
- value: /* @__PURE__ */ a(() => sourceSanitized, "value")
1592
- }), Object.defineProperty(result, "name", {
1593
- value: name
1594
- }), result;
1623
+ }, "replacer2"), Do = /* @__PURE__ */ s(function(e) {
1624
+ let t = [], n;
1625
+ return /* @__PURE__ */ s(function(p, a) {
1626
+ if (p === "" && (n = a, t.forEach(({ target: c, container: i, replacement: u }) => {
1627
+ let y = X(u) ? JSON.parse(u) : u.split(".");
1628
+ y.length === 0 ? i[c] = n : i[c] = Ro(n, y);
1629
+ })), p === "_constructor-name_")
1630
+ return a;
1631
+ if (Pe(a) && a.__isConvertedError__) {
1632
+ let { message: c, ...i } = a.errorProperties, u = new Error(c);
1633
+ return Object.assign(u, i), u;
1595
1634
  }
1596
- if (typeof value == "string" && value.startsWith("_regexp_") && options.allowRegExp) {
1597
- let [, r, t] = value.match(/_regexp_([^|]*)\|(.*)/) || [];
1598
- return new RegExp(t, r);
1635
+ if (typeof a == "string" && a.startsWith("_regexp_") && e.allowRegExp) {
1636
+ let [, c, i] = a.match(/_regexp_([^|]*)\|(.*)/) || [];
1637
+ return new RegExp(i, c);
1599
1638
  }
1600
- return typeof value == "string" && value.startsWith("_date_") && options.allowDate ? new Date(value.replace("_date_", "")) : typeof value ==
1601
- "string" && value.startsWith("_duplicate_") ? (refs.push({ target: key, container: this, replacement: value.replace(/^_duplicate_/, "") }),
1602
- null) : typeof value == "string" && value.startsWith("_symbol_") && options.allowSymbol ? Symbol(value.replace("_symbol_", "")) : typeof value ==
1603
- "string" && value.startsWith("_gsymbol_") && options.allowSymbol ? Symbol.for(value.replace("_gsymbol_", "")) : typeof value == "string" &&
1604
- value === "_-Infinity_" ? -1 / 0 : typeof value == "string" && value === "_Infinity_" ? 1 / 0 : typeof value == "string" && value === "_\
1605
- NaN_" ? NaN : typeof value == "string" && value.startsWith("_bigint_") && typeof BigInt == "function" ? BigInt(value.replace("_bigint_", "")) :
1606
- value;
1639
+ return typeof a == "string" && a.startsWith("_date_") && e.allowDate ? new Date(a.replace("_date_", "")) : typeof a == "string" && a.startsWith(
1640
+ "_duplicate_") ? (t.push({ target: p, container: this, replacement: a.replace(/^_duplicate_/, "") }), null) : typeof a == "string" && a.
1641
+ startsWith("_symbol_") && e.allowSymbol ? Symbol(a.replace("_symbol_", "")) : typeof a == "string" && a.startsWith("_gsymbol_") && e.allowSymbol ?
1642
+ Symbol.for(a.replace("_gsymbol_", "")) : typeof a == "string" && a === "_-Infinity_" ? Number.NEGATIVE_INFINITY : typeof a == "string" &&
1643
+ a === "_Infinity_" ? Number.POSITIVE_INFINITY : typeof a == "string" && a === "_NaN_" ? Number.NaN : typeof a == "string" && a.startsWith(
1644
+ "_bigint_") && typeof BigInt == "function" ? BigInt(a.replace("_bigint_", "")) : a;
1607
1645
  }, "revive");
1608
- }, "reviver"), Vt = {
1646
+ }, "reviver2"), at = {
1609
1647
  maxDepth: 10,
1610
1648
  space: void 0,
1611
- allowFunction: !0,
1612
1649
  allowRegExp: !0,
1613
1650
  allowDate: !0,
1614
- allowClass: !0,
1615
1651
  allowError: !0,
1616
1652
  allowUndefined: !0,
1617
- allowSymbol: !0,
1618
- lazyEval: !0
1619
- }, lt = /* @__PURE__ */ a((r, t = {}) => {
1620
- let e = { ...Vt, ...t };
1621
- return JSON.stringify(qt(r), ro(e), t.space);
1622
- }, "stringify"), oo = /* @__PURE__ */ a(() => {
1653
+ allowSymbol: !0
1654
+ }, fe = /* @__PURE__ */ s((r, e = {}) => {
1655
+ let t = { ...at, ...e };
1656
+ return JSON.stringify(it(r), Lo(t), e.space);
1657
+ }, "stringify"), $o = /* @__PURE__ */ s(() => {
1623
1658
  let r = /* @__PURE__ */ new Map();
1624
- return /* @__PURE__ */ a(function t(e) {
1625
- it(e) && Object.entries(e).forEach(([n, o]) => {
1626
- o === "_undefined_" ? e[n] = void 0 : r.get(o) || (r.set(o, !0), t(o));
1627
- }), Array.isArray(e) && e.forEach((n, o) => {
1628
- n === "_undefined_" ? (r.set(n, !0), e[o] = void 0) : r.get(n) || (r.set(n, !0), t(n));
1659
+ return /* @__PURE__ */ s(function e(t) {
1660
+ Pe(t) && Object.entries(t).forEach(([n, o]) => {
1661
+ o === "_undefined_" ? t[n] = void 0 : r.get(o) || (r.set(o, !0), e(o));
1662
+ }), Array.isArray(t) && t.forEach((n, o) => {
1663
+ n === "_undefined_" ? (r.set(n, !0), t[o] = void 0) : r.get(n) || (r.set(n, !0), e(n));
1629
1664
  });
1630
1665
  }, "mutateUndefined");
1631
- }, "mutator"), ct = /* @__PURE__ */ a((r, t = {}) => {
1632
- let e = { ...Vt, ...t }, n = JSON.parse(r, no(e));
1633
- return oo()(n), n;
1666
+ }, "mutator"), de = /* @__PURE__ */ s((r, e = {}) => {
1667
+ let t = { ...at, ...e }, n = JSON.parse(r, Do(t));
1668
+ return $o()(n), n;
1634
1669
  }, "parse");
1635
1670
 
1636
1671
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
1637
- var io = !1, St = "Invariant failed";
1638
- function K(r, t) {
1672
+ var Fo = !1, Oe = "Invariant failed";
1673
+ function Q(r, e) {
1639
1674
  if (!r) {
1640
- if (io)
1641
- throw new Error(St);
1642
- var e = typeof t == "function" ? t() : t, n = e ? "".concat(St, ": ").concat(e) : St;
1675
+ if (Fo)
1676
+ throw new Error(Oe);
1677
+ var t = typeof e == "function" ? e() : e, n = t ? "".concat(Oe, ": ").concat(t) : Oe;
1643
1678
  throw new Error(n);
1644
1679
  }
1645
1680
  }
1646
- a(K, "invariant");
1681
+ s(Q, "invariant");
1647
1682
 
1648
1683
  // src/channels/postmessage/getEventSourceUrl.ts
1649
- import { logger as ao } from "storybook/internal/client-logger";
1650
- var Jt = /* @__PURE__ */ a((r) => {
1651
- let t = Array.from(
1684
+ import { logger as Mo } from "storybook/internal/client-logger";
1685
+ var pt = /* @__PURE__ */ s((r) => {
1686
+ let e = Array.from(
1652
1687
  document.querySelectorAll("iframe[data-is-storybook]")
1653
- ), [e, ...n] = t.filter((s) => {
1688
+ ), [t, ...n] = e.filter((p) => {
1654
1689
  try {
1655
- return s.contentWindow?.location.origin === r.source.location.origin && s.contentWindow?.location.pathname === r.source.location.pathname;
1690
+ return p.contentWindow?.location.origin === r.source.location.origin && p.contentWindow?.location.pathname === r.source.location.pathname;
1656
1691
  } catch {
1657
1692
  }
1658
1693
  try {
1659
- return s.contentWindow === r.source;
1694
+ return p.contentWindow === r.source;
1660
1695
  } catch {
1661
1696
  }
1662
- let l = s.getAttribute("src"), c;
1697
+ let a = p.getAttribute("src"), c;
1663
1698
  try {
1664
- if (!l)
1699
+ if (!a)
1665
1700
  return !1;
1666
- ({ origin: c } = new URL(l, document.location.toString()));
1701
+ ({ origin: c } = new URL(a, document.location.toString()));
1667
1702
  } catch {
1668
1703
  return !1;
1669
1704
  }
1670
1705
  return c === r.origin;
1671
- }), o = e?.getAttribute("src");
1706
+ }), o = t?.getAttribute("src");
1672
1707
  if (o && n.length === 0) {
1673
- let { protocol: s, host: l, pathname: c } = new URL(o, document.location.toString());
1674
- return `${s}//${l}${c}`;
1708
+ let { protocol: p, host: a, pathname: c } = new URL(o, document.location.toString());
1709
+ return `${p}//${a}${c}`;
1675
1710
  }
1676
- return n.length > 0 && ao.error("found multiple candidates for event source"), null;
1711
+ return n.length > 0 && Mo.error("found multiple candidates for event source"), null;
1677
1712
  }, "getEventSourceUrl");
1678
1713
 
1679
1714
  // src/channels/postmessage/index.ts
1680
- var { document: _t, location: Tt } = S, Xt = "storybook-channel", lo = { allowFunction: !1, maxDepth: 25 }, At = class At {
1681
- constructor(t) {
1682
- this.config = t;
1715
+ var { document: Ce, location: Ne } = S, ut = "storybook-channel", Go = { maxDepth: 25 }, Ie = class Ie {
1716
+ constructor(e) {
1717
+ this.config = e;
1683
1718
  this.connected = !1;
1684
- if (this.buffer = [], typeof S?.addEventListener == "function" && S.addEventListener("message", this.handleEvent.bind(this), !1), t.page !==
1685
- "manager" && t.page !== "preview")
1686
- throw new Error(`postmsg-channel: "config.page" cannot be "${t.page}"`);
1719
+ if (this.buffer = [], typeof S?.addEventListener == "function" && S.addEventListener("message", this.handleEvent.bind(this), !1), e.page !==
1720
+ "manager" && e.page !== "preview")
1721
+ throw new Error(`postmsg-channel: "config.page" cannot be "${e.page}"`);
1687
1722
  }
1688
- setHandler(t) {
1689
- this.handler = (...e) => {
1690
- t.apply(this, e), !this.connected && this.getLocalFrame().length && (this.flush(), this.connected = !0);
1723
+ setHandler(e) {
1724
+ this.handler = (...t) => {
1725
+ e.apply(this, t), !this.connected && this.getLocalFrame().length && (this.flush(), this.connected = !0);
1691
1726
  };
1692
1727
  }
1693
1728
  /**
@@ -1696,68 +1731,62 @@ var { document: _t, location: Tt } = S, Xt = "storybook-channel", lo = { allowFu
1696
1731
  *
1697
1732
  * @param event
1698
1733
  */
1699
- send(t, e) {
1734
+ send(e, t) {
1700
1735
  let {
1701
1736
  target: n,
1702
1737
  // telejson options
1703
1738
  allowRegExp: o,
1704
- allowFunction: s,
1705
- allowSymbol: l,
1706
- allowDate: c,
1707
- allowError: i,
1708
- allowUndefined: g,
1709
- allowClass: p,
1739
+ allowSymbol: p,
1740
+ allowDate: a,
1741
+ allowError: c,
1742
+ allowUndefined: i,
1710
1743
  maxDepth: u,
1711
- space: y,
1712
- lazyEval: v
1713
- } = e || {}, d = Object.fromEntries(
1744
+ space: y
1745
+ } = t || {}, f = Object.fromEntries(
1714
1746
  Object.entries({
1715
1747
  allowRegExp: o,
1716
- allowFunction: s,
1717
- allowSymbol: l,
1718
- allowDate: c,
1719
- allowError: i,
1720
- allowUndefined: g,
1721
- allowClass: p,
1748
+ allowSymbol: p,
1749
+ allowDate: a,
1750
+ allowError: c,
1751
+ allowUndefined: i,
1722
1752
  maxDepth: u,
1723
- space: y,
1724
- lazyEval: v
1725
- }).filter(([R, C]) => typeof C < "u")
1726
- ), m = {
1727
- ...lo,
1753
+ space: y
1754
+ }).filter(([P, x]) => typeof x < "u")
1755
+ ), h = {
1756
+ ...Go,
1728
1757
  ...S.CHANNEL_OPTIONS || {},
1729
- ...d
1730
- }, E = this.getFrames(n), I = new URLSearchParams(Tt?.search || ""), T = lt(
1758
+ ...f
1759
+ }, m = this.getFrames(n), g = new URLSearchParams(Ne?.search || ""), N = fe(
1731
1760
  {
1732
- key: Xt,
1733
- event: t,
1734
- refId: I.get("refId")
1761
+ key: ut,
1762
+ event: e,
1763
+ refId: g.get("refId")
1735
1764
  },
1736
- m
1765
+ h
1737
1766
  );
1738
- return E.length ? (this.buffer.length && this.flush(), E.forEach((R) => {
1767
+ return m.length ? (this.buffer.length && this.flush(), m.forEach((P) => {
1739
1768
  try {
1740
- R.postMessage(T, "*");
1769
+ P.postMessage(N, "*");
1741
1770
  } catch {
1742
- Kt.error("sending over postmessage fail");
1771
+ ct.error("sending over postmessage fail");
1743
1772
  }
1744
- }), Promise.resolve(null)) : new Promise((R, C) => {
1745
- this.buffer.push({ event: t, resolve: R, reject: C });
1773
+ }), Promise.resolve(null)) : new Promise((P, x) => {
1774
+ this.buffer.push({ event: e, resolve: P, reject: x });
1746
1775
  });
1747
1776
  }
1748
1777
  flush() {
1749
- let { buffer: t } = this;
1750
- this.buffer = [], t.forEach((e) => {
1751
- this.send(e.event).then(e.resolve).catch(e.reject);
1778
+ let { buffer: e } = this;
1779
+ this.buffer = [], e.forEach((t) => {
1780
+ this.send(t.event).then(t.resolve).catch(t.reject);
1752
1781
  });
1753
1782
  }
1754
- getFrames(t) {
1783
+ getFrames(e) {
1755
1784
  if (this.config.page === "manager") {
1756
1785
  let n = Array.from(
1757
- _t.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")
1786
+ Ce.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")
1758
1787
  ).flatMap((o) => {
1759
1788
  try {
1760
- return o.contentWindow && o.dataset.isStorybook !== void 0 && o.id === t ? [o.contentWindow] : [];
1789
+ return o.contentWindow && o.dataset.isStorybook !== void 0 && o.id === e ? [o.contentWindow] : [];
1761
1790
  } catch {
1762
1791
  return [];
1763
1792
  }
@@ -1768,60 +1797,61 @@ var { document: _t, location: Tt } = S, Xt = "storybook-channel", lo = { allowFu
1768
1797
  }
1769
1798
  getCurrentFrames() {
1770
1799
  return this.config.page === "manager" ? Array.from(
1771
- _t.querySelectorAll('[data-is-storybook="true"]')
1772
- ).flatMap((e) => e.contentWindow ? [e.contentWindow] : []) : S && S.parent ? [S.parent] : [];
1800
+ Ce.querySelectorAll('[data-is-storybook="true"]')
1801
+ ).flatMap((t) => t.contentWindow ? [t.contentWindow] : []) : S && S.parent ? [S.parent] : [];
1773
1802
  }
1774
1803
  getLocalFrame() {
1775
1804
  return this.config.page === "manager" ? Array.from(
1776
- _t.querySelectorAll("#storybook-preview-iframe")
1777
- ).flatMap((e) => e.contentWindow ? [e.contentWindow] : []) : S && S.parent ? [S.parent] : [];
1805
+ Ce.querySelectorAll("#storybook-preview-iframe")
1806
+ ).flatMap((t) => t.contentWindow ? [t.contentWindow] : []) : S && S.parent ? [S.parent] : [];
1778
1807
  }
1779
- handleEvent(t) {
1808
+ handleEvent(e) {
1780
1809
  try {
1781
- let { data: e } = t, { key: n, event: o, refId: s } = typeof e == "string" && J(e) ? ct(e, S.CHANNEL_OPTIONS || {}) : e;
1782
- if (n === Xt) {
1783
- let l = this.config.page === "manager" ? '<span style="color: #37D5D3; background: black"> manager </span>' : '<span style="color: #\
1784
- 1EA7FD; background: black"> preview </span>', c = Object.values(so).includes(o.type) ? `<span style="color: #FF4785">${o.type}</span>` : `<s\
1810
+ let { data: t } = e, { key: n, event: o, refId: p } = typeof t == "string" && X(t) ? de(t, S.CHANNEL_OPTIONS || {}) : t;
1811
+ if (n === ut) {
1812
+ let a = this.config.page === "manager" ? '<span style="color: #37D5D3; background: black"> manager </span>' : '<span style="color: #\
1813
+ 1EA7FD; background: black"> preview </span>', c = Object.values(Uo).includes(o.type) ? `<span style="color: #FF4785">${o.type}</span>` : `<s\
1785
1814
  pan style="color: #FFAE00">${o.type}</span>`;
1786
- if (s && (o.refId = s), o.source = this.config.page === "preview" ? t.origin : Jt(t), !o.source) {
1787
- Yt.error(
1788
- `${l} received ${c} but was unable to determine the source of the event`
1815
+ if (p && (o.refId = p), o.source = this.config.page === "preview" ? e.origin : pt(e), !o.source) {
1816
+ lt.error(
1817
+ `${a} received ${c} but was unable to determine the source of the event`
1789
1818
  );
1790
1819
  return;
1791
1820
  }
1792
- let i = `${l} received ${c} (${e.length})`;
1793
- Yt.debug(
1794
- Tt.origin !== o.source ? i : `${i} <span style="color: gray">(on ${Tt.origin} from ${o.source})</span>`,
1821
+ let i = `${a} received ${c} (${t.length})`;
1822
+ lt.debug(
1823
+ Ne.origin !== o.source ? i : `${i} <span style="color: gray">(on ${Ne.origin} from ${o.source})</span>`,
1795
1824
  ...o.args
1796
- ), K(this.handler, "ChannelHandler should be set"), this.handler(o);
1825
+ ), Q(this.handler, "ChannelHandler should be set"), this.handler(o);
1797
1826
  }
1798
- } catch (e) {
1799
- Kt.error(e);
1827
+ } catch (t) {
1828
+ ct.error(t);
1800
1829
  }
1801
1830
  }
1802
1831
  };
1803
- a(At, "PostMessageTransport");
1804
- var Y = At;
1832
+ s(Ie, "PostMessageTransport");
1833
+ var Z = Ie;
1805
1834
 
1806
1835
  // src/channels/websocket/index.ts
1807
- import * as Qt from "storybook/internal/core-events";
1808
- var { WebSocket: co } = S, Zt = 15e3, te = 5e3, wt = class wt {
1809
- constructor({ url: t, onError: e, page: n }) {
1836
+ import * as ft from "storybook/internal/core-events";
1837
+ import { global as dt } from "@storybook/global";
1838
+ var { WebSocket: ko } = dt, yt = 15e3, ht = 5e3, Re = class Re {
1839
+ constructor({ url: e, onError: t, page: n }) {
1810
1840
  this.buffer = [];
1811
1841
  this.isReady = !1;
1812
1842
  this.isClosed = !1;
1813
1843
  this.pingTimeout = 0;
1814
- this.socket = new co(t), this.socket.onopen = () => {
1844
+ this.socket = new ko(e), this.socket.onopen = () => {
1815
1845
  this.isReady = !0, this.heartbeat(), this.flush();
1816
1846
  }, this.socket.onmessage = ({ data: o }) => {
1817
- let s = typeof o == "string" && J(o) ? ct(o) : o;
1818
- K(this.handler, "WebsocketTransport handler should be set"), this.handler(s), s.type === "ping" && (this.heartbeat(), this.send({ type: "\
1847
+ let p = typeof o == "string" && X(o) ? de(o) : o;
1848
+ Q(this.handler, "WebsocketTransport handler should be set"), this.handler(p), p.type === "ping" && (this.heartbeat(), this.send({ type: "\
1819
1849
  pong" }));
1820
1850
  }, this.socket.onerror = (o) => {
1821
- e && e(o);
1851
+ t && t(o);
1822
1852
  }, this.socket.onclose = (o) => {
1823
- K(this.handler, "WebsocketTransport handler should be set"), this.handler({
1824
- type: Qt.CHANNEL_WS_DISCONNECT,
1853
+ Q(this.handler, "WebsocketTransport handler should be set"), this.handler({
1854
+ type: ft.CHANNEL_WS_DISCONNECT,
1825
1855
  args: [{ reason: o.reason, code: o.code }],
1826
1856
  from: n || "preview"
1827
1857
  }), this.isClosed = !0, clearTimeout(this.pingTimeout);
@@ -1830,56 +1860,55 @@ pong" }));
1830
1860
  heartbeat() {
1831
1861
  clearTimeout(this.pingTimeout), this.pingTimeout = setTimeout(() => {
1832
1862
  this.socket.close(3008, "timeout");
1833
- }, Zt + te);
1863
+ }, yt + ht);
1834
1864
  }
1835
- setHandler(t) {
1836
- this.handler = t;
1865
+ setHandler(e) {
1866
+ this.handler = e;
1837
1867
  }
1838
- send(t) {
1839
- this.isClosed || (this.isReady ? this.sendNow(t) : this.sendLater(t));
1868
+ send(e) {
1869
+ this.isClosed || (this.isReady ? this.sendNow(e) : this.sendLater(e));
1840
1870
  }
1841
- sendLater(t) {
1842
- this.buffer.push(t);
1871
+ sendLater(e) {
1872
+ this.buffer.push(e);
1843
1873
  }
1844
- sendNow(t) {
1845
- let e = lt(t, {
1874
+ sendNow(e) {
1875
+ let t = fe(e, {
1846
1876
  maxDepth: 15,
1847
- allowFunction: !1,
1848
- ...S.CHANNEL_OPTIONS
1877
+ ...dt.CHANNEL_OPTIONS
1849
1878
  });
1850
- this.socket.send(e);
1879
+ this.socket.send(t);
1851
1880
  }
1852
1881
  flush() {
1853
- let { buffer: t } = this;
1854
- this.buffer = [], t.forEach((e) => this.send(e));
1882
+ let { buffer: e } = this;
1883
+ this.buffer = [], e.forEach((t) => this.send(t));
1855
1884
  }
1856
1885
  };
1857
- a(wt, "WebsocketTransport");
1858
- var X = wt;
1886
+ s(Re, "WebsocketTransport");
1887
+ var ee = Re;
1859
1888
 
1860
1889
  // src/channels/index.ts
1861
- var { CONFIG_TYPE: po } = S, Xo = B;
1862
- function Qo({ page: r, extraTransports: t = [] }) {
1863
- let e = [new Y({ page: r }), ...t];
1864
- if (po === "DEVELOPMENT") {
1865
- let o = window.location.protocol === "http:" ? "ws" : "wss", { hostname: s, port: l } = window.location, c = `${o}://${s}:${l}/storybook\
1890
+ var { CONFIG_TYPE: qo } = Wo, Ps = z;
1891
+ function Os({ page: r, extraTransports: e = [] }) {
1892
+ let t = [new Z({ page: r }), ...e];
1893
+ if (qo === "DEVELOPMENT") {
1894
+ let o = window.location.protocol === "http:" ? "ws" : "wss", { hostname: p, port: a } = window.location, c = `${o}://${p}:${a}/storybook\
1866
1895
  -server-channel`;
1867
- e.push(new X({ url: c, onError: /* @__PURE__ */ a(() => {
1896
+ t.push(new ee({ url: c, onError: /* @__PURE__ */ s(() => {
1868
1897
  }, "onError"), page: r }));
1869
1898
  }
1870
- let n = new B({ transports: e });
1871
- return $.__prepare(
1899
+ let n = new z({ transports: t });
1900
+ return U.__prepare(
1872
1901
  n,
1873
- r === "manager" ? $.Environment.MANAGER : $.Environment.PREVIEW
1902
+ r === "manager" ? U.Environment.MANAGER : U.Environment.PREVIEW
1874
1903
  ), n;
1875
1904
  }
1876
- a(Qo, "createBrowserChannel");
1905
+ s(Os, "createBrowserChannel");
1877
1906
  export {
1878
- B as Channel,
1879
- Zt as HEARTBEAT_INTERVAL,
1880
- te as HEARTBEAT_MAX_LATENCY,
1881
- Y as PostMessageTransport,
1882
- X as WebsocketTransport,
1883
- Qo as createBrowserChannel,
1884
- Xo as default
1907
+ z as Channel,
1908
+ yt as HEARTBEAT_INTERVAL,
1909
+ ht as HEARTBEAT_MAX_LATENCY,
1910
+ Z as PostMessageTransport,
1911
+ ee as WebsocketTransport,
1912
+ Os as createBrowserChannel,
1913
+ Ps as default
1885
1914
  };