import { __exports as s } from "./index-_virtual59.js";
import k from "react";
import { __require as B } from "./index-prop-types.js";
import { __require as F } from "./index-DateRange2.js";
import { __require as z } from "./index-DefinedRange.js";
import { __require as K } from "./index-utils7.js";
import { __require as U } from "./index-classnames2.js";
import { __require as $ } from "./index-styles.js";
var R;
function Y() {
  if (R) return s;
  R = 1;
  function f(e) {
    "@babel/helpers - typeof";
    return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? f = function(r) {
      return typeof r;
    } : f = function(r) {
      return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
    }, f(e);
  }
  Object.defineProperty(s, "__esModule", {
    value: !0
  }), s.default = void 0;
  var l = D(k), b = c(/* @__PURE__ */ B()), h = c(F()), m = c(z()), O = K(), w = c(U()), q = c($());
  function c(e) {
    return e && e.__esModule ? e : { default: e };
  }
  function v(e) {
    if (typeof WeakMap != "function") return null;
    var t = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap();
    return (v = function(a) {
      return a ? r : t;
    })(e);
  }
  function D(e, t) {
    if (e && e.__esModule)
      return e;
    if (e === null || f(e) !== "object" && typeof e != "function")
      return { default: e };
    var r = v(t);
    if (r && r.has(e))
      return r.get(e);
    var n = {}, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var u in e)
      if (u !== "default" && Object.prototype.hasOwnProperty.call(e, u)) {
        var o = a ? Object.getOwnPropertyDescriptor(e, u) : null;
        o && (o.get || o.set) ? Object.defineProperty(n, u, o) : n[u] = e[u];
      }
    return n.default = e, r && r.set(e, n), n;
  }
  function P(e, t) {
    var r = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var n = Object.getOwnPropertySymbols(e);
      t && (n = n.filter(function(a) {
        return Object.getOwnPropertyDescriptor(e, a).enumerable;
      })), r.push.apply(r, n);
    }
    return r;
  }
  function _(e) {
    for (var t = 1; t < arguments.length; t++) {
      var r = arguments[t] != null ? arguments[t] : {};
      t % 2 ? P(Object(r), !0).forEach(function(n) {
        S(e, n, r[n]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : P(Object(r)).forEach(function(n) {
        Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
      });
    }
    return e;
  }
  function S(e, t, r) {
    return t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
  }
  function p() {
    return p = Object.assign || function(e) {
      for (var t = 1; t < arguments.length; t++) {
        var r = arguments[t];
        for (var n in r)
          Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
      }
      return e;
    }, p.apply(this, arguments);
  }
  function N(e, t) {
    if (!(e instanceof t))
      throw new TypeError("Cannot call a class as a function");
  }
  function E(e, t) {
    for (var r = 0; r < t.length; r++) {
      var n = t[r];
      n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
    }
  }
  function T(e, t, r) {
    return t && E(e.prototype, t), e;
  }
  function x(e, t) {
    if (typeof t != "function" && t !== null)
      throw new TypeError("Super expression must either be null or a function");
    e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), t && d(e, t);
  }
  function d(e, t) {
    return d = Object.setPrototypeOf || function(n, a) {
      return n.__proto__ = a, n;
    }, d(e, t);
  }
  function C(e) {
    var t = j();
    return function() {
      var n = y(e), a;
      if (t) {
        var u = y(this).constructor;
        a = Reflect.construct(n, arguments, u);
      } else
        a = n.apply(this, arguments);
      return W(this, a);
    };
  }
  function W(e, t) {
    return t && (f(t) === "object" || typeof t == "function") ? t : M(e);
  }
  function M(e) {
    if (e === void 0)
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return e;
  }
  function j() {
    if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
    if (typeof Proxy == "function") return !0;
    try {
      return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      })), !0;
    } catch {
      return !1;
    }
  }
  function y(e) {
    return y = Object.setPrototypeOf ? Object.getPrototypeOf : function(r) {
      return r.__proto__ || Object.getPrototypeOf(r);
    }, y(e);
  }
  var g = /* @__PURE__ */ (function(e) {
    x(r, e);
    var t = C(r);
    function r(n) {
      var a;
      return N(this, r), a = t.call(this, n), a.state = {
        focusedRange: [(0, O.findNextRangeIndex)(n.ranges), 0]
      }, a.styles = (0, O.generateStyles)([q.default, n.classNames]), a;
    }
    return T(r, [{
      key: "render",
      value: function() {
        var a = this, u = this.state.focusedRange;
        return /* @__PURE__ */ l.default.createElement("div", {
          className: (0, w.default)(this.styles.dateRangePickerWrapper, this.props.className)
        }, /* @__PURE__ */ l.default.createElement(m.default, p({
          focusedRange: u,
          onPreviewChange: function(i) {
            return a.dateRange.updatePreview(i ? a.dateRange.calcNewSelection(i, typeof i == "string") : null);
          }
        }, this.props, {
          range: this.props.ranges[u[0]],
          className: void 0
        })), /* @__PURE__ */ l.default.createElement(h.default, p({
          onRangeFocusChange: function(i) {
            return a.setState({
              focusedRange: i
            });
          },
          focusedRange: u
        }, this.props, {
          ref: function(i) {
            return a.dateRange = i;
          },
          className: void 0
        })));
      }
    }]), r;
  })(l.Component);
  g.defaultProps = {}, g.propTypes = _(_(_({}, h.default.propTypes), m.default.propTypes), {}, {
    className: b.default.string
  });
  var I = g;
  return s.default = I, s;
}
export {
  Y as __require
};
