var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/list/hooks/useDevice.ts
var useDevice_exports = {};
__export(useDevice_exports, {
  getUserAgentInfo: () => getUserAgentInfo,
  useDevice: () => useDevice
});
module.exports = __toCommonJS(useDevice_exports);
var import_react = require("react");
var useDevice = () => {
  const [deviceInfo, setDeviceInfo] = (0, import_react.useState)(() => {
    const initialWidth = typeof window !== "undefined" ? window.innerWidth : 1920;
    const initialHeight = typeof window !== "undefined" ? window.innerHeight : 1080;
    const initialType = getDeviceType(initialWidth);
    return {
      type: initialType,
      isMobile: initialType === "mobile",
      isPad: initialType === "pad",
      isPc: initialType === "pc",
      width: initialWidth,
      height: initialHeight
    };
  });
  (0, import_react.useEffect)(() => {
    const handleResize = () => {
      const width = window.innerWidth;
      const height = window.innerHeight;
      const type = getDeviceType(width);
      setDeviceInfo({
        type,
        isMobile: type === "mobile",
        isPad: type === "pad",
        isPc: type === "pc",
        width,
        height
      });
    };
    handleResize();
    window.addEventListener("resize", handleResize);
    return () => {
      window.removeEventListener("resize", handleResize);
    };
  }, []);
  return deviceInfo;
};
function getDeviceType(width) {
  if (width < 768) {
    return "mobile";
  } else if (width < 1200) {
    return "pad";
  } else {
    return "pc";
  }
}
var getUserAgentInfo = () => {
  if (typeof window === "undefined" || !window.navigator) {
    return {
      isMobileUA: false,
      isTabletUA: false,
      isDesktopUA: true,
      userAgent: ""
    };
  }
  const userAgent = window.navigator.userAgent.toLowerCase();
  const isMobileUA = /mobile|android|iphone|ipod|phone/.test(userAgent);
  const isTabletUA = /tablet|ipad/.test(userAgent) && !isMobileUA;
  const isDesktopUA = !isMobileUA && !isTabletUA;
  return {
    isMobileUA,
    isTabletUA,
    isDesktopUA,
    userAgent
  };
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getUserAgentInfo,
  useDevice
});
