import { aX as P, bP as u, bR as ce, bS as T, r as b, b9 as H, bQ as D, aY as w, bs as Q, bt as X, bm as te, bn as oe, bo as ne, bp as ie } from "./index-6wLGsgHc.js";
var pe = ["title", "size", "color", "overrides"];
function L() {
  return L = Object.assign ? Object.assign.bind() : function(e) {
    for (var r = 1; r < arguments.length; r++) {
      var t = arguments[r];
      for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
    }
    return e;
  }, L.apply(this, arguments);
}
function de(e, r) {
  if (e == null) return {};
  var t = fe(e, r), o, n;
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    for (n = 0; n < i.length; n++) o = i[n], !(r.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
  }
  return t;
}
function fe(e, r) {
  if (e == null) return {};
  var t = {}, o = Object.keys(e), n, i;
  for (i = 0; i < o.length; i++) n = o[i], !(r.indexOf(n) >= 0) && (t[n] = e[n]);
  return t;
}
function be(e, r) {
  return me(e) || he(e, r) || ge(e, r) || ye();
}
function ye() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function ge(e, r) {
  if (e) {
    if (typeof e == "string") return Y(e, r);
    var t = Object.prototype.toString.call(e).slice(8, -1);
    if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set") return Array.from(e);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Y(e, r);
  }
}
function Y(e, r) {
  (r == null || r > e.length) && (r = e.length);
  for (var t = 0, o = new Array(r); t < r; t++) o[t] = e[t];
  return o;
}
function he(e, r) {
  var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (t != null) {
    var o = [], n = !0, i = !1, a, l;
    try {
      for (t = t.call(e); !(n = (a = t.next()).done) && (o.push(a.value), !(r && o.length === r)); n = !0) ;
    } catch (s) {
      i = !0, l = s;
    } finally {
      try {
        !n && t.return != null && t.return();
      } finally {
        if (i) throw l;
      }
    }
    return o;
  }
}
function me(e) {
  if (Array.isArray(e)) return e;
}
function ve(e, r) {
  var t = te(), o = be(t, 2), n = o[1], i = e.title, a = i === void 0 ? "Hide" : i, l = e.size, s = e.color, c = e.overrides, p = c === void 0 ? {} : c, y = de(e, pe), h = oe(
    // Icons from the theme target the SVG override in the underlying Icon component
    {
      component: n.icons && n.icons.Hide ? n.icons.Hide : null
    },
    p && p.Svg ? ne(p.Svg) : {}
  );
  return /* @__PURE__ */ b.createElement(ie, L({
    viewBox: "0 0 20 20",
    ref: r,
    title: a,
    size: l,
    color: s,
    overrides: {
      Svg: h
    }
  }, y), /* @__PURE__ */ b.createElement("path", {
    d: "M12.81 4.36l-1.77 1.78a4 4 0 00-4.9 4.9l-2.76 2.75C2.06 12.79.96 11.49.2 10a11 11 0 0112.6-5.64zm3.8 1.85c1.33 1 2.43 2.3 3.2 3.79a11 11 0 01-12.62 5.64l1.77-1.78a4 4 0 004.9-4.9l2.76-2.75zm-.25-3.99l1.42 1.42L3.64 17.78l-1.42-1.42L16.36 2.22z"
  }));
}
const Oe = /* @__PURE__ */ b.forwardRef(ve);
var Ce = ["title", "size", "color", "overrides"];
function A() {
  return A = Object.assign ? Object.assign.bind() : function(e) {
    for (var r = 1; r < arguments.length; r++) {
      var t = arguments[r];
      for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
    }
    return e;
  }, A.apply(this, arguments);
}
function we(e, r) {
  if (e == null) return {};
  var t = Fe(e, r), o, n;
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    for (n = 0; n < i.length; n++) o = i[n], !(r.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (t[o] = e[o]);
  }
  return t;
}
function Fe(e, r) {
  if (e == null) return {};
  var t = {}, o = Object.keys(e), n, i;
  for (i = 0; i < o.length; i++) n = o[i], !(r.indexOf(n) >= 0) && (t[n] = e[n]);
  return t;
}
function Se(e, r) {
  return Pe(e) || Te(e, r) || xe(e, r) || ke();
}
function ke() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function xe(e, r) {
  if (e) {
    if (typeof e == "string") return Z(e, r);
    var t = Object.prototype.toString.call(e).slice(8, -1);
    if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set") return Array.from(e);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Z(e, r);
  }
}
function Z(e, r) {
  (r == null || r > e.length) && (r = e.length);
  for (var t = 0, o = new Array(r); t < r; t++) o[t] = e[t];
  return o;
}
function Te(e, r) {
  var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (t != null) {
    var o = [], n = !0, i = !1, a, l;
    try {
      for (t = t.call(e); !(n = (a = t.next()).done) && (o.push(a.value), !(r && o.length === r)); n = !0) ;
    } catch (s) {
      i = !0, l = s;
    } finally {
      try {
        !n && t.return != null && t.return();
      } finally {
        if (i) throw l;
      }
    }
    return o;
  }
}
function Pe(e) {
  if (Array.isArray(e)) return e;
}
function je(e, r) {
  var t = te(), o = Se(t, 2), n = o[1], i = e.title, a = i === void 0 ? "Show" : i, l = e.size, s = e.color, c = e.overrides, p = c === void 0 ? {} : c, y = we(e, Ce), h = oe(
    // Icons from the theme target the SVG override in the underlying Icon component
    {
      component: n.icons && n.icons.Show ? n.icons.Show : null
    },
    p && p.Svg ? ne(p.Svg) : {}
  );
  return /* @__PURE__ */ b.createElement(ie, A({
    viewBox: "0 0 20 20",
    ref: r,
    title: a,
    size: l,
    color: s,
    overrides: {
      Svg: h
    }
  }, y), /* @__PURE__ */ b.createElement("path", {
    d: "M.2 10a11 11 0 0119.6 0A11 11 0 01.2 10zm9.8 4a4 4 0 100-8 4 4 0 000 8zm0-2a2 2 0 110-4 2 2 0 010 4z"
  }));
}
const Re = /* @__PURE__ */ b.forwardRef(je);
function J(e, r) {
  var t = e.disabled, o = e.error, n = e.positive, i = e.adjoined, a = e.size, l = e.required, s = e.resize, c = e.readOnly, p = r.isFocused;
  return {
    $isFocused: p,
    $disabled: t,
    $error: o,
    $positive: n,
    $adjoined: i,
    $size: a,
    $required: l,
    $resize: s,
    $isReadOnly: c
  };
}
function G(e, r) {
  var t = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    r && (o = o.filter(function(n) {
      return Object.getOwnPropertyDescriptor(e, n).enumerable;
    })), t.push.apply(t, o);
  }
  return t;
}
function g(e) {
  for (var r = 1; r < arguments.length; r++) {
    var t = arguments[r] != null ? arguments[r] : {};
    r % 2 ? G(Object(t), !0).forEach(function(o) {
      d(e, o, t[o]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : G(Object(t)).forEach(function(o) {
      Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(t, o));
    });
  }
  return e;
}
function d(e, r, t) {
  return r in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}
var K = P("button", function(e) {
  var r, t = e.$theme, o = e.$size, n = e.$isFocusVisible, i = (r = {}, d(r, u.mini, t.sizing.scale400), d(r, u.compact, t.sizing.scale400), d(r, u.default, t.sizing.scale300), d(r, u.large, t.sizing.scale200), r)[o];
  return {
    display: "flex",
    alignItems: "center",
    borderTopStyle: "none",
    borderBottomStyle: "none",
    borderLeftStyle: "none",
    borderRightStyle: "none",
    background: "none",
    paddingLeft: i,
    paddingRight: i,
    outline: n ? "solid 3px ".concat(t.colors.accent) : "none",
    color: t.colors.contentPrimary
  };
});
K.displayName = "StyledMaskToggleButton";
K.displayName = "StyledMaskToggleButton";
var _ = P("div", function(e) {
  var r, t = e.$alignTop, o = t === void 0 ? !1 : t, n = e.$size, i = e.$theme, a = (r = {}, d(r, u.mini, i.sizing.scale200), d(r, u.compact, i.sizing.scale200), d(r, u.default, i.sizing.scale100), d(r, u.large, i.sizing.scale0), r)[n];
  return {
    display: "flex",
    alignItems: o ? "flex-start" : "center",
    paddingLeft: a,
    paddingRight: a,
    paddingTop: o ? i.sizing.scale500 : "0px",
    color: i.colors.contentPrimary
  };
});
_.displayName = "StyledClearIconContainer";
_.displayName = "StyledClearIconContainer";
var W = P(ce, function(e) {
  var r = e.$theme, t = e.$isFocusVisible;
  return {
    cursor: "pointer",
    outline: t ? "solid 3px ".concat(r.colors.accent) : "none"
  };
});
W.displayName = "StyledClearIcon";
W.displayName = "StyledClearIcon";
function $e(e, r) {
  var t;
  return (t = {}, d(t, u.mini, {
    paddingTop: r.scale100,
    paddingBottom: r.scale100,
    paddingLeft: r.scale550,
    paddingRight: r.scale550
  }), d(t, u.compact, {
    paddingTop: r.scale200,
    paddingBottom: r.scale200,
    paddingLeft: r.scale550,
    paddingRight: r.scale550
  }), d(t, u.default, {
    paddingTop: r.scale400,
    paddingBottom: r.scale400,
    paddingLeft: r.scale550,
    paddingRight: r.scale550
  }), d(t, u.large, {
    paddingTop: r.scale550,
    paddingBottom: r.scale550,
    paddingLeft: r.scale550,
    paddingRight: r.scale550
  }), t)[e];
}
function Be(e, r, t, o, n) {
  var i = e === T.both || e === T.left && o !== "rtl" || e === T.right && o === "rtl" || n && o === "rtl", a = e === T.both || e === T.right && o !== "rtl" || e === T.left && o === "rtl" || n && o !== "rtl";
  return {
    paddingLeft: i ? t.scale550 : "0px",
    paddingRight: a ? t.scale550 : "0px"
  };
}
function z(e, r) {
  var t;
  return (t = {}, d(t, u.mini, r.font100), d(t, u.compact, r.font200), d(t, u.default, r.font300), d(t, u.large, r.font400), t)[e];
}
function Ee(e, r, t) {
  var o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, n = arguments.length > 4 ? arguments[4] : void 0;
  return e ? {
    borderLeftColor: n.inputFillDisabled,
    borderRightColor: n.inputFillDisabled,
    borderTopColor: n.inputFillDisabled,
    borderBottomColor: n.inputFillDisabled,
    backgroundColor: n.inputFillDisabled
  } : r ? {
    borderLeftColor: n.borderSelected,
    borderRightColor: n.borderSelected,
    borderTopColor: n.borderSelected,
    borderBottomColor: n.borderSelected,
    backgroundColor: n.inputFillActive
  } : t ? {
    borderLeftColor: n.inputBorderError,
    borderRightColor: n.inputBorderError,
    borderTopColor: n.inputBorderError,
    borderBottomColor: n.inputBorderError,
    backgroundColor: n.inputFillError
  } : o ? {
    borderLeftColor: n.inputBorderPositive,
    borderRightColor: n.inputBorderPositive,
    borderTopColor: n.inputBorderPositive,
    borderBottomColor: n.inputBorderPositive,
    backgroundColor: n.inputFillPositive
  } : {
    borderLeftColor: n.inputBorder,
    borderRightColor: n.inputBorder,
    borderTopColor: n.inputBorder,
    borderBottomColor: n.inputBorder,
    backgroundColor: n.inputFill
  };
}
function Ie(e, r) {
  var t = r.inputBorderRadius;
  return e === u.mini && (t = r.inputBorderRadiusMini), {
    borderTopLeftRadius: t,
    borderBottomLeftRadius: t,
    borderTopRightRadius: t,
    borderBottomRightRadius: t
  };
}
var ze = function(e) {
  var r = e.$isFocused, t = e.$adjoined, o = e.$error, n = e.$disabled, i = e.$positive, a = e.$size, l = e.$theme, s = e.$theme, c = s.borders, p = s.colors, y = s.sizing, h = s.typography, O = s.animation, S = e.$hasIconTrailing;
  return g(g(g(g({
    boxSizing: "border-box",
    display: "flex",
    overflow: "hidden",
    width: "100%",
    borderLeftWidth: "2px",
    borderRightWidth: "2px",
    borderTopWidth: "2px",
    borderBottomWidth: "2px",
    borderLeftStyle: "solid",
    borderRightStyle: "solid",
    borderTopStyle: "solid",
    borderBottomStyle: "solid",
    transitionProperty: "border",
    transitionDuration: O.timing200,
    transitionTimingFunction: O.easeOutCurve
  }, Ie(a, c)), z(a, h)), Ee(n, r, o, i, p)), Be(t, a, y, l.direction, S));
}, ae = P("div", ze);
ae.displayName = "Root";
ae.displayName = "Root";
function Me(e, r) {
  var t;
  return (t = {}, d(t, u.mini, {
    paddingRight: r.scale400,
    paddingLeft: r.scale400
  }), d(t, u.compact, {
    paddingRight: r.scale400,
    paddingLeft: r.scale400
  }), d(t, u.default, {
    paddingRight: r.scale300,
    paddingLeft: r.scale300
  }), d(t, u.large, {
    paddingRight: r.scale200,
    paddingLeft: r.scale200
  }), t)[e];
}
function De(e, r, t, o, n) {
  return e ? {
    color: n.inputEnhancerTextDisabled,
    backgroundColor: n.inputFillDisabled
  } : r ? {
    color: n.contentPrimary,
    backgroundColor: n.inputFillActive
  } : t ? {
    color: n.contentPrimary,
    backgroundColor: n.inputFillError
  } : o ? {
    color: n.contentPrimary,
    backgroundColor: n.inputFillPositive
  } : {
    color: n.contentPrimary,
    backgroundColor: n.inputFill
  };
}
var le = P("div", function(e) {
  var r = e.$size, t = e.$disabled, o = e.$isFocused, n = e.$error, i = e.$positive, a = e.$theme, l = a.colors, s = a.sizing, c = a.typography, p = a.animation;
  return g(g(g({
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    transitionProperty: "color, background-color",
    transitionDuration: p.timing200,
    transitionTimingFunction: p.easeOutCurve
  }, z(r, c)), Me(r, s)), De(t, o, n, i, l));
});
le.displayName = "InputEnhancer";
le.displayName = "InputEnhancer";
function Le(e, r, t, o, n) {
  return e ? {
    color: n.inputTextDisabled,
    backgroundColor: n.inputFillDisabled
  } : r ? {
    color: n.contentPrimary,
    backgroundColor: n.inputFillActive
  } : t ? {
    color: n.contentPrimary,
    backgroundColor: n.inputFillError
  } : o ? {
    color: n.contentPrimary,
    backgroundColor: n.inputFillPositive
  } : {
    color: n.contentPrimary,
    backgroundColor: n.inputFill
  };
}
var Ae = function(e) {
  var r = e.$isFocused, t = e.$error, o = e.$disabled, n = e.$positive, i = e.$size, a = e.$theme, l = a.colors, s = a.typography, c = a.animation;
  return g(g({
    display: "flex",
    width: "100%",
    transitionProperty: "background-color",
    transitionDuration: c.timing200,
    transitionTimingFunction: c.easeOutCurve
  }, z(i, s)), Le(o, r, t, n, l));
}, U = P("div", Ae);
U.displayName = "InputContainer";
U.displayName = "InputContainer";
function Ve(e, r, t, o) {
  return e ? {
    color: o.inputTextDisabled,
    "-webkit-text-fill-color": o.inputTextDisabled,
    caretColor: o.contentPrimary,
    "::placeholder": {
      color: o.inputPlaceholderDisabled
    }
  } : {
    color: o.contentPrimary,
    caretColor: o.contentPrimary,
    "::placeholder": {
      color: o.inputPlaceholder
    }
  };
}
var Ne = function(e) {
  var r = e.$disabled, t = e.$isFocused, o = e.$error, n = e.$size, i = e.$theme, a = i.colors, l = i.sizing, s = i.typography;
  return g(g(g({
    boxSizing: "border-box",
    backgroundColor: "transparent",
    borderLeftWidth: 0,
    borderRightWidth: 0,
    borderTopWidth: 0,
    borderBottomWidth: 0,
    borderLeftStyle: "none",
    borderRightStyle: "none",
    borderTopStyle: "none",
    borderBottomStyle: "none",
    outline: "none",
    width: "100%",
    // See https://stackoverflow.com/a/33811151
    minWidth: 0,
    maxWidth: "100%",
    cursor: r ? "not-allowed" : "text",
    margin: "0",
    paddingTop: "0",
    paddingBottom: "0",
    paddingLeft: "0",
    paddingRight: "0"
  }, z(n, s)), $e(n, l)), Ve(r, t, o, a));
}, q = P("input", Ne);
q.displayName = "Input";
q.displayName = "Input";
function Ke(e) {
  var r;
  return typeof window.Event == "function" ? r = new window.Event(e, {
    bubbles: !0,
    cancelable: !0
  }) : (r = document.createEvent("Event"), r.initEvent(e, !0, !0)), r;
}
function V(e) {
  "@babel/helpers - typeof";
  return V = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
    return typeof r;
  } : function(r) {
    return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
  }, V(e);
}
function v() {
  return v = Object.assign ? Object.assign.bind() : function(e) {
    for (var r = 1; r < arguments.length; r++) {
      var t = arguments[r];
      for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
    }
    return e;
  }, v.apply(this, arguments);
}
function F(e, r) {
  return qe(e) || Ue(e, r) || We(e, r) || _e();
}
function _e() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function We(e, r) {
  if (e) {
    if (typeof e == "string") return ee(e, r);
    var t = Object.prototype.toString.call(e).slice(8, -1);
    if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set") return Array.from(e);
    if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return ee(e, r);
  }
}
function ee(e, r) {
  (r == null || r > e.length) && (r = e.length);
  for (var t = 0, o = new Array(r); t < r; t++) o[t] = e[t];
  return o;
}
function Ue(e, r) {
  var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (t != null) {
    var o = [], n = !0, i = !1, a, l;
    try {
      for (t = t.call(e); !(n = (a = t.next()).done) && (o.push(a.value), !(r && o.length === r)); n = !0) ;
    } catch (s) {
      i = !0, l = s;
    } finally {
      try {
        !n && t.return != null && t.return();
      } finally {
        if (i) throw l;
      }
    }
    return o;
  }
}
function qe(e) {
  if (Array.isArray(e)) return e;
}
function He(e, r) {
  if (!(e instanceof r)) throw new TypeError("Cannot call a class as a function");
}
function Qe(e, r) {
  for (var t = 0; t < r.length; t++) {
    var o = r[t];
    o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
  }
}
function Xe(e, r, t) {
  return r && Qe(e.prototype, r), Object.defineProperty(e, "prototype", {
    writable: !1
  }), e;
}
function Ye(e, r) {
  if (typeof r != "function" && r !== null) throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(r && r.prototype, {
    constructor: {
      value: e,
      writable: !0,
      configurable: !0
    }
  }), Object.defineProperty(e, "prototype", {
    writable: !1
  }), r && N(e, r);
}
function N(e, r) {
  return N = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, o) {
    return t.__proto__ = o, t;
  }, N(e, r);
}
function Ze(e) {
  var r = Ge();
  return function() {
    var t = I(e), o;
    if (r) {
      var n = I(this).constructor;
      o = Reflect.construct(t, arguments, n);
    } else o = t.apply(this, arguments);
    return Je(this, o);
  };
}
function Je(e, r) {
  if (r && (V(r) === "object" || typeof r == "function")) return r;
  if (r !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
  return 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 Ge() {
  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 I(e) {
  return I = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
    return r.__proto__ || Object.getPrototypeOf(r);
  }, I(e);
}
function f(e, r, t) {
  return r in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}
var re = function() {
  return null;
}, er = /* @__PURE__ */ (function(e) {
  Ye(t, e);
  var r = Ze(t);
  function t() {
    var o;
    He(this, t);
    for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++) i[a] = arguments[a];
    return o = r.call.apply(r, [this].concat(i)), f(m(o), "inputRef", o.props.inputRef || /* @__PURE__ */ b.createRef()), f(m(o), "state", {
      isFocused: o.props.autoFocus || !1,
      isMasked: o.props.type === "password",
      initialType: o.props.type,
      isFocusVisibleForClear: !1,
      isFocusVisibleForMaskToggle: !1
    }), f(m(o), "onInputKeyDown", function(l) {
      o.props.clearOnEscape && l.key === "Escape" && o.inputRef.current && !o.props.readOnly && (o.clearValue(), l.stopPropagation());
    }), f(m(o), "onClearIconClick", function() {
      o.inputRef.current && o.clearValue(), o.inputRef.current && o.inputRef.current.focus();
    }), f(m(o), "onFocus", function(l) {
      o.setState({
        isFocused: !0
      }), o.props.onFocus(l);
    }), f(m(o), "onBlur", function(l) {
      o.setState({
        isFocused: !1
      }), o.props.onBlur(l);
    }), f(m(o), "handleFocusForMaskToggle", function(l) {
      H(l) && o.setState({
        isFocusVisibleForMaskToggle: !0
      });
    }), f(m(o), "handleBlurForMaskToggle", function(l) {
      o.state.isFocusVisibleForMaskToggle !== !1 && o.setState({
        isFocusVisibleForMaskToggle: !1
      });
    }), f(m(o), "handleFocusForClear", function(l) {
      H(l) && o.setState({
        isFocusVisibleForClear: !0
      });
    }), f(m(o), "handleBlurForClear", function(l) {
      o.state.isFocusVisibleForClear !== !1 && o.setState({
        isFocusVisibleForClear: !1
      });
    }), o;
  }
  return Xe(t, [{
    key: "componentDidMount",
    value: function() {
      var o = this.props, n = o.autoFocus, i = o.clearable;
      this.inputRef.current && (n && this.inputRef.current.focus(), i && this.inputRef.current.addEventListener("keydown", this.onInputKeyDown));
    }
  }, {
    key: "componentWillUnmount",
    value: function() {
      var o = this.props.clearable;
      o && this.inputRef.current && this.inputRef.current.removeEventListener("keydown", this.onInputKeyDown);
    }
  }, {
    key: "clearValue",
    value: function() {
      var o = this.inputRef.current;
      if (o) {
        var n = Object.getOwnPropertyDescriptor(this.props.type === D.textarea ? (
          // todo(flow->ts): globals, not props of window object
          HTMLTextAreaElement.prototype
        ) : HTMLInputElement.prototype, "value");
        if (n) {
          var i = n.set;
          if (i) {
            i.call(o, "");
            var a = Ke("input");
            o.dispatchEvent(a);
          }
        }
      }
    }
  }, {
    key: "getInputType",
    value: function() {
      return this.props.type === "password" ? this.state.isMasked ? "password" : "text" : this.props.type;
    }
  }, {
    key: "renderMaskToggle",
    value: function() {
      var o, n = this;
      if (this.props.type !== "password") return null;
      var i = w(this.props.overrides.MaskToggleButton, K), a = F(i, 2), l = a[0], s = a[1], c = w(this.props.overrides.MaskToggleShowIcon, Re), p = F(c, 2), y = p[0], h = p[1], O = w(this.props.overrides.MaskToggleHideIcon, Oe), S = F(O, 2), j = S[0], $ = S[1], C = this.state.isMasked ? "Show password text" : "Hide password text", R = (o = {}, f(o, u.mini, "12px"), f(o, u.compact, "16px"), f(o, u.default, "20px"), f(o, u.large, "24px"), o)[this.props.size];
      return /* @__PURE__ */ b.createElement(l, v({
        $size: this.props.size,
        $isFocusVisible: this.state.isFocusVisibleForMaskToggle,
        "aria-label": C,
        onClick: function() {
          return n.setState(function(k) {
            return {
              isMasked: !k.isMasked
            };
          });
        },
        title: C,
        type: "button"
      }, s, {
        onFocus: X(s, this.handleFocusForMaskToggle),
        onBlur: Q(s, this.handleBlurForMaskToggle)
      }), this.state.isMasked ? /* @__PURE__ */ b.createElement(y, v({
        size: R,
        title: C
      }, h)) : /* @__PURE__ */ b.createElement(j, v({
        size: R,
        title: C
      }, $)));
    }
  }, {
    key: "renderClear",
    value: function() {
      var o, n = this, i = this.props, a = i.clearable, l = i.value, s = i.disabled, c = i.readOnly, p = i.overrides, y = p === void 0 ? {} : p;
      if (s || c || !a || l == null || typeof l == "string" && l.length === 0) return null;
      var h = w(y.ClearIconContainer, _), O = F(h, 2), S = O[0], j = O[1], $ = w(y.ClearIcon, W), C = F($, 2), R = C[0], k = C[1], B = "Clear value", E = J(this.props, this.state), M = (o = {}, f(o, u.mini, "14px"), f(o, u.compact, "14px"), f(o, u.default, "16px"), f(o, u.large, "22px"), o)[this.props.size];
      return /* @__PURE__ */ b.createElement(S, v({
        $alignTop: this.props.type === D.textarea
      }, E, j), /* @__PURE__ */ b.createElement(R, v({
        size: M,
        tabIndex: 0,
        title: B,
        "aria-label": B,
        onClick: this.onClearIconClick,
        onKeyDown: function(x) {
          x.key && (x.key === "Enter" || x.key === " ") && (x.preventDefault(), n.onClearIconClick());
        },
        role: "button",
        $isFocusVisible: this.state.isFocusVisibleForClear
      }, E, k, {
        onFocus: X(k, this.handleFocusForClear),
        onBlur: Q(k, this.handleBlurForClear)
      })));
    }
  }, {
    key: "render",
    value: function() {
      var o = this.props.overrides, n = o.InputContainer, i = o.Input, a = o.Before, l = o.After, s = this.state.initialType === "password" && this.props.autoComplete === t.defaultProps.autoComplete ? "new-password" : this.props.autoComplete, c = J(this.props, this.state), p = w(n, U), y = F(p, 2), h = y[0], O = y[1], S = w(i, q), j = F(S, 2), $ = j[0], C = j[1], R = w(a, re), k = F(R, 2), B = k[0], E = k[1], M = w(l, re), x = F(M, 2), se = x[0], ue = x[1];
      return /* @__PURE__ */ b.createElement(h, v({
        "data-baseweb": this.props["data-baseweb"] || "base-input"
      }, c, O), /* @__PURE__ */ b.createElement(B, v({}, c, E)), /* @__PURE__ */ b.createElement($, v({
        ref: this.inputRef,
        "aria-activedescendant": this.props["aria-activedescendant"],
        "aria-autocomplete": this.props["aria-autocomplete"],
        "aria-controls": this.props["aria-controls"],
        "aria-errormessage": this.props["aria-errormessage"],
        "aria-haspopup": this.props["aria-haspopup"],
        "aria-label": this.props["aria-label"],
        "aria-labelledby": this.props["aria-labelledby"],
        "aria-describedby": this.props["aria-describedby"],
        "aria-invalid": this.props.error,
        "aria-required": this.props.required,
        autoComplete: s,
        disabled: this.props.disabled,
        readOnly: this.props.readOnly,
        id: this.props.id,
        inputMode: this.props.inputMode,
        maxLength: this.props.maxLength,
        name: this.props.name,
        onBlur: this.onBlur,
        onChange: this.props.onChange,
        onFocus: this.onFocus,
        onKeyDown: this.props.onKeyDown,
        onKeyPress: this.props.onKeyPress,
        onKeyUp: this.props.onKeyUp,
        pattern: this.props.pattern,
        placeholder: this.props.placeholder,
        type: this.getInputType(),
        required: this.props.required,
        role: this.props.role,
        value: this.props.value,
        min: this.props.min,
        max: this.props.max,
        step: this.props.step,
        rows: this.props.type === D.textarea ? this.props.rows : null
      }, c, C)), this.renderClear(), this.renderMaskToggle(), /* @__PURE__ */ b.createElement(se, v({}, c, ue)));
    }
  }]), t;
})(b.Component);
f(er, "defaultProps", {
  "aria-activedescendant": null,
  "aria-autocomplete": null,
  "aria-controls": null,
  "aria-errormessage": null,
  "aria-haspopup": null,
  "aria-label": null,
  "aria-labelledby": null,
  "aria-describedby": null,
  adjoined: T.none,
  autoComplete: "on",
  autoFocus: !1,
  disabled: !1,
  error: !1,
  positive: !1,
  name: "",
  inputMode: "text",
  onBlur: function() {
  },
  onChange: function() {
  },
  onKeyDown: function() {
  },
  onKeyPress: function() {
  },
  onKeyUp: function() {
  },
  onFocus: function() {
  },
  onClear: function() {
  },
  clearable: !1,
  clearOnEscape: !0,
  overrides: {},
  pattern: null,
  placeholder: "",
  required: !1,
  role: null,
  size: u.default,
  type: "text",
  readOnly: !1
});
export {
  ze as A,
  Ae as D,
  Ne as V,
  J as e,
  q,
  ae as s,
  er as t,
  le as u
};
//# sourceMappingURL=base-input-DjjpNP8Y-D5Wig0hH.js.map
