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