"use strict";
var vo = Object.create;
var oe = Object.defineProperty;
var ko = Object.getOwnPropertyDescriptor;
var Po = Object.getOwnPropertyNames;
var Oo = Object.getPrototypeOf, Mo = Object.prototype.hasOwnProperty;
var n = (e, t) => oe(e, "name", { value: t, configurable: !0 });
var Ot = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Fe = (e, t) => {
  for (var r in t)
    oe(e, r, { get: t[r], enumerable: !0 });
}, Mt = (e, t, r, o) => {
  if (t && typeof t == "object" || typeof t == "function")
    for (let i of Po(t))
      !Mo.call(e, i) && i !== r && oe(e, i, { get: () => t[i], enumerable: !(o = ko(t, i)) || o.enumerable });
  return e;
};
var J = (e, t, r) => (r = e != null ? vo(Oo(e)) : {}, Mt(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  t || !e || !e.__esModule ? oe(r, "default", { value: e, enumerable: !0 }) : r,
  e
)), $o = (e) => Mt(oe({}, "__esModule", { value: !0 }), e);

// ../node_modules/@ngard/tiny-isequal/index.js
var It = Ot((Le) => {
  Object.defineProperty(Le, "__esModule", { value: !0 }), Le.isEqual = /* @__PURE__ */ function() {
    var e = Object.prototype.toString, t = Object.getPrototypeOf, r = Object.getOwnPropertySymbols ? function(o) {
      return Object.keys(o).concat(Object.getOwnPropertySymbols(o));
    } : Object.keys;
    return function(o, i) {
      return (/* @__PURE__ */ n(function s(a, l, c) {
        var p, g, u, h = e.call(a), T = e.call(l);
        if (a === l) return !0;
        if (a == null || l == null) return !1;
        if (c.indexOf(a) > -1 && c.indexOf(l) > -1) return !0;
        if (c.push(a, l), h != T || (p = r(a), g = r(l), p.length != g.length || p.some(function(R) {
          return !s(a[R], l[R], c);
        }))) return !1;
        switch (h.slice(8, -1)) {
          case "Symbol":
            return a.valueOf() == l.valueOf();
          case "Date":
          case "Number":
            return +a == +l || +a != +a && +l != +l;
          case "RegExp":
          case "Function":
          case "String":
          case "Boolean":
            return "" + a == "" + l;
          case "Set":
          case "Map":
            p = a.entries(), g = l.entries();
            do
              if (!s((u = p.next()).value, g.next().value, c)) return !1;
            while (!u.done);
            return !0;
          case "ArrayBuffer":
            a = new Uint8Array(a), l = new Uint8Array(l);
          case "DataView":
            a = new Uint8Array(a.buffer), l = new Uint8Array(l.buffer);
          case "Float32Array":
          case "Float64Array":
          case "Int8Array":
          case "Int16Array":
          case "Int32Array":
          case "Uint8Array":
          case "Uint16Array":
          case "Uint32Array":
          case "Uint8ClampedArray":
          case "Arguments":
          case "Array":
            if (a.length != l.length) return !1;
            for (u = 0; u < a.length; u++) if ((u in a || u in l) && (u in a != u in l || !s(a[u], l[u], c))) return !1;
            return !0;
          case "Object":
            return s(t(a), t(l), c);
          default:
            return !1;
        }
      }, "n"))(o, i, []);
    };
  }();
});

// ../node_modules/ts-dedent/dist/index.js
var Q = Ot((ie) => {
  "use strict";
  Object.defineProperty(ie, "__esModule", { value: !0 });
  ie.dedent = void 0;
  function jt(e) {
    for (var t = [], r = 1; r < arguments.length; r++)
      t[r - 1] = arguments[r];
    var o = Array.from(typeof e == "string" ? [e] : e);
    o[o.length - 1] = o[o.length - 1].replace(/\r?\n([\t ]*)$/, "");
    var i = o.reduce(function(l, c) {
      var p = c.match(/\n([\t ]+|(?!\s).)/g);
      return p ? l.concat(p.map(function(g) {
        var u, h;
        return (h = (u = g.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && h !== void 0 ? h : 0;
      })) : l;
    }, []);
    if (i.length) {
      var s = new RegExp(`
[	 ]{` + Math.min.apply(Math, i) + "}", "g");
      o = o.map(function(l) {
        return l.replace(s, `
`);
      });
    }
    o[0] = o[0].replace(/^\r?\n/, "");
    var a = o[0];
    return t.forEach(function(l, c) {
      var p = a.match(/(?:^|\n)( *)$/), g = p ? p[1] : "", u = l;
      typeof l == "string" && l.includes(`
`) && (u = String(l).split(`
`).map(function(h, T) {
        return T === 0 ? h : "" + g + h;
      }).join(`
`)), a += u + o[c + 1];
    }), a;
  }
  n(jt, "dedent");
  ie.dedent = jt;
  ie.default = jt;
});

// src/csf/index.ts
var ei = {};
Fe(ei, {
  combineTags: () => Qn,
  definePreview: () => Un,
  definePreviewAddon: () => Gn,
  getCoreAnnotations: () => vt,
  includeConditionalArg: () => Ft,
  isExportStory: () => Zn,
  isMeta: () => Yn,
  isPreview: () => Wn,
  isStory: () => Kn,
  parseKind: () => Jn,
  sanitize: () => Co,
  storyNameFromExport: () => qn,
  toId: () => Xn
});
module.exports = $o(ei);

// src/csf/toStartCaseStr.ts
function $t(e) {
  return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (t, r, o, i) => `${r} ${o}${i}`).replace(
  /([a-z])([A-Z])/g, (t, r, o) => `${r} ${o}`).replace(/([a-z])([0-9])/gi, (t, r, o) => `${r} ${o}`).replace(/([0-9])([a-z])/gi, (t, r, o) => `${r}\
 ${o}`).replace(/(\s|^)(\w)/g, (t, r, o) => `${r}${o.toUpperCase()}`).replace(/ +/g, " ").trim();
}
n($t, "toStartCaseStr");

// src/csf/includeConditionalArg.ts
var De = J(It(), 1);
var _t = /* @__PURE__ */ n((e) => e.map((t) => typeof t < "u").filter(Boolean).length, "count"), Io = /* @__PURE__ */ n((e, t) => {
  let { exists: r, eq: o, neq: i, truthy: s } = e;
  if (_t([r, o, i, s]) > 1)
    throw new Error(`Invalid conditional test ${JSON.stringify({ exists: r, eq: o, neq: i })}`);
  if (typeof o < "u")
    return (0, De.isEqual)(t, o);
  if (typeof i < "u")
    return !(0, De.isEqual)(t, i);
  if (typeof r < "u") {
    let l = typeof t < "u";
    return r ? l : !l;
  }
  return (typeof s > "u" ? !0 : s) ? !!t : !t;
}, "testValue"), Ft = /* @__PURE__ */ n((e, t, r) => {
  if (!e.if)
    return !0;
  let { arg: o, global: i } = e.if;
  if (_t([o, i]) !== 1)
    throw new Error(`Invalid conditional value ${JSON.stringify({ arg: o, global: i })}`);
  let s = o ? t[o] : r[i];
  return Io(e.if, s);
}, "includeConditionalArg");

// src/csf/csf-factories.ts
var Ao = require("storybook/internal/csf");

// src/preview-api/modules/addons/main.ts
var he = require("@storybook/global");

// src/preview-api/modules/addons/storybook-channel-mock.ts
var Lt = require("storybook/internal/channels");
function Dt() {
  let e = {
    setHandler: /* @__PURE__ */ n(() => {
    }, "setHandler"),
    send: /* @__PURE__ */ n(() => {
    }, "send")
  };
  return new Lt.Channel({ transport: e });
}
n(Dt, "mockChannel");

// src/preview-api/modules/addons/main.ts
var Ne = class {
  constructor() {
    this.getChannel = /* @__PURE__ */ n(() => {
      if (!this.channel) {
        let t = Dt();
        return this.setChannel(t), t;
      }
      return this.channel;
    }, "getChannel");
    this.ready = /* @__PURE__ */ n(() => this.promise, "ready");
    this.hasChannel = /* @__PURE__ */ n(() => !!this.channel, "hasChannel");
    this.setChannel = /* @__PURE__ */ n((t) => {
      this.channel = t, this.resolve();
    }, "setChannel");
    this.promise = new Promise((t) => {
      this.resolve = () => t(this.getChannel());
    });
  }
  static {
    n(this, "AddonStore");
  }
}, He = "__STORYBOOK_ADDONS_PREVIEW";
function _o() {
  return he.global[He] || (he.global[He] = new Ne()), he.global[He];
}
n(_o, "getAddonsStore");
var je = _o();

// src/preview-api/modules/addons/hooks.ts
var Fo = require("storybook/internal/client-logger"), X = require("storybook/internal/core-events"), xe = require("@storybook/global");
var be = class {
  constructor() {
    this.hookListsMap = void 0;
    this.mountedDecorators = void 0;
    this.prevMountedDecorators = void 0;
    this.currentHooks = void 0;
    this.nextHookIndex = void 0;
    this.currentPhase = void 0;
    this.currentEffects = void 0;
    this.prevEffects = void 0;
    this.currentDecoratorName = void 0;
    this.hasUpdates = void 0;
    this.currentContext = void 0;
    this.renderListener = /* @__PURE__ */ n((t) => {
      t === this.currentContext?.id && (this.triggerEffects(), this.currentContext = null, this.removeRenderListeners());
    }, "renderListener");
    this.init();
  }
  static {
    n(this, "HooksContext");
  }
  init() {
    this.hookListsMap = /* @__PURE__ */ new WeakMap(), this.mountedDecorators = /* @__PURE__ */ new Set(), this.prevMountedDecorators = /* @__PURE__ */ new Set(),
    this.currentHooks = [], this.nextHookIndex = 0, this.currentPhase = "NONE", this.currentEffects = [], this.prevEffects = [], this.currentDecoratorName =
    null, this.hasUpdates = !1, this.currentContext = null;
  }
  clean() {
    this.prevEffects.forEach((t) => {
      t.destroy && t.destroy();
    }), this.init(), this.removeRenderListeners();
  }
  getNextHook() {
    let t = this.currentHooks[this.nextHookIndex];
    return this.nextHookIndex += 1, t;
  }
  triggerEffects() {
    this.prevEffects.forEach((t) => {
      !this.currentEffects.includes(t) && t.destroy && t.destroy();
    }), this.currentEffects.forEach((t) => {
      this.prevEffects.includes(t) || (t.destroy = t.create());
    }), this.prevEffects = this.currentEffects, this.currentEffects = [];
  }
  addRenderListeners() {
    this.removeRenderListeners(), je.getChannel().on(X.STORY_RENDERED, this.renderListener);
  }
  removeRenderListeners() {
    je.getChannel().removeListener(X.STORY_RENDERED, this.renderListener);
  }
};
function Ht(e) {
  let t = /* @__PURE__ */ n((...r) => {
    let { hooks: o } = typeof r[0] == "function" ? r[1] : r[0], i = o.currentPhase, s = o.currentHooks, a = o.nextHookIndex, l = o.currentDecoratorName;
    o.currentDecoratorName = e.name, o.prevMountedDecorators.has(e) ? (o.currentPhase = "UPDATE", o.currentHooks = o.hookListsMap.get(e) || []) :
    (o.currentPhase = "MOUNT", o.currentHooks = [], o.hookListsMap.set(e, o.currentHooks), o.prevMountedDecorators.add(e)), o.nextHookIndex =
    0;
    let c = xe.global.STORYBOOK_HOOKS_CONTEXT;
    xe.global.STORYBOOK_HOOKS_CONTEXT = o;
    let p = e(...r);
    if (xe.global.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
      throw new Error(
        "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
      );
    return o.currentPhase = i, o.currentHooks = s, o.nextHookIndex = a, o.currentDecoratorName = l, p;
  }, "hookified");
  return t.originalFn = e, t;
}
n(Ht, "hookify");
var Be = 0, Lo = 25, Nt = /* @__PURE__ */ n((e) => (t, r) => {
  let o = e(
    Ht(t),
    r.map((i) => Ht(i))
  );
  return (i) => {
    let { hooks: s } = i;
    s.prevMountedDecorators ??= /* @__PURE__ */ new Set(), s.mountedDecorators = /* @__PURE__ */ new Set([t, ...r]), s.currentContext = i, s.
    hasUpdates = !1;
    let a = o(i);
    for (Be = 1; s.hasUpdates; )
      if (s.hasUpdates = !1, s.currentEffects = [], a = o(i), Be += 1, Be > Lo)
        throw new Error(
          "Too many re-renders. Storybook limits the number of renders to prevent an infinite loop."
        );
    return s.addRenderListeners(), a;
  };
}, "applyHooks");

// ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
function ne(e) {
  if (!e || typeof e != "object")
    return !1;
  let t = Object.getPrototypeOf(e);
  return t === null || t === Object.prototype || Object.getPrototypeOf(t) === null ? Object.prototype.toString.call(e) === "[object Object]" :
  !1;
}
n(ne, "isPlainObject");

// ../node_modules/es-toolkit/dist/object/mapValues.mjs
function G(e, t) {
  let r = {}, o = Object.keys(e);
  for (let i = 0; i < o.length; i++) {
    let s = o[i], a = e[s];
    r[s] = t(a, s, e);
  }
  return r;
}
n(G, "mapValues");

// ../node_modules/es-toolkit/dist/object/pickBy.mjs
function ze(e, t) {
  let r = {}, o = Object.keys(e);
  for (let i = 0; i < o.length; i++) {
    let s = o[i], a = e[s];
    t(a, s) && (r[s] = a);
  }
  return r;
}
n(ze, "pickBy");

// src/preview-api/modules/store/args.ts
var Do = require("storybook/internal/client-logger");
var Ho = J(Q(), 1);
var ki = Symbol("incompatible");
var Pi = Symbol("Deeply equal");
var Ue = "UNTARGETED";
function Bt({
  args: e,
  argTypes: t
}) {
  let r = {};
  return Object.entries(e).forEach(([o, i]) => {
    let { target: s = Ue } = t[o] || {};
    r[s] = r[s] || {}, r[s][o] = i;
  }), r;
}
n(Bt, "groupArgsByTarget");

// src/preview-api/modules/store/csf/getValuesFromArgTypes.ts
var zt = /* @__PURE__ */ n((e = {}) => Object.entries(e).reduce((t, [r, { defaultValue: o }]) => (typeof o < "u" && (t[r] = o), t), {}), "ge\
tValuesFromArgTypes");

// src/preview-api/modules/store/csf/normalizeInputTypes.ts
var No = /* @__PURE__ */ n((e) => typeof e == "string" ? { name: e } : e, "normalizeType"), jo = /* @__PURE__ */ n((e) => typeof e == "strin\
g" ? { type: e } : e, "normalizeControl"), Bo = /* @__PURE__ */ n((e, t) => {
  let { type: r, control: o, ...i } = e, s = {
    name: t,
    ...i
  };
  return r && (s.type = No(r)), o ? s.control = jo(o) : o === !1 && (s.control = { disable: !0 }), s;
}, "normalizeInputType"), q = /* @__PURE__ */ n((e) => G(e, Bo), "normalizeInputTypes");

// src/preview-api/modules/store/csf/normalizeStory.ts
var Te = require("storybook/internal/client-logger"), Se = require("storybook/internal/csf"), Ut = J(Q(), 1);

// src/preview-api/modules/store/csf/normalizeArrays.ts
var b = /* @__PURE__ */ n((e) => Array.isArray(e) ? e : e ? [e] : [], "normalizeArrays");

// src/preview-api/modules/store/csf/normalizeStory.ts
var zo = Ut.dedent`
CSF .story annotations deprecated; annotate story functions directly:
- StoryFn.story.name => StoryFn.storyName
- StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
`;
function Ge(e, t, r) {
  let o = t, i = typeof t == "function" ? t : null, { story: s } = o;
  s && (Te.logger.debug("deprecated story", s), (0, Te.deprecate)(zo));
  let a = (0, Se.storyNameFromExport)(e), l = typeof o != "function" && o.name || o.storyName || s?.name || a, c = [
    ...b(o.decorators),
    ...b(s?.decorators)
  ], p = { ...s?.parameters, ...o.parameters }, g = { ...s?.args, ...o.args }, u = { ...s?.argTypes, ...o.argTypes }, h = [...b(o.loaders), ...b(
  s?.loaders)], T = [
    ...b(o.beforeEach),
    ...b(s?.beforeEach)
  ], R = [
    ...b(o.afterEach),
    ...b(s?.afterEach)
  ], { render: P, play: F, tags: O = [], globals: _ = {} } = o, A = p.__id || (0, Se.toId)(r.id, a);
  return {
    moduleExport: t,
    id: A,
    name: l,
    tags: O,
    decorators: c,
    parameters: p,
    args: g,
    argTypes: q(u),
    loaders: h,
    beforeEach: T,
    afterEach: R,
    globals: _,
    ...P && { render: P },
    ...i && { userStoryFn: i },
    ...F && { play: F }
  };
}
n(Ge, "normalizeStory");

// src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts
var Gt = require("storybook/internal/csf");
function Wt(e, t = e.title, r) {
  let { id: o, argTypes: i } = e;
  return {
    id: (0, Gt.sanitize)(o || t),
    ...e,
    title: t,
    ...i && { argTypes: q(i) },
    parameters: {
      fileName: r,
      ...e.parameters
    }
  };
}
n(Wt, "normalizeComponentAnnotations");

// src/preview-api/modules/store/csf/prepareStory.ts
var Ae = require("storybook/internal/csf"), qt = require("storybook/internal/preview-errors"), Zt = require("@storybook/global"), Jt = require("@storybook/global");

// src/preview-api/modules/preview-web/render/mount-utils.ts
function Vt(e) {
  return e != null && Uo(e).includes("mount");
}
n(Vt, "mountDestructured");
function Uo(e) {
  let t = e.toString().match(/[^(]*\(([^)]*)/);
  if (!t)
    return [];
  let r = Yt(t[1]);
  if (!r.length)
    return [];
  let o = r[0];
  return o.startsWith("{") && o.endsWith("}") ? Yt(o.slice(1, -1).replace(/\s/g, "")).map((s) => s.replace(/:.*|=.*/g, "")) : [];
}
n(Uo, "getUsedProps");
function Yt(e) {
  let t = [], r = [], o = 0;
  for (let s = 0; s < e.length; s++)
    if (e[s] === "{" || e[s] === "[")
      r.push(e[s] === "{" ? "}" : "]");
    else if (e[s] === r[r.length - 1])
      r.pop();
    else if (!r.length && e[s] === ",") {
      let a = e.substring(o, s).trim();
      a && t.push(a), o = s + 1;
    }
  let i = e.substring(o).trim();
  return i && t.push(i), t;
}
n(Yt, "splitByComma");

// src/preview-api/modules/store/decorators.ts
function Kt(e, t, r) {
  let o = r(e);
  return (i) => t(o, i);
}
n(Kt, "decorateStory");
function Xt({
  componentId: e,
  title: t,
  kind: r,
  id: o,
  name: i,
  story: s,
  parameters: a,
  initialArgs: l,
  argTypes: c,
  ...p
} = {}) {
  return p;
}
n(Xt, "sanitizeStoryContextUpdate");
function We(e, t) {
  let r = {}, o = /* @__PURE__ */ n((s) => (a) => {
    if (!r.value)
      throw new Error("Decorated function called without init");
    return r.value = {
      ...r.value,
      ...Xt(a)
    }, s(r.value);
  }, "bindWithContext"), i = t.reduce(
    (s, a) => Kt(s, a, o),
    e
  );
  return (s) => (r.value = s, i(s));
}
n(We, "defaultDecorateStory");

// src/preview-api/modules/store/parameters.ts
var D = /* @__PURE__ */ n((...e) => {
  let t = {}, r = e.filter(Boolean), o = r.reduce((i, s) => (Object.entries(s).forEach(([a, l]) => {
    let c = i[a];
    Array.isArray(l) || typeof c > "u" ? i[a] = l : ne(l) && ne(c) ? t[a] = !0 : typeof l < "u" && (i[a] = l);
  }), i), {});
  return Object.keys(t).forEach((i) => {
    let s = r.filter(Boolean).map((a) => a[i]).filter((a) => typeof a < "u");
    s.every((a) => ne(a)) ? o[i] = D(...s) : o[i] = s[s.length - 1];
  }), o;
}, "combineParameters");

// src/preview-api/modules/store/csf/prepareStory.ts
function Ye(e, t, r) {
  let { moduleExport: o, id: i, name: s } = e || {}, a = Go(
    e,
    t,
    r
  ), l = /* @__PURE__ */ n(async (w) => {
    let d = {};
    for (let m of [
      b(r.loaders),
      b(t.loaders),
      b(e.loaders)
    ]) {
      if (w.abortSignal.aborted)
        return d;
      let f = await Promise.all(m.map((x) => x(w)));
      Object.assign(d, ...f);
    }
    return d;
  }, "applyLoaders"), c = /* @__PURE__ */ n(async (w) => {
    let d = new Array();
    for (let m of [
      ...b(r.beforeEach),
      ...b(t.beforeEach),
      ...b(e.beforeEach)
    ]) {
      if (w.abortSignal.aborted)
        return d;
      let f = await m(w);
      f && d.push(f);
    }
    return d;
  }, "applyBeforeEach"), p = /* @__PURE__ */ n(async (w) => {
    let d = [
      ...b(r.afterEach),
      ...b(t.afterEach),
      ...b(e.afterEach)
    ].reverse();
    for (let m of d) {
      if (w.abortSignal.aborted)
        return;
      await m(w);
    }
  }, "applyAfterEach"), g = /* @__PURE__ */ n((w) => w.originalStoryFn(w.args, w), "undecoratedStoryFn"), { applyDecorators: u = We, runStep: h } = r,
  T = [
    ...b(e?.decorators),
    ...b(t?.decorators),
    ...b(r?.decorators)
  ], R = e?.userStoryFn || e?.render || t.render || r.render, P = Nt(u)(g, T), F = /* @__PURE__ */ n((w) => P(w), "unboundStoryFn"), O = e?.
  play ?? t?.play, _ = Vt(O);
  if (!R && !_)
    throw new qt.NoRenderFunctionError({ id: i });
  let A = /* @__PURE__ */ n((w) => async () => (await w.renderToCanvas(), w.canvas), "defaultMount"), S = e.mount ?? t.mount ?? r.mount ?? A,
  k = r.testingLibraryRender;
  return {
    storyGlobals: {},
    ...a,
    moduleExport: o,
    id: i,
    name: s,
    story: s,
    originalStoryFn: R,
    undecoratedStoryFn: g,
    unboundStoryFn: F,
    applyLoaders: l,
    applyBeforeEach: c,
    applyAfterEach: p,
    playFunction: O,
    runStep: h,
    mount: S,
    testingLibraryRender: k,
    renderToCanvas: r.renderToCanvas,
    usesMount: _
  };
}
n(Ye, "prepareStory");
function Go(e, t, r) {
  let o = ["dev", "test"], i = Jt.global.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], s = (0, Ae.combineTags)(
    ...o,
    ...i,
    ...r.tags ?? [],
    ...t.tags ?? [],
    ...e?.tags ?? []
  ), a = D(
    r.parameters,
    t.parameters,
    e?.parameters
  ), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = r, p = D(
    r.argTypes,
    t.argTypes,
    e?.argTypes
  );
  if (e) {
    let O = e?.userStoryFn || e?.render || t.render || r.render;
    a.__isArgsStory = O && O.length > 0;
  }
  let g = {
    ...r.args,
    ...t.args,
    ...e?.args
  }, u = {
    ...t.globals,
    ...e?.globals
  }, h = {
    componentId: t.id,
    title: t.title,
    kind: t.title,
    // Back compat
    id: e?.id || t.id,
    // if there's no story name, we create a fake one since enhancers expect a name
    name: e?.name || "__meta",
    story: e?.name || "__meta",
    // Back compat
    component: t.component,
    subcomponents: t.subcomponents,
    tags: s,
    parameters: a,
    initialArgs: g,
    argTypes: p,
    storyGlobals: u
  };
  h.argTypes = l.reduce(
    (O, _) => _({ ...h, argTypes: O }),
    h.argTypes
  );
  let T = { ...g };
  h.initialArgs = [...c].reduce(
    (O, _) => ({
      ...O,
      ..._({
        ...h,
        initialArgs: O
      })
    }),
    T
  );
  let { name: R, story: P, ...F } = h;
  return F;
}
n(Go, "preparePartialAnnotations");
function Qt(e) {
  let { args: t } = e, r = {
    ...e,
    allArgs: void 0,
    argsByTarget: void 0
  };
  if (Zt.global.FEATURES?.argTypeTargetsV7) {
    let s = Bt(e);
    r = {
      ...e,
      allArgs: e.args,
      argsByTarget: s,
      args: s[Ue] || {}
    };
  }
  let o = Object.entries(r.args).reduce((s, [a, l]) => {
    if (!r.argTypes[a]?.mapping)
      return s[a] = l, s;
    let c = /* @__PURE__ */ n((p) => {
      let g = r.argTypes[a].mapping;
      return g && p in g ? g[p] : p;
    }, "mappingFn");
    return s[a] = Array.isArray(l) ? l.map(c) : c(l), s;
  }, {}), i = Object.entries(o).reduce((s, [a, l]) => {
    let c = r.argTypes[a] || {};
    return (0, Ae.includeConditionalArg)(c, o, r.globals) && (s[a] = l), s;
  }, {});
  return { ...r, unmappedArgs: t, args: i };
}
n(Qt, "prepareContext");

// src/preview-api/modules/store/inferArgTypes.ts
var er = require("storybook/internal/client-logger");
var tr = J(Q(), 1);
var Ve = /* @__PURE__ */ n((e, t, r) => {
  let o = typeof e;
  switch (o) {
    case "boolean":
    case "string":
    case "number":
    case "function":
    case "symbol":
      return { name: o };
    default:
      break;
  }
  return e ? r.has(e) ? (er.logger.warn(tr.dedent`
        We've detected a cycle in arg '${t}'. Args should be JSON-serializable.

        Consider using the mapping feature or fully custom args:
        - Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
        - Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
      `), { name: "other", value: "cyclic object" }) : (r.add(e), Array.isArray(e) ? { name: "array", value: e.length > 0 ? Ve(e[0], t, new Set(
  r)) : { name: "other", value: "unknown" } } : { name: "object", value: G(e, (s) => Ve(s, t, new Set(r))) }) : { name: "object", value: {} };
}, "inferType"), Ke = /* @__PURE__ */ n((e) => {
  let { id: t, argTypes: r = {}, initialArgs: o = {} } = e, i = G(o, (a, l) => ({
    name: l,
    type: Ve(a, `${t}.${l}`, /* @__PURE__ */ new Set())
  })), s = G(r, (a, l) => ({
    name: l
  }));
  return D(i, s, r);
}, "inferArgTypes");
Ke.secondPass = !0;

// src/preview-api/modules/store/inferControls.ts
var or = require("storybook/internal/client-logger");

// src/preview-api/modules/store/filterArgTypes.ts
var rr = /* @__PURE__ */ n((e, t) => Array.isArray(t) ? t.includes(e) : e.match(t), "matches"), Xe = /* @__PURE__ */ n((e, t, r) => !t && !r ?
e : e && ze(e, (o, i) => {
  let s = o.name || i.toString();
  return !!(!t || rr(s, t)) && (!r || !rr(s, r));
}), "filterArgTypes");

// src/preview-api/modules/store/inferControls.ts
var Wo = /* @__PURE__ */ n((e, t, r) => {
  let { type: o, options: i } = e;
  if (o) {
    if (r.color && r.color.test(t)) {
      let s = o.name;
      if (s === "string")
        return { control: { type: "color" } };
      s !== "enum" && or.logger.warn(
        `Addon controls: Control of type color only supports string, received "${s}" instead`
      );
    }
    if (r.date && r.date.test(t))
      return { control: { type: "date" } };
    switch (o.name) {
      case "array":
        return { control: { type: "object" } };
      case "boolean":
        return { control: { type: "boolean" } };
      case "string":
        return { control: { type: "text" } };
      case "number":
        return { control: { type: "number" } };
      case "enum": {
        let { value: s } = o;
        return { control: { type: s?.length <= 5 ? "radio" : "select" }, options: s };
      }
      case "function":
      case "symbol":
        return null;
      default:
        return { control: { type: i ? "select" : "object" } };
    }
  }
}, "inferControl"), Re = /* @__PURE__ */ n((e) => {
  let {
    argTypes: t,
    parameters: { __isArgsStory: r, controls: { include: o = null, exclude: i = null, matchers: s = {} } = {} }
  } = e;
  if (!r)
    return t;
  let a = Xe(t, o, i), l = G(a, (c, p) => c?.type && Wo(c, p.toString(), s));
  return D(l, a);
}, "inferControls");
Re.secondPass = !0;

// src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts
function se({
  argTypes: e,
  globalTypes: t,
  argTypesEnhancers: r,
  decorators: o,
  loaders: i,
  beforeEach: s,
  afterEach: a,
  initialGlobals: l,
  ...c
}) {
  return {
    ...e && { argTypes: q(e) },
    ...t && { globalTypes: q(t) },
    decorators: b(o),
    loaders: b(i),
    beforeEach: b(s),
    afterEach: b(a),
    argTypesEnhancers: [
      ...r || [],
      Ke,
      // There's an architectural decision to be made regarding embedded addons in core:
      //
      // Option 1: Keep embedded addons but ensure consistency by moving addon-specific code
      // (like inferControls) to live alongside the addon code itself. This maintains the
      // concept of core addons while improving code organization.
      //
      // Option 2: Fully integrate these addons into core, potentially moving UI components
      // into the manager and treating them as core features rather than addons. This is a
      // bigger architectural change requiring careful consideration.
      //
      // For now, we're keeping inferControls here as we need time to properly evaluate
      // these options and their implications. Some features (like Angular's cleanArgsDecorator)
      // currently rely on this behavior.
      //
      // TODO: Make an architectural decision on the handling of core addons
      Re
    ],
    initialGlobals: l,
    ...c
  };
}
n(se, "normalizeProjectAnnotations");

// src/preview-api/modules/store/csf/composeConfigs.ts
var ir = require("@storybook/global");

// src/preview-api/modules/store/csf/beforeAll.ts
var nr = /* @__PURE__ */ n((e) => async () => {
  let t = [];
  for (let r of e) {
    let o = await r();
    o && t.unshift(o);
  }
  return async () => {
    for (let r of t)
      await r();
  };
}, "composeBeforeAllHooks");

// src/preview-api/modules/store/csf/stepRunners.ts
function qe(e) {
  return async (t, r, o) => {
    await e.reduceRight(
      (s, a) => async () => a(t, s, o),
      async () => r(o)
    )();
  };
}
n(qe, "composeStepRunners");

// src/preview-api/modules/store/csf/composeConfigs.ts
function le(e, t) {
  return e.map((r) => r.default?.[t] ?? r[t]).filter(Boolean);
}
n(le, "getField");
function V(e, t, r = {}) {
  return le(e, t).reduce((o, i) => {
    let s = b(i);
    return r.reverseFileOrder ? [...s, ...o] : [...o, ...s];
  }, []);
}
n(V, "getArrayField");
function Ee(e, t) {
  return Object.assign({}, ...le(e, t));
}
n(Ee, "getObjectField");
function ae(e, t) {
  return le(e, t).pop();
}
n(ae, "getSingletonField");
function pe(e) {
  let t = V(e, "argTypesEnhancers"), r = le(e, "runStep"), o = V(e, "beforeAll");
  return {
    parameters: D(...le(e, "parameters")),
    decorators: V(e, "decorators", {
      reverseFileOrder: !(ir.global.FEATURES?.legacyDecoratorFileOrder ?? !1)
    }),
    args: Ee(e, "args"),
    argsEnhancers: V(e, "argsEnhancers"),
    argTypes: Ee(e, "argTypes"),
    argTypesEnhancers: [
      ...t.filter((i) => !i.secondPass),
      ...t.filter((i) => i.secondPass)
    ],
    initialGlobals: Ee(e, "initialGlobals"),
    globalTypes: Ee(e, "globalTypes"),
    loaders: V(e, "loaders"),
    beforeAll: nr(o),
    beforeEach: V(e, "beforeEach"),
    afterEach: V(e, "afterEach"),
    render: ae(e, "render"),
    renderToCanvas: ae(e, "renderToCanvas"),
    applyDecorators: ae(e, "applyDecorators"),
    runStep: qe(r),
    tags: V(e, "tags"),
    mount: ae(e, "mount"),
    testingLibraryRender: ae(e, "testingLibraryRender")
  };
}
n(pe, "composeConfigs");

// src/preview-api/modules/store/csf/portable-stories.ts
var Vo = require("storybook/internal/csf"), Ko = require("storybook/internal/csf"), cr = require("storybook/internal/preview-errors"), Xo = J(Q(), 1);

// src/preview-api/modules/preview-web/render/animation-utils.ts
function sr() {
  try {
    return (
      // @ts-expect-error this property exists in certain environments
      !!globalThis.__vitest_browser__ || // @ts-expect-error this property exists in certain environments
      !!globalThis.__playwright__binding__
    );
  } catch {
    return !1;
  }
}
n(sr, "isTestEnvironment");
function ar(e = !0) {
  if (!("document" in globalThis && "createElement" in globalThis.document))
    return () => {
    };
  let t = document.createElement("style");
  t.textContent = `*, *:before, *:after {
    animation: none !important;
  }`, document.head.appendChild(t);
  let r = document.createElement("style");
  return r.textContent = `*, *:before, *:after {
    animation-delay: 0s !important;
    animation-direction: ${e ? "reverse" : "normal"} !important;
    animation-play-state: paused !important;
    transition: none !important;
  }`, document.head.appendChild(r), document.body.clientHeight, document.head.removeChild(t), () => {
    r.parentNode?.removeChild(r);
  };
}
n(ar, "pauseAnimations");
async function lr(e) {
  if (!("document" in globalThis && "getAnimations" in globalThis.document && "querySelectorAll" in globalThis.document))
    return;
  let t = !1;
  await Promise.race([
    // After 50ms, retrieve any running animations and wait for them to finish
    // If new animations are created while waiting, we'll wait for them too
    new Promise((r) => {
      setTimeout(() => {
        let o = [globalThis.document, ...pr(globalThis.document)], i = /* @__PURE__ */ n(async () => {
          if (t || e?.aborted)
            return;
          let s = o.flatMap((a) => a?.getAnimations?.() || []).filter((a) => a.playState === "running" && !Yo(a));
          s.length > 0 && (await Promise.all(s.map((a) => a.finished)), await i());
        }, "checkAnimationsFinished");
        i().then(r);
      }, 100);
    }),
    // If animations don't finish within the timeout, continue without waiting
    new Promise(
      (r) => setTimeout(() => {
        t = !0, r(void 0);
      }, 5e3)
    )
  ]);
}
n(lr, "waitForAnimations");
function pr(e) {
  return [e, ...e.querySelectorAll("*")].reduce((t, r) => ("shadowRoot" in r && r.shadowRoot && t.push(r.shadowRoot, ...pr(r.shadowRoot)), t),
  []);
}
n(pr, "getShadowRoots");
function Yo(e) {
  if (e instanceof CSSAnimation && e.effect instanceof KeyframeEffect && e.effect.target) {
    let t = getComputedStyle(e.effect.target, e.effect.pseudoElement), r = t.animationName?.split(", ").indexOf(e.animationName);
    return t.animationIterationCount.split(", ")[r] === "infinite";
  }
  return !1;
}
n(Yo, "isInfiniteAnimation");

// src/preview-api/modules/store/reporter-api.ts
var we = class {
  constructor() {
    this.reports = [];
  }
  static {
    n(this, "ReporterAPI");
  }
  async addReport(t) {
    this.reports.push(t);
  }
};

// src/preview-api/modules/store/csf/portable-stories.ts
var qo = "ComposedStory", Zo = "Unnamed Story";
var K = [];
function Ze(e, t, r, o, i) {
  if (e === void 0)
    throw new Error("Expected a story but received undefined.");
  t.title = t.title ?? qo;
  let s = Wt(t), a = i || e.storyName || e.story?.name || e.name || Zo, l = Ge(
    a,
    e,
    s
  ), c = se(
    pe([
      o ?? globalThis.globalProjectAnnotations ?? {},
      r ?? {}
    ])
  ), p = Ye(
    l,
    s,
    c
  ), u = {
    ...zt(c.globalTypes),
    ...c.initialGlobals,
    ...p.storyGlobals
  }, h = new we(), T = /* @__PURE__ */ n(() => {
    let A = Qt({
      hooks: new be(),
      globals: u,
      args: { ...p.initialArgs },
      viewMode: "story",
      reporting: h,
      loaded: {},
      abortSignal: new AbortController().signal,
      step: /* @__PURE__ */ n((S, k) => p.runStep(S, k, A), "step"),
      canvasElement: null,
      canvas: {},
      userEvent: {},
      globalTypes: c.globalTypes,
      ...p,
      context: null,
      mount: null
    });
    return A.parameters.__isPortableStory = !0, A.context = A, p.renderToCanvas && (A.renderToCanvas = async () => {
      let S = await p.renderToCanvas?.(
        {
          componentId: p.componentId,
          title: p.title,
          id: p.id,
          name: p.name,
          tags: p.tags,
          showMain: /* @__PURE__ */ n(() => {
          }, "showMain"),
          showError: /* @__PURE__ */ n((k) => {
            throw new Error(`${k.title}
${k.description}`);
          }, "showError"),
          showException: /* @__PURE__ */ n((k) => {
            throw k;
          }, "showException"),
          forceRemount: !0,
          storyContext: A,
          storyFn: /* @__PURE__ */ n(() => p.unboundStoryFn(A), "storyFn"),
          unboundStoryFn: p.unboundStoryFn
        },
        A.canvasElement
      );
      S && K.push(S);
    }), A.mount = p.mount(A), A;
  }, "initializeContext"), R, P = /* @__PURE__ */ n(async (A) => {
    let S = T();
    return S.canvasElement ??= globalThis?.document?.body, R && (S.loaded = R.loaded), Object.assign(S, A), p.playFunction(S);
  }, "play"), F = /* @__PURE__ */ n((A) => {
    let S = T();
    return Object.assign(S, A), Jo(p, S);
  }, "run"), O = p.playFunction ? P : void 0;
  return Object.assign(
    /* @__PURE__ */ n(function(S) {
      let k = T();
      return R && (k.loaded = R.loaded), k.args = {
        ...k.initialArgs,
        ...S
      }, p.unboundStoryFn(k);
    }, "storyFn"),
    {
      id: p.id,
      storyName: a,
      load: /* @__PURE__ */ n(async () => {
        for (let S of [...K].reverse())
          await S();
        K.length = 0;
        let A = T();
        A.loaded = await p.applyLoaders(A), K.push(...(await p.applyBeforeEach(A)).filter(Boolean)), R = A;
      }, "load"),
      globals: u,
      args: p.initialArgs,
      parameters: p.parameters,
      argTypes: p.argTypes,
      play: O,
      run: F,
      reporting: h,
      tags: p.tags
    }
  );
}
n(Ze, "composeStory");
async function Jo(e, t) {
  for (let s of [...K].reverse())
    await s();
  if (K.length = 0, !t.canvasElement) {
    let s = document.createElement("div");
    globalThis?.document?.body?.appendChild(s), t.canvasElement = s, K.push(() => {
      globalThis?.document?.body?.contains(s) && globalThis?.document?.body?.removeChild(s);
    });
  }
  if (t.loaded = await e.applyLoaders(t), t.abortSignal.aborted)
    return;
  K.push(...(await e.applyBeforeEach(t)).filter(Boolean));
  let r = e.playFunction, o = e.usesMount;
  if (o || await t.mount(), t.abortSignal.aborted)
    return;
  r && (o || (t.mount = async () => {
    throw new cr.MountMustBeDestructuredError({ playFunction: r.toString() });
  }), await r(t));
  let i;
  sr() ? i = ar() : await lr(t.abortSignal), await e.applyAfterEach(t), await i?.();
}
n(Jo, "runStory");

// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
var Qo = process.env.NODE_ENV === "production", Je = "Invariant failed";
function Ce(e, t) {
  if (!e) {
    if (Qo)
      throw new Error(Je);
    var r = typeof t == "function" ? t() : t, o = r ? "".concat(Je, ": ").concat(r) : Je;
    throw new Error(o);
  }
}
n(Ce, "invariant");

// src/actions/preview.ts
var Sr = require("storybook/internal/csf");

// src/actions/addArgs.ts
var tt = {};
Fe(tt, {
  argsEnhancers: () => rn
});

// src/actions/runtime/action.ts
var ur = require("storybook/internal/preview-errors"), et = require("@storybook/global"), fr = require("storybook/preview-api");

// src/actions/constants.ts
var Qe = "storybook/actions", ha = `${Qe}/panel`, dr = `${Qe}/action-event`, xa = `${Qe}/action-clear`;

// src/actions/runtime/configureActions.ts
var mr = {
  depth: 10,
  clearOnStoryChange: !0,
  limit: 50
};

// src/actions/runtime/action.ts
var gr = /* @__PURE__ */ n((e, t) => {
  let r = Object.getPrototypeOf(e);
  return !r || t(r) ? r : gr(r, t);
}, "findProto"), en = /* @__PURE__ */ n((e) => !!(typeof e == "object" && e && gr(e, (t) => /^Synthetic(?:Base)?Event$/.test(t.constructor.name)) &&
typeof e.persist == "function"), "isReactSyntheticEvent"), tn = /* @__PURE__ */ n((e) => {
  if (en(e)) {
    let t = Object.create(
      e.constructor.prototype,
      Object.getOwnPropertyDescriptors(e)
    );
    t.persist();
    let r = Object.getOwnPropertyDescriptor(t, "view"), o = r?.value;
    return typeof o == "object" && o?.constructor.name === "Window" && Object.defineProperty(t, "view", {
      ...r,
      value: Object.create(o.constructor.prototype)
    }), t;
  }
  return e;
}, "serializeArg");
function ce(e, t = {}) {
  let r = {
    ...mr,
    ...t
  }, o = /* @__PURE__ */ n(function(...s) {
    if (t.implicit) {
      let T = ("__STORYBOOK_PREVIEW__" in et.global ? et.global.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
        (R) => R.phase === "playing" || R.phase === "rendering"
      );
      if (T) {
        let R = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, P = new ur.ImplicitActionsDuringRendering({
          phase: T.phase,
          name: e,
          deprecated: R
        });
        if (R)
          console.warn(P);
        else
          throw P;
      }
    }
    let a = fr.addons.getChannel(), l = Date.now().toString(36) + Math.random().toString(36).substring(2), c = 5, p = s.map(tn), g = s.length >
    1 ? p : p[0], u = {
      id: l,
      count: 0,
      data: { name: e, args: g },
      options: {
        ...r,
        maxDepth: c + (r.depth || 3)
      }
    };
    a.emit(dr, u);
  }, "actionHandler");
  return o.isAction = !0, o.implicit = t.implicit, o;
}
n(ce, "action");

// src/actions/addArgsHelpers.ts
var yr = /* @__PURE__ */ n((e, t) => typeof t[e] > "u" && !(e in t), "isInInitialArgs"), hr = /* @__PURE__ */ n((e) => {
  let {
    initialArgs: t,
    argTypes: r,
    id: o,
    parameters: { actions: i }
  } = e;
  if (!i || i.disable || !i.argTypesRegex || !r)
    return {};
  let s = new RegExp(i.argTypesRegex);
  return Object.entries(r).filter(
    ([l]) => !!s.test(l)
  ).reduce((l, [c, p]) => (yr(c, t) && (l[c] = ce(c, { implicit: !0, id: o })), l), {});
}, "inferActionsFromArgTypesRegex"), xr = /* @__PURE__ */ n((e) => {
  let {
    initialArgs: t,
    argTypes: r,
    parameters: { actions: o }
  } = e;
  return o?.disable || !r ? {} : Object.entries(r).filter(([s, a]) => !!a.action).reduce((s, [a, l]) => (yr(a, t) && (s[a] = ce(typeof l.action ==
  "string" ? l.action : a)), s), {});
}, "addActionsFromArgTypes");

// src/actions/addArgs.ts
var rn = [
  xr,
  hr
];

// src/actions/loaders.ts
var rt = {};
Fe(rt, {
  loaders: () => nn
});
var Tr = require("storybook/test");
var br = !1, on = /* @__PURE__ */ n((e) => {
  let { parameters: t } = e;
  t?.actions?.disable || br || ((0, Tr.onMockCall)((r, o) => {
    let i = r.getMockName();
    i !== "spy" && (!/^next\/.*::/.test(i) || [
      "next/router::useRouter()",
      "next/navigation::useRouter()",
      "next/navigation::redirect",
      "next/cache::",
      "next/headers::cookies().set",
      "next/headers::cookies().delete",
      "next/headers::headers().set",
      "next/headers::headers().delete"
    ].some((s) => i.startsWith(s))) && ce(i)(o);
  }), br = !0);
}, "logActionsWhenMockCalled"), nn = [on];

// src/actions/preview.ts
var ot = /* @__PURE__ */ n(() => (0, Sr.definePreviewAddon)({
  ...tt,
  ...rt
}), "default");

// src/backgrounds/preview.ts
var Pr = require("storybook/internal/csf");

// src/backgrounds/constants.ts
var sn = "storybook/background", ee = "backgrounds";
var _a = {
  UPDATE: `${sn}/update`
};

// src/backgrounds/decorator.ts
var it = require("storybook/preview-api");

// src/backgrounds/defaults.ts
var Ar = {
  light: { name: "light", value: "#F8F8F8" },
  dark: { name: "dark", value: "#333" }
};

// src/backgrounds/utils.ts
var { document: B } = globalThis, Rr = /* @__PURE__ */ n(() => globalThis?.matchMedia ? !!globalThis.matchMedia("(prefers-reduced-motion: re\
duce)")?.matches : !1, "isReduceMotionEnabled"), nt = /* @__PURE__ */ n((e) => {
  (Array.isArray(e) ? e : [e]).forEach(an);
}, "clearStyles"), an = /* @__PURE__ */ n((e) => {
  if (!B)
    return;
  let t = B.getElementById(e);
  t && t.parentElement && t.parentElement.removeChild(t);
}, "clearStyle"), Er = /* @__PURE__ */ n((e, t) => {
  if (!B)
    return;
  let r = B.getElementById(e);
  if (r)
    r.innerHTML !== t && (r.innerHTML = t);
  else {
    let o = B.createElement("style");
    o.setAttribute("id", e), o.innerHTML = t, B.head.appendChild(o);
  }
}, "addGridStyle"), wr = /* @__PURE__ */ n((e, t, r) => {
  if (!B)
    return;
  let o = B.getElementById(e);
  if (o)
    o.innerHTML !== t && (o.innerHTML = t);
  else {
    let i = B.createElement("style");
    i.setAttribute("id", e), i.innerHTML = t;
    let s = `addon-backgrounds-grid${r ? `-docs-${r}` : ""}`, a = B.getElementById(s);
    a ? a.parentElement?.insertBefore(i, a) : B.head.appendChild(i);
  }
}, "addBackgroundStyle");

// src/backgrounds/decorator.ts
var ln = {
  cellSize: 100,
  cellAmount: 10,
  opacity: 0.8
}, Cr = "addon-backgrounds", vr = "addon-backgrounds-grid", pn = Rr() ? "" : "transition: background-color 0.3s;", kr = /* @__PURE__ */ n((e, t) => {
  let { globals: r = {}, parameters: o = {}, viewMode: i, id: s } = t, {
    options: a = Ar,
    disable: l,
    grid: c = ln
  } = o[ee] || {}, p = r[ee] || {}, g = typeof p == "string" ? p : p?.value, u = g ? a[g] : void 0, h = typeof u == "string" ? u : u?.value ||
  "transparent", T = typeof p == "string" ? !1 : p.grid || !1, R = !!u && !l, P = i === "docs" ? `#anchor--${s} .docs-story` : ".sb-show-mai\
n", F = i === "docs" ? `#anchor--${s} .docs-story` : ".sb-show-main", O = o.layout === void 0 || o.layout === "padded", _ = i === "docs" ? 20 :
  O ? 16 : 0, { cellAmount: A, cellSize: S, opacity: k, offsetX: w = _, offsetY: d = _ } = c, m = i === "docs" ? `${Cr}-docs-${s}` : `${Cr}-\
color`, f = i === "docs" ? s : null;
  (0, it.useEffect)(() => {
    let y = `
    ${P} {
      background: ${h} !important;
      ${pn}
      }`;
    if (!R) {
      nt(m);
      return;
    }
    wr(m, y, f);
  }, [P, m, f, R, h]);
  let x = i === "docs" ? `${vr}-docs-${s}` : `${vr}`;
  return (0, it.useEffect)(() => {
    if (!T) {
      nt(x);
      return;
    }
    let y = [
      `${S * A}px ${S * A}px`,
      `${S * A}px ${S * A}px`,
      `${S}px ${S}px`,
      `${S}px ${S}px`
    ].join(", "), E = `
        ${F} {
          background-size: ${y} !important;
          background-position: ${w}px ${d}px, ${w}px ${d}px, ${w}px ${d}px, ${w}px ${d}px !important;
          background-blend-mode: difference !important;
          background-image: linear-gradient(rgba(130, 130, 130, ${k}) 1px, transparent 1px),
           linear-gradient(90deg, rgba(130, 130, 130, ${k}) 1px, transparent 1px),
           linear-gradient(rgba(130, 130, 130, ${k / 2}) 1px, transparent 1px),
           linear-gradient(90deg, rgba(130, 130, 130, ${k / 2}) 1px, transparent 1px) !important;
        }
      `;
    Er(x, E);
  }, [A, S, F, x, T, w, d, k]), e();
}, "withBackgroundAndGrid");

// src/backgrounds/preview.ts
var cn = globalThis.FEATURES?.backgrounds ? [kr] : [], dn = {
  [ee]: {
    grid: {
      cellSize: 20,
      opacity: 0.5,
      cellAmount: 5
    },
    disable: !1
  }
}, mn = {
  [ee]: { value: void 0, grid: !1 }
}, st = /* @__PURE__ */ n(() => (0, Pr.definePreviewAddon)({
  decorators: cn,
  parameters: dn,
  initialGlobals: mn
}), "default");

// src/component-testing/preview.ts
var Or = require("storybook/internal/csf"), Mr = require("storybook/internal/instrumenter");
var { step: un } = (0, Mr.instrument)(
  {
    // It seems like the label is unused, but the instrumenter has access to it
    // The context will be bounded later in StoryRender, so that the user can write just:
    // await step("label", (context) => {
    //   // labeled step
    // });
    step: /* @__PURE__ */ n(async (e, t, r) => t(r), "step")
  },
  { intercept: !0 }
), at = /* @__PURE__ */ n(() => (0, Or.definePreviewAddon)({
  parameters: {
    throwPlayFunctionExceptions: !1
  },
  runStep: un
}), "default");

// src/highlight/preview.ts
var Wr = require("storybook/internal/csf"), gt = require("storybook/preview-api");

// src/highlight/useHighlights.ts
var Ur = require("storybook/internal/core-events");

// src/highlight/constants.ts
var ve = "storybook/highlight", $r = `${ve}/add`, Ir = `${ve}/remove`, _r = `${ve}/reset`, Fr = `${ve}/scroll-into-view`, lt = 2147483647, z = 28;

// src/highlight/icons.ts
var pt = {
  chevronLeft: [
    "M9.10355 10.1464C9.29882 10.3417 9.29882 10.6583 9.10355 10.8536C8.90829 11.0488 8.59171 11.0488 8.39645 10.8536L4.89645 7.35355C4.7011\
8 7.15829 4.70118 6.84171 4.89645 6.64645L8.39645 3.14645C8.59171 2.95118 8.90829 2.95118 9.10355 3.14645C9.29882 3.34171 9.29882 3.65829 9.\
10355 3.85355L5.95711 7L9.10355 10.1464Z"
  ],
  chevronRight: [
    "M4.89645 10.1464C4.70118 10.3417 4.70118 10.6583 4.89645 10.8536C5.09171 11.0488 5.40829 11.0488 5.60355 10.8536L9.10355 7.35355C9.2988\
2 7.15829 9.29882 6.84171 9.10355 6.64645L5.60355 3.14645C5.40829 2.95118 5.09171 2.95118 4.89645 3.14645C4.70118 3.34171 4.70118 3.65829 4.\
89645 3.85355L8.04289 7L4.89645 10.1464Z"
  ],
  info: [
    "M7 5.5a.5.5 0 01.5.5v4a.5.5 0 01-1 0V6a.5.5 0 01.5-.5zM7 4.5A.75.75 0 107 3a.75.75 0 000 1.5z",
    "M7 14A7 7 0 107 0a7 7 0 000 14zm0-1A6 6 0 107 1a6 6 0 000 12z"
  ],
  shareAlt: [
    "M2 1.004a1 1 0 00-1 1v10a1 1 0 001 1h10a1 1 0 001-1v-4.5a.5.5 0 00-1 0v4.5H2v-10h4.5a.5.5 0 000-1H2z",
    "M7.354 7.357L12 2.711v1.793a.5.5 0 001 0v-3a.5.5 0 00-.5-.5h-3a.5.5 0 100 1h1.793L6.646 6.65a.5.5 0 10.708.707z"
  ]
};

// src/highlight/types.ts
var Lr = /* @__PURE__ */ n((e) => "elements" in e && e.elements?.every((t) => typeof t == "string"), "isLegacyFormat");

// src/highlight/utils.ts
var fn = "svg,path,rect,circle,line,polyline,polygon,ellipse,text".split(","), M = /* @__PURE__ */ n((e, t = {}, r) => {
  let o = fn.includes(e) ? document.createElementNS("http://www.w3.org/2000/svg", e) : document.createElement(e);
  return Object.entries(t).forEach(([i, s]) => {
    /[A-Z]/.test(i) ? (i === "onClick" && (o.addEventListener("click", s), o.addEventListener("keydown", (a) => {
      (a.key === "Enter" || a.key === " ") && (a.preventDefault(), s());
    })), i === "onMouseEnter" && o.addEventListener("mouseenter", s), i === "onMouseLeave" && o.addEventListener("mouseleave", s)) : o.setAttribute(
    i, s);
  }), r?.forEach((i) => {
    if (!(i == null || i === !1))
      try {
        o.appendChild(i);
      } catch {
        o.appendChild(document.createTextNode(String(i)));
      }
  }), o;
}, "createElement"), me = /* @__PURE__ */ n((e) => pt[e] && M(
  "svg",
  { width: "14", height: "14", viewBox: "0 0 14 14", xmlns: "http://www.w3.org/2000/svg" },
  pt[e].map(
    (t) => M("path", {
      fill: "currentColor",
      "fill-rule": "evenodd",
      "clip-rule": "evenodd",
      d: t
    })
  )
), "createIcon"), Dr = /* @__PURE__ */ n((e) => {
  if (Lr(e)) {
    let { elements: r, color: o, style: i } = e;
    return {
      id: void 0,
      priority: 0,
      selectors: r,
      styles: {
        outline: `2px ${i} ${o}`,
        outlineOffset: "2px",
        boxShadow: "0 0 0 6px rgba(255,255,255,0.6)"
      },
      menu: void 0
    };
  }
  let { menu: t } = e;
  return {
    ...e,
    menu: Array.isArray(t) ? t.every(Array.isArray) ? t : [t] : void 0
  };
}, "normalizeOptions"), gn = /* @__PURE__ */ n((e) => e instanceof Function, "isFunction"), de = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(),
ke = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ n((e) => {
  let t = Symbol();
  return Z.set(t, []), de.set(t, e), { get: /* @__PURE__ */ n(() => de.get(t), "get"), set: /* @__PURE__ */ n((a) => {
    let l = de.get(t), c = gn(a) ? a(l) : a;
    c !== l && (de.set(t, c), Z.get(t)?.forEach((p) => {
      ke.get(p)?.(), ke.set(p, p(c));
    }));
  }, "set"), subscribe: /* @__PURE__ */ n((a) => (Z.get(t)?.push(a), () => {
    let l = Z.get(t);
    l && Z.set(
      t,
      l.filter((c) => c !== a)
    );
  }), "subscribe"), teardown: /* @__PURE__ */ n(() => {
    Z.get(t)?.forEach((a) => {
      ke.get(a)?.(), ke.delete(a);
    }), Z.delete(t), de.delete(t);
  }, "teardown") };
}, "useStore"), ct = /* @__PURE__ */ n((e, t) => {
  if (typeof t == "string")
    return [
      ...document.querySelectorAll(
        // Elements matching the selector, excluding storybook elements and their descendants.
        // Necessary to find portaled elements (e.g. children of `body`).
        `:is(${t}):not([id^="storybook-"], [id^="storybook-"] *, .sb-wrapper, .sb-wrapper *)`
      ),
      // Elements matching the selector inside the storybook root, as these were excluded above.
      ...e?.querySelectorAll(t) || []
    ];
  if (typeof t == "object" && "__callId__" in t) {
    let r = window?.__STORYBOOK_PREVIEW__?.currentSelection?.storyId, o = window?.parent?.__STORYBOOK_ADDON_INTERACTIONS_INSTRUMENTER_STATE__?.[r];
    if (o)
      return o.calls.find((s) => s.id === t.__callId__)?.actualArgs?.filter((s) => s instanceof HTMLElement) || [];
  }
  return [];
}, "selectElements"), yn = /* @__PURE__ */ n((e) => e.reduce(
  (t, r) => ((typeof r == "string" && !t.includes(r) || typeof r == "object" && !t.some((o) => typeof o == "object" && o.__callId__ === r.__callId__)) &&
  t.push(r), t),
  []
), "dedupeSelectors"), hn = { outline: "2px dashed #029cfd" }, dt = /* @__PURE__ */ n((e) => {
  let t = document.getElementById("storybook-root"), r = /* @__PURE__ */ new Map();
  for (let o of e)
    for (let i of o.selectors) {
      let s = ct(t, i);
      for (let a of s) {
        let l = r.get(a);
        (!l || l.priority <= (o.priority || 0)) && r.set(a, {
          id: o.id,
          priority: o.priority || 0,
          selectors: yn([...l?.selectors || [], i]),
          styles: o.styles || hn,
          hoverStyles: o.hoverStyles,
          focusStyles: o.focusStyles,
          menu: o.menu
        });
      }
    }
  return r;
}, "mapElements"), Hr = /* @__PURE__ */ n((e) => Array.from(e.entries()).map(([t, { selectors: r, styles: o, hoverStyles: i, focusStyles: s,
menu: a }]) => {
  let { top: l, left: c, width: p, height: g } = t.getBoundingClientRect(), { position: u } = getComputedStyle(t);
  return {
    element: t,
    selectors: r,
    styles: o,
    hoverStyles: i,
    focusStyles: s,
    menu: a,
    top: u === "fixed" ? l : l + window.scrollY,
    left: u === "fixed" ? c : c + window.scrollX,
    width: p,
    height: g
  };
}).sort((t, r) => r.width * r.height - t.width * t.height), "mapBoxes"), mt = /* @__PURE__ */ n((e, t) => {
  let r = e.getBoundingClientRect(), { x: o, y: i } = t;
  return r?.top && r?.left && o >= r.left && o <= r.left + r.width && i >= r.top && i <= r.top + r.height;
}, "isOverMenu"), ut = /* @__PURE__ */ n((e, t, r) => {
  if (!t || !r)
    return !1;
  let { left: o, top: i, width: s, height: a } = e;
  a < z && (i = i - Math.round((z - a) / 2), a = z), s < z && (o = o - Math.round((z - s) / 2), s = z), t.style.position === "fixed" && (o +=
  window.scrollX, i += window.scrollY);
  let { x: l, y: c } = r;
  return l >= o && l <= o + s && c >= i && c <= i + a;
}, "isTargeted"), Nr = /* @__PURE__ */ n((e, t, r = {}) => {
  let { x: o, y: i } = t, { margin: s = 5, topOffset: a = 0, centered: l = !1 } = r, { scrollX: c, scrollY: p, innerHeight: g, innerWidth: u } = window,
  h = Math.min(
    e.style.position === "fixed" ? i - p : i,
    g - e.clientHeight - s - a + p
  ), T = l ? e.clientWidth / 2 : 0, R = e.style.position === "fixed" ? Math.max(Math.min(o - c, u - T - s), T + s) : Math.max(
    Math.min(o, u - T - s + c),
    T + s + c
  );
  Object.assign(e.style, {
    ...R !== o && { left: `${R}px` },
    ...h !== i && { top: `${h}px` }
  });
}, "keepInViewport"), ft = /* @__PURE__ */ n((e) => {
  window.HTMLElement.prototype.hasOwnProperty("showPopover") && e.showPopover();
}, "showPopover"), jr = /* @__PURE__ */ n((e) => {
  window.HTMLElement.prototype.hasOwnProperty("showPopover") && e.hidePopover();
}, "hidePopover"), Br = /* @__PURE__ */ n((e) => ({
  top: e.top,
  left: e.left,
  width: e.width,
  height: e.height,
  selectors: e.selectors,
  element: {
    attributes: Object.fromEntries(
      Array.from(e.element.attributes).map((t) => [t.name, t.value])
    ),
    localName: e.element.localName,
    tagName: e.element.tagName,
    outerHTML: e.element.outerHTML
  }
}), "getEventDetails");

// src/highlight/useHighlights.ts
var C = "storybook-highlights-menu", zr = "storybook-highlights-root", xn = "storybook-root", Gr = /* @__PURE__ */ n((e) => {
  if (globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED)
    return;
  globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED = !0;
  let { document: t } = globalThis, r = U([]), o = U(/* @__PURE__ */ new Map()), i = U([]), s = U(), a = U(), l = U([]), c = U([]), p = U(),
  g = U(), u = t.getElementById(zr);
  r.subscribe(() => {
    u || (u = M("div", { id: zr }), t.body.appendChild(u));
  }), r.subscribe((d) => {
    let m = t.getElementById(xn);
    if (!m)
      return;
    o.set(dt(d));
    let f = new MutationObserver(() => o.set(dt(d)));
    return f.observe(m, { subtree: !0, childList: !0 }), () => {
      f.disconnect();
    };
  }), o.subscribe((d) => {
    let m = /* @__PURE__ */ n(() => requestAnimationFrame(() => i.set(Hr(d))), "updateBoxes"), f = new ResizeObserver(m);
    f.observe(t.body), Array.from(d.keys()).forEach((y) => f.observe(y));
    let x = Array.from(t.body.querySelectorAll("*")).filter((y) => {
      let { overflow: E, overflowX: $, overflowY: v } = window.getComputedStyle(y);
      return ["auto", "scroll"].some((L) => [E, $, v].includes(L));
    });
    return x.forEach((y) => y.addEventListener("scroll", m)), () => {
      f.disconnect(), x.forEach((y) => y.removeEventListener("scroll", m));
    };
  }), o.subscribe((d) => {
    let m = Array.from(d.keys()).filter(
      (x) => getComputedStyle(x).position === "sticky"
    ), f = /* @__PURE__ */ n(() => requestAnimationFrame(() => {
      i.set(
        (x) => x.map((y) => {
          if (m.includes(y.element)) {
            let { top: E, left: $ } = y.element.getBoundingClientRect();
            return { ...y, top: E + window.scrollY, left: $ + window.scrollX };
          }
          return y;
        })
      );
    }), "updateBoxes");
    return t.addEventListener("scroll", f), () => t.removeEventListener("scroll", f);
  }), o.subscribe((d) => {
    l.set((m) => m.filter(({ element: f }) => d.has(f)));
  }), l.subscribe((d) => {
    d.length ? (g.set((m) => d.some((f) => f.element === m?.element) ? m : void 0), p.set((m) => d.some((f) => f.element === m?.element) ? m :
    void 0)) : (g.set(void 0), p.set(void 0), s.set(void 0));
  });
  let h = new Map(/* @__PURE__ */ new Map());
  r.subscribe((d) => {
    d.forEach(({ keyframes: m }) => {
      if (m) {
        let f = h.get(m);
        f || (f = t.createElement("style"), f.setAttribute("data-highlight", "keyframes"), h.set(m, f), t.head.appendChild(f)), f.innerHTML =
        m;
      }
    }), h.forEach((m, f) => {
      d.some((x) => x.keyframes === f) || (m.remove(), h.delete(f));
    });
  });
  let T = new Map(/* @__PURE__ */ new Map());
  i.subscribe((d) => {
    d.forEach((m) => {
      let f = T.get(m.element);
      if (u && !f) {
        let x = {
          popover: "manual",
          "data-highlight-dimensions": `w${m.width.toFixed(0)}h${m.height.toFixed(0)}`,
          "data-highlight-coordinates": `x${m.left.toFixed(0)}y${m.top.toFixed(0)}`
        };
        f = u.appendChild(
          M("div", x, [M("div")])
        ), T.set(m.element, f);
      }
    }), T.forEach((m, f) => {
      d.some(({ element: x }) => x === f) || (m.remove(), T.delete(f));
    });
  }), i.subscribe((d) => {
    let m = d.filter((x) => x.menu);
    if (!m.length)
      return;
    let f = /* @__PURE__ */ n((x) => {
      requestAnimationFrame(() => {
        let y = t.getElementById(C), E = { x: x.pageX, y: x.pageY };
        if (y && !mt(y, E)) {
          let $ = m.filter((v) => {
            let L = T.get(v.element);
            return ut(v, L, E);
          });
          s.set($.length ? E : void 0), l.set($);
        }
      });
    }, "onClick");
    return t.addEventListener("click", f), () => t.removeEventListener("click", f);
  });
  let R = /* @__PURE__ */ n(() => {
    let d = t.getElementById(C), m = a.get();
    !m || d && mt(d, m) || c.set((f) => {
      let x = i.get().filter((v) => {
        let L = T.get(v.element);
        return ut(v, L, m);
      }), y = f.filter((v) => x.includes(v)), E = x.filter((v) => !f.includes(v)), $ = f.length - y.length;
      return E.length || $ ? [...y, ...E] : f;
    });
  }, "updateHovered");
  a.subscribe(R), i.subscribe(R);
  let P = /* @__PURE__ */ n(() => {
    let d = g.get(), m = d ? [d] : l.get(), f = m.length === 1 ? m[0] : p.get(), x = s.get() !== void 0;
    i.get().forEach((y) => {
      let E = T.get(y.element);
      if (E) {
        let $ = f === y, v = x ? f ? $ : m.includes(y) : c.get()?.includes(y);
        Object.assign(E.style, {
          animation: "none",
          background: "transparent",
          border: "none",
          boxSizing: "border-box",
          outline: "none",
          outlineOffset: "0px",
          ...y.styles,
          ...v ? y.hoverStyles : {},
          ...$ ? y.focusStyles : {},
          position: getComputedStyle(y.element).position === "fixed" ? "fixed" : "absolute",
          zIndex: lt - 10,
          top: `${y.top}px`,
          left: `${y.left}px`,
          width: `${y.width}px`,
          height: `${y.height}px`,
          margin: 0,
          padding: 0,
          cursor: y.menu && v ? "pointer" : "default",
          pointerEvents: y.menu ? "auto" : "none",
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          overflow: "visible"
        }), Object.assign(E.children[0].style, {
          width: "100%",
          height: "100%",
          minHeight: `${z}px`,
          minWidth: `${z}px`,
          boxSizing: "content-box",
          padding: E.style.outlineWidth || "0px"
        }), ft(E);
      }
    });
  }, "updateBoxStyles");
  i.subscribe(P), l.subscribe(P), c.subscribe(P), p.subscribe(P), g.subscribe(P);
  let F = /* @__PURE__ */ n(() => {
    if (!u)
      return;
    let d = t.getElementById(C);
    if (d)
      d.innerHTML = "";
    else {
      let y = { id: C, popover: "manual" };
      d = u.appendChild(M("div", y)), u.appendChild(
        M("style", {}, [
          `
            #${C} {
              position: absolute;
              z-index: ${lt};
              width: 300px;
              padding: 0px;
              margin: 15px 0 0 0;
              transform: translateX(-50%);
              font-family: "Nunito Sans", -apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", "Helvetica Ne\
ue", Helvetica, Arial, sans-serif;
              font-size: 12px;
              background: white;
              border: none;
              border-radius: 6px;
              box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.05), 0 5px 15px 0 rgba(0, 0, 0, 0.1);
              color: #2E3438;
            }
            #${C} ul {
              list-style: none;
              margin: 0;
              padding: 0;
            }
            #${C} > ul {
              max-height: 300px;
              overflow-y: auto;
              padding: 4px 0;
            }
            #${C} li {
              padding: 0 4px;
              margin: 0;
            }
            #${C} li > :not(ul) {
              display: flex;
              padding: 8px;
              margin: 0;
              align-items: center;
              gap: 8px;
              border-radius: 4px;
            }
            #${C} button {
              width: 100%;
              border: 0;
              background: transparent;
              color: inherit;
              text-align: left;
              font-family: inherit;
              font-size: inherit;
            }
            #${C} button:focus-visible {
              outline-color: #029CFD;
            }
            #${C} button:hover {
              background: rgba(2, 156, 253, 0.07);
              color: #029CFD;
              cursor: pointer;
            }
            #${C} li code {
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              line-height: 16px;
              font-size: 11px;
            }
            #${C} li svg {
              flex-shrink: 0;
              margin: 1px;
              color: #73828C;
            }
            #${C} li > button:hover svg, #${C} li > button:focus-visible svg {
              color: #029CFD;
            }
            #${C} .element-list li svg {
              display: none;
            }
            #${C} li.selectable svg, #${C} li.selected svg {
              display: block;
            }
            #${C} .menu-list {
              border-top: 1px solid rgba(38, 85, 115, 0.15);
            }
            #${C} .menu-list > li:not(:last-child) {
              padding-bottom: 4px;
              margin-bottom: 4px;
              border-bottom: 1px solid rgba(38, 85, 115, 0.15);
            }
            #${C} .menu-items, #${C} .menu-items li {
              padding: 0;
            }
            #${C} .menu-item {
              display: flex;
            }
            #${C} .menu-item-content {
              display: flex;
              flex-direction: column;
              flex-grow: 1;
            }
          `
        ])
      );
    }
    let m = g.get(), f = m ? [m] : l.get();
    if (f.length && (d.style.position = getComputedStyle(f[0].element).position === "fixed" ? "fixed" : "absolute", d.appendChild(
      M(
        "ul",
        { class: "element-list" },
        f.map((y) => {
          let E = f.length > 1 && !!y.menu?.some(
            (L) => L.some(
              (Y) => !Y.selectors || Y.selectors.some((ye) => y.selectors.includes(ye))
            )
          ), $ = E ? {
            class: "selectable",
            onClick: /* @__PURE__ */ n(() => g.set(y), "onClick"),
            onMouseEnter: /* @__PURE__ */ n(() => p.set(y), "onMouseEnter"),
            onMouseLeave: /* @__PURE__ */ n(() => p.set(void 0), "onMouseLeave")
          } : m ? { class: "selected", onClick: /* @__PURE__ */ n(() => g.set(void 0), "onClick") } : {}, v = E || m;
          return M("li", $, [
            M(v ? "button" : "div", v ? { type: "button" } : {}, [
              m ? me("chevronLeft") : null,
              M("code", {}, [y.element.outerHTML]),
              E ? me("chevronRight") : null
            ])
          ]);
        })
      )
    )), g.get() || l.get().length === 1) {
      let y = g.get() || l.get()[0], E = y.menu?.filter(
        ($) => $.some(
          (v) => !v.selectors || v.selectors.some((L) => y.selectors.includes(L))
        )
      );
      E?.length && d.appendChild(
        M(
          "ul",
          { class: "menu-list" },
          E.map(
            ($) => M("li", {}, [
              M(
                "ul",
                { class: "menu-items" },
                $.map(
                  ({ id: v, title: L, description: Y, iconLeft: ye, iconRight: kt, clickEvent: Pt }) => {
                    let _e = Pt && (() => e.emit(Pt, v, Br(y)));
                    return M("li", {}, [
                      M(
                        _e ? "button" : "div",
                        _e ? { class: "menu-item", type: "button", onClick: _e } : { class: "menu-item" },
                        [
                          ye ? me(ye) : null,
                          M("div", { class: "menu-item-content" }, [
                            M(Y ? "strong" : "span", {}, [L]),
                            Y && M("span", {}, [Y])
                          ]),
                          kt ? me(kt) : null
                        ]
                      )
                    ]);
                  }
                )
              )
            ])
          )
        )
      );
    }
    let x = s.get();
    x ? (Object.assign(d.style, {
      display: "block",
      left: `${d.style.position === "fixed" ? x.x - window.scrollX : x.x}px`,
      top: `${d.style.position === "fixed" ? x.y - window.scrollY : x.y}px`
    }), ft(d), requestAnimationFrame(() => Nr(d, x, { topOffset: 15, centered: !0 }))) : (jr(d), Object.assign(d.style, { display: "none" }));
  }, "renderMenu");
  l.subscribe(F), g.subscribe(F);
  let O = /* @__PURE__ */ n((d) => {
    let m = Dr(d);
    r.set((f) => {
      let x = m.id ? f.filter((y) => y.id !== m.id) : f;
      return m.selectors?.length ? [...x, m] : x;
    });
  }, "addHighlight"), _ = /* @__PURE__ */ n((d) => {
    d && r.set((m) => m.filter((f) => f.id !== d));
  }, "removeHighlight"), A = /* @__PURE__ */ n(() => {
    r.set([]), o.set(/* @__PURE__ */ new Map()), i.set([]), s.set(void 0), a.set(void 0), l.set([]), c.set([]), p.set(void 0), g.set(void 0);
  }, "resetState"), S, k = /* @__PURE__ */ n((d, m = {}) => {
    let f = "scrollIntoView-highlight";
    clearTimeout(S), _(f);
    let x = Array.isArray(d) ? d : [d];
    if (!x.length)
      return;
    let y = t.getElementById("storybook-root"), E = x.flatMap((L) => ct(y, L));
    if (E.length === 0) {
      console.warn(`No elements found for (${d})`);
      return;
    }
    let { highlight: $ = !0, ...v } = m;
    if (E[0].scrollIntoView({ behavior: "smooth", block: "center", ...v }), $) {
      let L = `kf-${Math.random().toString(36).substring(2, 15)}`;
      r.set((Y) => [
        ...Y,
        {
          id: f,
          priority: 1e3,
          selectors: x,
          styles: {
            outline: "2px solid #1EA7FD",
            outlineOffset: "-1px",
            animation: `${L} 3s linear forwards`
          },
          keyframes: `@keyframes ${L} {
            0% { outline: 2px solid #1EA7FD; }
            20% { outline: 2px solid #1EA7FD00; }
            40% { outline: 2px solid #1EA7FD; }
            60% { outline: 2px solid #1EA7FD00; }
            80% { outline: 2px solid #1EA7FD; }
            100% { outline: 2px solid #1EA7FD00; }
          }`
        }
      ]), S = setTimeout(() => _(f), 3500);
    }
  }, "scrollIntoView"), w = /* @__PURE__ */ n((d) => {
    requestAnimationFrame(() => a.set({ x: d.pageX, y: d.pageY }));
  }, "onMouseMove");
  t.body.addEventListener("mousemove", w), e.on($r, O), e.on(Ir, _), e.on(_r, A), e.on(Fr, k), e.on(Ur.STORY_RENDER_PHASE_CHANGED, ({ newPhase: d }) => {
    d === "loading" && A();
  });
}, "useHighlights");

// src/highlight/preview.ts
globalThis?.FEATURES?.highlight && gt.addons?.ready && gt.addons.ready().then(Gr);
var yt = /* @__PURE__ */ n(() => (0, Wr.definePreviewAddon)({}), "default");

// src/measure/preview.ts
var co = require("storybook/internal/csf");

// src/measure/constants.ts
var Pe = "storybook/measure-addon", ml = `${Pe}/tool`, Yr = "measureEnabled", ul = {
  RESULT: `${Pe}/result`,
  REQUEST: `${Pe}/request`,
  CLEAR: `${Pe}/clear`
};

// src/measure/withMeasure.ts
var bt = require("storybook/preview-api");

// src/measure/box-model/canvas.ts
var ue = require("@storybook/global");
function Vr() {
  let e = ue.global.document.documentElement, t = Math.max(e.scrollHeight, e.offsetHeight);
  return { width: Math.max(e.scrollWidth, e.offsetWidth), height: t };
}
n(Vr, "getDocumentWidthAndHeight");
function bn() {
  let e = ue.global.document.createElement("canvas");
  e.id = "storybook-addon-measure";
  let t = e.getContext("2d");
  Ce(t != null);
  let { width: r, height: o } = Vr();
  return ht(e, t, { width: r, height: o }), e.style.position = "absolute", e.style.left = "0", e.style.top = "0", e.style.zIndex = "21474836\
47", e.style.pointerEvents = "none", ue.global.document.body.appendChild(e), { canvas: e, context: t, width: r, height: o };
}
n(bn, "createCanvas");
function ht(e, t, { width: r, height: o }) {
  e.style.width = `${r}px`, e.style.height = `${o}px`;
  let i = ue.global.window.devicePixelRatio;
  e.width = Math.floor(r * i), e.height = Math.floor(o * i), t.scale(i, i);
}
n(ht, "setCanvasWidthAndHeight");
var I = {};
function Kr() {
  I.canvas || (I = bn());
}
n(Kr, "init");
function Xr() {
  I.context && I.context.clearRect(0, 0, I.width ?? 0, I.height ?? 0);
}
n(Xr, "clear");
function qr(e) {
  Xr(), e(I.context);
}
n(qr, "draw");
function Zr() {
  Ce(I.canvas, "Canvas should exist in the state."), Ce(I.context, "Context should exist in the state."), ht(I.canvas, I.context, { width: 0,
  height: 0 });
  let { width: e, height: t } = Vr();
  ht(I.canvas, I.context, { width: e, height: t }), I.width = e, I.height = t;
}
n(Zr, "rescale");
function Jr() {
  I.canvas && (Xr(), I.canvas.parentNode?.removeChild(I.canvas), I = {});
}
n(Jr, "destroy");

// src/measure/box-model/visualizer.ts
var j = require("@storybook/global");

// src/measure/box-model/labels.ts
var te = {
  margin: "#f6b26b",
  border: "#ffe599",
  padding: "#93c47d",
  content: "#6fa8dc",
  text: "#232020"
}, W = 6;
function Qr(e, { x: t, y: r, w: o, h: i, r: s }) {
  t = t - o / 2, r = r - i / 2, o < 2 * s && (s = o / 2), i < 2 * s && (s = i / 2), e.beginPath(), e.moveTo(t + s, r), e.arcTo(t + o, r, t +
  o, r + i, s), e.arcTo(t + o, r + i, t, r + i, s), e.arcTo(t, r + i, t, r, s), e.arcTo(t, r, t + o, r, s), e.closePath();
}
n(Qr, "roundedRect");
function Tn(e, { padding: t, border: r, width: o, height: i, top: s, left: a }) {
  let l = o - r.left - r.right - t.left - t.right, c = i - t.top - t.bottom - r.top - r.bottom, p = a + r.left + t.left, g = s + r.top + t.top;
  return e === "top" ? p += l / 2 : e === "right" ? (p += l, g += c / 2) : e === "bottom" ? (p += l / 2, g += c) : e === "left" ? g += c / 2 :
  e === "center" && (p += l / 2, g += c / 2), { x: p, y: g };
}
n(Tn, "positionCoordinate");
function Sn(e, t, { margin: r, border: o, padding: i }, s, a) {
  let l = /* @__PURE__ */ n((h) => 0, "shift"), c = 0, p = 0, g = a ? 1 : 0.5, u = a ? s * 2 : 0;
  return e === "padding" ? l = /* @__PURE__ */ n((h) => i[h] * g + u, "shift") : e === "border" ? l = /* @__PURE__ */ n((h) => i[h] + o[h] *
  g + u, "shift") : e === "margin" && (l = /* @__PURE__ */ n((h) => i[h] + o[h] + r[h] * g + u, "shift")), t === "top" ? p = -l("top") : t ===
  "right" ? c = l("right") : t === "bottom" ? p = l("bottom") : t === "left" && (c = -l("left")), { offsetX: c, offsetY: p };
}
n(Sn, "offset");
function An(e, t) {
  return Math.abs(e.x - t.x) < Math.abs(e.w + t.w) / 2 && Math.abs(e.y - t.y) < Math.abs(e.h + t.h) / 2;
}
n(An, "collide");
function Rn(e, t, r) {
  return e === "top" ? t.y = r.y - r.h - W : e === "right" ? t.x = r.x + r.w / 2 + W + t.w / 2 : e === "bottom" ? t.y = r.y + r.h + W : e ===
  "left" && (t.x = r.x - r.w / 2 - W - t.w / 2), { x: t.x, y: t.y };
}
n(Rn, "overlapAdjustment");
function eo(e, t, { x: r, y: o, w: i, h: s }, a) {
  return Qr(e, { x: r, y: o, w: i, h: s, r: 3 }), e.fillStyle = `${te[t]}dd`, e.fill(), e.strokeStyle = te[t], e.stroke(), e.fillStyle = te.
  text, e.fillText(a, r, o), Qr(e, { x: r, y: o, w: i, h: s, r: 3 }), e.fillStyle = `${te[t]}dd`, e.fill(), e.strokeStyle = te[t], e.stroke(),
  e.fillStyle = te.text, e.fillText(a, r, o), { x: r, y: o, w: i, h: s };
}
n(eo, "textWithRect");
function to(e, t) {
  e.font = "600 12px monospace", e.textBaseline = "middle", e.textAlign = "center";
  let r = e.measureText(t), o = r.actualBoundingBoxAscent + r.actualBoundingBoxDescent, i = r.width + W * 2, s = o + W * 2;
  return { w: i, h: s };
}
n(to, "configureText");
function En(e, t, { type: r, position: o = "center", text: i }, s, a = !1) {
  let { x: l, y: c } = Tn(o, t), { offsetX: p, offsetY: g } = Sn(r, o, t, W + 1, a);
  l += p, c += g;
  let { w: u, h } = to(e, i);
  if (s && An({ x: l, y: c, w: u, h }, s)) {
    let T = Rn(o, { x: l, y: c, w: u, h }, s);
    l = T.x, c = T.y;
  }
  return eo(e, r, { x: l, y: c, w: u, h }, i);
}
n(En, "drawLabel");
function wn(e, { w: t, h: r }) {
  let o = t * 0.5 + W, i = r * 0.5 + W;
  return {
    offsetX: (e.x === "left" ? -1 : 1) * o,
    offsetY: (e.y === "top" ? -1 : 1) * i
  };
}
n(wn, "floatingOffset");
function Cn(e, t, { type: r, text: o }) {
  let { floatingAlignment: i, extremities: s } = t, a = s[i.x], l = s[i.y], { w: c, h: p } = to(e, o), { offsetX: g, offsetY: u } = wn(i, {
    w: c,
    h: p
  });
  return a += g, l += u, eo(e, r, { x: a, y: l, w: c, h: p }, o);
}
n(Cn, "drawFloatingLabel");
function fe(e, t, r, o) {
  let i = [];
  r.forEach((s, a) => {
    let l = o && s.position === "center" ? Cn(e, t, s) : En(e, t, s, i[a - 1], o);
    i[a] = l;
  });
}
n(fe, "drawStack");
function ro(e, t, r, o) {
  let i = r.reduce((s, a) => (Object.prototype.hasOwnProperty.call(s, a.position) || (s[a.position] = []), s[a.position]?.push(a), s), {});
  i.top && fe(e, t, i.top, o), i.right && fe(e, t, i.right, o), i.bottom && fe(e, t, i.bottom, o), i.left && fe(e, t, i.left, o), i.center &&
  fe(e, t, i.center, o);
}
n(ro, "labelStacks");

// src/measure/box-model/visualizer.ts
var Oe = {
  margin: "#f6b26ba8",
  border: "#ffe599a8",
  padding: "#93c47d8c",
  content: "#6fa8dca8"
}, oo = 30;
function N(e) {
  return parseInt(e.replace("px", ""), 10);
}
n(N, "pxToNumber");
function re(e) {
  return Number.isInteger(e) ? e : e.toFixed(2);
}
n(re, "round");
function xt(e) {
  return e.filter((t) => t.text !== 0 && t.text !== "0");
}
n(xt, "filterZeroValues");
function vn(e) {
  let t = {
    top: j.global.window.scrollY,
    bottom: j.global.window.scrollY + j.global.window.innerHeight,
    left: j.global.window.scrollX,
    right: j.global.window.scrollX + j.global.window.innerWidth
  }, r = {
    top: Math.abs(t.top - e.top),
    bottom: Math.abs(t.bottom - e.bottom),
    left: Math.abs(t.left - e.left),
    right: Math.abs(t.right - e.right)
  };
  return {
    x: r.left > r.right ? "left" : "right",
    y: r.top > r.bottom ? "top" : "bottom"
  };
}
n(vn, "floatingAlignment");
function kn(e) {
  let t = j.global.getComputedStyle(e), { top: r, left: o, right: i, bottom: s, width: a, height: l } = e.getBoundingClientRect(), {
    marginTop: c,
    marginBottom: p,
    marginLeft: g,
    marginRight: u,
    paddingTop: h,
    paddingBottom: T,
    paddingLeft: R,
    paddingRight: P,
    borderBottomWidth: F,
    borderTopWidth: O,
    borderLeftWidth: _,
    borderRightWidth: A
  } = t;
  r = r + j.global.window.scrollY, o = o + j.global.window.scrollX, s = s + j.global.window.scrollY, i = i + j.global.window.scrollX;
  let S = {
    top: N(c),
    bottom: N(p),
    left: N(g),
    right: N(u)
  }, k = {
    top: N(h),
    bottom: N(T),
    left: N(R),
    right: N(P)
  }, w = {
    top: N(O),
    bottom: N(F),
    left: N(_),
    right: N(A)
  }, d = {
    top: r - S.top,
    bottom: s + S.bottom,
    left: o - S.left,
    right: i + S.right
  };
  return {
    margin: S,
    padding: k,
    border: w,
    top: r,
    left: o,
    bottom: s,
    right: i,
    width: a,
    height: l,
    extremities: d,
    floatingAlignment: vn(d)
  };
}
n(kn, "measureElement");
function Pn(e, { margin: t, width: r, height: o, top: i, left: s, bottom: a, right: l }) {
  let c = o + t.bottom + t.top;
  e.fillStyle = Oe.margin, e.fillRect(s, i - t.top, r, t.top), e.fillRect(l, i - t.top, t.right, c), e.fillRect(s, a, r, t.bottom), e.fillRect(
  s - t.left, i - t.top, t.left, c);
  let p = [
    {
      type: "margin",
      text: re(t.top),
      position: "top"
    },
    {
      type: "margin",
      text: re(t.right),
      position: "right"
    },
    {
      type: "margin",
      text: re(t.bottom),
      position: "bottom"
    },
    {
      type: "margin",
      text: re(t.left),
      position: "left"
    }
  ];
  return xt(p);
}
n(Pn, "drawMargin");
function On(e, { padding: t, border: r, width: o, height: i, top: s, left: a, bottom: l, right: c }) {
  let p = o - r.left - r.right, g = i - t.top - t.bottom - r.top - r.bottom;
  e.fillStyle = Oe.padding, e.fillRect(a + r.left, s + r.top, p, t.top), e.fillRect(
    c - t.right - r.right,
    s + t.top + r.top,
    t.right,
    g
  ), e.fillRect(
    a + r.left,
    l - t.bottom - r.bottom,
    p,
    t.bottom
  ), e.fillRect(a + r.left, s + t.top + r.top, t.left, g);
  let u = [
    {
      type: "padding",
      text: t.top,
      position: "top"
    },
    {
      type: "padding",
      text: t.right,
      position: "right"
    },
    {
      type: "padding",
      text: t.bottom,
      position: "bottom"
    },
    {
      type: "padding",
      text: t.left,
      position: "left"
    }
  ];
  return xt(u);
}
n(On, "drawPadding");
function Mn(e, { border: t, width: r, height: o, top: i, left: s, bottom: a, right: l }) {
  let c = o - t.top - t.bottom;
  e.fillStyle = Oe.border, e.fillRect(s, i, r, t.top), e.fillRect(s, a - t.bottom, r, t.bottom), e.fillRect(s, i + t.top, t.left, c), e.fillRect(
  l - t.right, i + t.top, t.right, c);
  let p = [
    {
      type: "border",
      text: t.top,
      position: "top"
    },
    {
      type: "border",
      text: t.right,
      position: "right"
    },
    {
      type: "border",
      text: t.bottom,
      position: "bottom"
    },
    {
      type: "border",
      text: t.left,
      position: "left"
    }
  ];
  return xt(p);
}
n(Mn, "drawBorder");
function $n(e, { padding: t, border: r, width: o, height: i, top: s, left: a }) {
  let l = o - r.left - r.right - t.left - t.right, c = i - t.top - t.bottom - r.top - r.bottom;
  return e.fillStyle = Oe.content, e.fillRect(
    a + r.left + t.left,
    s + r.top + t.top,
    l,
    c
  ), [
    {
      type: "content",
      position: "center",
      text: `${re(l)} x ${re(c)}`
    }
  ];
}
n($n, "drawContent");
function In(e) {
  return (t) => {
    if (e && t) {
      let r = kn(e), o = Pn(t, r), i = On(t, r), s = Mn(t, r), a = $n(t, r), l = r.width <= oo * 3 || r.height <= oo;
      ro(
        t,
        r,
        [...a, ...i, ...s, ...o],
        l
      );
    }
  };
}
n(In, "drawBoxModel");
function no(e) {
  qr(In(e));
}
n(no, "drawSelectedElement");

// src/measure/util.ts
var io = require("@storybook/global");
var so = /* @__PURE__ */ n((e, t) => {
  let r = io.global.document.elementFromPoint(e, t), o = /* @__PURE__ */ n((s) => {
    if (s && s.shadowRoot) {
      let a = s.shadowRoot.elementFromPoint(e, t);
      return s.isEqualNode(a) ? s : a.shadowRoot ? o(a) : a;
    }
    return s;
  }, "crawlShadows");
  return o(r) || r;
}, "deepElementFromPoint");

// src/measure/withMeasure.ts
var ao, Me = { x: 0, y: 0 };
function lo(e, t) {
  ao = so(e, t), no(ao);
}
n(lo, "findAndDrawElement");
var po = /* @__PURE__ */ n((e, t) => {
  let { measureEnabled: r } = t.globals || {};
  return (0, bt.useEffect)(() => {
    if (typeof globalThis.document > "u")
      return;
    let o = /* @__PURE__ */ n((i) => {
      window.requestAnimationFrame(() => {
        i.stopPropagation(), Me.x = i.clientX, Me.y = i.clientY;
      });
    }, "onPointerMove");
    return globalThis.document.addEventListener("pointermove", o), () => {
      globalThis.document.removeEventListener("pointermove", o);
    };
  }, []), (0, bt.useEffect)(() => {
    let o = /* @__PURE__ */ n((s) => {
      window.requestAnimationFrame(() => {
        s.stopPropagation(), lo(s.clientX, s.clientY);
      });
    }, "onPointerOver"), i = /* @__PURE__ */ n(() => {
      window.requestAnimationFrame(() => {
        Zr();
      });
    }, "onResize");
    return t.viewMode === "story" && r && (globalThis.document.addEventListener("pointerover", o), Kr(), globalThis.window.addEventListener(
    "resize", i), lo(Me.x, Me.y)), () => {
      globalThis.window.removeEventListener("resize", i), Jr();
    };
  }, [r, t.viewMode]), e();
}, "withMeasure");

// src/measure/preview.ts
var _n = globalThis.FEATURES?.measure ? [po] : [], Fn = {
  [Yr]: !1
}, Tt = /* @__PURE__ */ n(() => (0, co.definePreviewAddon)({
  decorators: _n,
  initialGlobals: Fn
}), "default");

// src/outline/preview.ts
var go = require("storybook/internal/csf");

// src/outline/constants.ts
var $e = "outline";

// src/outline/withOutline.ts
var Ie = require("storybook/preview-api");

// src/outline/helpers.ts
var ge = require("@storybook/global");
var St = /* @__PURE__ */ n((e) => {
  (Array.isArray(e) ? e : [e]).forEach(Ln);
}, "clearStyles"), Ln = /* @__PURE__ */ n((e) => {
  let t = typeof e == "string" ? e : e.join(""), r = ge.global.document.getElementById(t);
  r && r.parentElement && r.parentElement.removeChild(r);
}, "clearStyle"), mo = /* @__PURE__ */ n((e, t) => {
  let r = ge.global.document.getElementById(e);
  if (r)
    r.innerHTML !== t && (r.innerHTML = t);
  else {
    let o = ge.global.document.createElement("style");
    o.setAttribute("id", e), o.innerHTML = t, ge.global.document.head.appendChild(o);
  }
}, "addOutlineStyles");

// src/outline/outlineCSS.ts
var uo = J(Q(), 1);
function At(e) {
  return uo.dedent`
    ${e} body {
      outline: 1px solid #2980b9 !important;
    }

    ${e} article {
      outline: 1px solid #3498db !important;
    }

    ${e} nav {
      outline: 1px solid #0088c3 !important;
    }

    ${e} aside {
      outline: 1px solid #33a0ce !important;
    }

    ${e} section {
      outline: 1px solid #66b8da !important;
    }

    ${e} header {
      outline: 1px solid #99cfe7 !important;
    }

    ${e} footer {
      outline: 1px solid #cce7f3 !important;
    }

    ${e} h1 {
      outline: 1px solid #162544 !important;
    }

    ${e} h2 {
      outline: 1px solid #314e6e !important;
    }

    ${e} h3 {
      outline: 1px solid #3e5e85 !important;
    }

    ${e} h4 {
      outline: 1px solid #449baf !important;
    }

    ${e} h5 {
      outline: 1px solid #c7d1cb !important;
    }

    ${e} h6 {
      outline: 1px solid #4371d0 !important;
    }

    ${e} main {
      outline: 1px solid #2f4f90 !important;
    }

    ${e} address {
      outline: 1px solid #1a2c51 !important;
    }

    ${e} div {
      outline: 1px solid #036cdb !important;
    }

    ${e} p {
      outline: 1px solid #ac050b !important;
    }

    ${e} hr {
      outline: 1px solid #ff063f !important;
    }

    ${e} pre {
      outline: 1px solid #850440 !important;
    }

    ${e} blockquote {
      outline: 1px solid #f1b8e7 !important;
    }

    ${e} ol {
      outline: 1px solid #ff050c !important;
    }

    ${e} ul {
      outline: 1px solid #d90416 !important;
    }

    ${e} li {
      outline: 1px solid #d90416 !important;
    }

    ${e} dl {
      outline: 1px solid #fd3427 !important;
    }

    ${e} dt {
      outline: 1px solid #ff0043 !important;
    }

    ${e} dd {
      outline: 1px solid #e80174 !important;
    }

    ${e} figure {
      outline: 1px solid #ff00bb !important;
    }

    ${e} figcaption {
      outline: 1px solid #bf0032 !important;
    }

    ${e} table {
      outline: 1px solid #00cc99 !important;
    }

    ${e} caption {
      outline: 1px solid #37ffc4 !important;
    }

    ${e} thead {
      outline: 1px solid #98daca !important;
    }

    ${e} tbody {
      outline: 1px solid #64a7a0 !important;
    }

    ${e} tfoot {
      outline: 1px solid #22746b !important;
    }

    ${e} tr {
      outline: 1px solid #86c0b2 !important;
    }

    ${e} th {
      outline: 1px solid #a1e7d6 !important;
    }

    ${e} td {
      outline: 1px solid #3f5a54 !important;
    }

    ${e} col {
      outline: 1px solid #6c9a8f !important;
    }

    ${e} colgroup {
      outline: 1px solid #6c9a9d !important;
    }

    ${e} button {
      outline: 1px solid #da8301 !important;
    }

    ${e} datalist {
      outline: 1px solid #c06000 !important;
    }

    ${e} fieldset {
      outline: 1px solid #d95100 !important;
    }

    ${e} form {
      outline: 1px solid #d23600 !important;
    }

    ${e} input {
      outline: 1px solid #fca600 !important;
    }

    ${e} keygen {
      outline: 1px solid #b31e00 !important;
    }

    ${e} label {
      outline: 1px solid #ee8900 !important;
    }

    ${e} legend {
      outline: 1px solid #de6d00 !important;
    }

    ${e} meter {
      outline: 1px solid #e8630c !important;
    }

    ${e} optgroup {
      outline: 1px solid #b33600 !important;
    }

    ${e} option {
      outline: 1px solid #ff8a00 !important;
    }

    ${e} output {
      outline: 1px solid #ff9619 !important;
    }

    ${e} progress {
      outline: 1px solid #e57c00 !important;
    }

    ${e} select {
      outline: 1px solid #e26e0f !important;
    }

    ${e} textarea {
      outline: 1px solid #cc5400 !important;
    }

    ${e} details {
      outline: 1px solid #33848f !important;
    }

    ${e} summary {
      outline: 1px solid #60a1a6 !important;
    }

    ${e} command {
      outline: 1px solid #438da1 !important;
    }

    ${e} menu {
      outline: 1px solid #449da6 !important;
    }

    ${e} del {
      outline: 1px solid #bf0000 !important;
    }

    ${e} ins {
      outline: 1px solid #400000 !important;
    }

    ${e} img {
      outline: 1px solid #22746b !important;
    }

    ${e} iframe {
      outline: 1px solid #64a7a0 !important;
    }

    ${e} embed {
      outline: 1px solid #98daca !important;
    }

    ${e} object {
      outline: 1px solid #00cc99 !important;
    }

    ${e} param {
      outline: 1px solid #37ffc4 !important;
    }

    ${e} video {
      outline: 1px solid #6ee866 !important;
    }

    ${e} audio {
      outline: 1px solid #027353 !important;
    }

    ${e} source {
      outline: 1px solid #012426 !important;
    }

    ${e} canvas {
      outline: 1px solid #a2f570 !important;
    }

    ${e} track {
      outline: 1px solid #59a600 !important;
    }

    ${e} map {
      outline: 1px solid #7be500 !important;
    }

    ${e} area {
      outline: 1px solid #305900 !important;
    }

    ${e} a {
      outline: 1px solid #ff62ab !important;
    }

    ${e} em {
      outline: 1px solid #800b41 !important;
    }

    ${e} strong {
      outline: 1px solid #ff1583 !important;
    }

    ${e} i {
      outline: 1px solid #803156 !important;
    }

    ${e} b {
      outline: 1px solid #cc1169 !important;
    }

    ${e} u {
      outline: 1px solid #ff0430 !important;
    }

    ${e} s {
      outline: 1px solid #f805e3 !important;
    }

    ${e} small {
      outline: 1px solid #d107b2 !important;
    }

    ${e} abbr {
      outline: 1px solid #4a0263 !important;
    }

    ${e} q {
      outline: 1px solid #240018 !important;
    }

    ${e} cite {
      outline: 1px solid #64003c !important;
    }

    ${e} dfn {
      outline: 1px solid #b4005a !important;
    }

    ${e} sub {
      outline: 1px solid #dba0c8 !important;
    }

    ${e} sup {
      outline: 1px solid #cc0256 !important;
    }

    ${e} time {
      outline: 1px solid #d6606d !important;
    }

    ${e} code {
      outline: 1px solid #e04251 !important;
    }

    ${e} kbd {
      outline: 1px solid #5e001f !important;
    }

    ${e} samp {
      outline: 1px solid #9c0033 !important;
    }

    ${e} var {
      outline: 1px solid #d90047 !important;
    }

    ${e} mark {
      outline: 1px solid #ff0053 !important;
    }

    ${e} bdi {
      outline: 1px solid #bf3668 !important;
    }

    ${e} bdo {
      outline: 1px solid #6f1400 !important;
    }

    ${e} ruby {
      outline: 1px solid #ff7b93 !important;
    }

    ${e} rt {
      outline: 1px solid #ff2f54 !important;
    }

    ${e} rp {
      outline: 1px solid #803e49 !important;
    }

    ${e} span {
      outline: 1px solid #cc2643 !important;
    }

    ${e} br {
      outline: 1px solid #db687d !important;
    }

    ${e} wbr {
      outline: 1px solid #db175b !important;
    }`;
}
n(At, "outlineCSS");

// src/outline/withOutline.ts
var fo = /* @__PURE__ */ n((e, t) => {
  let r = t.globals || {}, o = [!0, "true"].includes(r[$e]), i = t.viewMode === "docs", s = (0, Ie.useMemo)(() => At(i ? '[data-story-block=\
"true"]' : ".sb-show-main"), [t]);
  return (0, Ie.useEffect)(() => {
    let a = i ? `addon-outline-docs-${t.id}` : "addon-outline";
    return o ? mo(a, s) : St(a), () => {
      St(a);
    };
  }, [o, s, t]), e();
}, "withOutline");

// src/outline/preview.ts
var Dn = globalThis.FEATURES?.outline ? [fo] : [], Hn = {
  [$e]: !1
}, Rt = /* @__PURE__ */ n(() => (0, go.definePreviewAddon)({ decorators: Dn, initialGlobals: Hn }), "default");

// src/test/preview.ts
var ho = require("storybook/internal/csf"), xo = require("storybook/internal/instrumenter"), H = require("storybook/test");
var Nn = /* @__PURE__ */ n(({ parameters: e }) => {
  e?.test?.mockReset === !0 ? (0, H.resetAllMocks)() : e?.test?.clearMocks === !0 ? (0, H.clearAllMocks)() : e?.test?.restoreMocks !== !1 &&
  (0, H.restoreAllMocks)();
}, "resetAllMocksLoader"), Et = /* @__PURE__ */ n((e, t = 0, r) => {
  if (t > 5 || e == null)
    return e;
  if ((0, H.isMockFunction)(e))
    return r && e.mockName(r), e;
  if (typeof e == "function" && "isAction" in e && e.isAction && !("implicit" in e && e.implicit)) {
    let o = (0, H.fn)(e);
    return r && o.mockName(r), o;
  }
  if (Array.isArray(e)) {
    t++;
    for (let o = 0; o < e.length; o++)
      Object.getOwnPropertyDescriptor(e, o)?.writable && (e[o] = Et(e[o], t));
    return e;
  }
  if (typeof e == "object" && e.constructor === Object) {
    t++;
    for (let [o, i] of Object.entries(e))
      Object.getOwnPropertyDescriptor(e, o)?.writable && (e[o] = Et(i, t, o));
    return e;
  }
  return e;
}, "traverseArgs"), jn = /* @__PURE__ */ n(({ initialArgs: e }) => {
  Et(e);
}, "nameSpiesAndWrapActionsInSpies"), yo = !1, Bn = /* @__PURE__ */ n(async (e) => {
  globalThis.HTMLElement && e.canvasElement instanceof globalThis.HTMLElement && (e.canvas = (0, H.within)(e.canvasElement));
  let t = globalThis.window?.navigator?.clipboard;
  if (t) {
    e.userEvent = (0, xo.instrument)(
      { userEvent: H.uninstrumentedUserEvent.setup() },
      { intercept: /* @__PURE__ */ n((o) => o !== "setup", "intercept") }
    ).userEvent, Object.defineProperty(globalThis.window.navigator, "clipboard", {
      get: /* @__PURE__ */ n(() => t, "get"),
      configurable: !0
    });
    let r = HTMLElement.prototype.focus;
    yo || Object.defineProperties(HTMLElement.prototype, {
      focus: {
        configurable: !0,
        set: /* @__PURE__ */ n((o) => {
          r = o, yo = !0;
        }, "set"),
        get: /* @__PURE__ */ n(() => r, "get")
      }
    });
  }
}, "enhanceContext"), wt = /* @__PURE__ */ n(() => (0, ho.definePreviewAddon)({
  loaders: [Nn, jn, Bn]
}), "default");

// src/viewport/preview.ts
var So = require("storybook/internal/csf");

// src/viewport/constants.ts
var bo = "storybook/viewport", To = "viewport", Zl = `${bo}/panel`, Jl = `${bo}/tool`;

// src/viewport/preview.ts
var zn = {
  [To]: { value: void 0, isRotated: !1 }
}, Ct = /* @__PURE__ */ n(() => (0, So.definePreviewAddon)({
  initialGlobals: zn
}), "default");

// src/csf/core-annotations.ts
function vt() {
  return [
    // @ts-expect-error CJS fallback
    (Tt.default ?? Tt)(),
    // @ts-expect-error CJS fallback
    (st.default ?? st)(),
    // @ts-expect-error CJS fallback
    (yt.default ?? yt)(),
    // @ts-expect-error CJS fallback
    (Rt.default ?? Rt)(),
    // @ts-expect-error CJS fallback
    (Ct.default ?? Ct)(),
    // @ts-expect-error CJS fallback
    (ot.default ?? ot)(),
    // @ts-expect-error CJS fallback
    (at.default ?? at)(),
    // @ts-expect-error CJS fallback
    (wt.default ?? wt)()
  ];
}
n(vt, "getCoreAnnotations");

// src/csf/csf-factories.ts
function Un(e) {
  let t, r = {
    _tag: "Preview",
    input: e,
    get composed() {
      if (t)
        return t;
      let { addons: o, ...i } = e;
      return t = se(
        pe([...vt(), ...o ?? [], i])
      ), t;
    },
    meta(o) {
      return Vn(o, this);
    }
  };
  return globalThis.globalProjectAnnotations = r.composed, r;
}
n(Un, "definePreview");
function Gn(e) {
  return e;
}
n(Gn, "definePreviewAddon");
function Wn(e) {
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Preview";
}
n(Wn, "isPreview");
function Yn(e) {
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Meta";
}
n(Yn, "isMeta");
function Vn(e, t) {
  return {
    _tag: "Meta",
    input: e,
    preview: t,
    get composed() {
      throw new Error("Not implemented");
    },
    // @ts-expect-error hard
    story(r = {}) {
      return Ro(typeof r == "function" ? { render: r } : r, this);
    }
  };
}
n(Vn, "defineMeta");
function Kn(e) {
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Story";
}
n(Kn, "isStory");
function Ro(e, t) {
  let r, o = /* @__PURE__ */ n(() => (r || (r = Ze(
    e,
    t.input,
    void 0,
    t.preview.composed
  )), r), "compose");
  return {
    _tag: "Story",
    input: e,
    meta: t,
    __compose: o,
    get composed() {
      let i = o(), { args: s, argTypes: a, parameters: l, id: c, tags: p, globals: g, storyName: u } = i;
      return { args: s, argTypes: a, parameters: l, id: c, tags: p, name: u, globals: g };
    },
    get play() {
      return e.play ?? t.input?.play ?? (async () => {
      });
    },
    get run() {
      return o().run ?? (async () => {
      });
    },
    extend(i) {
      return Ro(
        {
          ...this.input,
          ...i,
          args: { ...this.input.args, ...i.args },
          argTypes: D(this.input.argTypes, i.argTypes),
          afterEach: [
            ...b(this.input?.afterEach ?? []),
            ...b(i.afterEach ?? [])
          ],
          beforeEach: [
            ...b(this.input?.beforeEach ?? []),
            ...b(i.beforeEach ?? [])
          ],
          decorators: [
            ...b(this.input?.decorators ?? []),
            ...b(i.decorators ?? [])
          ],
          globals: { ...this.input.globals, ...i.globals },
          loaders: [
            ...b(this.input?.loaders ?? []),
            ...b(i.loaders ?? [])
          ],
          parameters: D(this.input.parameters, i.parameters),
          tags: (0, Ao.combineTags)(...this.input.tags ?? [], ...i.tags ?? [])
        },
        this.meta
      );
    }
  };
}
n(Ro, "defineStory");

// src/csf/index.ts
var Co = /* @__PURE__ */ n((e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g,
"-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), Eo = /* @__PURE__ */ n((e, t) => {
  let r = Co(e);
  if (r === "")
    throw new Error(`Invalid ${t} '${e}', must include alphanumeric characters`);
  return r;
}, "sanitizeSafe"), Xn = /* @__PURE__ */ n((e, t) => `${Eo(e, "kind")}${t ? `--${Eo(t, "name")}` : ""}`, "toId"), qn = /* @__PURE__ */ n((e) => $t(
e), "storyNameFromExport");
function wo(e, t) {
  return Array.isArray(t) ? t.includes(e) : e.match(t);
}
n(wo, "matches");
function Zn(e, { includeStories: t, excludeStories: r }) {
  return (
    // https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs
    e !== "__esModule" && (!t || wo(e, t)) && (!r || !wo(e, r))
  );
}
n(Zn, "isExportStory");
var Jn = /* @__PURE__ */ n((e, { rootSeparator: t, groupSeparator: r }) => {
  let [o, i] = e.split(t, 2), s = (i || e).split(r).filter((a) => !!a);
  return {
    root: i ? o : null,
    groups: s
  };
}, "parseKind"), Qn = /* @__PURE__ */ n((...e) => {
  let t = e.reduce((r, o) => (o.startsWith("!") ? r.delete(o.slice(1)) : r.add(o), r), /* @__PURE__ */ new Set());
  return Array.from(t);
}, "combineTags");
