let Y;
function fe(e) {
  return [
    ...e.v,
    (e.i ? "!" : "") + e.n
  ].join(":");
}
function ve(e, t = ",") {
  return e.map(fe).join(t);
}
let W = typeof CSS < "u" && CSS.escape || // Simplified: escaping only special characters
// Needed for NodeJS and Edge <79 (https://caniuse.com/mdn-api_css_escape)
((e) => e.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g, "\\$&").replace(/^\d/, "\\3$& "));
function D(e) {
  for (var t = 9, r = e.length; r--; ) t = Math.imul(t ^ e.charCodeAt(r), 1597334677);
  return "#" + ((t ^ t >>> 9) >>> 0).toString(36);
}
function Oe(e, t = "@media ") {
  return t + $(e).map((r) => (typeof r == "string" && (r = {
    min: r
  }), r.raw || Object.keys(r).map((n) => `(${n}-width:${r[n]})`).join(" and "))).join(",");
}
function $(e = []) {
  return Array.isArray(e) ? e : e == null ? [] : [
    e
  ];
}
function ge(e) {
  return e;
}
function B() {
}
let S = {
  /**
  * 1. `default` (public)
  */
  d: (
    /* efaults */
    0
  ),
  /* Shifts.layer */
  /**
  * 2. `base` (public) — for things like reset rules or default styles applied to plain HTML elements.
  */
  b: (
    /* ase */
    134217728
  ),
  /* Shifts.layer */
  /**
  * 3. `components` (public, used by `style()`) — is for class-based styles that you want to be able to override with utilities.
  */
  c: (
    /* omponents */
    268435456
  ),
  /* Shifts.layer */
  // reserved for style():
  // - props: 0b011
  // - when: 0b100
  /**
  * 6. `aliases` (public, used by `apply()`) — `~(...)`
  */
  a: (
    /* liases */
    671088640
  ),
  /* Shifts.layer */
  /**
  * 6. `utilities` (public) — for small, single-purpose classes
  */
  u: (
    /* tilities */
    805306368
  ),
  /* Shifts.layer */
  /**
  * 7. `overrides` (public, used by `css()`)
  */
  o: (
    /* verrides */
    939524096
  )
};
function Me(e) {
  return e.match(/[-=:;]/g)?.length || 0;
}
function ee(e) {
  return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(e) ? Math.max(0, 29.63 * (+RegExp.$1 / (RegExp.$2 ? 15 : 1)) ** 0.137 - 43) : 0, 15) << 22 | /* Shifts.responsive */
  Math.min(Me(e), 15) << 18;
}
let Te = [
  /* fi */
  "rst-c",
  /* hild: 0 */
  /* la */
  "st-ch",
  /* ild: 1 */
  // even and odd use: nth-child
  /* nt */
  "h-chi",
  /* ld: 2 */
  /* an */
  "y-lin",
  /* k: 3 */
  /* li */
  "nk",
  /* : 4 */
  /* vi */
  "sited",
  /* : 5 */
  /* ch */
  "ecked",
  /* : 6 */
  /* em */
  "pty",
  /* : 7 */
  /* re */
  "ad-on",
  /* ly: 8 */
  /* fo */
  "cus-w",
  /* ithin : 9 */
  /* ho */
  "ver",
  /* : 10 */
  /* fo */
  "cus",
  /* : 11 */
  /* fo */
  "cus-v",
  /* isible : 12 */
  /* ac */
  "tive",
  /* : 13 */
  /* di */
  "sable",
  /* d : 14 */
  /* op */
  "tiona",
  /* l: 15 */
  /* re */
  "quire"
];
function ae({ n: e, i: t, v: r = [] }, n, i, l) {
  e && (e = fe({
    n: e,
    i: t,
    v: r
  })), l = [
    ...$(l)
  ];
  for (let s of r) {
    let a = n.theme("screens", s);
    for (let o of $(a && Oe(a) || n.v(s))) {
      var f;
      l.push(o), i |= a ? 67108864 | /* Shifts.screens */
      ee(o) : s == "dark" ? 1073741824 : (
        /* Shifts.darkMode */
        o[0] == "@" ? ee(o) : (f = o, // use first found pseudo-class
        1 << ~(/:([a-z-]+)/.test(f) && ~Te.indexOf(RegExp.$1.slice(2, 7)) || -18))
      );
    }
  }
  return {
    n: e,
    p: i,
    r: l,
    i: t
  };
}
let oe = /* @__PURE__ */ new Map();
function te(e) {
  if (e.d) {
    let t = [], r = Z(
      // merge all conditions into a selector string
      e.r.reduce((n, i) => i[0] == "@" ? (t.push(i), n) : (
        // Go over the selector and replace the matching multiple selectors if any
        i ? Z(n, (l) => Z(
          i,
          // If the current condition has a nested selector replace it
          (f) => {
            let s = /(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(f);
            if (s) {
              let a = l.indexOf(s[1]);
              return ~a ? (
                // [':merge(.group):hover .rule', ':merge(.group):focus &'] -> ':merge(.group):focus:hover .rule'
                // ':merge(.group)' + ':focus' + ':hover .rule'
                l.slice(0, a) + s[0] + l.slice(a + s[1].length)
              ) : (
                // [':merge(.peer):focus~&', ':merge(.group):hover &'] -> ':merge(.peer):focus~:merge(.group):hover &'
                H(l, f)
              );
            }
            return H(f, l);
          }
        )) : n
      ), "&"),
      // replace '&' with rule name or an empty string
      (n) => H(n, e.n ? "." + W(e.n) : "")
    );
    return r && t.push(r.replace(/:merge\((.+?)\)/g, "$1")), t.reduceRight((n, i) => i + "{" + n + "}", e.d);
  }
}
function Z(e, t) {
  return e.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g, (r, n, i) => t(n) + i);
}
function H(e, t) {
  return e.replace(/&/g, t);
}
let me = new Intl.Collator("en", {
  numeric: !0
});
function Ee(e, t) {
  for (var r = 0, n = e.length; r < n; ) {
    let i = n + r >> 1;
    0 >= _e(e[i], t) ? r = i + 1 : n = i;
  }
  return n;
}
function _e(e, t) {
  let r = e.p & S.o;
  return r == (t.p & S.o) && (r == S.b || r == S.o) ? 0 : e.p - t.p || e.o - t.o || me.compare(be(e.n), be(t.n)) || me.compare($e(e.n), $e(t.n));
}
function be(e) {
  return (e || "").split(/:/).pop().split("/").pop() || "\0";
}
function $e(e) {
  return (e || "").replace(/\W/g, (t) => String.fromCharCode(127 + t.charCodeAt(0))) + "\0";
}
function Q(e, t) {
  return Math.round(parseInt(e, 16) * t);
}
function T(e, t = {}) {
  if (typeof e == "function") return e(t);
  let { opacityValue: r = "1", opacityVariable: n } = t, i = n ? `var(${n})` : r;
  if (e.includes("<alpha-value>")) return e.replace("<alpha-value>", i);
  if (e[0] == "#" && (e.length == 4 || e.length == 7)) {
    let l = (e.length - 1) / 3, f = [
      17,
      1,
      0.062272
    ][l - 1];
    return `rgba(${[
      Q(e.substr(1, l), f),
      Q(e.substr(1 + l, l), f),
      Q(e.substr(1 + 2 * l, l), f),
      i
    ]})`;
  }
  return i == "1" ? e : i == "0" ? "#0000" : (
    // convert rgb and hsl to alpha variant
    e.replace(/^(rgb|hsl)(\([^)]+)\)$/, `$1a$2,${i})`)
  );
}
function ue(e, t, r, n, i = []) {
  return function l(f, { n: s, p: a, r: o = [], i: c }, u) {
    let p = [], g = "", y = 0, b = 0;
    for (let h in f || {}) {
      var R, j;
      let d = f[h];
      if (h[0] == "@") {
        if (!d) continue;
        if (h[1] == "a") {
          p.push(...de(s, a, F("" + d), u, a, o, c, !0));
          continue;
        }
        if (h[1] == "l") {
          for (let w of $(d)) p.push(...l(w, {
            n: s,
            p: (R = S[h[7]], // Set layer (first reset, than set)
            a & -939524097 | R),
            r: h[7] == "d" ? [] : o,
            i: c
          }, u));
          continue;
        }
        if (h[1] == "i") {
          p.push(...$(d).map((w) => ({
            // before all layers
            p: -1,
            o: 0,
            r: [],
            d: h + " " + w
          })));
          continue;
        }
        if (h[1] == "k") {
          p.push({
            p: S.d,
            o: 0,
            r: [
              h
            ],
            d: l(d, {
              p: S.d
            }, u).map(te).join("")
          });
          continue;
        }
        if (h[1] == "f") {
          p.push(...$(d).map((w) => ({
            p: S.d,
            o: 0,
            r: [
              h
            ],
            d: l(w, {
              p: S.d
            }, u).map(te).join("")
          })));
          continue;
        }
      }
      if (typeof d != "object" || Array.isArray(d))
        h == "label" && d ? s = d + D(JSON.stringify([
          a,
          c,
          f
        ])) : (d || d === 0) && (h = h.replace(/[A-Z]/g, (w) => "-" + w.toLowerCase()), b += 1, y = Math.max(y, (j = h)[0] == "-" ? 0 : Me(j) + (/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(j) ? +!!RegExp.$1 || /* +1 */
        -!!RegExp.$2 : (
          /* -1 */
          0
        )) + 1), g += (g ? ";" : "") + $(d).map((w) => u.s(
          h,
          // support theme(...) function in values
          // calc(100vh - theme('spacing.12'))
          ce("" + w, u.theme) + (c ? " !important" : "")
        )).join(";"));
      else if (h[0] == "@" || h.includes("&")) {
        let w = a;
        h[0] == "@" && (h = h.replace(/\bscreen\(([^)]+)\)/g, (v, C) => {
          let k = u.theme("screens", C);
          return k ? (w |= 67108864, /* Shifts.screens */
          Oe(k, "")) : v;
        }), w |= ee(h)), p.push(...l(d, {
          n: s,
          p: w,
          r: [
            ...o,
            h
          ],
          i: c
        }, u));
      } else
        p.push(...l(d, {
          p: a,
          r: [
            ...o,
            h
          ]
        }, u));
    }
    return (
      // PERF: prevent unshift using `rules = [{}]` above and then `rules[0] = {...}`
      p.unshift({
        n: s,
        p: a,
        o: (
          // number of declarations (descending)
          Math.max(0, 15 - b) + // greatest precedence of properties
          // if there is no property precedence this is most likely a custom property only declaration
          // these have the highest precedence
          1.5 * Math.min(y || 15, 15)
        ),
        r: o,
        // stringified declarations
        d: g
      }), p.sort(_e)
    );
  }(e, ae(t, r, n, i), r);
}
function ce(e, t) {
  return e.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g, (r, n, i, l, f = "") => {
    let s = t(i, f);
    return typeof s == "function" && /color|fill|stroke/i.test(i) ? T(s) : "" + $(s).filter((a) => Object(a) !== a);
  });
}
function pe(e, t) {
  let r, n = [];
  for (let i of e)
    i.d && i.n ? r?.p == i.p && "" + r.r == "" + i.r ? (r.c = [
      r.c,
      i.c
    ].filter(Boolean).join(" "), r.d = r.d + ";" + i.d) : n.push(r = {
      ...i,
      n: i.n && t
    }) : n.push({
      ...i,
      n: i.n && t
    });
  return n;
}
function J(e, t, r = S.u, n, i) {
  let l = [];
  for (let f of e) for (let s of function(a, o, c, u, p) {
    a = {
      ...a,
      i: a.i || p
    };
    let g = function(y, b) {
      let R = oe.get(y.n);
      return R ? R(y, b) : b.r(y.n, y.v[0] == "dark");
    }(a, o);
    return g ? (
      // a list of class names
      typeof g == "string" ? ({ r: u, p: c } = ae(a, o, c, u), pe(J(F(g), o, c, u, a.i), a.n)) : Array.isArray(g) ? g.map((y) => {
        var b, R;
        return {
          o: 0,
          ...y,
          r: [
            ...$(u),
            ...$(y.r)
          ],
          p: (b = c, R = y.p ?? c, b & -939524097 | R)
        };
      }) : ue(g, a, o, c, u)
    ) : (
      // propagate className as is
      [
        {
          c: fe(a),
          p: 0,
          o: 0,
          r: []
        }
      ]
    );
  }(f, t, r, n, i)) l.splice(Ee(l, s), 0, s);
  return l;
}
function de(e, t, r, n, i, l, f, s) {
  return pe((s ? r.flatMap((a) => J([
    a
  ], n, i, l, f)) : J(r, n, i, l, f)).map((a) => (
    // do not move defaults
    // move only rules with a name unless they are in the base layer
    a.p & S.o && (a.n || t == S.b) ? {
      ...a,
      p: a.p & -939524097 | t,
      o: 0
    } : a
  )), e);
}
function Ce(e, t, r, n) {
  var i;
  return i = (l, f) => {
    let { n: s, p: a, r: o, i: c } = ae(l, f, t);
    return r && de(s, t, r, f, a, o, c, n);
  }, oe.set(e, i), e;
}
function X(e, t, r) {
  if (e[e.length - 1] != "(") {
    let n = [], i = !1, l = !1, f = "";
    for (let s of e) if (!(s == "(" || /[~@]$/.test(s))) {
      if (s[0] == "!" && (s = s.slice(1), i = !i), s.endsWith(":")) {
        n[s == "dark:" ? "unshift" : "push"](s.slice(0, -1));
        continue;
      }
      s[0] == "-" && (s = s.slice(1), l = !l), s.endsWith("-") && (s = s.slice(0, -1)), s && s != "&" && (f += (f && "-") + s);
    }
    f && (l && (f = "-" + f), t[0].push({
      n: f,
      v: n.filter(Fe),
      i
    }));
  }
}
function Fe(e, t, r) {
  return r.indexOf(e) == t;
}
let we = /* @__PURE__ */ new Map();
function F(e) {
  let t = we.get(e);
  if (!t) {
    let r = [], n = [
      []
    ], i = 0, l = 0, f = null, s = 0, a = (o, c = 0) => {
      i != s && (r.push(e.slice(i, s + c)), o && X(r, n)), i = s + 1;
    };
    for (; s < e.length; s++) {
      let o = e[s];
      if (l) e[s - 1] != "\\" && (l += +(o == "[") || -(o == "]"));
      else if (o == "[")
        l += 1;
      else if (f)
        e[s - 1] != "\\" && f.test(e.slice(s)) && (f = null, i = s + RegExp.lastMatch.length);
      else if (o == "/" && e[s - 1] != "\\" && (e[s + 1] == "*" || e[s + 1] == "/"))
        f = e[s + 1] == "*" ? /^\*\// : /^[\r\n]/;
      else if (o == "(")
        a(), r.push(o);
      else if (o == ":") e[s + 1] != ":" && a(!1, 1);
      else if (/[\s,)]/.test(o)) {
        a(!0);
        let c = r.lastIndexOf("(");
        if (o == ")") {
          let u = r[c - 1];
          if (/[~@]$/.test(u)) {
            let p = n.shift();
            r.length = c, X([
              ...r,
              "#"
            ], n);
            let { v: g } = n[0].pop();
            for (let y of p)
              y.v.splice(+(y.v[0] == "dark") - +(g[0] == "dark"), g.length);
            X([
              ...r,
              Ce(
                // named nested
                u.length > 1 ? u.slice(0, -1) + D(JSON.stringify([
                  u,
                  p
                ])) : u + "(" + ve(p) + ")",
                S.a,
                p,
                /@$/.test(u)
              )
            ], n);
          }
          c = r.lastIndexOf("(", c - 1);
        }
        r.length = c + 1;
      } else /[~@]/.test(o) && e[s + 1] == "(" && // start nested block
      // ~(...) or button~(...)
      // @(...) or button@(...)
      n.unshift([]);
    }
    a(!0), we.set(e, t = n[0]);
  }
  return t;
}
function ke(e, t, r) {
  return t.reduce((n, i, l) => n + r(i) + e[l + 1], e[0]);
}
function he(e, t) {
  return Array.isArray(e) && Array.isArray(e.raw) ? ke(e, t, (r) => K(r).trim()) : t.filter(Boolean).reduce((r, n) => r + K(n), e ? K(e) : "");
}
function K(e) {
  let t, r = "";
  if (e && typeof e == "object")
    if (Array.isArray(e)) (t = he(e[0], e.slice(1))) && (r += " " + t);
    else for (let n in e) e[n] && (r += " " + n);
  else e != null && typeof e != "boolean" && (r += " " + e);
  return r;
}
let Xe = /* @__PURE__ */ Pe("@");
function Pe(e) {
  return new Proxy(function(n, ...i) {
    return t("", n, i);
  }, {
    get(r, n) {
      return n in r ? r[n] : function(l, ...f) {
        return t(n, l, f);
      };
    }
  });
  function t(r, n, i) {
    return ve(F(r + e + "(" + he(n, i) + ")"));
  }
}
function U(e, t) {
  return Array.isArray(e) ? Re(ke(e, t, (r) => r != null && typeof r != "boolean" ? r : "")) : typeof e == "string" ? Re(e) : [
    e
  ];
}
let Le = / *(?:(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}))/g;
function Re(e) {
  let t;
  e = // Remove comments (multiline and single line)
  e.replace(/\/\*[^]*?\*\/|\s\s+|\n/gm, " ");
  let r = [
    {}
  ], n = [
    r[0]
  ], i = [];
  for (; t = Le.exec(e); )
    t[4] && (r.shift(), i.shift()), t[3] ? (i.unshift(t[3]), r.unshift({}), n.push(i.reduce((l, f) => ({
      [f]: l
    }), r[0]))) : t[4] || (r[0][t[1]] && (r.unshift({}), n.push(i.reduce((l, f) => ({
      [f]: l
    }), r[0]))), r[0][t[1]] = t[2]);
  return n;
}
function Ve(e, ...t) {
  var r;
  let n = U(e, t), i = (n.find((l) => l.label)?.label || "css") + D(JSON.stringify(n));
  return r = (l, f) => pe(n.flatMap((s) => ue(s, l, f, S.o)), i), oe.set(i, r), i;
}
function Ke(e, t, r) {
  return [
    e,
    re(t, r)
  ];
}
function re(e, t) {
  return typeof e == "function" ? e : typeof e == "string" && /^[\w-]+$/.test(e) ? (
    // a CSS property alias
    (r, n) => ({
      [e]: t ? t(r, n) : ne(r, 1)
    })
  ) : (r) => (
    // CSSObject, shortcut or apply
    e || {
      [r[1]]: ne(r, 2)
    }
  );
}
function ne(e, t, r = e.slice(t).find(Boolean) || e.$$ || e.input) {
  return e.input[0] == "-" ? `calc(${r} * -1)` : r;
}
function et(e, t, r, n) {
  return [
    e,
    Ie(t, r, n)
  ];
}
function Ie(e, t, r) {
  let n = typeof t == "string" ? (i, l) => ({
    [t]: r ? r(i, l) : i._
  }) : t || (({ 1: i, _: l }, f, s) => ({
    [i || s]: l
  }));
  return (i, l) => {
    let f = ze(e || i[1]), s = l.theme(f, i.$$) ?? ie(i.$$, f, l);
    if (s != null) return i._ = ne(i, 0, s), n(i, l, f);
  };
}
function tt(e, t = {}, r) {
  return [
    e,
    qe(t, r)
  ];
}
function qe(e = {}, t) {
  return (r, n) => {
    let { section: i = ze(r[0]).replace("-", "") + "Color" } = e, [l, f] = Je(r.$$);
    if (!l) return;
    let s = n.theme(i, l) || ie(l, i, n);
    if (!s || typeof s == "object") return;
    let {
      // text- -> --tw-text-opacity
      // ring-offset(?:-|$) -> --tw-ring-offset-opacity
      // TODO move this default into preset-tailwind?
      opacityVariable: a = `--tw-${r[0].replace(/-$/, "")}-opacity`,
      opacitySection: o = i.replace("Color", "Opacity"),
      property: c = i,
      selector: u
    } = e, p = n.theme(o, f || "DEFAULT") || f && ie(f, o, n), g = t || (({ _: b }) => {
      let R = Ue(c, b);
      return u ? {
        [u]: R
      } : R;
    });
    r._ = {
      value: T(s, {
        opacityVariable: a || void 0,
        opacityValue: p || void 0
      }),
      color: (b) => T(s, b),
      opacityVariable: a || void 0,
      opacityValue: p || void 0
    };
    let y = g(r, n);
    if (!r.dark) {
      let b = n.d(i, l, s);
      b && b !== s && (r._ = {
        value: T(b, {
          opacityVariable: a || void 0,
          opacityValue: p || "1"
        }),
        color: (R) => T(b, R),
        opacityVariable: a || void 0,
        opacityValue: p || void 0
      }, y = {
        "&": y,
        [n.v("dark")]: g(r, n)
      });
    }
    return y;
  };
}
function Je(e) {
  return (e.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/) || []).slice(1);
}
function Ue(e, t) {
  let r = {};
  return typeof t == "string" ? r[e] = t : (t.opacityVariable && t.value.includes(t.opacityVariable) && (r[t.opacityVariable] = t.opacityValue || "1"), r[e] = t.value), r;
}
function ie(e, t, r) {
  if (e[0] == "[" && e.slice(-1) == "]") {
    if (e = le(ce(e.slice(1, -1), r.theme)), !t) return e;
    if (
      // Respect type hints from the user on ambiguous arbitrary values - https://tailwindcss.com/docs/adding-custom-styles#resolving-ambiguities
      !// If this is a color section and the value is a hex color, color function or color name
      (/color|fill|stroke/i.test(t) && !(/^color:/.test(e) || /^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(e)) || // url(, [a-z]-gradient(, image(, cross-fade(, image-set(
      /image/i.test(t) && !(/^image:/.test(e) || /^[a-z-]+\(/.test(e)) || // font-*
      // - fontWeight (type: ['lookup', 'number', 'any'])
      // - fontFamily (type: ['lookup', 'generic-name', 'family-name'])
      /weight/i.test(t) && !(/^(number|any):/.test(e) || /^\d+$/.test(e)) || // bg-*
      // - backgroundPosition (type: ['lookup', ['position', { preferOnConflict: true }]])
      // - backgroundSize (type: ['lookup', 'length', 'percentage', 'size'])
      /position/i.test(t) && /^(length|size):/.test(e))
    )
      return e.replace(/^[a-z-]+:/, "");
  }
}
function ze(e) {
  return e.replace(/-./g, (t) => t[1].toUpperCase());
}
function le(e) {
  return (
    // Keep raw strings if it starts with `url(`
    e.includes("url(") ? e.replace(/(.*?)(url\(.*?\))(.*?)/g, (t, r = "", n, i = "") => le(r) + n + le(i)) : e.replace(/(^|[^\\])_+/g, (t, r) => r + " ".repeat(t.length - r.length)).replace(/\\_/g, "_").replace(/(calc|min|max|clamp)\(.+\)/g, (t) => t.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 "))
  );
}
function We({ presets: e = [], ...t }) {
  let r = {
    darkMode: void 0,
    darkColor: void 0,
    preflight: t.preflight !== !1 && [],
    theme: {},
    variants: $(t.variants),
    rules: $(t.rules),
    ignorelist: $(t.ignorelist),
    hash: void 0,
    stringify: (n, i) => n + ":" + i,
    finalize: []
  };
  for (let n of $([
    ...e,
    {
      darkMode: t.darkMode,
      darkColor: t.darkColor,
      preflight: t.preflight !== !1 && $(t.preflight),
      theme: t.theme,
      hash: t.hash,
      stringify: t.stringify,
      finalize: t.finalize
    }
  ])) {
    let { preflight: i, darkMode: l = r.darkMode, darkColor: f = r.darkColor, theme: s, variants: a, rules: o, ignorelist: c, hash: u = r.hash, stringify: p = r.stringify, finalize: g } = typeof n == "function" ? n(r) : n;
    r = {
      // values defined by user or previous presets take precedence
      preflight: r.preflight !== !1 && i !== !1 && [
        ...r.preflight,
        ...$(i)
      ],
      darkMode: l,
      darkColor: f,
      theme: {
        ...r.theme,
        ...s,
        extend: {
          ...r.theme.extend,
          ...s?.extend
        }
      },
      variants: [
        ...r.variants,
        ...$(a)
      ],
      rules: [
        ...r.rules,
        ...$(o)
      ],
      ignorelist: [
        ...r.ignorelist,
        ...$(c)
      ],
      hash: u,
      stringify: p,
      finalize: [
        ...r.finalize,
        ...$(g)
      ]
    };
  }
  return r;
}
function Se(e, t, r, n, i, l) {
  for (let f of t) {
    let s = r.get(f);
    s || r.set(f, s = n(f));
    let a = s(e, i, l);
    if (a) return a;
  }
}
function Be(e) {
  var t;
  return se(e[0], typeof (t = e[1]) == "function" ? t : () => t);
}
function Ge(e) {
  var t, r;
  return Array.isArray(e) ? se(e[0], re(e[1], e[2])) : se(e, re(t, r));
}
function se(e, t) {
  return Ne(e, (r, n, i, l) => {
    let f = n.exec(r);
    if (f) return (
      // MATCH.$_ = value
      f.$$ = r.slice(f[0].length), f.dark = l, t(f, i)
    );
  });
}
function Ne(e, t) {
  let r = $(e).map(Ye);
  return (n, i, l) => {
    for (let f of r) {
      let s = t(n, f, i, l);
      if (s) return s;
    }
  };
}
function Ye(e) {
  return typeof e == "string" ? RegExp("^" + e + (e.includes("$") || e.slice(-1) == "-" ? "" : "$")) : e;
}
function rt(e, t) {
  let r = We(e), n = function({ theme: a, darkMode: o, darkColor: c = B, variants: u, rules: p, hash: g, stringify: y, ignorelist: b, finalize: R }) {
    let j = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), v = Ne(b, (m, O) => O.test(m));
    u.push([
      "dark",
      Array.isArray(o) || o == "class" ? `${$(o)[1] || ".dark"} &` : typeof o == "string" && o != "media" ? o : (
        // a custom selector
        "@media (prefers-color-scheme:dark)"
      )
    ]);
    let C = typeof g == "function" ? (m) => g(m, D) : g ? D : ge;
    C !== ge && R.push((m) => ({
      ...m,
      n: m.n && C(m.n),
      d: m.d?.replace(/--(tw(?:-[\w-]+)?)\b/g, (O, _) => "--" + C(_).replace("#", ""))
    }));
    let k = {
      theme: function({ extend: m = {}, ...O }) {
        let _ = {}, xe = {
          get colors() {
            return P("colors");
          },
          theme: P,
          // Stub implementation as negated values are automatically infered and do _not_ need to be in the theme
          negative() {
            return {};
          },
          breakpoints(A) {
            let M = {};
            for (let E in A) typeof A[E] == "string" && (M["screen-" + E] = A[E]);
            return M;
          }
        };
        return P;
        function P(A, M, E, L) {
          if (A) {
            if ({ 1: A, 2: L } = // eslint-disable-next-line no-sparse-arrays
            /^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(A) || [
              ,
              A
            ], /[.[]/.test(A)) {
              let z = [];
              A.replace(/\[([^\]]+)\]|([^.[]+)/g, (x, q, De = q) => z.push(De)), A = z.shift(), E = M, M = z.join("-");
            }
            let V = _[A] || // two-step deref to allow extend section to reference base section
            Object.assign(Object.assign(
              // Make sure to not get into recursive calls
              _[A] = {},
              ye(O, A)
            ), ye(m, A));
            if (M == null) return V;
            M || (M = "DEFAULT");
            let N = V[M] ?? M.split("-").reduce((z, x) => z?.[x], V) ?? E;
            return L ? T(N, {
              opacityValue: ce(L, P)
            }) : N;
          }
          let I = {};
          for (let V of [
            ...Object.keys(O),
            ...Object.keys(m)
          ]) I[V] = P(V);
          return I;
        }
        function ye(A, M) {
          let E = A[M];
          return typeof E == "function" && (E = E(xe)), E && /color|fill|stroke/i.test(M) ? function L(I, V = []) {
            let N = {};
            for (let z in I) {
              let x = I[z], q = [
                ...V,
                z
              ];
              N[q.join("-")] = x, z == "DEFAULT" && (q = V, N[V.join("-")] = x), typeof x == "object" && Object.assign(N, L(x, q));
            }
            return N;
          }(E) : E;
        }
      }(a),
      e: W,
      h: C,
      s(m, O) {
        return y(m, O, k);
      },
      d(m, O, _) {
        return c(m, O, k, _);
      },
      v(m) {
        return j.has(m) || j.set(m, Se(m, u, h, Be, k) || "&:" + m), j.get(m);
      },
      r(m, O) {
        let _ = JSON.stringify([
          m,
          O
        ]);
        return d.has(_) || d.set(_, !v(m, k) && Se(m, p, w, Ge, k, O)), d.get(_);
      },
      f(m) {
        return R.reduce((O, _) => _(O, k), m);
      }
    };
    return k;
  }(r), i = /* @__PURE__ */ new Map(), l = [], f = /* @__PURE__ */ new Set();
  t.resume((a) => i.set(a, a), (a, o) => {
    t.insert(a, l.length, o), l.push(o), f.add(a);
  });
  function s(a) {
    let o = n.f(a), c = te(o);
    if (c && !f.has(c)) {
      f.add(c);
      let u = Ee(l, a);
      t.insert(c, u, a), l.splice(u, 0, a);
    }
    return o.n;
  }
  return Object.defineProperties(function(o) {
    if (!i.size) for (let u of $(r.preflight))
      typeof u == "function" && (u = u(n)), u && (typeof u == "string" ? de("", S.b, F(u), n, S.b, [], !1, !0) : ue(u, {}, n, S.b)).forEach(s);
    o = "" + o;
    let c = i.get(o);
    if (!c) {
      let u = /* @__PURE__ */ new Set();
      for (let p of J(F(o), n)) u.add(p.c).add(s(p));
      c = [
        ...u
      ].filter(Boolean).join(" "), i.set(o, c).set(c, c);
    }
    return c;
  }, Object.getOwnPropertyDescriptors({
    get target() {
      return t.target;
    },
    theme: n.theme,
    config: r,
    snapshot() {
      let a = t.snapshot(), o = new Set(f), c = new Map(i), u = [
        ...l
      ];
      return () => {
        a(), f = o, i = c, l = u;
      };
    },
    clear() {
      t.clear(), f = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), l = [];
    },
    destroy() {
      this.clear(), t.destroy();
    }
  }));
}
function Ze(e, t) {
  return e != t && "" + e.split(" ").sort() != "" + t.split(" ").sort();
}
function He(e) {
  let t = new MutationObserver(r);
  return {
    observe(i) {
      t.observe(i, {
        attributeFilter: [
          "class"
        ],
        subtree: !0,
        childList: !0
      }), n(i), r([
        {
          target: i,
          type: ""
        }
      ]);
    },
    disconnect() {
      t.disconnect();
    }
  };
  function r(i) {
    for (let { type: l, target: f } of i) if (l[0] == "a")
      n(f);
    else
      for (let s of f.querySelectorAll("[class]")) n(s);
    t.takeRecords();
  }
  function n(i) {
    let l, f = i.getAttribute?.("class");
    f && Ze(f, l = e(f)) && // Not using `target.className = ...` as that is read-only for SVGElements
    i.setAttribute("class", l);
  }
}
function nt(e = G, t = typeof document < "u" && document.documentElement) {
  if (t) {
    let r = He(e);
    r.observe(t);
    let { destroy: n } = e;
    e.destroy = () => {
      r.disconnect(), n.call(e);
    };
  }
  return e;
}
function Qe(e) {
  let t = document.querySelector(e);
  return (!t || t.tagName != "STYLE") && (t = document.createElement("style"), document.head.prepend(t)), t.dataset.twind = "claimed", t;
}
function it(e) {
  let t = e?.cssRules ? e : Qe(e).sheet;
  return {
    target: t,
    snapshot() {
      let r = Array.from(t.cssRules, (n) => n.cssText);
      return () => {
        this.clear(), r.forEach(this.insert);
      };
    },
    clear() {
      for (let r = t.cssRules.length; r--; ) t.deleteRule(r);
    },
    destroy() {
      t.ownerNode?.remove();
    },
    insert(r, n) {
      try {
        t.insertRule(r, n);
      } catch {
        t.insertRule(":root{}", n);
      }
    },
    resume: B
  };
}
function lt(e) {
  let t = [];
  return {
    target: t,
    snapshot() {
      let r = [
        ...t
      ];
      return () => {
        t.splice(0, t.length, ...r);
      };
    },
    clear() {
      t.length = 0;
    },
    destroy() {
      this.clear();
    },
    insert(r, n, i) {
      t.splice(n, 0, r);
    },
    resume: B
  };
}
let G = /* @__PURE__ */ new Proxy(
  // just exposing the active as tw should work with most bundlers
  // as ES module export can be re-assigned BUT some bundlers to not honor this
  // -> using a delegation proxy here
  B,
  {
    apply(e, t, r) {
      return Y(r[0]);
    },
    get(e, t) {
      let r = Y[t];
      return typeof r == "function" ? function() {
        return r.apply(Y, arguments);
      } : r;
    }
  }
), st = function(e, ...t) {
  (typeof this == "function" ? this : G)(Ve({
    "@layer base": U(e, t)
  }));
}, ft = /* @__PURE__ */ function e(t) {
  return new Proxy(function(n, ...i) {
    return Ae(t, "", n, i);
  }, {
    get(r, n) {
      return n === "bind" ? e : n in r ? r[n] : function(l, ...f) {
        return Ae(t, n, l, f);
      };
    }
  });
}();
function Ae(e, t, r, n) {
  return {
    toString() {
      let i = U(r, n), l = W(t + D(JSON.stringify([
        t,
        i
      ])));
      return (
        // lazy access tw
        (typeof e == "function" ? e : G)(Ve({
          [`@keyframes ${l}`]: U(r, n)
        })), l
      );
    }
  };
}
let at = (e, t) => typeof e == "function" ? je(t, e) : je(e);
function je(e = {}, t) {
  let { label: r = "style", base: n, props: i = {}, defaults: l, when: f = [] } = e, s = {
    ...t?.defaults,
    ...l
  }, a = D(JSON.stringify([
    r,
    t?.className,
    n,
    i,
    s,
    f
  ])), o = c("", n || "", S.c);
  function c(u, p, g) {
    return Ce(
      // `<name>#<id>` or `<parent>~<name>#<id>`
      ((t ? t.className.replace(/#.+$/, "~") : "") + r + u + a).replace(/[: ,()[\]]/, ""),
      g,
      p && F(p)
    );
  }
  return Object.defineProperties(function(p) {
    let g, y;
    Array.isArray(p) && (g = !0, p = Object.fromEntries(new URLSearchParams(p[1]).entries()));
    let b = {
      ...s,
      ...p
    }, R = g ? "" : (t ? t(b) + " " : "") + o;
    for (let j in i) {
      let h = i[j], d = b[j];
      if (d === Object(d)) {
        let w = "";
        y = "";
        for (let v in d) {
          let C = h[d[v]];
          C && (w += "@" + v + "-" + d[v], y += (y && " ") + (v == "_" ? C : v + ":(" + C + ")"));
        }
        y && (R += " " + c("--" + j + "-" + w, y, 402653184));
      } else (y = h[d]) && (R += " " + c("--" + j + "-" + d, y, 402653184));
    }
    return (
      /* Shifts.layer */
      f.forEach((j, h) => {
        let d = "";
        for (let w in j[0]) {
          let v = b[w];
          if (v !== Object(v) && "" + v == "" + j[0][w]) d += (d && "_") + w + "-" + v;
          else {
            d = "";
            break;
          }
        }
        d && (y = j[1]) && (R += " " + c("-" + h + "--" + d, y, 536870912));
      }), /* Shifts.layer */
      R
    );
  }, Object.getOwnPropertyDescriptors({
    className: o,
    defaults: s,
    selector: "." + W(o)
  }));
}
let ot = function(e, ...t) {
  return (typeof this == "function" ? this : G)(he(e, t));
};
export {
  Xe as apply,
  ie as arbitrary,
  $ as asArray,
  qe as colorFromTheme,
  Ve as css,
  it as cssom,
  We as defineConfig,
  W as escape,
  re as fromMatch,
  Ie as fromTheme,
  D as hash,
  ge as identity,
  st as injectGlobal,
  ft as keyframes,
  Ke as match,
  tt as matchColor,
  et as matchTheme,
  He as mo,
  Oe as mql,
  B as noop,
  le as normalize,
  nt as observe,
  F as parse,
  Je as parseValue,
  at as style,
  Ue as toCSS,
  T as toColorValue,
  G as tw,
  rt as twind,
  ot as tx,
  lt as virtual
};
//# sourceMappingURL=core.js.map
