var y = Object.defineProperty;
var p = (i, t) => y(i, "name", { value: t, configurable: !0 });
var k = (i, t) => {
  for (var n in t)
    y(i, n, { get: t[n], enumerable: !0 });
};

// src/outline/index.ts
import { definePreview as C } from "storybook/preview-api";

// src/outline/preview.ts
var h = {};
k(h, {
  decorators: () => S,
  default: () => I,
  initialGlobals: () => c
});
import { definePreview as P } from "storybook/preview-api";

// src/outline/constants.ts
var x = "outline";

// src/outline/withOutline.ts
import { useEffect as D, useMemo as O } from "storybook/preview-api";

// src/outline/helpers.ts
import { global as $ } from "@storybook/global";
var b = /* @__PURE__ */ p((i) => {
  (Array.isArray(i) ? i : [i]).forEach(w);
}, "clearStyles"), w = /* @__PURE__ */ p((i) => {
  let t = typeof i == "string" ? i : i.join(""), n = $.document.getElementById(t);
  n && n.parentElement && n.parentElement.removeChild(n);
}, "clearStyle"), v = /* @__PURE__ */ p((i, t) => {
  let n = $.document.getElementById(i);
  if (n)
    n.innerHTML !== t && (n.innerHTML = t);
  else {
    let o = $.document.createElement("style");
    o.setAttribute("id", i), o.innerHTML = t, $.document.head.appendChild(o);
  }
}, "addOutlineStyles");

// ../node_modules/ts-dedent/esm/index.js
function A(i) {
  for (var t = [], n = 1; n < arguments.length; n++)
    t[n - 1] = arguments[n];
  var o = Array.from(typeof i == "string" ? [i] : i);
  o[o.length - 1] = o[o.length - 1].replace(/\r?\n([\t ]*)$/, "");
  var u = o.reduce(function(a, f) {
    var r = f.match(/\n([\t ]+|(?!\s).)/g);
    return r ? a.concat(r.map(function(s) {
      var l, m;
      return (m = (l = s.match(/[\t ]/g)) === null || l === void 0 ? void 0 : l.length) !== null && m !== void 0 ? m : 0;
    })) : a;
  }, []);
  if (u.length) {
    var e = new RegExp(`
[	 ]{` + Math.min.apply(Math, u) + "}", "g");
    o = o.map(function(a) {
      return a.replace(e, `
`);
    });
  }
  o[0] = o[0].replace(/^\r?\n/, "");
  var d = o[0];
  return t.forEach(function(a, f) {
    var r = d.match(/(?:^|\n)( *)$/), s = r ? r[1] : "", l = a;
    typeof a == "string" && a.includes(`
`) && (l = String(a).split(`
`).map(function(m, M) {
      return M === 0 ? m : "" + s + m;
    }).join(`
`)), d += l + o[f + 1];
  }), d;
}
p(A, "dedent");

// src/outline/outlineCSS.ts
function g(i) {
  return A`
    ${i} body {
      outline: 1px solid #2980b9 !important;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    ${i} wbr {
      outline: 1px solid #db175b !important;
    }`;
}
p(g, "outlineCSS");

// src/outline/withOutline.ts
var E = /* @__PURE__ */ p((i, t) => {
  let n = t.globals || {}, o = [!0, "true"].includes(n[x]), u = t.viewMode === "docs", e = O(() => g(u ? '[data-story-block="true"]' : ".sb-\
show-main"), [t]);
  return D(() => {
    let d = u ? `addon-outline-docs-${t.id}` : "addon-outline";
    return o ? v(d, e) : b(d), () => {
      b(d);
    };
  }, [o, e, t]), i();
}, "withOutline");

// src/outline/preview.ts
var S = [E], c = {
  [x]: !1
}, I = /* @__PURE__ */ p(() => P({ decorators: S, initialGlobals: c }), "default");

// src/outline/index.ts
var ii = /* @__PURE__ */ p(() => C(h), "default");
export {
  ii as default
};
