import {
  Nt,
  _t
} from "../../../../../chunk.PSO6NFST.js";

// node_modules/twind/observe/observe.js
var f = (t2, e = 1) => t2.slice(e);
var d = (t2, e) => {
  t2.size > e && t2.delete(t2.keys().next().value);
};
var b = typeof CSS != "undefined" && CSS.escape || ((t2) => {
  let e = t2.charCodeAt(0), i2 = "";
  return e >= 48 && e <= 57 && (i2 = "\\" + e.toString(16) + " ", t2 = f(t2)), i2 + t2.replace(/[!./:#]/g, "\\$&");
});
var c = new WeakMap();
var g = (t2) => {
  let e = c.get(t2);
  return e || (e = new Map(), c.set(t2, e)), e;
};
var S = (t2, e, i2) => i2.indexOf(t2) == e;
var p = ({tw: t2 = _t} = {}) => {
  let e = g(t2), i2 = ({target: r2, addedNodes: o2}) => {
    var u;
    let s2 = (u = r2.getAttribute) == null ? void 0 : u.call(r2, "class");
    if (s2) {
      let n = e.get(s2);
      n || (n = t2(s2).split(/ +/g).filter(S).join(" "), e.set(s2, n), e.set(n, n), d(e, 3e4)), s2 !== n && r2.setAttribute("class", n);
    }
    for (let n = o2.length; n--; ) {
      let l = o2[n];
      a([{target: l, addedNodes: l.children || []}]);
    }
  }, a = (r2) => r2.forEach(i2);
  if (typeof MutationObserver == "function") {
    let r2 = new MutationObserver(a);
    return {observe(o2) {
      return a([{target: o2, addedNodes: [o2]}]), r2.observe(o2, {attributes: true, attributeFilter: ["class"], subtree: true, childList: true}), this;
    }, disconnect() {
      return r2.disconnect(), this;
    }};
  }
  return {observe() {
    return this;
  }, disconnect() {
    return this;
  }};
};

// node_modules/twind/shim/shim.js
typeof document != "undefined" && typeof addEventListener == "function" && (t = () => {
  let e = document.querySelector('script[type="twind-config"]');
  r(e ? JSON.parse(e.innerHTML) : {});
}, document.readyState === "loading" ? addEventListener("DOMContentLoaded", t) : i = setTimeout(t));
var t;
var i;
var o = p();
var s = () => {
  t && (removeEventListener("DOMContentLoaded", t), clearTimeout(i)), o.disconnect();
};
var r = ({target: e = document.documentElement, ...n} = {}) => {
  Object.keys(n).length && Nt(n), s(), o.observe(e), e.hidden = false;
};
export {
  s as disconnect,
  r as setup
};
