import { j as i } from "../../node_modules/react/jsx-runtime.mjs";
import { useState as o } from "react";
import { isMobile as T } from "../../node_modules/react-device-detect/dist/lib.mjs";
import P from "../BitzRefresh/index.mjs";
import "./index.less.mjs";
const b = ({ children: c, pageRefeshEmit: r = () => {
} }) => {
  const [a, s] = o(!1), [u, h] = o(0), [f, e] = o(0), m = (t) => {
    const n = t.changedTouches[0].clientY;
    h(n);
  }, l = (t) => {
    const p = t.changedTouches[0].clientY - u;
    e(p);
  }, d = () => {
    T && (f > 400 && (s(!0), setTimeout(() => {
      r(), s(!1);
    }, 2e3)), e(0));
  };
  return /* @__PURE__ */ i.jsxs(
    "div",
    {
      className: "bitzPageBlock",
      onTouchStart: m,
      onTouchMove: l,
      onTouchEnd: () => {
        d();
      },
      children: [
        /* @__PURE__ */ i.jsx(P, { showRefresh: a }),
        c
      ]
    }
  );
};
export {
  b as default
};
