import { __exports as a } from "../../../_virtual/lib.mjs";
import He from "react";
import { u as Re } from "../../ua-parser-js/dist/ua-parser.min.mjs";
Object.defineProperty(a, "__esModule", { value: !0 });
function $e(n) {
  return n && typeof n == "object" && "default" in n ? n.default : n;
}
var c = He, l = $e(c), H = Re, y = new H(), v = y.getBrowser(), Ke = y.getCPU(), g = y.getDevice(), U = y.getEngine(), w = y.getOS(), E = y.getUA(), R = function(e) {
  return y.setUA(e);
}, S = function(e) {
  if (!e) {
    console.error("No userAgent string was provided");
    return;
  }
  var r = new H(e);
  return {
    UA: r,
    browser: r.getBrowser(),
    cpu: r.getCPU(),
    device: r.getDevice(),
    engine: r.getEngine(),
    os: r.getOS(),
    ua: r.getUA(),
    setUserAgent: function(i) {
      return r.setUA(i);
    }
  };
}, $ = /* @__PURE__ */ Object.freeze({
  ClientUAInstance: y,
  browser: v,
  cpu: Ke,
  device: g,
  engine: U,
  os: w,
  ua: E,
  setUa: R,
  parseUserAgent: S
});
function _(n, e) {
  var r = Object.keys(n);
  if (Object.getOwnPropertySymbols) {
    var t = Object.getOwnPropertySymbols(n);
    e && (t = t.filter(function(i) {
      return Object.getOwnPropertyDescriptor(n, i).enumerable;
    })), r.push.apply(r, t);
  }
  return r;
}
function qe(n) {
  for (var e = 1; e < arguments.length; e++) {
    var r = arguments[e] != null ? arguments[e] : {};
    e % 2 ? _(Object(r), !0).forEach(function(t) {
      Qe(n, t, r[t]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(r)) : _(Object(r)).forEach(function(t) {
      Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(r, t));
    });
  }
  return n;
}
function T(n) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? T = function(e) {
    return typeof e;
  } : T = function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, T(n);
}
function Ge(n, e) {
  if (!(n instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function k(n, e) {
  for (var r = 0; r < e.length; r++) {
    var t = e[r];
    t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(n, t.key, t);
  }
}
function Je(n, e, r) {
  return e && k(n.prototype, e), r && k(n, r), n;
}
function Qe(n, e, r) {
  return e in n ? Object.defineProperty(n, e, {
    value: r,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : n[e] = r, n;
}
function C() {
  return C = Object.assign || function(n) {
    for (var e = 1; e < arguments.length; e++) {
      var r = arguments[e];
      for (var t in r)
        Object.prototype.hasOwnProperty.call(r, t) && (n[t] = r[t]);
    }
    return n;
  }, C.apply(this, arguments);
}
function Xe(n, e) {
  if (typeof e != "function" && e !== null)
    throw new TypeError("Super expression must either be null or a function");
  n.prototype = Object.create(e && e.prototype, {
    constructor: {
      value: n,
      writable: !0,
      configurable: !0
    }
  }), e && F(n, e);
}
function A(n) {
  return A = Object.setPrototypeOf ? Object.getPrototypeOf : function(r) {
    return r.__proto__ || Object.getPrototypeOf(r);
  }, A(n);
}
function F(n, e) {
  return F = Object.setPrototypeOf || function(t, i) {
    return t.__proto__ = i, t;
  }, F(n, e);
}
function Ze(n, e) {
  if (n == null)
    return {};
  var r = {}, t = Object.keys(n), i, s;
  for (s = 0; s < t.length; s++)
    i = t[s], !(e.indexOf(i) >= 0) && (r[i] = n[i]);
  return r;
}
function p(n, e) {
  if (n == null)
    return {};
  var r = Ze(n, e), t, i;
  if (Object.getOwnPropertySymbols) {
    var s = Object.getOwnPropertySymbols(n);
    for (i = 0; i < s.length; i++)
      t = s[i], !(e.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(n, t) && (r[t] = n[t]);
  }
  return r;
}
function P(n) {
  if (n === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return n;
}
function er(n, e) {
  if (e && (typeof e == "object" || typeof e == "function"))
    return e;
  if (e !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return P(n);
}
function rr(n, e) {
  return nr(n) || tr(n, e) || ir(n, e) || ar();
}
function nr(n) {
  if (Array.isArray(n))
    return n;
}
function tr(n, e) {
  var r = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
  if (r != null) {
    var t = [], i = !0, s = !1, u, m;
    try {
      for (r = r.call(n); !(i = (u = r.next()).done) && (t.push(u.value), !(e && t.length === e)); i = !0)
        ;
    } catch (V) {
      s = !0, m = V;
    } finally {
      try {
        !i && r.return != null && r.return();
      } finally {
        if (s)
          throw m;
      }
    }
    return t;
  }
}
function ir(n, e) {
  if (n) {
    if (typeof n == "string")
      return Y(n, e);
    var r = Object.prototype.toString.call(n).slice(8, -1);
    if (r === "Object" && n.constructor && (r = n.constructor.name), r === "Map" || r === "Set")
      return Array.from(n);
    if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))
      return Y(n, e);
  }
}
function Y(n, e) {
  (e == null || e > n.length) && (e = n.length);
  for (var r = 0, t = new Array(e); r < e; r++)
    t[r] = n[r];
  return t;
}
function ar() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var d = {
  Mobile: "mobile",
  Tablet: "tablet",
  SmartTv: "smarttv",
  Console: "console",
  Wearable: "wearable",
  Embedded: "embedded",
  Browser: void 0
}, f = {
  Chrome: "Chrome",
  Firefox: "Firefox",
  Opera: "Opera",
  Yandex: "Yandex",
  Safari: "Safari",
  InternetExplorer: "Internet Explorer",
  Edge: "Edge",
  Chromium: "Chromium",
  Ie: "IE",
  MobileSafari: "Mobile Safari",
  EdgeChromium: "Edge Chromium",
  MIUI: "MIUI Browser",
  SamsungBrowser: "Samsung Browser"
}, O = {
  IOS: "iOS",
  Android: "Android",
  WindowsPhone: "Windows Phone",
  Windows: "Windows",
  MAC_OS: "Mac OS"
}, or = {
  isMobile: !1,
  isTablet: !1,
  isBrowser: !1,
  isSmartTV: !1,
  isConsole: !1,
  isWearable: !1
}, sr = function(e) {
  switch (e) {
    case d.Mobile:
      return {
        isMobile: !0
      };
    case d.Tablet:
      return {
        isTablet: !0
      };
    case d.SmartTv:
      return {
        isSmartTV: !0
      };
    case d.Console:
      return {
        isConsole: !0
      };
    case d.Wearable:
      return {
        isWearable: !0
      };
    case d.Browser:
      return {
        isBrowser: !0
      };
    case d.Embedded:
      return {
        isEmbedded: !0
      };
    default:
      return or;
  }
}, lr = function(e) {
  return R(e);
}, o = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "none";
  return e || r;
}, B = function() {
  return typeof window < "u" && (window.navigator || navigator) ? window.navigator || navigator : !1;
}, N = function(e) {
  var r = B();
  return r && r.platform && (r.platform.indexOf(e) !== -1 || r.platform === "MacIntel" && r.maxTouchPoints > 1 && !window.MSStream);
}, ur = function(e, r, t, i, s) {
  return {
    isBrowser: e,
    browserMajorVersion: o(r.major),
    browserFullVersion: o(r.version),
    browserName: o(r.name),
    engineName: o(t.name),
    engineVersion: o(t.version),
    osName: o(i.name),
    osVersion: o(i.version),
    userAgent: o(s)
  };
}, z = function(e, r, t, i) {
  return qe({}, e, {
    vendor: o(r.vendor),
    model: o(r.model),
    os: o(t.name),
    osVersion: o(t.version),
    ua: o(i)
  });
}, dr = function(e, r, t, i) {
  return {
    isSmartTV: e,
    engineName: o(r.name),
    engineVersion: o(r.version),
    osName: o(t.name),
    osVersion: o(t.version),
    userAgent: o(i)
  };
}, cr = function(e, r, t, i) {
  return {
    isConsole: e,
    engineName: o(r.name),
    engineVersion: o(r.version),
    osName: o(t.name),
    osVersion: o(t.version),
    userAgent: o(i)
  };
}, vr = function(e, r, t, i) {
  return {
    isWearable: e,
    engineName: o(r.name),
    engineVersion: o(r.version),
    osName: o(t.name),
    osVersion: o(t.version),
    userAgent: o(i)
  };
}, mr = function(e, r, t, i, s) {
  return {
    isEmbedded: e,
    vendor: o(r.vendor),
    model: o(r.model),
    engineName: o(t.name),
    engineVersion: o(t.version),
    osName: o(i.name),
    osVersion: o(i.version),
    userAgent: o(s)
  };
};
function fr(n) {
  var e = n ? S(n) : $, r = e.device, t = e.browser, i = e.engine, s = e.os, u = e.ua, m = sr(r.type), V = m.isBrowser, Ye = m.isMobile, ze = m.isTablet, j = m.isSmartTV, D = m.isConsole, L = m.isWearable, x = m.isEmbedded;
  if (V)
    return ur(V, t, i, s, u);
  if (j)
    return dr(j, i, s, u);
  if (D)
    return cr(D, i, s, u);
  if (Ye || ze)
    return z(m, r, s, u);
  if (L)
    return vr(L, i, s, u);
  if (x)
    return mr(x, r, i, s, u);
}
var K = function(e) {
  var r = e.type;
  return r === d.Mobile;
}, q = function(e) {
  var r = e.type;
  return r === d.Tablet;
}, G = function(e) {
  var r = e.type;
  return r === d.Mobile || r === d.Tablet;
}, J = function(e) {
  var r = e.type;
  return r === d.SmartTv;
}, W = function(e) {
  var r = e.type;
  return r === d.Browser;
}, Q = function(e) {
  var r = e.type;
  return r === d.Wearable;
}, X = function(e) {
  var r = e.type;
  return r === d.Console;
}, Z = function(e) {
  var r = e.type;
  return r === d.Embedded;
}, ee = function(e) {
  var r = e.vendor;
  return o(r);
}, re = function(e) {
  var r = e.model;
  return o(r);
}, ne = function(e) {
  var r = e.type;
  return o(r, "browser");
}, te = function(e) {
  var r = e.name;
  return r === O.Android;
}, ie = function(e) {
  var r = e.name;
  return r === O.Windows;
}, ae = function(e) {
  var r = e.name;
  return r === O.MAC_OS;
}, oe = function(e) {
  var r = e.name;
  return r === O.WindowsPhone;
}, se = function(e) {
  var r = e.name;
  return r === O.IOS;
}, le = function(e) {
  var r = e.version;
  return o(r);
}, ue = function(e) {
  var r = e.name;
  return o(r);
}, de = function(e) {
  var r = e.name;
  return r === f.Chrome;
}, ce = function(e) {
  var r = e.name;
  return r === f.Firefox;
}, ve = function(e) {
  var r = e.name;
  return r === f.Chromium;
}, I = function(e) {
  var r = e.name;
  return r === f.Edge;
}, me = function(e) {
  var r = e.name;
  return r === f.Yandex;
}, fe = function(e) {
  var r = e.name;
  return r === f.Safari || r === f.MobileSafari;
}, ge = function(e) {
  var r = e.name;
  return r === f.MobileSafari;
}, pe = function(e) {
  var r = e.name;
  return r === f.Opera;
}, he = function(e) {
  var r = e.name;
  return r === f.InternetExplorer || r === f.Ie;
}, ye = function(e) {
  var r = e.name;
  return r === f.MIUI;
}, we = function(e) {
  var r = e.name;
  return r === f.SamsungBrowser;
}, be = function(e) {
  var r = e.version;
  return o(r);
}, Oe = function(e) {
  var r = e.major;
  return o(r);
}, Te = function(e) {
  var r = e.name;
  return o(r);
}, Ee = function(e) {
  var r = e.name;
  return o(r);
}, Se = function(e) {
  var r = e.version;
  return o(r);
}, Ve = function() {
  var e = B(), r = e && e.userAgent && e.userAgent.toLowerCase();
  return typeof r == "string" ? /electron/.test(r) : !1;
}, b = function(e) {
  return typeof e == "string" && e.indexOf("Edg/") !== -1;
}, Pe = function() {
  var e = B();
  return e && (/iPad|iPhone|iPod/.test(e.platform) || e.platform === "MacIntel" && e.maxTouchPoints > 1) && !window.MSStream;
}, h = function() {
  return N("iPad");
}, We = function() {
  return N("iPhone");
}, Ie = function() {
  return N("iPod");
}, Me = function(e) {
  return o(e);
};
function Ce(n) {
  var e = n || $, r = e.device, t = e.browser, i = e.os, s = e.engine, u = e.ua;
  return {
    isSmartTV: J(r),
    isConsole: X(r),
    isWearable: Q(r),
    isEmbedded: Z(r),
    isMobileSafari: ge(t) || h(),
    isChromium: ve(t),
    isMobile: G(r) || h(),
    isMobileOnly: K(r),
    isTablet: q(r) || h(),
    isBrowser: W(r),
    isDesktop: W(r),
    isAndroid: te(i),
    isWinPhone: oe(i),
    isIOS: se(i) || h(),
    isChrome: de(t),
    isFirefox: ce(t),
    isSafari: fe(t),
    isOpera: pe(t),
    isIE: he(t),
    osVersion: le(i),
    osName: ue(i),
    fullBrowserVersion: be(t),
    browserVersion: Oe(t),
    browserName: Te(t),
    mobileVendor: ee(r),
    mobileModel: re(r),
    engineName: Ee(s),
    engineVersion: Se(s),
    getUA: Me(u),
    isEdge: I(t) || b(u),
    isYandex: me(t),
    deviceType: ne(r),
    isIOS13: Pe(),
    isIPad13: h(),
    isIPhone13: We(),
    isIPod13: Ie(),
    isElectron: Ve(),
    isEdgeChromium: b(u),
    isLegacyEdge: I(t) && !b(u),
    isWindows: ie(i),
    isMacOs: ae(i),
    isMIUI: ye(t),
    isSamsungBrowser: we(t)
  };
}
var Ae = J(g), Fe = X(g), Ue = Q(g), gr = Z(g), pr = ge(v) || h(), hr = ve(v), M = G(g) || h(), Be = K(g), Ne = q(g) || h(), je = W(g), yr = W(g), De = te(w), Le = oe(w), xe = se(w) || h(), wr = de(v), br = ce(v), Or = fe(v), Tr = pe(v), _e = he(v), Er = le(w), Sr = ue(w), Vr = be(v), Pr = Oe(v), Wr = Te(v), Ir = ee(g), Mr = re(g), Cr = Ee(U), Ar = Se(U), Fr = Me(E), Ur = I(v) || b(E), Br = me(v), Nr = ne(g), jr = Pe(), Dr = h(), Lr = We(), xr = Ie(), _r = Ve(), kr = b(E), Yr = I(v) && !b(E), zr = ie(w), Hr = ae(w), Rr = ye(v), $r = we(v), Kr = function(e) {
  if (!e || typeof e != "string") {
    console.error("No valid user agent string was provided");
    return;
  }
  var r = S(e), t = r.device, i = r.browser, s = r.os, u = r.engine, m = r.ua;
  return Ce({
    device: t,
    browser: i,
    os: s,
    engine: u,
    ua: m
  });
}, qr = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return De ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, Gr = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return je ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, Jr = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return _e ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, Qr = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return xe ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, Xr = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return M ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, Zr = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return Ne ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, en = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return Le ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, rn = function(e) {
  var r = e.renderWithFragment, t = e.children;
  e.viewClassName, e.style;
  var i = p(e, ["renderWithFragment", "children", "viewClassName", "style"]);
  return Be ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, nn = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return Ae ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, tn = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return Fe ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, an = function(e) {
  var r = e.renderWithFragment, t = e.children, i = p(e, ["renderWithFragment", "children"]);
  return Ue ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", i, t) : null;
}, on = function(e) {
  var r = e.renderWithFragment, t = e.children;
  e.viewClassName, e.style;
  var i = e.condition, s = p(e, ["renderWithFragment", "children", "viewClassName", "style", "condition"]);
  return i ? r ? l.createElement(c.Fragment, null, t) : l.createElement("div", s, t) : null;
};
function sn(n) {
  return /* @__PURE__ */ function(e) {
    Xe(r, e);
    function r(t) {
      var i;
      return Ge(this, r), i = er(this, A(r).call(this, t)), i.isEventListenerAdded = !1, i.handleOrientationChange = i.handleOrientationChange.bind(P(i)), i.onOrientationChange = i.onOrientationChange.bind(P(i)), i.onPageLoad = i.onPageLoad.bind(P(i)), i.state = {
        isLandscape: !1,
        isPortrait: !1
      }, i;
    }
    return Je(r, [{
      key: "handleOrientationChange",
      value: function() {
        this.isEventListenerAdded || (this.isEventListenerAdded = !0);
        var i = window.innerWidth > window.innerHeight ? 90 : 0;
        this.setState({
          isPortrait: i === 0,
          isLandscape: i === 90
        });
      }
    }, {
      key: "onOrientationChange",
      value: function() {
        this.handleOrientationChange();
      }
    }, {
      key: "onPageLoad",
      value: function() {
        this.handleOrientationChange();
      }
    }, {
      key: "componentDidMount",
      value: function() {
        (typeof window > "u" ? "undefined" : T(window)) !== void 0 && M && (this.isEventListenerAdded ? window.removeEventListener("load", this.onPageLoad, !1) : (this.handleOrientationChange(), window.addEventListener("load", this.onPageLoad, !1)), window.addEventListener("resize", this.onOrientationChange, !1));
      }
    }, {
      key: "componentWillUnmount",
      value: function() {
        window.removeEventListener("resize", this.onOrientationChange, !1);
      }
    }, {
      key: "render",
      value: function() {
        return l.createElement(n, C({}, this.props, {
          isLandscape: this.state.isLandscape,
          isPortrait: this.state.isPortrait
        }));
      }
    }]), r;
  }(l.Component);
}
function ln() {
  var n = c.useState(function() {
    var s = window.innerWidth > window.innerHeight ? 90 : 0;
    return {
      isPortrait: s === 0,
      isLandscape: s === 90,
      orientation: s === 0 ? "portrait" : "landscape"
    };
  }), e = rr(n, 2), r = e[0], t = e[1], i = c.useCallback(function() {
    var s = window.innerWidth > window.innerHeight ? 90 : 0, u = {
      isPortrait: s === 0,
      isLandscape: s === 90,
      orientation: s === 0 ? "portrait" : "landscape"
    };
    r.orientation !== u.orientation && t(u);
  }, [r.orientation]);
  return c.useEffect(function() {
    return (typeof window > "u" ? "undefined" : T(window)) !== void 0 && M && (i(), window.addEventListener("load", i, !1), window.addEventListener("resize", i, !1)), function() {
      window.removeEventListener("resize", i, !1), window.removeEventListener("load", i, !1);
    };
  }, [i]), r;
}
function ke(n) {
  var e = n || window.navigator.userAgent;
  return S(e);
}
function un(n) {
  var e = n || window.navigator.userAgent, r = ke(e), t = Ce(r);
  return [t, r];
}
a.AndroidView = qr;
a.BrowserTypes = f;
a.BrowserView = Gr;
a.ConsoleView = tn;
a.CustomView = on;
a.IEView = Jr;
a.IOSView = Qr;
a.MobileOnlyView = rn;
a.MobileView = Xr;
a.OsTypes = O;
a.SmartTVView = nn;
a.TabletView = Zr;
a.WearableView = an;
a.WinPhoneView = en;
a.browserName = Wr;
a.browserVersion = Pr;
a.deviceDetect = fr;
a.deviceType = Nr;
a.engineName = Cr;
a.engineVersion = Ar;
a.fullBrowserVersion = Vr;
a.getSelectorsByUserAgent = Kr;
a.getUA = Fr;
a.isAndroid = De;
a.isBrowser = je;
a.isChrome = wr;
a.isChromium = hr;
a.isConsole = Fe;
a.isDesktop = yr;
a.isEdge = Ur;
a.isEdgeChromium = kr;
a.isElectron = _r;
a.isEmbedded = gr;
a.isFirefox = br;
a.isIE = _e;
a.isIOS = xe;
a.isIOS13 = jr;
a.isIPad13 = Dr;
a.isIPhone13 = Lr;
a.isIPod13 = xr;
a.isLegacyEdge = Yr;
a.isMIUI = Rr;
a.isMacOs = Hr;
var mn = a.isMobile = M;
a.isMobileOnly = Be;
a.isMobileSafari = pr;
a.isOpera = Tr;
a.isSafari = Or;
a.isSamsungBrowser = $r;
a.isSmartTV = Ae;
a.isTablet = Ne;
a.isWearable = Ue;
a.isWinPhone = Le;
a.isWindows = zr;
a.isYandex = Br;
a.mobileModel = Mr;
a.mobileVendor = Ir;
a.osName = Sr;
a.osVersion = Er;
a.parseUserAgent = S;
a.setUserAgent = lr;
a.useDeviceData = ke;
a.useDeviceSelectors = un;
a.useMobileOrientation = ln;
a.withOrientationChange = sn;
export {
  a as default,
  mn as isMobile
};
