import { noop as F, toValue as S, isObject as Q, tryOnScopeDispose as H, isIOS as Z, notNullish as J, isClient as G, useThrottleFn as K, tryOnMounted as N, increaseWithUnit as ee, useDebounceFn as te } from "../../../../@vueuse_shared@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
import { createFilterWrapper as xe, debounceFilter as Se, getLifeCycleTarget as _e, throttleFilter as Te } from "../../../../@vueuse_shared@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
import { watch as j, computed as O, ref as $, shallowRef as ne, reactive as V, watchEffect as oe, getCurrentInstance as re, onMounted as se, unref as le } from "vue";
const R = G ? window : void 0;
function _(o) {
  var l;
  const r = S(o);
  return (l = r == null ? void 0 : r.$el) != null ? l : r;
}
function L(...o) {
  let l, r, a, d;
  if (typeof o[0] == "string" || Array.isArray(o[0]) ? ([r, a, d] = o, l = R) : [l, r, a, d] = o, !l)
    return F;
  Array.isArray(r) || (r = [r]), Array.isArray(a) || (a = [a]);
  const u = [], c = () => {
    u.forEach((t) => t()), u.length = 0;
  }, f = (t, e, i, s) => (t.addEventListener(e, i, s), () => t.removeEventListener(e, i, s)), v = j(
    () => [_(l), S(d)],
    ([t, e]) => {
      if (c(), !t)
        return;
      const i = Q(e) ? { ...e } : e;
      u.push(
        ...r.flatMap((s) => a.map((p) => f(t, s, p, i)))
      );
    },
    { immediate: !0, flush: "post" }
  ), h = () => {
    v(), c();
  };
  return H(h), h;
}
let U = !1;
function fe(o, l, r = {}) {
  const { window: a = R, ignore: d = [], capture: u = !0, detectIframe: c = !1 } = r;
  if (!a)
    return F;
  Z && !U && (U = !0, Array.from(a.document.body.children).forEach((s) => s.addEventListener("click", F)), a.document.documentElement.addEventListener("click", F));
  let f = !0;
  const v = (s) => S(d).some((p) => {
    if (typeof p == "string")
      return Array.from(a.document.querySelectorAll(p)).some((n) => n === s.target || s.composedPath().includes(n));
    {
      const n = _(p);
      return n && (s.target === n || s.composedPath().includes(n));
    }
  }), h = (s) => {
    const p = _(o);
    if (!(!p || p === s.target || s.composedPath().includes(p))) {
      if (s.detail === 0 && (f = !v(s)), !f) {
        f = !0;
        return;
      }
      l(s);
    }
  };
  let t = !1;
  const e = [
    L(a, "click", (s) => {
      t || (t = !0, setTimeout(() => {
        t = !1;
      }, 0), h(s));
    }, { passive: !0, capture: u }),
    L(a, "pointerdown", (s) => {
      const p = _(o);
      f = !v(s) && !!(p && !s.composedPath().includes(p));
    }, { passive: !0 }),
    c && L(a, "blur", (s) => {
      setTimeout(() => {
        var p;
        const n = _(o);
        ((p = a.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(n != null && n.contains(a.document.activeElement)) && l(s);
      }, 0);
    })
  ].filter(Boolean);
  return () => e.forEach((s) => s());
}
function ie() {
  const o = $(!1), l = re();
  return l && se(() => {
    o.value = !0;
  }, l), o;
}
function q(o) {
  const l = ie();
  return O(() => (l.value, !!o()));
}
function ve(o, l, r = {}) {
  const { window: a = R, ...d } = r;
  let u;
  const c = q(() => a && "MutationObserver" in a), f = () => {
    u && (u.disconnect(), u = void 0);
  }, v = O(() => {
    const i = S(o), s = (Array.isArray(i) ? i : [i]).map(_).filter(J);
    return new Set(s);
  }), h = j(
    () => v.value,
    (i) => {
      f(), c.value && i.size && (u = new MutationObserver(l), i.forEach((s) => u.observe(s, d)));
    },
    { immediate: !0, flush: "post" }
  ), t = () => u == null ? void 0 : u.takeRecords(), e = () => {
    h(), f();
  };
  return H(e), {
    isSupported: c,
    stop: e,
    takeRecords: t
  };
}
function I(o, l = {}) {
  const { window: r = R } = l, a = q(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
  let d;
  const u = $(!1), c = (h) => {
    u.value = h.matches;
  }, f = () => {
    d && ("removeEventListener" in d ? d.removeEventListener("change", c) : d.removeListener(c));
  }, v = oe(() => {
    a.value && (f(), d = r.matchMedia(S(o)), "addEventListener" in d ? d.addEventListener("change", c) : d.addListener(c), u.value = d.matches);
  });
  return H(() => {
    v(), f(), d = void 0;
  }), u;
}
const pe = {
  sm: 640,
  md: 768,
  lg: 1024,
  xl: 1280,
  "2xl": 1536
};
function he(o, l = {}) {
  function r(t, e) {
    let i = S(o[S(t)]);
    return e != null && (i = ee(i, e)), typeof i == "number" && (i = `${i}px`), i;
  }
  const { window: a = R, strategy: d = "min-width" } = l;
  function u(t) {
    return a ? a.matchMedia(t).matches : !1;
  }
  const c = (t) => I(() => `(min-width: ${r(t)})`, l), f = (t) => I(() => `(max-width: ${r(t)})`, l), v = Object.keys(o).reduce((t, e) => (Object.defineProperty(t, e, {
    get: () => d === "min-width" ? c(e) : f(e),
    enumerable: !0,
    configurable: !0
  }), t), {});
  function h() {
    const t = Object.keys(o).map((e) => [e, c(e)]);
    return O(() => t.filter(([, e]) => e.value).map(([e]) => e));
  }
  return Object.assign(v, {
    greaterOrEqual: c,
    smallerOrEqual: f,
    greater(t) {
      return I(() => `(min-width: ${r(t, 0.1)})`, l);
    },
    smaller(t) {
      return I(() => `(max-width: ${r(t, -0.1)})`, l);
    },
    between(t, e) {
      return I(() => `(min-width: ${r(t)}) and (max-width: ${r(e, -0.1)})`, l);
    },
    isGreater(t) {
      return u(`(min-width: ${r(t, 0.1)})`);
    },
    isGreaterOrEqual(t) {
      return u(`(min-width: ${r(t)})`);
    },
    isSmaller(t) {
      return u(`(max-width: ${r(t, -0.1)})`);
    },
    isSmallerOrEqual(t) {
      return u(`(max-width: ${r(t)})`);
    },
    isInBetween(t, e) {
      return u(`(min-width: ${r(t)}) and (max-width: ${r(e, -0.1)})`);
    },
    current: h,
    active() {
      const t = h();
      return O(() => t.value.length === 0 ? "" : t.value.at(-1));
    }
  });
}
function me(o, l = {}) {
  var r, a;
  const d = $(!1), u = ne(null);
  let c = 0, f = !0;
  if (G) {
    const v = typeof l == "function" ? { onDrop: l } : l, h = (r = v.multiple) != null ? r : !0, t = (a = v.preventDefaultForUnhandled) != null ? a : !1, e = (n) => {
      var y, w;
      const g = Array.from((w = (y = n.dataTransfer) == null ? void 0 : y.files) != null ? w : []);
      return g.length === 0 ? null : h ? g : [g[0]];
    }, i = (n) => {
      if (v.dataTypes) {
        const y = le(v.dataTypes);
        return typeof y == "function" ? y(n) : y ? y.some((w) => n.includes(w)) : !0;
      }
      return !0;
    }, s = (n) => {
      var y, w;
      const g = Array.from((w = (y = n.dataTransfer) == null ? void 0 : y.items) != null ? w : []), M = g.filter((k) => k.kind === "file").map((k) => k.type), E = i(M), T = h || g.filter((k) => k.kind === "file").length <= 1;
      return E && T;
    }, p = (n, y) => {
      var w, g, M, E;
      if (f = s(n), !f) {
        t && n.preventDefault(), n.dataTransfer && (n.dataTransfer.dropEffect = "none");
        return;
      }
      n.preventDefault(), n.dataTransfer && (n.dataTransfer.dropEffect = "copy");
      const T = e(n);
      switch (y) {
        case "enter":
          c += 1, d.value = !0, (w = v.onEnter) == null || w.call(v, null, n);
          break;
        case "over":
          (g = v.onOver) == null || g.call(v, null, n);
          break;
        case "leave":
          c -= 1, c === 0 && (d.value = !1), (M = v.onLeave) == null || M.call(v, null, n);
          break;
        case "drop":
          c = 0, d.value = !1, f && (u.value = T, (E = v.onDrop) == null || E.call(v, T, n));
          break;
      }
    };
    L(o, "dragenter", (n) => p(n, "enter")), L(o, "dragover", (n) => p(n, "over")), L(o, "dragleave", (n) => p(n, "leave")), L(o, "drop", (n) => p(n, "drop"));
  }
  return {
    files: u,
    isOverDropZone: d
  };
}
function ue(o, l, r = {}) {
  const { window: a = R, ...d } = r;
  let u;
  const c = q(() => a && "ResizeObserver" in a), f = () => {
    u && (u.disconnect(), u = void 0);
  }, v = O(() => {
    const e = S(o);
    return Array.isArray(e) ? e.map((i) => _(i)) : [_(e)];
  }), h = j(
    v,
    (e) => {
      if (f(), c.value && a) {
        u = new ResizeObserver(l);
        for (const i of e)
          i && u.observe(i, d);
      }
    },
    { immediate: !0, flush: "post" }
  ), t = () => {
    f(), h();
  };
  return H(t), {
    isSupported: c,
    stop: t
  };
}
function be(o, l = { width: 0, height: 0 }, r = {}) {
  const { window: a = R, box: d = "content-box" } = r, u = O(() => {
    var e, i;
    return (i = (e = _(o)) == null ? void 0 : e.namespaceURI) == null ? void 0 : i.includes("svg");
  }), c = $(l.width), f = $(l.height), { stop: v } = ue(
    o,
    ([e]) => {
      const i = d === "border-box" ? e.borderBoxSize : d === "content-box" ? e.contentBoxSize : e.devicePixelContentBoxSize;
      if (a && u.value) {
        const s = _(o);
        if (s) {
          const p = s.getBoundingClientRect();
          c.value = p.width, f.value = p.height;
        }
      } else if (i) {
        const s = Array.isArray(i) ? i : [i];
        c.value = s.reduce((p, { inlineSize: n }) => p + n, 0), f.value = s.reduce((p, { blockSize: n }) => p + n, 0);
      } else
        c.value = e.contentRect.width, f.value = e.contentRect.height;
    },
    r
  );
  N(() => {
    const e = _(o);
    e && (c.value = "offsetWidth" in e ? e.offsetWidth : l.width, f.value = "offsetHeight" in e ? e.offsetHeight : l.height);
  });
  const h = j(
    () => _(o),
    (e) => {
      c.value = e ? l.width : 0, f.value = e ? l.height : 0;
    }
  );
  function t() {
    v(), h();
  }
  return {
    width: c,
    height: f,
    stop: t
  };
}
const Y = 1;
function we(o, l = {}) {
  const {
    throttle: r = 0,
    idle: a = 200,
    onStop: d = F,
    onScroll: u = F,
    offset: c = {
      left: 0,
      right: 0,
      top: 0,
      bottom: 0
    },
    eventListenerOptions: f = {
      capture: !1,
      passive: !0
    },
    behavior: v = "auto",
    window: h = R,
    onError: t = (b) => {
      console.error(b);
    }
  } = l, e = $(0), i = $(0), s = O({
    get() {
      return e.value;
    },
    set(b) {
      n(b, void 0);
    }
  }), p = O({
    get() {
      return i.value;
    },
    set(b) {
      n(void 0, b);
    }
  });
  function n(b, C) {
    var m, x, D, W;
    if (!h)
      return;
    const A = S(o);
    if (!A)
      return;
    (D = A instanceof Document ? h.document.body : A) == null || D.scrollTo({
      top: (m = S(C)) != null ? m : p.value,
      left: (x = S(b)) != null ? x : s.value,
      behavior: S(v)
    });
    const B = ((W = A == null ? void 0 : A.document) == null ? void 0 : W.documentElement) || (A == null ? void 0 : A.documentElement) || A;
    s != null && (e.value = B.scrollLeft), p != null && (i.value = B.scrollTop);
  }
  const y = $(!1), w = V({
    left: !0,
    right: !1,
    top: !0,
    bottom: !1
  }), g = V({
    left: !1,
    right: !1,
    top: !1,
    bottom: !1
  }), M = (b) => {
    y.value && (y.value = !1, g.left = !1, g.right = !1, g.top = !1, g.bottom = !1, d(b));
  }, E = te(M, r + a), T = (b) => {
    var C;
    if (!h)
      return;
    const m = ((C = b == null ? void 0 : b.document) == null ? void 0 : C.documentElement) || (b == null ? void 0 : b.documentElement) || _(b), { display: x, flexDirection: D } = getComputedStyle(m), W = m.scrollLeft;
    g.left = W < e.value, g.right = W > e.value;
    const A = Math.abs(W) <= (c.left || 0), B = Math.abs(W) + m.clientWidth >= m.scrollWidth - (c.right || 0) - Y;
    x === "flex" && D === "row-reverse" ? (w.left = B, w.right = A) : (w.left = A, w.right = B), e.value = W;
    let P = m.scrollTop;
    b === h.document && !P && (P = h.document.body.scrollTop), g.top = P < i.value, g.bottom = P > i.value;
    const z = Math.abs(P) <= (c.top || 0), X = Math.abs(P) + m.clientHeight >= m.scrollHeight - (c.bottom || 0) - Y;
    x === "flex" && D === "column-reverse" ? (w.top = X, w.bottom = z) : (w.top = z, w.bottom = X), i.value = P;
  }, k = (b) => {
    var C;
    if (!h)
      return;
    const m = (C = b.target.documentElement) != null ? C : b.target;
    T(m), y.value = !0, E(b), u(b);
  };
  return L(
    o,
    "scroll",
    r ? K(k, r, !0, !1) : k,
    f
  ), N(() => {
    try {
      const b = S(o);
      if (!b)
        return;
      T(b);
    } catch (b) {
      t(b);
    }
  }), L(
    o,
    "scrollend",
    M,
    f
  ), {
    x: s,
    y: p,
    isScrolling: y,
    arrivedState: w,
    directions: g,
    measure() {
      const b = S(o);
      h && b && T(b);
    }
  };
}
function ge(o, l = {}) {
  const {
    threshold: r = 50,
    onSwipe: a,
    onSwipeEnd: d,
    onSwipeStart: u,
    passive: c = !0,
    window: f = R
  } = l, v = V({ x: 0, y: 0 }), h = V({ x: 0, y: 0 }), t = O(() => v.x - h.x), e = O(() => v.y - h.y), { max: i, abs: s } = Math, p = O(() => i(s(t.value), s(e.value)) >= r), n = $(!1), y = O(() => p.value ? s(t.value) > s(e.value) ? t.value > 0 ? "left" : "right" : e.value > 0 ? "up" : "down" : "none"), w = (m) => [m.touches[0].clientX, m.touches[0].clientY], g = (m, x) => {
    v.x = m, v.y = x;
  }, M = (m, x) => {
    h.x = m, h.y = x;
  };
  let E;
  const T = ae(f == null ? void 0 : f.document);
  c ? E = T ? { passive: !0 } : { capture: !1 } : E = T ? { passive: !1, capture: !0 } : { capture: !0 };
  const k = (m) => {
    n.value && (d == null || d(m, y.value)), n.value = !1;
  }, b = [
    L(o, "touchstart", (m) => {
      if (m.touches.length !== 1)
        return;
      E.capture && !E.passive && m.preventDefault();
      const [x, D] = w(m);
      g(x, D), M(x, D), u == null || u(m);
    }, E),
    L(o, "touchmove", (m) => {
      if (m.touches.length !== 1)
        return;
      const [x, D] = w(m);
      M(x, D), !n.value && p.value && (n.value = !0), n.value && (a == null || a(m));
    }, E),
    L(o, ["touchend", "touchcancel"], k, E)
  ];
  return {
    isPassiveEventSupported: T,
    isSwiping: n,
    direction: y,
    coordsStart: v,
    coordsEnd: h,
    lengthX: t,
    lengthY: e,
    stop: () => b.forEach((m) => m())
  };
}
function ae(o) {
  if (!o)
    return !1;
  let l = !1;
  const r = {
    get passive() {
      return l = !0, !1;
    }
  };
  return o.addEventListener("x", F, r), o.removeEventListener("x", F), l;
}
export {
  pe as breakpointsTailwind,
  xe as createFilterWrapper,
  Se as debounceFilter,
  R as defaultWindow,
  _e as getLifeCycleTarget,
  ee as increaseWithUnit,
  G as isClient,
  Z as isIOS,
  Q as isObject,
  F as noop,
  J as notNullish,
  fe as onClickOutside,
  Te as throttleFilter,
  S as toValue,
  N as tryOnMounted,
  H as tryOnScopeDispose,
  _ as unrefElement,
  he as useBreakpoints,
  te as useDebounceFn,
  me as useDropZone,
  be as useElementSize,
  L as useEventListener,
  I as useMediaQuery,
  ie as useMounted,
  ve as useMutationObserver,
  ue as useResizeObserver,
  we as useScroll,
  q as useSupported,
  ge as useSwipe,
  K as useThrottleFn
};
