New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/core

Package Overview
Dependencies
Maintainers
12
Versions
1389
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/core - npm Package Compare versions

Comparing version 0.0.0-pr-30202-sha-4958640a to 0.0.0-pr-30202-sha-958e81ef

7

dist/channels/index.d.ts

@@ -76,2 +76,4 @@ interface Config {

}
declare const HEARTBEAT_INTERVAL = 15000;
declare const HEARTBEAT_MAX_LATENCY = 5000;
declare class WebsocketTransport implements ChannelTransport {

@@ -82,2 +84,5 @@ private buffer;

private isReady;
private isClosed;
private pingTimeout;
private heartbeat;
constructor({ url, onError, page }: WebsocketTransportArgs);

@@ -105,2 +110,2 @@ setHandler(handler: ChannelHandler): void;

export { Channel, type ChannelEvent, type ChannelHandler, type ChannelTransport, type Listener, PostMessageTransport, WebsocketTransport, createBrowserChannel, Channel as default };
export { Channel, type ChannelEvent, type ChannelHandler, type ChannelTransport, HEARTBEAT_INTERVAL, HEARTBEAT_MAX_LATENCY, type Listener, PostMessageTransport, WebsocketTransport, createBrowserChannel, Channel as default };

705

dist/channels/index.js

@@ -1,6 +0,6 @@

var Qt = Object.create;
var ee = Object.create;
var st = Object.defineProperty;
var te = Object.getOwnPropertyDescriptor;
var ee = Object.getOwnPropertyNames;
var re = Object.getPrototypeOf, ne = Object.prototype.hasOwnProperty;
var re = Object.getOwnPropertyDescriptor;
var ne = Object.getOwnPropertyNames;
var oe = Object.getPrototypeOf, ae = Object.prototype.hasOwnProperty;
var i = (t, e) => st(t, "name", { value: e, configurable: !0 }), U = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy <

@@ -13,10 +13,10 @@ "u" ? new Proxy(t, {

});
var oe = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
var ae = (t, e, r, n) => {
var ie = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
var se = (t, e, r, n) => {
if (e && typeof e == "object" || typeof e == "function")
for (let a of ee(e))
!ne.call(t, a) && a !== r && st(t, a, { get: () => e[a], enumerable: !(n = te(e, a)) || n.enumerable });
for (let a of ne(e))
!ae.call(t, a) && a !== r && st(t, a, { get: () => e[a], enumerable: !(n = re(e, a)) || n.enumerable });
return t;
};
var ie = (t, e, r) => (r = t != null ? Qt(re(t)) : {}, ae(
var le = (t, e, r) => (r = t != null ? ee(oe(t)) : {}, se(
// If the importer is in node compatibility mode or this is not an ESM

@@ -31,5 +31,5 @@ // file that has been converted to a CommonJS file using a Babel-

// ../node_modules/memoizerific/memoizerific.js
var At = oe((Ot, ct) => {
var Ot = ie((At, ct) => {
(function(t) {
if (typeof Ot == "object" && typeof ct < "u")
if (typeof At == "object" && typeof ct < "u")
ct.exports = t();

@@ -48,4 +48,4 @@ else if (typeof define == "function" && define.amd)

if (!a[u]) {
var d = typeof U == "function" && U;
if (!p && d) return d(u, !0);
var h = typeof U == "function" && U;
if (!p && h) return h(u, !0);
if (o) return o(u, !0);

@@ -64,3 +64,3 @@ var g = new Error("Cannot find module '" + u + "'");

i(c, "s");
for (var o = typeof U == "function" && U, h = 0; h < s.length; h++) c(s[h]);
for (var o = typeof U == "function" && U, d = 0; d < s.length; d++) c(s[d]);
return c;

@@ -86,5 +86,5 @@ }, "e"))({ 1: [function(n, a, l) {

}, s.prototype.set = function(c, o) {
var h;
return this.lastItem && this.isEqual(this.lastItem.key, c) ? (this.lastItem.val = o, this) : (h = this.indexOf(c), h >= 0 ? (this.lastItem =
this.list[h], this.list[h].val = o, this) : (this.lastItem = { key: c, val: o }, this.list.push(this.lastItem), this.size++, this));
var d;
return this.lastItem && this.isEqual(this.lastItem.key, c) ? (this.lastItem.val = o, this) : (d = this.indexOf(c), d >= 0 ? (this.lastItem =
this.list[d], this.list[d].val = o, this) : (this.lastItem = { key: c, val: o }, this.list.push(this.lastItem), this.size++, this));
}, s.prototype.delete = function(c) {

@@ -99,5 +99,5 @@ var o;

}, s.prototype.forEach = function(c, o) {
var h;
for (h = 0; h < this.size; h++)
c.call(o || this, this.list[h].val, this.list[h].key, this);
var d;
for (d = 0; d < this.size; d++)
c.call(o || this, this.list[d].val, this.list[d].key, this);
}, s.prototype.indexOf = function(c) {

@@ -115,6 +115,6 @@ var o;

a.exports = function(u) {
var p = new s(!1), d = [];
var p = new s(!1), h = [];
return function(g) {
var y = /* @__PURE__ */ i(function() {
var m = p, v, C, w = arguments.length - 1, I = Array(w + 1), P = !0, j;
var m = p, v, C, w = arguments.length - 1, I = Array(w + 1), x = !0, j;
if ((y.numArgs || y.numArgs === 0) && y.numArgs !== w + 1)

@@ -130,18 +130,18 @@ throw new Error("Memoizerific functions should always be called with the same number of arguments");

}
P = !1, v = new s(!1), m.set(arguments[j], v), m = v;
x = !1, v = new s(!1), m.set(arguments[j], v), m = v;
}
return P && (m.has(arguments[w]) ? C = m.get(arguments[w]) : P = !1), P || (C = g.apply(null, arguments), m.set(arguments[w], C)),
return x && (m.has(arguments[w]) ? C = m.get(arguments[w]) : x = !1), x || (C = g.apply(null, arguments), m.set(arguments[w], C)),
u > 0 && (I[w] = {
cacheItem: m,
arg: arguments[w]
}, P ? c(d, I) : d.push(I), d.length > u && o(d.shift())), y.wasMemoized = P, y.numArgs = w + 1, C;
}, x ? c(h, I) : h.push(I), h.length > u && o(h.shift())), y.wasMemoized = x, y.numArgs = w + 1, C;
}, "memoizerific");
return y.limit = u, y.wasMemoized = !1, y.cache = p, y.lru = d, y;
return y.limit = u, y.wasMemoized = !1, y.cache = p, y.lru = h, y;
};
};
function c(u, p) {
var d = u.length, g = p.length, y, m, v;
for (m = 0; m < d; m++) {
var h = u.length, g = p.length, y, m, v;
for (m = 0; m < h; m++) {
for (y = !0, v = 0; v < g; v++)
if (!h(u[m][v].arg, p[v].arg)) {
if (!d(u[m][v].arg, p[v].arg)) {
y = !1;

@@ -157,11 +157,11 @@ break;

function o(u) {
var p = u.length, d = u[p - 1], g, y;
for (d.cacheItem.delete(d.arg), y = p - 2; y >= 0 && (d = u[y], g = d.cacheItem.get(d.arg), !g || !g.size); y--)
d.cacheItem.delete(d.arg);
var p = u.length, h = u[p - 1], g, y;
for (h.cacheItem.delete(h.arg), y = p - 2; y >= 0 && (h = u[y], g = h.cacheItem.get(h.arg), !g || !g.size); y--)
h.cacheItem.delete(h.arg);
}
i(o, "removeCachedResult");
function h(u, p) {
function d(u, p) {
return u === p || u !== u && p !== p;
}
i(h, "isEqual");
i(d, "isEqual");
}, { "map-or-similar": 1 }] }, {}, [3])(3);

@@ -179,10 +179,10 @@ });

// src/channels/main.ts
var se = /* @__PURE__ */ i((t) => t.transports !== void 0, "isMulti"), le = /* @__PURE__ */ i(() => Math.random().toString(16).slice(2), "ge\
var ce = /* @__PURE__ */ i((t) => t.transports !== void 0, "isMulti"), fe = /* @__PURE__ */ i(() => Math.random().toString(16).slice(2), "ge\
nerateRandomId"), lt = class lt {
constructor(e = {}) {
this.sender = le();
this.sender = fe();
this.events = {};
this.data = {};
this.transports = [];
this.isAsync = e.async || !1, se(e) ? (this.transports = e.transports || [], this.transports.forEach((r) => {
this.isAsync = e.async || !1, ce(e) ? (this.transports = e.transports || [], this.transports.forEach((r) => {
r.setHandler((n) => this.handleEvent(n));

@@ -255,17 +255,17 @@ })) : this.transports = e.transport ? [e.transport] : [], this.transports.forEach((r) => {

import { logger as Ht, pretty as qt } from "@storybook/core/client-logger";
import * as Qn from "@storybook/core/core-events";
import * as eo from "@storybook/core/core-events";
// ../node_modules/telejson/dist/chunk-465TF3XA.mjs
var ce = Object.create, St = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, wt = Object.getOwnPropertyNames, ue = Object.getPrototypeOf,
pe = Object.prototype.hasOwnProperty, x = /* @__PURE__ */ i((t, e) => /* @__PURE__ */ i(function() {
var ue = Object.create, St = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, wt = Object.getOwnPropertyNames, ye = Object.getPrototypeOf,
he = Object.prototype.hasOwnProperty, P = /* @__PURE__ */ i((t, e) => /* @__PURE__ */ i(function() {
return e || (0, t[wt(t)[0]])((e = { exports: {} }).exports, e), e.exports;
}, "__require"), "__commonJS"), ye = /* @__PURE__ */ i((t, e, r, n) => {
}, "__require"), "__commonJS"), de = /* @__PURE__ */ i((t, e, r, n) => {
if (e && typeof e == "object" || typeof e == "function")
for (let a of wt(e))
!pe.call(t, a) && a !== r && St(t, a, { get: /* @__PURE__ */ i(() => e[a], "get"), enumerable: !(n = fe(e, a)) || n.enumerable });
!he.call(t, a) && a !== r && St(t, a, { get: /* @__PURE__ */ i(() => e[a], "get"), enumerable: !(n = pe(e, a)) || n.enumerable });
return t;
}, "__copyProps"), tt = /* @__PURE__ */ i((t, e, r) => (r = t != null ? ce(ue(t)) : {}, ye(
}, "__copyProps"), tt = /* @__PURE__ */ i((t, e, r) => (r = t != null ? ue(ye(t)) : {}, de(
e || !t || !t.__esModule ? St(r, "default", { value: t, enumerable: !0 }) : r,
t
)), "__toESM"), de = [
)), "__toESM"), ge = [
"bubbles",

@@ -284,6 +284,6 @@ "cancelBubble",

"type"
], he = ["detail"];
], me = ["detail"];
function Et(t) {
let e = de.filter((r) => t[r] !== void 0).reduce((r, n) => ({ ...r, [n]: t[n] }), {});
return t instanceof CustomEvent && he.filter((r) => t[r] !== void 0).forEach((r) => {
let e = ge.filter((r) => t[r] !== void 0).reduce((r, n) => ({ ...r, [n]: t[n] }), {});
return t instanceof CustomEvent && me.filter((r) => t[r] !== void 0).forEach((r) => {
e[r] = t[r];

@@ -295,4 +295,4 @@ }), e;

// ../node_modules/telejson/dist/index.mjs
var Ut = ie(At(), 1);
var Tt = x({
var Ut = le(Ot(), 1);
var Tt = P({
"node_modules/has-symbols/shams.js"(t, e) {

@@ -327,3 +327,3 @@ "use strict";

}
}), Ft = x({
}), Ft = P({
"node_modules/has-symbols/index.js"(t, e) {

@@ -337,3 +337,3 @@ "use strict";

}
}), ge = x({
}), ve = P({
"node_modules/function-bind/implementation.js"(t, e) {

@@ -347,7 +347,7 @@ "use strict";

throw new TypeError(r + o);
for (var h = n.call(arguments, 1), u, p = /* @__PURE__ */ i(function() {
for (var d = n.call(arguments, 1), u, p = /* @__PURE__ */ i(function() {
if (this instanceof u) {
var v = o.apply(
this,
h.concat(n.call(arguments))
d.concat(n.call(arguments))
);

@@ -358,5 +358,5 @@ return Object(v) === v ? v : this;

c,
h.concat(n.call(arguments))
d.concat(n.call(arguments))
);
}, "binder"), d = Math.max(0, o.length - h.length), g = [], y = 0; y < d; y++)
}, "binder"), h = Math.max(0, o.length - d.length), g = [], y = 0; y < h; y++)
g.push("$" + y);

@@ -371,9 +371,9 @@ if (u = Function("binder", "return function (" + g.join(",") + "){ return binder.apply(this,arguments); }")(p), o.prototype) {

}
}), ut = x({
}), ut = P({
"node_modules/function-bind/index.js"(t, e) {
"use strict";
var r = ge();
var r = ve();
e.exports = Function.prototype.bind || r;
}
}), me = x({
}), _e = P({
"node_modules/has/src/index.js"(t, e) {

@@ -384,3 +384,3 @@ "use strict";

}
}), Nt = x({
}), Nt = P({
"node_modules/get-intrinsic/index.js"(t, e) {

@@ -402,3 +402,3 @@ "use strict";

throw new l();
}, "throwTypeError"), h = c ? function() {
}, "throwTypeError"), d = c ? function() {
try {

@@ -415,3 +415,3 @@ return arguments.callee, o;

return T.__proto__;
}, d = {}, g = typeof Uint8Array > "u" ? r : p(Uint8Array), y = {
}, h = {}, g = typeof Uint8Array > "u" ? r : p(Uint8Array), y = {
"%AggregateError%": typeof AggregateError > "u" ? r : AggregateError,

@@ -422,6 +422,6 @@ "%Array%": Array,

"%AsyncFromSyncIteratorPrototype%": r,
"%AsyncFunction%": d,
"%AsyncGenerator%": d,
"%AsyncGeneratorFunction%": d,
"%AsyncIteratorPrototype%": d,
"%AsyncFunction%": h,
"%AsyncGenerator%": h,
"%AsyncGeneratorFunction%": h,
"%AsyncIteratorPrototype%": h,
"%Atomics%": typeof Atomics > "u" ? r : Atomics,

@@ -443,3 +443,3 @@ "%BigInt%": typeof BigInt > "u" ? r : BigInt,

"%Function%": a,
"%GeneratorFunction%": d,
"%GeneratorFunction%": h,
"%Int8Array%": typeof Int8Array > "u" ? r : Int8Array,

@@ -472,3 +472,3 @@ "%Int16Array%": typeof Int16Array > "u" ? r : Int16Array,

"%SyntaxError%": n,
"%ThrowTypeError%": h,
"%ThrowTypeError%": d,
"%TypedArray%": g,

@@ -496,4 +496,4 @@ "%TypeError%": l,

} else if (_ === "%AsyncIteratorPrototype%") {
var O = T("%AsyncGenerator%");
O && (E = p(O.prototype));
var A = T("%AsyncGenerator%");
A && (E = p(A.prototype));
}

@@ -553,5 +553,5 @@ return y[_] = E, E;

"%WeakSetPrototype%": ["WeakSet", "prototype"]
}, C = ut(), w = me(), I = C.call(Function.call, Array.prototype.concat), P = C.call(Function.apply, Array.prototype.splice), j = C.call(
Function.call, String.prototype.replace), V = C.call(Function.call, String.prototype.slice), Vt = C.call(Function.call, RegExp.prototype.
exec), Kt = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Yt = /\\(\\)?/g, Zt = /* @__PURE__ */ i(
}, C = ut(), w = _e(), I = C.call(Function.call, Array.prototype.concat), x = C.call(Function.apply, Array.prototype.splice), j = C.call(
Function.call, String.prototype.replace), V = C.call(Function.call, String.prototype.slice), Yt = C.call(Function.call, RegExp.prototype.
exec), Xt = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Zt = /\\(\\)?/g, Qt = /* @__PURE__ */ i(
function(_) {

@@ -563,14 +563,14 @@ var E = V(_, 0, 1), S = V(_, -1);

throw new n("invalid intrinsic syntax, expected opening `%`");
var O = [];
return j(_, Kt, function(F, R, A, K) {
O[O.length] = A ? j(K, Yt, "$1") : R || F;
}), O;
}, "stringToPath3"), Xt = /* @__PURE__ */ i(function(_, E) {
var S = _, O;
if (w(v, S) && (O = v[S], S = "%" + O[0] + "%"), w(y, S)) {
var A = [];
return j(_, Xt, function(F, R, O, K) {
A[A.length] = O ? j(K, Zt, "$1") : R || F;
}), A;
}, "stringToPath3"), te = /* @__PURE__ */ i(function(_, E) {
var S = _, A;
if (w(v, S) && (A = v[S], S = "%" + A[0] + "%"), w(y, S)) {
var F = y[S];
if (F === d && (F = m(S)), typeof F > "u" && !E)
if (F === h && (F = m(S)), typeof F > "u" && !E)
throw new l("intrinsic " + _ + " exists, but is not available. Please file an issue!");
return {
alias: O,
alias: A,
name: S,

@@ -587,14 +587,14 @@ value: F

throw new l('"allowMissing" argument must be a boolean');
if (Vt(/^%?[^%]*%?$/, _) === null)
if (Yt(/^%?[^%]*%?$/, _) === null)
throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
var S = Zt(_), O = S.length > 0 ? S[0] : "", F = Xt("%" + O + "%", E), R = F.name, A = F.value, K = !1, it = F.alias;
it && (O = it[0], P(S, I([0, 1], it)));
for (var Y = 1, L = !0; Y < S.length; Y += 1) {
var N = S[Y], Z = V(N, 0, 1), X = V(N, -1);
if ((Z === '"' || Z === "'" || Z === "`" || X === '"' || X === "'" || X === "`") && Z !== X)
var S = Qt(_), A = S.length > 0 ? S[0] : "", F = te("%" + A + "%", E), R = F.name, O = F.value, K = !1, it = F.alias;
it && (A = it[0], x(S, I([0, 1], it)));
for (var Y = 1, D = !0; Y < S.length; Y += 1) {
var N = S[Y], X = V(N, 0, 1), Z = V(N, -1);
if ((X === '"' || X === "'" || X === "`" || Z === '"' || Z === "'" || Z === "`") && X !== Z)
throw new n("property names with quotes must have matching quotes");
if ((N === "constructor" || !L) && (K = !0), O += "." + N, R = "%" + O + "%", w(y, R))
A = y[R];
else if (A != null) {
if (!(N in A)) {
if ((N === "constructor" || !D) && (K = !0), A += "." + N, R = "%" + A + "%", w(y, R))
O = y[R];
else if (O != null) {
if (!(N in O)) {
if (!E)

@@ -605,17 +605,17 @@ throw new l("base intrinsic for " + _ + " exists, but the property is not available.");

if (c && Y + 1 >= S.length) {
var Q = c(A, N);
L = !!Q, L && "get" in Q && !("originalValue" in Q.get) ? A = Q.get : A = A[N];
var Q = c(O, N);
D = !!Q, D && "get" in Q && !("originalValue" in Q.get) ? O = Q.get : O = O[N];
} else
L = w(A, N), A = A[N];
L && !K && (y[R] = A);
D = w(O, N), O = O[N];
D && !K && (y[R] = O);
}
}
return A;
return O;
}, "GetIntrinsic");
}
}), ve = x({
}), be = P({
"node_modules/call-bind/index.js"(t, e) {
"use strict";
var r = ut(), n = Nt(), a = n("%Function.prototype.apply%"), l = n("%Function.prototype.call%"), s = n("%Reflect.apply%", !0) || r.call(
l, a), c = n("%Object.getOwnPropertyDescriptor%", !0), o = n("%Object.defineProperty%", !0), h = n("%Math.max%");
l, a), c = n("%Object.getOwnPropertyDescriptor%", !0), o = n("%Object.defineProperty%", !0), d = n("%Math.max%");
if (o)

@@ -627,3 +627,3 @@ try {

}
e.exports = /* @__PURE__ */ i(function(d) {
e.exports = /* @__PURE__ */ i(function(h) {
var g = s(r, l, arguments);

@@ -635,3 +635,3 @@ if (c && o) {

"length",
{ value: 1 + h(0, d.length - (arguments.length - 1)) }
{ value: 1 + d(0, h.length - (arguments.length - 1)) }
);

@@ -646,6 +646,6 @@ }

}
}), _e = x({
}), Se = P({
"node_modules/call-bind/callBound.js"(t, e) {
"use strict";
var r = Nt(), n = ve(), a = n(r("String.prototype.indexOf"));
var r = Nt(), n = be(), a = n(r("String.prototype.indexOf"));
e.exports = /* @__PURE__ */ i(function(s, c) {

@@ -656,3 +656,3 @@ var o = r(s, !!c);

}
}), be = x({
}), we = P({
"node_modules/has-tostringtag/shams.js"(t, e) {

@@ -665,6 +665,6 @@ "use strict";

}
}), Se = x({
}), Ee = P({
"node_modules/is-regex/index.js"(t, e) {
"use strict";
var r = _e(), n = be()(), a, l, s, c;
var r = Se(), n = we()(), a, l, s, c;
n && (a = r("Object.prototype.hasOwnProperty"), l = r("RegExp.prototype.exec"), s = {}, o = /* @__PURE__ */ i(function() {

@@ -676,3 +676,3 @@ throw s;

}, typeof Symbol.toPrimitive == "symbol" && (c[Symbol.toPrimitive] = o));
var o, h = r("Object.prototype.toString"), u = Object.getOwnPropertyDescriptor, p = "[object RegExp]";
var o, d = r("Object.prototype.toString"), u = Object.getOwnPropertyDescriptor, p = "[object RegExp]";
e.exports = /* @__PURE__ */ i(n ? function(g) {

@@ -690,6 +690,6 @@ if (!g || typeof g != "object")

} : function(g) {
return !g || typeof g != "object" && typeof g != "function" ? !1 : h(g) === p;
return !g || typeof g != "object" && typeof g != "function" ? !1 : d(g) === p;
}, "isRegex");
}
}), we = x({
}), Ae = P({
"node_modules/is-function/index.js"(t, e) {

@@ -707,3 +707,3 @@ e.exports = n;

}
}), Ee = x({
}), Oe = P({
"node_modules/is-symbol/index.js"(t, e) {

@@ -729,12 +729,12 @@ "use strict";

}
}), Oe = tt(Se()), Ae = tt(we()), Pe = tt(Ee());
function xe(t) {
}), xe = tt(Ee()), Pe = tt(Ae()), Ce = tt(Oe());
function Ie(t) {
return t != null && typeof t == "object" && Array.isArray(t) === !1;
}
i(xe, "isObject");
var Ce = typeof global == "object" && global && global.Object === Object && global, Ie = Ce, je = typeof self == "object" && self && self.Object ===
Object && self, Te = Ie || je || Function("return this")(), pt = Te, Fe = pt.Symbol, M = Fe, Rt = Object.prototype, Ne = Rt.hasOwnProperty, Re = Rt.
i(Ie, "isObject");
var je = typeof global == "object" && global && global.Object === Object && global, Te = je, Fe = typeof self == "object" && self && self.Object ===
Object && self, Ne = Te || Fe || Function("return this")(), pt = Ne, Re = pt.Symbol, M = Re, Rt = Object.prototype, Me = Rt.hasOwnProperty, $e = Rt.
toString, W = M ? M.toStringTag : void 0;
function Me(t) {
var e = Ne.call(t, W), r = t[W];
function Le(t) {
var e = Me.call(t, W), r = t[W];
try {

@@ -745,28 +745,28 @@ t[W] = void 0;

}
var a = Re.call(t);
var a = $e.call(t);
return n && (e ? t[W] = r : delete t[W]), a;
}
i(Me, "getRawTag");
var $e = Me, ke = Object.prototype, De = ke.toString;
function Le(t) {
return De.call(t);
i(Le, "getRawTag");
var ke = Le, De = Object.prototype, Ue = De.toString;
function ze(t) {
return Ue.call(t);
}
i(Le, "objectToString");
var Ue = Le, ze = "[object Null]", We = "[object Undefined]", Pt = M ? M.toStringTag : void 0;
function Be(t) {
return t == null ? t === void 0 ? We : ze : Pt && Pt in Object(t) ? $e(t) : Ue(t);
i(ze, "objectToString");
var We = ze, Be = "[object Null]", He = "[object Undefined]", xt = M ? M.toStringTag : void 0;
function qe(t) {
return t == null ? t === void 0 ? He : Be : xt && xt in Object(t) ? ke(t) : We(t);
}
i(Be, "baseGetTag");
var Mt = Be;
function He(t) {
i(qe, "baseGetTag");
var Mt = qe;
function Ge(t) {
return t != null && typeof t == "object";
}
i(He, "isObjectLike");
var qe = He, Ge = "[object Symbol]";
function Je(t) {
return typeof t == "symbol" || qe(t) && Mt(t) == Ge;
i(Ge, "isObjectLike");
var Je = Ge, Ve = "[object Symbol]";
function Ke(t) {
return typeof t == "symbol" || Je(t) && Mt(t) == Ve;
}
i(Je, "isSymbol");
var yt = Je;
function Ve(t, e) {
i(Ke, "isSymbol");
var yt = Ke;
function Ye(t, e) {
for (var r = -1, n = t == null ? 0 : t.length, a = Array(n); ++r < n; )

@@ -776,42 +776,42 @@ a[r] = e(t[r], r, t);

}
i(Ve, "arrayMap");
var Ke = Ve, Ye = Array.isArray, dt = Ye, Ze = 1 / 0, xt = M ? M.prototype : void 0, Ct = xt ? xt.toString : void 0;
i(Ye, "arrayMap");
var Xe = Ye, Ze = Array.isArray, ht = Ze, Qe = 1 / 0, Pt = M ? M.prototype : void 0, Ct = Pt ? Pt.toString : void 0;
function $t(t) {
if (typeof t == "string")
return t;
if (dt(t))
return Ke(t, $t) + "";
if (ht(t))
return Xe(t, $t) + "";
if (yt(t))
return Ct ? Ct.call(t) : "";
var e = t + "";
return e == "0" && 1 / t == -Ze ? "-0" : e;
return e == "0" && 1 / t == -Qe ? "-0" : e;
}
i($t, "baseToString");
var Xe = $t;
function Qe(t) {
var tr = $t;
function er(t) {
var e = typeof t;
return t != null && (e == "object" || e == "function");
}
i(Qe, "isObject2");
var kt = Qe, tr = "[object AsyncFunction]", er = "[object Function]", rr = "[object GeneratorFunction]", nr = "[object Proxy]";
function or(t) {
if (!kt(t))
i(er, "isObject2");
var Lt = er, rr = "[object AsyncFunction]", nr = "[object Function]", or = "[object GeneratorFunction]", ar = "[object Proxy]";
function ir(t) {
if (!Lt(t))
return !1;
var e = Mt(t);
return e == er || e == rr || e == tr || e == nr;
return e == nr || e == or || e == rr || e == ar;
}
i(or, "isFunction");
var ar = or, ir = pt["__core-js_shared__"], ft = ir, It = function() {
i(ir, "isFunction");
var sr = ir, lr = pt["__core-js_shared__"], ft = lr, It = function() {
var t = /[^.]+$/.exec(ft && ft.keys && ft.keys.IE_PROTO || "");
return t ? "Symbol(src)_1." + t : "";
}();
function sr(t) {
function cr(t) {
return !!It && It in t;
}
i(sr, "isMasked");
var lr = sr, cr = Function.prototype, fr = cr.toString;
function ur(t) {
i(cr, "isMasked");
var fr = cr, ur = Function.prototype, pr = ur.toString;
function yr(t) {
if (t != null) {
try {
return fr.call(t);
return pr.call(t);
} catch {

@@ -826,73 +826,73 @@ }

}
i(ur, "toSource");
var pr = ur, yr = /[\\^$.*+?()[\]{}|]/g, dr = /^\[object .+?Constructor\]$/, hr = Function.prototype, gr = Object.prototype, mr = hr.toString,
vr = gr.hasOwnProperty, _r = RegExp(
"^" + mr.call(vr).replace(yr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
i(yr, "toSource");
var hr = yr, dr = /[\\^$.*+?()[\]{}|]/g, gr = /^\[object .+?Constructor\]$/, mr = Function.prototype, vr = Object.prototype, _r = mr.toString,
br = vr.hasOwnProperty, Sr = RegExp(
"^" + _r.call(br).replace(dr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function br(t) {
if (!kt(t) || lr(t))
function wr(t) {
if (!Lt(t) || fr(t))
return !1;
var e = ar(t) ? _r : dr;
return e.test(pr(t));
var e = sr(t) ? Sr : gr;
return e.test(hr(t));
}
i(br, "baseIsNative");
var Sr = br;
function wr(t, e) {
i(wr, "baseIsNative");
var Er = wr;
function Ar(t, e) {
return t?.[e];
}
i(wr, "getValue");
var Er = wr;
function Or(t, e) {
var r = Er(t, e);
return Sr(r) ? r : void 0;
i(Ar, "getValue");
var Or = Ar;
function xr(t, e) {
var r = Or(t, e);
return Er(r) ? r : void 0;
}
i(Or, "getNative");
var Dt = Or;
function Ar(t, e) {
i(xr, "getNative");
var kt = xr;
function Pr(t, e) {
return t === e || t !== t && e !== e;
}
i(Ar, "eq");
var Pr = Ar, xr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Cr = /^\w*$/;
function Ir(t, e) {
if (dt(t))
i(Pr, "eq");
var Cr = Pr, Ir = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, jr = /^\w*$/;
function Tr(t, e) {
if (ht(t))
return !1;
var r = typeof t;
return r == "number" || r == "symbol" || r == "boolean" || t == null || yt(t) ? !0 : Cr.test(t) || !xr.test(t) || e != null && t in Object(
return r == "number" || r == "symbol" || r == "boolean" || t == null || yt(t) ? !0 : jr.test(t) || !Ir.test(t) || e != null && t in Object(
e);
}
i(Ir, "isKey");
var jr = Ir, Tr = Dt(Object, "create"), B = Tr;
function Fr() {
i(Tr, "isKey");
var Fr = Tr, Nr = kt(Object, "create"), B = Nr;
function Rr() {
this.__data__ = B ? B(null) : {}, this.size = 0;
}
i(Fr, "hashClear");
var Nr = Fr;
function Rr(t) {
i(Rr, "hashClear");
var Mr = Rr;
function $r(t) {
var e = this.has(t) && delete this.__data__[t];
return this.size -= e ? 1 : 0, e;
}
i(Rr, "hashDelete");
var Mr = Rr, $r = "__lodash_hash_undefined__", kr = Object.prototype, Dr = kr.hasOwnProperty;
function Lr(t) {
i($r, "hashDelete");
var Lr = $r, kr = "__lodash_hash_undefined__", Dr = Object.prototype, Ur = Dr.hasOwnProperty;
function zr(t) {
var e = this.__data__;
if (B) {
var r = e[t];
return r === $r ? void 0 : r;
return r === kr ? void 0 : r;
}
return Dr.call(e, t) ? e[t] : void 0;
return Ur.call(e, t) ? e[t] : void 0;
}
i(Lr, "hashGet");
var Ur = Lr, zr = Object.prototype, Wr = zr.hasOwnProperty;
function Br(t) {
i(zr, "hashGet");
var Wr = zr, Br = Object.prototype, Hr = Br.hasOwnProperty;
function qr(t) {
var e = this.__data__;
return B ? e[t] !== void 0 : Wr.call(e, t);
return B ? e[t] !== void 0 : Hr.call(e, t);
}
i(Br, "hashHas");
var Hr = Br, qr = "__lodash_hash_undefined__";
function Gr(t, e) {
i(qr, "hashHas");
var Gr = qr, Jr = "__lodash_hash_undefined__";
function Vr(t, e) {
var r = this.__data__;
return this.size += this.has(t) ? 0 : 1, r[t] = B && e === void 0 ? qr : e, this;
return this.size += this.has(t) ? 0 : 1, r[t] = B && e === void 0 ? Jr : e, this;
}
i(Gr, "hashSet");
var Jr = Gr;
i(Vr, "hashSet");
var Kr = Vr;
function $(t) {

@@ -906,22 +906,22 @@ var e = -1, r = t == null ? 0 : t.length;

i($, "Hash");
$.prototype.clear = Nr;
$.prototype.delete = Mr;
$.prototype.get = Ur;
$.prototype.has = Hr;
$.prototype.set = Jr;
$.prototype.clear = Mr;
$.prototype.delete = Lr;
$.prototype.get = Wr;
$.prototype.has = Gr;
$.prototype.set = Kr;
var jt = $;
function Vr() {
function Yr() {
this.__data__ = [], this.size = 0;
}
i(Vr, "listCacheClear");
var Kr = Vr;
function Yr(t, e) {
i(Yr, "listCacheClear");
var Xr = Yr;
function Zr(t, e) {
for (var r = t.length; r--; )
if (Pr(t[r][0], e))
if (Cr(t[r][0], e))
return r;
return -1;
}
i(Yr, "assocIndexOf");
var rt = Yr, Zr = Array.prototype, Xr = Zr.splice;
function Qr(t) {
i(Zr, "assocIndexOf");
var rt = Zr, Qr = Array.prototype, tn = Qr.splice;
function en(t) {
var e = this.__data__, r = rt(e, t);

@@ -931,24 +931,24 @@ if (r < 0)

var n = e.length - 1;
return r == n ? e.pop() : Xr.call(e, r, 1), --this.size, !0;
return r == n ? e.pop() : tn.call(e, r, 1), --this.size, !0;
}
i(Qr, "listCacheDelete");
var tn = Qr;
function en(t) {
i(en, "listCacheDelete");
var rn = en;
function nn(t) {
var e = this.__data__, r = rt(e, t);
return r < 0 ? void 0 : e[r][1];
}
i(en, "listCacheGet");
var rn = en;
function nn(t) {
i(nn, "listCacheGet");
var on = nn;
function an(t) {
return rt(this.__data__, t) > -1;
}
i(nn, "listCacheHas");
var on = nn;
function an(t, e) {
i(an, "listCacheHas");
var sn = an;
function ln(t, e) {
var r = this.__data__, n = rt(r, t);
return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
}
i(an, "listCacheSet");
var sn = an;
function k(t) {
i(ln, "listCacheSet");
var cn = ln;
function L(t) {
var e = -1, r = t == null ? 0 : t.length;

@@ -960,53 +960,53 @@ for (this.clear(); ++e < r; ) {

}
i(k, "ListCache");
k.prototype.clear = Kr;
k.prototype.delete = tn;
k.prototype.get = rn;
k.prototype.has = on;
k.prototype.set = sn;
var ln = k, cn = Dt(pt, "Map"), fn = cn;
function un() {
i(L, "ListCache");
L.prototype.clear = Xr;
L.prototype.delete = rn;
L.prototype.get = on;
L.prototype.has = sn;
L.prototype.set = cn;
var fn = L, un = kt(pt, "Map"), pn = un;
function yn() {
this.size = 0, this.__data__ = {
hash: new jt(),
map: new (fn || ln)(),
map: new (pn || fn)(),
string: new jt()
};
}
i(un, "mapCacheClear");
var pn = un;
function yn(t) {
i(yn, "mapCacheClear");
var hn = yn;
function dn(t) {
var e = typeof t;
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
}
i(yn, "isKeyable");
var dn = yn;
function hn(t, e) {
i(dn, "isKeyable");
var gn = dn;
function mn(t, e) {
var r = t.__data__;
return dn(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
return gn(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
i(hn, "getMapData");
var nt = hn;
function gn(t) {
i(mn, "getMapData");
var nt = mn;
function vn(t) {
var e = nt(this, t).delete(t);
return this.size -= e ? 1 : 0, e;
}
i(gn, "mapCacheDelete");
var mn = gn;
function vn(t) {
i(vn, "mapCacheDelete");
var _n = vn;
function bn(t) {
return nt(this, t).get(t);
}
i(vn, "mapCacheGet");
var _n = vn;
function bn(t) {
i(bn, "mapCacheGet");
var Sn = bn;
function wn(t) {
return nt(this, t).has(t);
}
i(bn, "mapCacheHas");
var Sn = bn;
function wn(t, e) {
i(wn, "mapCacheHas");
var En = wn;
function An(t, e) {
var r = nt(this, t), n = r.size;
return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
}
i(wn, "mapCacheSet");
var En = wn;
function D(t) {
i(An, "mapCacheSet");
var On = An;
function k(t) {
var e = -1, r = t == null ? 0 : t.length;

@@ -1018,12 +1018,12 @@ for (this.clear(); ++e < r; ) {

}
i(D, "MapCache");
D.prototype.clear = pn;
D.prototype.delete = mn;
D.prototype.get = _n;
D.prototype.has = Sn;
D.prototype.set = En;
var Lt = D, On = "Expected a function";
function ht(t, e) {
i(k, "MapCache");
k.prototype.clear = hn;
k.prototype.delete = _n;
k.prototype.get = Sn;
k.prototype.has = En;
k.prototype.set = On;
var Dt = k, xn = "Expected a function";
function dt(t, e) {
if (typeof t != "function" || e != null && typeof e != "function")
throw new TypeError(On);
throw new TypeError(xn);
var r = /* @__PURE__ */ i(function() {

@@ -1036,53 +1036,53 @@ var n = arguments, a = e ? e.apply(this, n) : n[0], l = r.cache;

}, "memoized");
return r.cache = new (ht.Cache || Lt)(), r;
return r.cache = new (dt.Cache || Dt)(), r;
}
i(ht, "memoize");
ht.Cache = Lt;
var An = ht, Pn = 500;
function xn(t) {
var e = An(t, function(n) {
return r.size === Pn && r.clear(), n;
i(dt, "memoize");
dt.Cache = Dt;
var Pn = dt, Cn = 500;
function In(t) {
var e = Pn(t, function(n) {
return r.size === Cn && r.clear(), n;
}), r = e.cache;
return e;
}
i(xn, "memoizeCapped");
var Cn = xn, In = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, jn = /\\(\\)?/g, Tn = Cn(
i(In, "memoizeCapped");
var jn = In, Tn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Fn = /\\(\\)?/g, Nn = jn(
function(t) {
var e = [];
return t.charCodeAt(0) === 46 && e.push(""), t.replace(In, function(r, n, a, l) {
e.push(a ? l.replace(jn, "$1") : n || r);
return t.charCodeAt(0) === 46 && e.push(""), t.replace(Tn, function(r, n, a, l) {
e.push(a ? l.replace(Fn, "$1") : n || r);
}), e;
}), Fn = Tn;
function Nn(t) {
return t == null ? "" : Xe(t);
}), Rn = Nn;
function Mn(t) {
return t == null ? "" : tr(t);
}
i(Nn, "toString");
var Rn = Nn;
function Mn(t, e) {
return dt(t) ? t : jr(t, e) ? [t] : Fn(Rn(t));
i(Mn, "toString");
var $n = Mn;
function Ln(t, e) {
return ht(t) ? t : Fr(t, e) ? [t] : Rn($n(t));
}
i(Mn, "castPath");
var $n = Mn, kn = 1 / 0;
function Dn(t) {
i(Ln, "castPath");
var kn = Ln, Dn = 1 / 0;
function Un(t) {
if (typeof t == "string" || yt(t))
return t;
var e = t + "";
return e == "0" && 1 / t == -kn ? "-0" : e;
return e == "0" && 1 / t == -Dn ? "-0" : e;
}
i(Dn, "toKey");
var Ln = Dn;
function Un(t, e) {
e = $n(e, t);
i(Un, "toKey");
var zn = Un;
function Wn(t, e) {
e = kn(e, t);
for (var r = 0, n = e.length; t != null && r < n; )
t = t[Ln(e[r++])];
t = t[zn(e[r++])];
return r && r == n ? t : void 0;
}
i(Un, "baseGet");
var zn = Un;
function Wn(t, e, r) {
var n = t == null ? void 0 : zn(t, e);
i(Wn, "baseGet");
var Bn = Wn;
function Hn(t, e, r) {
var n = t == null ? void 0 : Bn(t, e);
return n === void 0 ? r : n;
}
i(Wn, "get");
var Bn = Wn, et = xe, Hn = /* @__PURE__ */ i((t) => {
i(Hn, "get");
var qn = Hn, et = Ie, Gn = /* @__PURE__ */ i((t) => {
let e = null, r = !1, n = !1, a = !1, l = "";

@@ -1099,5 +1099,5 @@ if (t.indexOf("//") >= 0 || t.indexOf("/*") >= 0)

return l;
}, "removeCodeComments"), qn = (0, Ut.default)(1e4)(
(t) => Hn(t).replace(/\n\s*/g, "").trim()
), Gn = /* @__PURE__ */ i(function(e, r) {
}, "removeCodeComments"), Jn = (0, Ut.default)(1e4)(
(t) => Gn(t).replace(/\n\s*/g, "").trim()
), Vn = /* @__PURE__ */ i(function(e, r) {
let n = r.slice(0, r.indexOf("{")), a = r.slice(r.indexOf("{"));

@@ -1108,3 +1108,3 @@ if (n.includes("=>") || n.includes("function"))

return l = l.replace(e, "function"), l + a;
}, "convertShorthandMethods2"), Jn = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, H = /* @__PURE__ */ i((t) => t.match(/^[\[\{\"\}].*[\]\}\"]$/),
}, "convertShorthandMethods2"), Kn = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, H = /* @__PURE__ */ i((t) => t.match(/^[\[\{\"\}].*[\]\}\"]$/),
"isJSON");

@@ -1125,3 +1125,3 @@ function zt(t) {

i(zt, "convertUnconventionalData");
var Vn = /* @__PURE__ */ i(function(e) {
var Yn = /* @__PURE__ */ i(function(e) {
let r, n, a, l;

@@ -1132,4 +1132,4 @@ return /* @__PURE__ */ i(function(c, o) {

return l = [], r = /* @__PURE__ */ new Map([[o, "[]"]]), n = /* @__PURE__ */ new Map(), a = [], o;
let h = n.get(this) || this;
for (; a.length && h !== a[0]; )
let d = n.get(this) || this;
for (; a.length && d !== a[0]; )
a.shift(), l.pop();

@@ -1147,15 +1147,15 @@ if (typeof o == "boolean")

if (typeof o == "string")
return Jn.test(o) ? e.allowDate ? `_date_${o}` : void 0 : o;
if ((0, Oe.default)(o))
return Kn.test(o) ? e.allowDate ? `_date_${o}` : void 0 : o;
if ((0, xe.default)(o))
return e.allowRegExp ? `_regexp_${o.flags}|${o.source}` : void 0;
if ((0, Ae.default)(o)) {
if ((0, Pe.default)(o)) {
if (!e.allowFunction)
return;
let { name: p } = o, d = o.toString();
return d.match(
let { name: p } = o, h = o.toString();
return h.match(
/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/
) ? `_function_${p}|${(() => {
}).toString()}` : `_function_${p}|${qn(Gn(c, d))}`;
}).toString()}` : `_function_${p}|${Jn(Vn(c, h))}`;
}
if ((0, Pe.default)(o)) {
if ((0, Ce.default)(o)) {
if (!e.allowSymbol)

@@ -1199,3 +1199,3 @@ return;

}, "replace");
}, "replacer2"), Kn = /* @__PURE__ */ i(function reviver(options) {
}, "replacer2"), Xn = /* @__PURE__ */ i(function reviver(options) {
let refs = [], root;

@@ -1205,3 +1205,3 @@ return /* @__PURE__ */ i(function revive(key, value) {

let n = H(r) ? JSON.parse(r) : r.split(".");
n.length === 0 ? e[t] = root : e[t] = Bn(root, n);
n.length === 0 ? e[t] = root : e[t] = qn(root, n);
})), key === "_constructor-name_")

@@ -1260,4 +1260,4 @@ return value;

let r = { ...Wt, ...e };
return JSON.stringify(zt(t), Vn(r), e.space);
}, "stringify"), Yn = /* @__PURE__ */ i(() => {
return JSON.stringify(zt(t), Yn(r), e.space);
}, "stringify"), Zn = /* @__PURE__ */ i(() => {
let t = /* @__PURE__ */ new Map();

@@ -1272,11 +1272,11 @@ return /* @__PURE__ */ i(function e(r) {

}, "mutator"), at = /* @__PURE__ */ i((t, e = {}) => {
let r = { ...Wt, ...e }, n = JSON.parse(t, Kn(r));
return Yn()(n), n;
let r = { ...Wt, ...e }, n = JSON.parse(t, Xn(r));
return Zn()(n), n;
}, "parse");
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
var Zn = !1, gt = "Invariant failed";
var Qn = !1, gt = "Invariant failed";
function q(t, e) {
if (!t) {
if (Zn)
if (Qn)
throw new Error(gt);

@@ -1290,3 +1290,3 @@ var r = typeof e == "function" ? e() : e, n = r ? "".concat(gt, ": ").concat(r) : gt;

// src/channels/postmessage/getEventSourceUrl.ts
import { logger as Xn } from "@storybook/core/client-logger";
import { logger as to } from "@storybook/core/client-logger";
var Bt = /* @__PURE__ */ i((t) => {

@@ -1318,7 +1318,7 @@ let e = Array.from(

}
return n.length > 0 && Xn.error("found multiple candidates for event source"), null;
return n.length > 0 && to.error("found multiple candidates for event source"), null;
}, "getEventSourceUrl");
// src/channels/postmessage/index.ts
var { document: mt, location: vt } = b, Gt = "storybook-channel", to = { allowFunction: !1, maxDepth: 25 }, _t = class _t {
var { document: mt, location: vt } = b, Gt = "storybook-channel", ro = { allowFunction: !1, maxDepth: 25 }, _t = class _t {
constructor(e) {

@@ -1351,6 +1351,6 @@ this.config = e;

allowError: o,
allowUndefined: h,
allowUndefined: d,
allowClass: u,
maxDepth: p,
space: d,
space: h,
lazyEval: g

@@ -1364,10 +1364,10 @@ } = r || {}, y = Object.fromEntries(

allowError: o,
allowUndefined: h,
allowUndefined: d,
allowClass: u,
maxDepth: p,
space: d,
space: h,
lazyEval: g
}).filter(([I, P]) => typeof P < "u")
}).filter(([I, x]) => typeof x < "u")
), m = {
...to,
...ro,
...b.CHANNEL_OPTIONS || {},

@@ -1389,4 +1389,4 @@ ...y

}
}), Promise.resolve(null)) : new Promise((I, P) => {
this.buffer.push({ event: e, resolve: I, reject: P });
}), Promise.resolve(null)) : new Promise((I, x) => {
this.buffer.push({ event: e, resolve: I, reject: x });
});

@@ -1430,3 +1430,3 @@ }

let s = this.config.page === "manager" ? '<span style="color: #37D5D3; background: black"> manager </span>' : '<span style="color: #\
1EA7FD; background: black"> preview </span>', c = Object.values(Qn).includes(a.type) ? `<span style="color: #FF4785">${a.type}</span>` : `<s\
1EA7FD; background: black"> preview </span>', c = Object.values(eo).includes(a.type) ? `<span style="color: #FF4785">${a.type}</span>` : `<s\
pan style="color: #FFAE00">${a.type}</span>`;

@@ -1455,18 +1455,29 @@ if (l && (a.refId = l), a.source = this.config.page === "preview" ? e.origin : Bt(e), !a.source) {

import * as Jt from "@storybook/core/core-events";
var { WebSocket: eo } = b, bt = class bt {
var { WebSocket: no } = b, Vt = 15e3, Kt = 5e3, bt = class bt {
constructor({ url: e, onError: r, page: n }) {
this.buffer = [];
this.isReady = !1;
this.socket = new eo(e), this.socket.onopen = () => {
this.isReady = !0, this.flush();
this.isClosed = !1;
this.pingTimeout = 0;
this.socket = new no(e), this.socket.onopen = () => {
this.isReady = !0, this.heartbeat(), this.flush();
}, this.socket.onmessage = ({ data: a }) => {
let l = typeof a == "string" && H(a) ? at(a) : a;
q(this.handler, "WebsocketTransport handler should be set"), this.handler(l);
q(this.handler, "WebsocketTransport handler should be set"), this.handler(l), l.type === "ping" && (this.heartbeat(), this.send({ type: "\
pong" }));
}, this.socket.onerror = (a) => {
r && r(a);
}, this.socket.onclose = () => {
q(this.handler, "WebsocketTransport handler should be set"), this.handler({ type: Jt.CHANNEL_WS_DISCONNECT, args: [], from: n || "prev\
iew" });
}, this.socket.onclose = (a) => {
q(this.handler, "WebsocketTransport handler should be set"), this.handler({
type: Jt.CHANNEL_WS_DISCONNECT,
args: [{ reason: a.reason, code: a.code }],
from: n || "preview"
}), this.isClosed = !0, clearTimeout(this.pingTimeout);
};
}
heartbeat() {
clearTimeout(this.pingTimeout), this.pingTimeout = setTimeout(() => {
this.socket.close(3008, "timeout");
}, Vt + Kt);
}
setHandler(e) {

@@ -1476,3 +1487,3 @@ this.handler = e;

send(e) {
this.isReady ? this.sendNow(e) : this.sendLater(e);
this.isClosed || (this.isReady ? this.sendNow(e) : this.sendLater(e));
}

@@ -1499,6 +1510,6 @@ sendLater(e) {

// src/channels/index.ts
var { CONFIG_TYPE: ro } = b, Mo = z;
function $o({ page: t, extraTransports: e = [] }) {
var { CONFIG_TYPE: oo } = b, Lo = z;
function ko({ page: t, extraTransports: e = [] }) {
let r = [new G({ page: t }), ...e];
if (ro === "DEVELOPMENT") {
if (oo === "DEVELOPMENT") {
let n = window.location.protocol === "http:" ? "ws" : "wss", { hostname: a, port: l } = window.location, s = `${n}://${a}:${l}/storybook\

@@ -1511,9 +1522,11 @@ -server-channel`;

}
i($o, "createBrowserChannel");
i(ko, "createBrowserChannel");
export {
z as Channel,
Vt as HEARTBEAT_INTERVAL,
Kt as HEARTBEAT_MAX_LATENCY,
G as PostMessageTransport,
J as WebsocketTransport,
$o as createBrowserChannel,
Mo as default
ko as createBrowserChannel,
Lo as default
};

@@ -182,2 +182,8 @@ import { types, GeneratorOptions, generate, RecastOptions } from '@storybook/core/babel';

* setImport('foo', 'bar');
*
* // import * as foo from 'bar';
* setImport({ namespace: 'foo' }, 'bar');
*
* // import 'bar';
* setImport(null, 'bar');
* ```

@@ -189,3 +195,5 @@ *

*/
setImport(importSpecifier: string[] | string, fromImport: string): void;
setImport(importSpecifier: string[] | string | {
namespace: string;
} | null, fromImport: string): void;
}

@@ -192,0 +200,0 @@ declare const loadConfig: (code: string, fileName?: string) => ConfigFile;

@@ -20,3 +20,3 @@ import ESM_COMPAT_Module from "node:module";

};
var L = (s, e, r) => (r = s != null ? we(Te(s)) : {}, Ae(
var R = (s, e, r) => (r = s != null ? we(Te(s)) : {}, Ae(
// If the importer is in node compatibility mode or this is not an ESM

@@ -40,7 +40,7 @@ // file that has been converted to a CommonJS file using a Babel-

t[t.length - 1] = t[t.length - 1].replace(/\r?\n([\t ]*)$/, "");
var i = t.reduce(function(l, u) {
var f = u.match(/\n([\t ]+|(?!\s).)/g);
return f ? l.concat(f.map(function(x) {
var g, b;
return (b = (g = x.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && b !== void 0 ? b : 0;
var i = t.reduce(function(l, f) {
var d = f.match(/\n([\t ]+|(?!\s).)/g);
return d ? l.concat(d.map(function(m) {
var x, b;
return (b = (x = m.match(/[\t ]/g)) === null || x === void 0 ? void 0 : x.length) !== null && b !== void 0 ? b : 0;
})) : l;

@@ -58,10 +58,10 @@ }, []);

var n = t[0];
return e.forEach(function(l, u) {
var f = n.match(/(?:^|\n)( *)$/), x = f ? f[1] : "", g = l;
return e.forEach(function(l, f) {
var d = n.match(/(?:^|\n)( *)$/), m = d ? d[1] : "", x = l;
typeof l == "string" && l.includes(`
`) && (g = String(l).split(`
`) && (x = String(l).split(`
`).map(function(b, _) {
return _ === 0 ? b : "" + x + b;
return _ === 0 ? b : "" + m + b;
}).join(`
`)), n += g + t[u + 1];
`)), n += x + t[f + 1];
}), n;

@@ -75,4 +75,4 @@ }

// src/csf-tools/CsfFile.ts
var T = L(F(), 1);
import { readFile as Re, writeFile as Le } from "node:fs/promises";
var T = R(F(), 1);
import { readFile as Le, writeFile as Re } from "node:fs/promises";
import {

@@ -219,8 +219,8 @@ BabelFileClass as Me,

if (c.isIdentifier(a)) {
let l = a.name, u = r.body.find(
(f) => c.isImportDeclaration(f) && f.specifiers.find((x) => x.local.name === l)
let l = a.name, f = r.body.find(
(d) => c.isImportDeclaration(d) && d.specifiers.find((m) => m.local.name === l)
);
if (u) {
let { source: f } = u;
c.isStringLiteral(f) && (this._rawComponentPath = f.value);
if (f) {
let { source: d } = f;
c.isStringLiteral(d) && (this._rawComponentPath = d.value);
}

@@ -260,25 +260,25 @@ }

if (e._options.transformInlineMeta && !n && c.isExpression(i.declaration)) {
let f = t.scope.generateUidIdentifier("meta");
e._metaVariableName = f.name;
let x = [
c.variableDeclaration("const", [c.variableDeclarator(f, i.declaration)]),
c.exportDefaultDeclaration(f)
let d = t.scope.generateUidIdentifier("meta");
e._metaVariableName = d.name;
let m = [
c.variableDeclaration("const", [c.variableDeclarator(d, i.declaration)]),
c.exportDefaultDeclaration(d)
];
x.forEach((g) => g.loc = t.node.loc), t.replaceWithMultiple(x);
m.forEach((x) => x.loc = t.node.loc), t.replaceWithMultiple(m);
}
let l, u;
let l, f;
if (n) {
let f = i.declaration.name;
e._metaVariableName = f;
let x = /* @__PURE__ */ p((g) => c.isIdentifier(g.id) && g.id.name === f, "isVariableDeclarator");
let d = i.declaration.name;
e._metaVariableName = d;
let m = /* @__PURE__ */ p((x) => c.isIdentifier(x.id) && x.id.name === d, "isVariableDeclarator");
e._metaStatement = e._ast.program.body.find(
(g) => c.isVariableDeclaration(g) && g.declarations.find(x)
), u = (e?._metaStatement?.declarations || []).find(
x
(x) => c.isVariableDeclaration(x) && x.declarations.find(m)
), f = (e?._metaStatement?.declarations || []).find(
m
)?.init;
} else
e._metaStatement = i, u = i.declaration;
if (c.isObjectExpression(u) ? l = u : (
e._metaStatement = i, f = i.declaration;
if (c.isObjectExpression(f) ? l = f : (
// export default { ... } as Meta<...>
(c.isTSAsExpression(u) || c.isTSSatisfiesExpression(u)) && c.isObjectExpression(u.expression) && (l = u.expression)
(c.isTSAsExpression(f) || c.isTSSatisfiesExpression(f)) && c.isObjectExpression(f.expression) && (l = f.expression)
), !e._meta && l && c.isProgram(a) && (e._metaNode = l, e._parseMeta(l, a)), e._metaStatement && !e._metaNode)

@@ -304,36 +304,36 @@ throw new M(

e._storyExports[l] = n, e._storyStatements[l] = t;
let u = re(l);
let f = re(l);
e._storyAnnotations[l] ? ie.warn(
`Unexpected annotations for "${l}" before story declaration`
) : e._storyAnnotations[l] = {};
let f;
c.isVariableDeclarator(n) ? f = c.isTSAsExpression(n.init) || c.isTSSatisfiesExpression(n.init) ? n.init.expression : n.init :
f = n;
let x = {};
c.isObjectExpression(f) ? (x.__isArgsStory = !0, f.properties.forEach((g) => {
if (c.isIdentifier(g.key)) {
if (g.key.name === "render")
x.__isArgsStory = ne(
g.value,
let d;
c.isVariableDeclarator(n) ? d = c.isTSAsExpression(n.init) || c.isTSSatisfiesExpression(n.init) ? n.init.expression : n.init :
d = n;
let m = {};
c.isObjectExpression(d) ? (m.__isArgsStory = !0, d.properties.forEach((x) => {
if (c.isIdentifier(x.key)) {
if (x.key.name === "render")
m.__isArgsStory = ne(
x.value,
i,
e
);
else if (g.key.name === "name" && c.isStringLiteral(g.value))
u = g.value.value;
else if (g.key.name === "storyName" && c.isStringLiteral(g.value))
else if (x.key.name === "name" && c.isStringLiteral(x.value))
f = x.value.value;
else if (x.key.name === "storyName" && c.isStringLiteral(x.value))
ie.warn(
`Unexpected usage of "storyName" in "${l}". Please use "name" instead.`
);
else if (g.key.name === "parameters" && c.isObjectExpression(g.value)) {
let b = g.value.properties.find(
else if (x.key.name === "parameters" && c.isObjectExpression(x.value)) {
let b = x.value.properties.find(
(_) => c.isObjectProperty(_) && c.isIdentifier(_.key) && _.key.name === "__id"
);
b && (x.__id = b.value.value);
b && (m.__id = b.value.value);
}
e._storyAnnotations[l][g.key.name] = g.value;
e._storyAnnotations[l][x.key.name] = x.value;
}
})) : x.__isArgsStory = ne(f, i, e), e._stories[l] = {
})) : m.__isArgsStory = ne(d, i, e), e._stories[l] = {
id: "FIXME",
name: u,
parameters: x,
name: f,
parameters: m,
__stats: {}

@@ -344,14 +344,14 @@ };

if (c.isExportSpecifier(n) && c.isIdentifier(n.exported)) {
let { name: l } = n.exported, { name: u } = n.local, f = c.isProgram(i) ? O(n.local.name, i) : n.local;
let { name: l } = n.exported, { name: f } = n.local, d = c.isProgram(i) ? O(n.local.name, i) : n.local;
if (l === "default") {
let x;
c.isObjectExpression(f) ? x = f : (
let m;
c.isObjectExpression(d) ? m = d : (
// export default { ... } as Meta<...>
c.isTSAsExpression(f) && c.isObjectExpression(f.expression) && (x = f.expression)
), !e._meta && x && c.isProgram(i) && e._parseMeta(x, i);
c.isTSAsExpression(d) && c.isObjectExpression(d.expression) && (m = d.expression)
), !e._meta && m && c.isProgram(i) && e._parseMeta(m, i);
} else
e._storyAnnotations[l] = {}, e._storyStatements[l] = f, e._stories[l] = {
e._storyAnnotations[l] = {}, e._storyStatements[l] = d, e._stories[l] = {
id: "FIXME",
name: l,
localName: u,
localName: f,
parameters: {},

@@ -369,10 +369,10 @@ __stats: {}

a.left.property)) {
let n = a.left.object.name, l = a.left.property.name, u = a.right;
if (e._storyAnnotations[n] && (l === "story" && c.isObjectExpression(u) ? u.properties.forEach((f) => {
c.isIdentifier(f.key) && (e._storyAnnotations[n][f.key.name] = f.value);
}) : e._storyAnnotations[n][l] = u), l === "storyName" && c.isStringLiteral(u)) {
let f = u.value, x = e._stories[n];
if (!x)
let n = a.left.object.name, l = a.left.property.name, f = a.right;
if (e._storyAnnotations[n] && (l === "story" && c.isObjectExpression(f) ? f.properties.forEach((d) => {
c.isIdentifier(d.key) && (e._storyAnnotations[n][d.key.name] = d.value);
}) : e._storyAnnotations[n][l] = f), l === "storyName" && c.isStringLiteral(f)) {
let d = f.value, m = e._stories[n];
if (!m)
return;
x.name = f;
m.name = d;
}

@@ -410,17 +410,17 @@ }

return t;
let n = a.parameters?.__id ?? qe(e._meta?.id || e._meta?.title, re(i)), l = { ...a.parameters, __id: n }, { includeStories: u } = e.
let n = a.parameters?.__id ?? qe(e._meta?.id || e._meta?.title, re(i)), l = { ...a.parameters, __id: n }, { includeStories: f } = e.
_meta || {};
i === "__page" && (r.length === 1 || Array.isArray(u) && u.length === 1) && (l.docsOnly = !0), t[i] = { ...a, id: n, parameters: l };
let f = e._storyAnnotations[i], { tags: x, play: g } = f;
if (x) {
let S = c.isIdentifier(x) ? O(x.name, this._ast.program) : x;
i === "__page" && (r.length === 1 || Array.isArray(f) && f.length === 1) && (l.docsOnly = !0), t[i] = { ...a, id: n, parameters: l };
let d = e._storyAnnotations[i], { tags: m, play: x } = d;
if (m) {
let S = c.isIdentifier(m) ? O(m.name, this._ast.program) : m;
t[i].tags = se(S);
}
g && (t[i].tags = [...t[i].tags || [], "play-fn"]);
x && (t[i].tags = [...t[i].tags || [], "play-fn"]);
let b = t[i].__stats;
["play", "render", "loaders", "beforeEach", "globals"].forEach((S) => {
b[S] = !!f[S] || !!e._metaAnnotations[S];
b[S] = !!d[S] || !!e._metaAnnotations[S];
});
let _ = e.getStoryExport(i);
return b.storyFn = !!(c.isArrowFunctionExpression(_) || c.isFunctionDeclaration(_)), b.mount = Ge(f.play ?? e._metaAnnotations.play),
return b.storyFn = !!(c.isArrowFunctionExpression(_) || c.isFunctionDeclaration(_)), b.mount = Ge(d.play ?? e._metaAnnotations.play),
b.moduleMock = !!e.imports.find((S) => We(S)), t;

@@ -484,12 +484,12 @@ },

}, "formatCsf"), Xe = /* @__PURE__ */ p((s, e = {}) => le.print(s._ast, e), "printCsf"), Dt = /* @__PURE__ */ p(async (s, e) => {
let r = (await Re(s, "utf-8")).toString();
let r = (await Le(s, "utf-8")).toString();
return W(r, { ...e, fileName: s });
}, "readCsf"), vt = /* @__PURE__ */ p(async (s, e) => {
}, "readCsf"), It = /* @__PURE__ */ p(async (s, e) => {
if (!(e || s._options.fileName))
throw new Error("Please specify a fileName for writeCsf");
await Le(e, Xe(s).code);
await Re(e, Xe(s).code);
}, "writeCsf");
// src/csf-tools/ConfigFile.ts
var ue = L(F(), 1);
var ue = R(F(), 1);
import { readFile as Qe, writeFile as He } from "node:fs/promises";

@@ -620,9 +620,9 @@ import {

o.isIdentifier(a) && (n = D(a.name, t)), n = $(n), o.isObjectExpression(n) ? (e._exportsObject = n, n.properties.forEach((l) => {
let u = k(l);
if (u) {
let f = l.value;
o.isIdentifier(f) && (f = D(
f.name,
let f = k(l);
if (f) {
let d = l.value;
o.isIdentifier(d) && (d = D(
d.name,
t
)), e._exports[u] = f;
)), e._exports[f] = d;
}

@@ -923,2 +923,8 @@ })) : z.warn(

* setImport('foo', 'bar');
*
* // import * as foo from 'bar';
* setImport({ namespace: 'foo' }, 'bar');
*
* // import 'bar';
* setImport(null, 'bar');
* ```

@@ -931,10 +937,14 @@ *

setImport(e, r) {
let t = /* @__PURE__ */ p((l) => o.importSpecifier(o.identifier(l), o.identifier(l)), "getNewImportSpecifier"), i = /* @__PURE__ */ p((l, u) => l.
let t = /* @__PURE__ */ p((f) => o.importSpecifier(o.identifier(f), o.identifier(f)), "getNewImportSpecifier"), i = /* @__PURE__ */ p((f, d) => f.
specifiers.find(
(f) => o.isImportSpecifier(f) && o.isIdentifier(f.imported) && f.imported.name === u
), "hasImportSpecifier"), a = /* @__PURE__ */ p((l, u) => l.specifiers.find((f) => o.isImportDefaultSpecifier(f)), "hasDefaultImportSpec\
ifier"), n = this._ast.program.body.find(
(l) => o.isImportDeclaration(l) && l.source.value === r
(m) => o.isImportSpecifier(m) && o.isIdentifier(m.imported) && m.imported.name === d
), "hasImportSpecifier"), a = /* @__PURE__ */ p((f, d) => f.specifiers.find(
(m) => o.isImportNamespaceSpecifier(m) && o.isIdentifier(m.local) && m.local.name === d
), "hasNamespaceImportSpecifier"), n = /* @__PURE__ */ p((f, d) => f.specifiers.find(
(m) => o.isImportDefaultSpecifier(m) && o.isIdentifier(m.local) && m.local.name === d
), "hasDefaultImportSpecifier"), l = this._ast.program.body.find(
(f) => o.isImportDeclaration(f) && f.source.value === r
);
typeof e == "string" ? n ? a(n, e) || n.specifiers.push(
e === null ? l || this._ast.program.body.unshift(o.importDeclaration([], o.stringLiteral(r))) : typeof e == "string" ? l ? n(l, e) || l.
specifiers.push(
o.importDefaultSpecifier(o.identifier(e))

@@ -946,12 +956,17 @@ ) : this._ast.program.body.unshift(

)
) : n ? e.forEach((l) => {
i(n, l) || n.specifiers.push(t(l));
) : Array.isArray(e) ? l ? e.forEach((f) => {
i(l, f) || l.specifiers.push(t(f));
}) : this._ast.program.body.unshift(
o.importDeclaration(
e.map(
(l) => o.importSpecifier(o.identifier(l), o.identifier(l))
),
e.map(t),
o.stringLiteral(r)
)
);
) : e.namespace && (l ? a(l, e.namespace) || l.specifiers.push(
o.importNamespaceSpecifier(o.identifier(e.namespace))
) : this._ast.program.body.unshift(
o.importDeclaration(
[o.importNamespaceSpecifier(o.identifier(e.namespace))],
o.stringLiteral(r)
)
));
}

@@ -973,3 +988,3 @@ }, Ze = /* @__PURE__ */ p((s, e) => {

// src/csf-tools/getStorySortParameter.ts
var be = L(F(), 1);
var be = R(F(), 1);
import { babelParse as rt, generate as ye, types as y, traverse as it } from "@storybook/core/babel";

@@ -990,5 +1005,5 @@ var st = console, X = /* @__PURE__ */ p((s, e) => {

if (y.isIdentifier(e))
return v(e.name, !0);
return I(e.name, !0);
throw new Error(`Unknown node type ${e.type}`);
}, "parseValue"), v = /* @__PURE__ */ p((s, e) => {
}, "parseValue"), I = /* @__PURE__ */ p((s, e) => {
let r = be.dedent`

@@ -1016,3 +1031,3 @@ Unexpected '${s}'. Parameter 'options.storySort' should be defined inline e.g.:

return X(r, "storySort");
v("options", !0);
I("options", !0);
}

@@ -1027,4 +1042,4 @@ }

} else
v("default", !0);
}, "parseDefault"), Lt = /* @__PURE__ */ p((s) => {
I("default", !0);
}, "parseDefault"), Rt = /* @__PURE__ */ p((s) => {
if (!s.includes("storySort"))

@@ -1045,3 +1060,3 @@ return;

}) : t.specifiers.forEach((i) => {
y.isIdentifier(i.exported) && i.exported.name === "parameters" && v("parameters", !1);
y.isIdentifier(i.exported) && i.exported.name === "parameters" && I("parameters", !1);
});

@@ -1053,3 +1068,3 @@ }

let i = t.declaration;
y.isIdentifier(i) && (i = O(i.name, r.program)), i = A(i), y.isObjectExpression(i) ? e = nt(i, r.program) : v("default", !1);
y.isIdentifier(i) && (i = O(i.name, r.program)), i = A(i), y.isObjectExpression(i) ? e = nt(i, r.program) : I("default", !1);
}

@@ -1069,3 +1084,3 @@ }

}
return y.isLiteral(e) || y.isArrayExpression(e) || y.isObjectExpression(e) ? Q(e) : v("storySort", !0);
return y.isLiteral(e) || y.isArrayExpression(e) || y.isObjectExpression(e) ? Q(e) : I("storySort", !0);
}

@@ -1075,26 +1090,26 @@ }, "getStorySortParameter");

// src/csf-tools/enrichCsf.ts
import { generate as ot, types as m } from "@storybook/core/babel";
import { generate as ot, types as g } from "@storybook/core/babel";
var at = /* @__PURE__ */ p((s, e, r, t) => {
let i = e.getStoryExport(r), a = !t?.disableSource && ct(i), n = !t?.disableDescription && _e(e._storyStatements[r]), l = [], u = m.memberExpression(
m.identifier(r), m.identifier("parameters"));
l.push(m.spreadElement(u));
let f = m.optionalMemberExpression(
u,
m.identifier("docs"),
let i = e.getStoryExport(r), a = !t?.disableSource && ct(i), n = !t?.disableDescription && _e(e._storyStatements[r]), l = [], f = g.memberExpression(
g.identifier(r), g.identifier("parameters"));
l.push(g.spreadElement(f));
let d = g.optionalMemberExpression(
f,
g.identifier("docs"),
!1,
!0
), x = [];
), m = [];
if (a) {
let g = m.optionalMemberExpression(
f,
m.identifier("source"),
let x = g.optionalMemberExpression(
d,
g.identifier("source"),
!1,
!0
);
x.push(
m.objectProperty(
m.identifier("source"),
m.objectExpression([
m.objectProperty(m.identifier("originalSource"), m.stringLiteral(a)),
m.spreadElement(g)
m.push(
g.objectProperty(
g.identifier("source"),
g.objectExpression([
g.objectProperty(g.identifier("originalSource"), g.stringLiteral(a)),
g.spreadElement(x)
])

@@ -1105,14 +1120,14 @@ )

if (n) {
let g = m.optionalMemberExpression(
f,
m.identifier("description"),
let x = g.optionalMemberExpression(
d,
g.identifier("description"),
!1,
!0
);
x.push(
m.objectProperty(
m.identifier("description"),
m.objectExpression([
m.objectProperty(m.identifier("story"), m.stringLiteral(n)),
m.spreadElement(g)
m.push(
g.objectProperty(
g.identifier("description"),
g.objectExpression([
g.objectProperty(g.identifier("story"), g.stringLiteral(n)),
g.spreadElement(x)
])

@@ -1122,13 +1137,13 @@ )

}
if (x.length > 0) {
if (m.length > 0) {
l.push(
m.objectProperty(
m.identifier("docs"),
m.objectExpression([m.spreadElement(f), ...x])
g.objectProperty(
g.identifier("docs"),
g.objectExpression([g.spreadElement(d), ...m])
)
);
let g = m.expressionStatement(
m.assignmentExpression("=", u, m.objectExpression(l))
let x = g.expressionStatement(
g.assignmentExpression("=", f, g.objectExpression(l))
);
s._ast.program.body.push(g);
s._ast.program.body.push(x);
}

@@ -1138,3 +1153,3 @@ }, "enrichCsfStory"), he = /* @__PURE__ */ p((s, e, r) => {

s.properties.find(
(u) => m.isObjectProperty(u) && m.isIdentifier(u.key) && u.key.name === "component"
(f) => g.isObjectProperty(f) && g.isIdentifier(f.key) && f.key.name === "component"
) || s.properties.unshift(r);

@@ -1144,5 +1159,5 @@ return;

let [t, ...i] = e, a = s.properties.find(
(l) => m.isObjectProperty(l) && m.isIdentifier(l.key) && l.key.name === t && m.isObjectExpression(l.value)
(l) => g.isObjectProperty(l) && g.isIdentifier(l.key) && l.key.name === t && g.isObjectExpression(l.value)
), n;
a ? n = a.value : (n = m.objectExpression([]), s.properties.push(m.objectProperty(m.identifier(t), n))), he(n, i, r);
a ? n = a.value : (n = g.objectExpression([]), s.properties.push(g.objectProperty(g.identifier(t), n))), he(n, i, r);
}, "addComponentDescription"), lt = /* @__PURE__ */ p((s, e, r) => {

@@ -1152,6 +1167,6 @@ let t = !r?.disableDescription && _e(e._metaStatement);

let i = s._metaNode;
i && m.isObjectExpression(i) && he(
i && g.isObjectExpression(i) && he(
i,
["parameters", "docs", "description"],
m.objectProperty(m.identifier("component"), m.stringLiteral(t))
g.objectProperty(g.identifier("component"), g.stringLiteral(t))
);

@@ -1164,3 +1179,3 @@ }

}, "enrichCsf"), ct = /* @__PURE__ */ p((s) => {
let e = m.isVariableDeclarator(s) ? s.init : s, { code: r } = ot(e, {});
let e = g.isVariableDeclarator(s) ? s.init : s, { code: r } = ot(e, {});
return r;

@@ -1177,4 +1192,4 @@ }, "extractSource"), _e = /* @__PURE__ */ p((s) => s?.leadingComments ? s.leadingComments.map((r) => r.type === "CommentLine" || !r.value.startsWith(

// src/csf-tools/vitest-plugin/transformer.ts
var H = L(F(), 1);
import { types as d } from "@storybook/core/babel";
var H = R(F(), 1);
import { types as u } from "@storybook/core/babel";
import { getStoryTitle as pt } from "@storybook/core/common";

@@ -1211,6 +1226,6 @@ import { combineTags as ft } from "@storybook/csf";

}, "makeTitle")
}).parse(), u = l._ast, f = l._metaVariableName, x = l._metaNode, g = x.properties.find(
(E) => d.isObjectProperty(E) && d.isIdentifier(E.key) && E.key.name === "title"
), b = d.stringLiteral(l._meta?.title || "unknown");
if (g ? d.isObjectProperty(g) && (g.value = b) : x.properties.push(d.objectProperty(d.identifier("title"), b)), !x || !l._meta)
}).parse(), f = l._ast, d = l._metaVariableName, m = l._metaNode, x = m.properties.find(
(E) => u.isObjectProperty(E) && u.isIdentifier(E.key) && E.key.name === "title"
), b = u.stringLiteral(l._meta?.title || "unknown");
if (x ? u.isObjectProperty(x) && (x.value = b) : m.properties.push(u.objectProperty(u.identifier("title"), b)), !m || !l._meta)
throw new Error(

@@ -1235,44 +1250,44 @@ `The Storybook vitest plugin could not detect the meta (default export) object in the story file.

if (Object.keys(_).length === 0) {
let E = d.expressionStatement(
d.callExpression(d.memberExpression(Y, d.identifier("skip")), [
d.stringLiteral("No valid tests found")
let E = u.expressionStatement(
u.callExpression(u.memberExpression(Y, u.identifier("skip")), [
u.stringLiteral("No valid tests found")
])
);
u.program.body.push(E);
f.program.body.push(E);
let j = [
d.importDeclaration(
u.importDeclaration(
[
d.importSpecifier(S, d.identifier("test")),
d.importSpecifier(Y, d.identifier("describe"))
u.importSpecifier(S, u.identifier("test")),
u.importSpecifier(Y, u.identifier("describe"))
],
d.stringLiteral("vitest")
u.stringLiteral("vitest")
)
];
u.program.body.unshift(...j);
f.program.body.unshift(...j);
} else {
let Z = function() {
let h = l._file.path.scope.generateUidIdentifier("isRunningFromThisFile"), P = d.memberExpression(
d.callExpression(d.memberExpression(E, d.identifier("getState")), []),
d.identifier("testPath")
), I = d.memberExpression(
d.memberExpression(d.identifier("globalThis"), d.identifier("__vitest_worker__")),
d.identifier("filepath")
), N = d.logicalExpression(
let h = l._file.path.scope.generateUidIdentifier("isRunningFromThisFile"), P = u.memberExpression(
u.callExpression(u.memberExpression(E, u.identifier("getState")), []),
u.identifier("testPath")
), v = u.memberExpression(
u.memberExpression(u.identifier("globalThis"), u.identifier("__vitest_worker__")),
u.identifier("filepath")
), N = u.logicalExpression(
"??",
// TODO: switch order of testPathProperty and filePathProperty when the bug is fixed
// https://github.com/vitest-dev/vitest/issues/6367 (or probably just use testPathProperty)
I,
v,
P
), R = d.callExpression(
d.memberExpression(
d.memberExpression(
d.memberExpression(d.identifier("import"), d.identifier("meta")),
d.identifier("url")
), L = u.callExpression(
u.memberExpression(
u.memberExpression(
u.memberExpression(u.identifier("import"), u.identifier("meta")),
u.identifier("url")
),
d.identifier("includes")
u.identifier("includes")
),
[N]
);
return { isRunningFromThisFileDeclaration: d.variableDeclaration("const", [
d.variableDeclarator(h, R)
return { isRunningFromThisFileDeclaration: u.variableDeclaration("const", [
u.variableDeclarator(h, L)
]), isRunningFromThisFileId: h };

@@ -1282,18 +1297,18 @@ };

p(Z, "getTestGuardDeclaration");
let E = l._file.path.scope.generateUidIdentifier("expect"), j = l._file.path.scope.generateUidIdentifier("testStory"), je = d.identifier(
let E = l._file.path.scope.generateUidIdentifier("expect"), j = l._file.path.scope.generateUidIdentifier("testStory"), je = u.identifier(
JSON.stringify(i.skip)), { isRunningFromThisFileDeclaration: Oe, isRunningFromThisFileId: Pe } = Z();
u.program.body.push(Oe);
f.program.body.push(Oe);
let De = /* @__PURE__ */ p(({
localName: h,
exportName: P,
testTitle: I,
testTitle: v,
node: N
}) => {
let R = d.expressionStatement(
d.callExpression(S, [
d.stringLiteral(I),
d.callExpression(j, [
d.stringLiteral(P),
d.identifier(h),
d.identifier(f),
let L = u.expressionStatement(
u.callExpression(S, [
u.stringLiteral(v),
u.callExpression(j, [
u.stringLiteral(P),
u.identifier(h),
u.identifier(d),
je

@@ -1303,4 +1318,4 @@ ])

);
return R.loc = N.loc, R;
}, "getTestStatementForStory"), ve = Object.entries(_).map(([h, P]) => {
return L.loc = N.loc, L;
}, "getTestStatementForStory"), Ie = Object.entries(_).map(([h, P]) => {
if (P === null) {

@@ -1315,20 +1330,20 @@ Se.warn(

}
let I = l._stories[h].localName ?? h, N = l._stories[h].name ?? h;
return De({ testTitle: N, localName: I, exportName: h, node: P });
}).filter((h) => !!h), Ie = d.ifStatement(Pe, d.blockStatement(ve));
u.program.body.push(Ie);
let v = l._stories[h].localName ?? h, N = l._stories[h].name ?? h;
return De({ testTitle: N, localName: v, exportName: h, node: P });
}).filter((h) => !!h), ve = u.ifStatement(Pe, u.blockStatement(Ie));
f.program.body.push(ve);
let Ne = [
d.importDeclaration(
u.importDeclaration(
[
d.importSpecifier(S, d.identifier("test")),
d.importSpecifier(E, d.identifier("expect"))
u.importSpecifier(S, u.identifier("test")),
u.importSpecifier(E, u.identifier("expect"))
],
d.stringLiteral("vitest")
u.stringLiteral("vitest")
),
d.importDeclaration(
[d.importSpecifier(j, d.identifier("testStory"))],
d.stringLiteral("@storybook/experimental-addon-test/internal/test-utils")
u.importDeclaration(
[u.importSpecifier(j, u.identifier("testStory"))],
u.stringLiteral("@storybook/experimental-addon-test/internal/test-utils")
)
];
u.program.body.unshift(...Ne);
f.program.body.unshift(...Ne);
}

@@ -1351,3 +1366,3 @@ return ce(l, { sourceMaps: !0, sourceFileName: e }, s);

ce as formatCsf,
Lt as getStorySortParameter,
Rt as getStorySortParameter,
We as isModuleMock,

@@ -1362,3 +1377,3 @@ Ze as loadConfig,

Tt as writeConfig,
vt as writeCsf
It as writeCsf
};

@@ -750,2 +750,4 @@ import ESM_COMPAT_Module from "node:module";

"Channel",
"HEARTBEAT_INTERVAL",
"HEARTBEAT_MAX_LATENCY",
"PostMessageTransport",

@@ -757,2 +759,4 @@ "WebsocketTransport",

"Channel",
"HEARTBEAT_INTERVAL",
"HEARTBEAT_MAX_LATENCY",
"PostMessageTransport",

@@ -764,2 +768,4 @@ "WebsocketTransport",

"Channel",
"HEARTBEAT_INTERVAL",
"HEARTBEAT_MAX_LATENCY",
"PostMessageTransport",

@@ -766,0 +772,0 @@ "WebsocketTransport",

@@ -70,2 +70,3 @@ import { TypescriptOptions, StorybookConfig, PackageJson } from '@storybook/core/types';

stripMetadata?: boolean;
notify?: boolean;
}

@@ -72,0 +73,0 @@ interface TelemetryData {

{
"name": "@storybook/core",
"version": "0.0.0-pr-30202-sha-4958640a",
"version": "0.0.0-pr-30202-sha-958e81ef",
"description": "Storybook framework-agnostic API",

@@ -278,2 +278,3 @@ "keywords": [

"@storybook/csf": "0.1.12",
"@storybook/theming": "0.0.0-pr-30202-sha-958e81ef",
"better-opn": "^3.0.2",

@@ -280,0 +281,0 @@ "browser-assert": "^1.2.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc