"use strict";
var c = Object.defineProperty;
var p = Object.getOwnPropertyDescriptor;
var l = Object.getOwnPropertyNames;
var A = Object.prototype.hasOwnProperty;
var s = (n, t) => c(n, "name", { value: t, configurable: !0 });
var a = (n, t) => {
  for (var i in t)
    c(n, i, { get: t[i], enumerable: !0 });
}, b = (n, t, i, r) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let e of l(t))
      !A.call(n, e) && e !== i && c(n, e, { get: () => t[e], enumerable: !(r = p(t, e)) || r.enumerable });
  return n;
};
var d = (n) => b(c({}, "__esModule", { value: !0 }), n);

// src/test/preview.ts
var L = {};
a(L, {
  default: () => E,
  traverseArgs: () => f
});
module.exports = d(L);
var m = require("storybook/internal/instrumenter"), k = require("storybook/preview-api"), o = require("storybook/test");
var g = /* @__PURE__ */ s(({ parameters: n }) => {
  n?.test?.mockReset === !0 ? (0, o.resetAllMocks)() : n?.test?.clearMocks === !0 ? (0, o.clearAllMocks)() : n?.test?.restoreMocks !== !1 &&
  (0, o.restoreAllMocks)();
}, "resetAllMocksLoader"), f = /* @__PURE__ */ s((n, t = 0, i) => {
  if (t > 5 || n == null)
    return n;
  if ((0, o.isMockFunction)(n))
    return i && n.mockName(i), n;
  if (typeof n == "function" && "isAction" in n && n.isAction && !("implicit" in n && n.implicit)) {
    let r = (0, o.fn)(n);
    return i && r.mockName(i), r;
  }
  if (Array.isArray(n)) {
    t++;
    for (let r = 0; r < n.length; r++)
      n[r] = f(n[r], t);
    return n;
  }
  if (typeof n == "object" && n.constructor === Object) {
    t++;
    for (let [r, e] of Object.entries(n))
      Object.getOwnPropertyDescriptor(n, r)?.writable && (n[r] = f(e, t, r));
    return n;
  }
  return n;
}, "traverseArgs"), w = /* @__PURE__ */ s(({ initialArgs: n }) => {
  f(n);
}, "nameSpiesAndWrapActionsInSpies"), M = /* @__PURE__ */ s(async (n) => {
  globalThis.HTMLElement && n.canvasElement instanceof globalThis.HTMLElement && (n.canvas = (0, o.within)(n.canvasElement)), globalThis.window?.
  navigator?.clipboard && (n.userEvent = (0, m.instrument)(
    { userEvent: o.uninstrumentedUserEvent.setup() },
    { intercept: !0 }
  ).userEvent);
}, "enhanceContext"), E = /* @__PURE__ */ s(() => (0, k.definePreview)({
  loaders: [g, w, M]
}), "default");
