import { r as U, bd as ce, v as J, m as de, j as L, aI as pe, aJ as fe, b0 as ge, aK as be, ap as ye, bl as me, c as ie, bZ as ve, b_ as he, b$ as Se, bJ as Oe, c0 as je, bm as Pe, aX as Ce, bI as Ie, c1 as we, c2 as Te, c3 as Ee, c4 as xe, c5 as De, br as $e, aC as Y, c6 as Re } from "./index-6wLGsgHc.js";
import { S as _e } from "./useBasicWidgetState-DqA4I-I_-Cy-zNgyc.js";
import { w as Be } from "./timepicker-BTEFSiul-ecK8kRjX.js";
var ke = $e.Consumer;
const Ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ThemeConsumer: ke,
  ThemeProvider: De,
  createThemedStyled: xe,
  createThemedUseStyletron: Ee,
  createThemedWithStyle: Te,
  expandBorderStyles: we,
  hexToRgb: Ie,
  styled: Ce,
  useStyletron: Pe,
  withStyle: je,
  withWrapper: Oe
}, Symbol.toStringTag, {
  value: "Module"
}));
var P = {};
const G = /* @__PURE__ */ Se(Ne);
var x = {}, q;
function ze() {
  if (q) return x;
  q = 1, Object.defineProperty(x, "__esModule", {
    value: !0
  }), x.STATE_CHANGE_TYPE = x.SIZE = x.ENHANCER_POSITION = x.CUSTOM_INPUT_TYPE = x.ADJOINED = void 0;
  var f = {
    change: "change"
  };
  x.STATE_CHANGE_TYPE = f;
  var d = {
    textarea: "textarea"
  };
  x.CUSTOM_INPUT_TYPE = d;
  var h = {
    none: "none",
    left: "left",
    right: "right",
    both: "both"
  };
  x.ADJOINED = h;
  var y = {
    mini: "mini",
    default: "default",
    compact: "compact",
    large: "large"
  };
  x.SIZE = y;
  var v = {
    start: "start",
    end: "end"
  };
  return x.ENHANCER_POSITION = v, x;
}
var F = {}, R = {}, H = {}, K;
function Me() {
  if (K) return H;
  K = 1, Object.defineProperty(H, "__esModule", {
    value: !0
  }), H.default = d;
  function f(y) {
    "@babel/helpers - typeof";
    return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(v) {
      return typeof v;
    } : function(v) {
      return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
    }, f(y);
  }
  function d(y) {
    y = y || {};
    for (var v = arguments.length <= 1 ? 0 : arguments.length - 1, m, b, O = 0; O < v; O++) {
      m = (O + 1 < 1 || arguments.length <= O + 1 ? void 0 : arguments[O + 1]) || {};
      for (var g in m) f(m[g]) !== void 0 && (b = m[g], h(b) ? y[g] = d(
        /* eslint-disable-next-line no-mixed-operators */
        y[g] || Array.isArray(b) && [] || {},
        b
      ) : y[g] = b);
    }
    return y;
  }
  function h(y) {
    return Array.isArray(y) || {}.toString.call(y) == "[object Object]";
  }
  return H;
}
var Q;
function ae() {
  if (Q) return R;
  Q = 1, Object.defineProperty(R, "__esModule", {
    value: !0
  }), R.getOverride = E, R.getOverrideProps = w, R.getOverrides = z, R.mergeConfigurationOverrides = k, R.mergeOverride = $, R.mergeOverrides = B, R.toObjectOverride = D, R.useOverrides = M;
  var f = m(Y), d = Re(), h = y(/* @__PURE__ */ Me());
  function y(i) {
    return i && i.__esModule ? i : {
      default: i
    };
  }
  function v(i) {
    if (typeof WeakMap != "function") return null;
    var r = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap();
    return (v = function(s) {
      return s ? u : r;
    })(i);
  }
  function m(i, r) {
    if (i && i.__esModule) return i;
    if (i === null || C(i) !== "object" && typeof i != "function") return {
      default: i
    };
    var u = v(r);
    if (u && u.has(i)) return u.get(i);
    var s = {}, t = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var a in i) if (a !== "default" && Object.prototype.hasOwnProperty.call(i, a)) {
      var l = t ? Object.getOwnPropertyDescriptor(i, a) : null;
      l && (l.get || l.set) ? Object.defineProperty(s, a, l) : s[a] = i[a];
    }
    return s.default = i, u && u.set(i, s), s;
  }
  function b() {
    return b = Object.assign ? Object.assign.bind() : function(i) {
      for (var r = 1; r < arguments.length; r++) {
        var u = arguments[r];
        for (var s in u) Object.prototype.hasOwnProperty.call(u, s) && (i[s] = u[s]);
      }
      return i;
    }, b.apply(this, arguments);
  }
  function O(i, r) {
    var u = Object.keys(i);
    if (Object.getOwnPropertySymbols) {
      var s = Object.getOwnPropertySymbols(i);
      r && (s = s.filter(function(t) {
        return Object.getOwnPropertyDescriptor(i, t).enumerable;
      })), u.push.apply(u, s);
    }
    return u;
  }
  function g(i) {
    for (var r = 1; r < arguments.length; r++) {
      var u = arguments[r] != null ? arguments[r] : {};
      r % 2 ? O(Object(u), !0).forEach(function(s) {
        I(i, s, u[s]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(u)) : O(Object(u)).forEach(function(s) {
        Object.defineProperty(i, s, Object.getOwnPropertyDescriptor(u, s));
      });
    }
    return i;
  }
  function I(i, r, u) {
    return r in i ? Object.defineProperty(i, r, {
      value: u,
      enumerable: !0,
      configurable: !0,
      writable: !0
    }) : i[r] = u, i;
  }
  function C(i) {
    "@babel/helpers - typeof";
    return C = 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;
    }, C(i);
  }
  function E(i) {
    return (0, d.isValidElementType)(i) ? i : i && C(i) === "object" ? i.component : i;
  }
  function w(i) {
    return i && C(i) === "object" ? C(i.props) === "object" ? g(g({}, i.props), {}, {
      $style: i.style
    }) : {
      $style: i.style
    } : {};
  }
  function D(i) {
    return (0, d.isValidElementType)(i) ? {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      component: i
    } : i || {};
  }
  function z(i, r) {
    var u = E(i) || r;
    if (i && C(i) === "object" && typeof i.props == "function") {
      var s = /* @__PURE__ */ f.forwardRef(function(a, l) {
        var e = i.props(a), n = w(g(g({}, i), {}, {
          props: e
        }));
        return /* @__PURE__ */ f.createElement(u, b({
          ref: l
        }, n));
      });
      return s.displayName = u.displayName, [s, {}];
    }
    var t = w(i);
    return [u, t];
  }
  function B() {
    var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = Object.assign({}, i, r), s = Object.keys(u);
    return s.reduce(function(t, a) {
      return t[a] = $(D(i[a]), D(r[a])), t;
    }, {});
  }
  function $(i, r) {
    var u = g(g({}, i), r);
    return i.props && r.props && (u.props = k(i.props, r.props)), i.style && r.style && (u.style = k(i.style, r.style)), u;
  }
  function k(i, r) {
    return C(i) === "object" && C(r) === "object" ? (0, h.default)({}, i, r) : function() {
      return (0, h.default)({}, typeof i == "function" ? i.apply(void 0, arguments) : i, typeof r == "function" ? r.apply(void 0, arguments) : r);
    };
  }
  function M(i) {
    var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    return f.useMemo(function() {
      return Object.keys(i).reduce(function(u, s) {
        return u[s] = z(r[s], i[s]), u;
      }, {});
    }, [r]);
  }
  return R;
}
var Z = {}, A = {}, ee;
function Le() {
  if (ee) return A;
  ee = 1, Object.defineProperty(A, "__esModule", {
    value: !0
  }), A.Svg = void 0, A.getSvgStyles = d;
  var f = G;
  function d(y) {
    var v = y.$theme, m = y.$size, b = y.$color, O = v.sizing.scale600;
    m && (v.sizing[m] ? O = v.sizing[m] : typeof m == "number" ? O = "".concat(m, "px") : O = m);
    var g = "currentColor";
    return b && (v.colors[b] ? g = v.colors[b] : g = b), {
      display: "inline-block",
      fill: g,
      color: g,
      height: O,
      width: O
    };
  }
  var h = (0, f.styled)("svg", d);
  return A.Svg = h, h.displayName = "Svg", h.displayName = "Svg", A;
}
var V = {}, te;
function We() {
  if (te) return V;
  te = 1, Object.defineProperty(V, "__esModule", {
    value: !0
  }), V.default = f;
  function f(d) {
    var h = {};
    for (var y in d) y[0] !== "$" && (h[y] = d[y]);
    return h;
  }
  return V;
}
var re;
function Ae() {
  if (re) return Z;
  re = 1;
  function f(t) {
    "@babel/helpers - typeof";
    return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) {
      return typeof a;
    } : function(a) {
      return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a;
    }, f(t);
  }
  Object.defineProperty(Z, "__esModule", {
    value: !0
  }), Z.default = void 0;
  var d = g(Y), h = /* @__PURE__ */ ae(), y = /* @__PURE__ */ Le(), v = b(/* @__PURE__ */ We()), m = ["children", "title", "size", "color", "overrides"];
  function b(t) {
    return t && t.__esModule ? t : {
      default: t
    };
  }
  function O(t) {
    if (typeof WeakMap != "function") return null;
    var a = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();
    return (O = function(e) {
      return e ? l : a;
    })(t);
  }
  function g(t, a) {
    if (t && t.__esModule) return t;
    if (t === null || f(t) !== "object" && typeof t != "function") return {
      default: t
    };
    var l = O(a);
    if (l && l.has(t)) return l.get(t);
    var e = {}, n = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var o in t) if (o !== "default" && Object.prototype.hasOwnProperty.call(t, o)) {
      var p = n ? Object.getOwnPropertyDescriptor(t, o) : null;
      p && (p.get || p.set) ? Object.defineProperty(e, o, p) : e[o] = t[o];
    }
    return e.default = t, l && l.set(t, e), e;
  }
  function I() {
    return I = Object.assign ? Object.assign.bind() : function(t) {
      for (var a = 1; a < arguments.length; a++) {
        var l = arguments[a];
        for (var e in l) Object.prototype.hasOwnProperty.call(l, e) && (t[e] = l[e]);
      }
      return t;
    }, I.apply(this, arguments);
  }
  function C(t, a) {
    var l = Object.keys(t);
    if (Object.getOwnPropertySymbols) {
      var e = Object.getOwnPropertySymbols(t);
      a && (e = e.filter(function(n) {
        return Object.getOwnPropertyDescriptor(t, n).enumerable;
      })), l.push.apply(l, e);
    }
    return l;
  }
  function E(t) {
    for (var a = 1; a < arguments.length; a++) {
      var l = arguments[a] != null ? arguments[a] : {};
      a % 2 ? C(Object(l), !0).forEach(function(e) {
        w(t, e, l[e]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(l)) : C(Object(l)).forEach(function(e) {
        Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(l, e));
      });
    }
    return t;
  }
  function w(t, a, l) {
    return a in t ? Object.defineProperty(t, a, {
      value: l,
      enumerable: !0,
      configurable: !0,
      writable: !0
    }) : t[a] = l, t;
  }
  function D(t, a) {
    return M(t) || k(t, a) || B(t, a) || z();
  }
  function z() {
    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 B(t, a) {
    if (t) {
      if (typeof t == "string") return $(t, a);
      var l = Object.prototype.toString.call(t).slice(8, -1);
      if (l === "Object" && t.constructor && (l = t.constructor.name), l === "Map" || l === "Set") return Array.from(t);
      if (l === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)) return $(t, a);
    }
  }
  function $(t, a) {
    (a == null || a > t.length) && (a = t.length);
    for (var l = 0, e = new Array(a); l < a; l++) e[l] = t[l];
    return e;
  }
  function k(t, a) {
    var l = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
    if (l != null) {
      var e = [], n = !0, o = !1, p, c;
      try {
        for (l = l.call(t); !(n = (p = l.next()).done) && (e.push(p.value), !(a && e.length === a)); n = !0) ;
      } catch (S) {
        o = !0, c = S;
      } finally {
        try {
          !n && l.return != null && l.return();
        } finally {
          if (o) throw c;
        }
      }
      return e;
    }
  }
  function M(t) {
    if (Array.isArray(t)) return t;
  }
  function i(t, a) {
    if (t == null) return {};
    var l = r(t, a), e, n;
    if (Object.getOwnPropertySymbols) {
      var o = Object.getOwnPropertySymbols(t);
      for (n = 0; n < o.length; n++) e = o[n], !(a.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(t, e) && (l[e] = t[e]);
    }
    return l;
  }
  function r(t, a) {
    if (t == null) return {};
    var l = {}, e = Object.keys(t), n, o;
    for (o = 0; o < e.length; o++) n = e[o], !(a.indexOf(n) >= 0) && (l[n] = t[n]);
    return l;
  }
  var u = function(t, a) {
    var l = t.children, e = t.title, n = t.size, o = t.color, p = t.overrides, c = p === void 0 ? {} : p, S = i(t, m), j = (0, h.getOverrides)(c.Svg, y.Svg), _ = D(j, 2), T = _[0], N = _[1], W = T.__STYLETRON__ ? E(E({
      title: e,
      $color: o,
      $size: n
    }, S), N) : E(E({
      title: e,
      color: o,
      size: n
    }, (0, v.default)(S)), (0, v.default)(N));
    return /* @__PURE__ */ d.createElement(T, I({
      "data-baseweb": "icon",
      ref: a
    }, W), e ? /* @__PURE__ */ d.createElement("title", null, e) : null, l);
  }, s = /* @__PURE__ */ d.forwardRef(u);
  return Z.default = s, Z;
}
var ne;
function Fe() {
  if (ne) return F;
  ne = 1;
  function f(r) {
    "@babel/helpers - typeof";
    return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(u) {
      return typeof u;
    } : function(u) {
      return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u;
    }, f(r);
  }
  Object.defineProperty(F, "__esModule", {
    value: !0
  }), F.default = void 0;
  var d = g(Y), h = G, y = /* @__PURE__ */ ae(), v = b(/* @__PURE__ */ Ae()), m = ["title", "size", "color", "overrides"];
  function b(r) {
    return r && r.__esModule ? r : {
      default: r
    };
  }
  function O(r) {
    if (typeof WeakMap != "function") return null;
    var u = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap();
    return (O = function(t) {
      return t ? s : u;
    })(r);
  }
  function g(r, u) {
    if (r && r.__esModule) return r;
    if (r === null || f(r) !== "object" && typeof r != "function") return {
      default: r
    };
    var s = O(u);
    if (s && s.has(r)) return s.get(r);
    var t = {}, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var l in r) if (l !== "default" && Object.prototype.hasOwnProperty.call(r, l)) {
      var e = a ? Object.getOwnPropertyDescriptor(r, l) : null;
      e && (e.get || e.set) ? Object.defineProperty(t, l, e) : t[l] = r[l];
    }
    return t.default = r, s && s.set(r, t), t;
  }
  function I() {
    return I = Object.assign ? Object.assign.bind() : function(r) {
      for (var u = 1; u < arguments.length; u++) {
        var s = arguments[u];
        for (var t in s) Object.prototype.hasOwnProperty.call(s, t) && (r[t] = s[t]);
      }
      return r;
    }, I.apply(this, arguments);
  }
  function C(r, u) {
    if (r == null) return {};
    var s = E(r, u), t, a;
    if (Object.getOwnPropertySymbols) {
      var l = Object.getOwnPropertySymbols(r);
      for (a = 0; a < l.length; a++) t = l[a], !(u.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(r, t) && (s[t] = r[t]);
    }
    return s;
  }
  function E(r, u) {
    if (r == null) return {};
    var s = {}, t = Object.keys(r), a, l;
    for (l = 0; l < t.length; l++) a = t[l], !(u.indexOf(a) >= 0) && (s[a] = r[a]);
    return s;
  }
  function w(r, u) {
    return k(r) || $(r, u) || z(r, u) || D();
  }
  function D() {
    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 z(r, u) {
    if (r) {
      if (typeof r == "string") return B(r, u);
      var s = Object.prototype.toString.call(r).slice(8, -1);
      if (s === "Object" && r.constructor && (s = r.constructor.name), s === "Map" || s === "Set") return Array.from(r);
      if (s === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)) return B(r, u);
    }
  }
  function B(r, u) {
    (u == null || u > r.length) && (u = r.length);
    for (var s = 0, t = new Array(u); s < u; s++) t[s] = r[s];
    return t;
  }
  function $(r, u) {
    var s = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
    if (s != null) {
      var t = [], a = !0, l = !1, e, n;
      try {
        for (s = s.call(r); !(a = (e = s.next()).done) && (t.push(e.value), !(u && t.length === u)); a = !0) ;
      } catch (o) {
        l = !0, n = o;
      } finally {
        try {
          !a && s.return != null && s.return();
        } finally {
          if (l) throw n;
        }
      }
      return t;
    }
  }
  function k(r) {
    if (Array.isArray(r)) return r;
  }
  function M(r, u) {
    var s = (0, h.useStyletron)(), t = w(s, 2), a = t[1], l = r.title, e = l === void 0 ? "Delete Alt" : l, n = r.size, o = r.color, p = r.overrides, c = p === void 0 ? {} : p, S = C(r, m), j = (0, y.mergeOverride)(
      // Icons from the theme target the SVG override in the underlying Icon component
      {
        component: a.icons && a.icons.DeleteAlt ? a.icons.DeleteAlt : null
      },
      c && c.Svg ? (0, y.toObjectOverride)(c.Svg) : {}
    );
    return /* @__PURE__ */ d.createElement(v.default, I({
      viewBox: "0 0 24 24",
      ref: u,
      title: e,
      size: n,
      color: o,
      overrides: {
        Svg: j
      }
    }, S), /* @__PURE__ */ d.createElement("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"
    }));
  }
  var i = /* @__PURE__ */ d.forwardRef(M);
  return F.default = i, F;
}
var oe;
function Ze() {
  if (oe) return P;
  oe = 1, Object.defineProperty(P, "__esModule", {
    value: !0
  }), P.getRootStyles = P.getInputStyles = P.getInputContainerStyles = P.StyledMaskToggleButton = P.StyledClearIconContainer = P.StyledClearIcon = P.Root = P.InputEnhancer = P.InputContainer = P.Input = void 0;
  var f = G, d = /* @__PURE__ */ ze(), h = y(/* @__PURE__ */ Fe());
  function y(e) {
    return e && e.__esModule ? e : {
      default: e
    };
  }
  function v(e, n) {
    var o = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var p = Object.getOwnPropertySymbols(e);
      n && (p = p.filter(function(c) {
        return Object.getOwnPropertyDescriptor(e, c).enumerable;
      })), o.push.apply(o, p);
    }
    return o;
  }
  function m(e) {
    for (var n = 1; n < arguments.length; n++) {
      var o = arguments[n] != null ? arguments[n] : {};
      n % 2 ? v(Object(o), !0).forEach(function(p) {
        b(e, p, o[p]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : v(Object(o)).forEach(function(p) {
        Object.defineProperty(e, p, Object.getOwnPropertyDescriptor(o, p));
      });
    }
    return e;
  }
  function b(e, n, o) {
    return n in e ? Object.defineProperty(e, n, {
      value: o,
      enumerable: !0,
      configurable: !0,
      writable: !0
    }) : e[n] = o, e;
  }
  var O = (0, f.styled)("button", function(e) {
    var n, o = e.$theme, p = e.$size, c = e.$isFocusVisible, S = (n = {}, b(n, d.SIZE.mini, o.sizing.scale400), b(n, d.SIZE.compact, o.sizing.scale400), b(n, d.SIZE.default, o.sizing.scale300), b(n, d.SIZE.large, o.sizing.scale200), n)[p];
    return {
      display: "flex",
      alignItems: "center",
      borderTopStyle: "none",
      borderBottomStyle: "none",
      borderLeftStyle: "none",
      borderRightStyle: "none",
      background: "none",
      paddingLeft: S,
      paddingRight: S,
      outline: c ? "solid 3px ".concat(o.colors.accent) : "none",
      color: o.colors.contentPrimary
    };
  });
  P.StyledMaskToggleButton = O, O.displayName = "StyledMaskToggleButton", O.displayName = "StyledMaskToggleButton";
  var g = (0, f.styled)("div", function(e) {
    var n, o = e.$alignTop, p = o === void 0 ? !1 : o, c = e.$size, S = e.$theme, j = (n = {}, b(n, d.SIZE.mini, S.sizing.scale200), b(n, d.SIZE.compact, S.sizing.scale200), b(n, d.SIZE.default, S.sizing.scale100), b(n, d.SIZE.large, S.sizing.scale0), n)[c];
    return {
      display: "flex",
      alignItems: p ? "flex-start" : "center",
      paddingLeft: j,
      paddingRight: j,
      paddingTop: p ? S.sizing.scale500 : "0px",
      color: S.colors.contentPrimary
    };
  });
  P.StyledClearIconContainer = g, g.displayName = "StyledClearIconContainer", g.displayName = "StyledClearIconContainer";
  var I = (0, f.styled)(h.default, function(e) {
    var n = e.$theme, o = e.$isFocusVisible;
    return {
      cursor: "pointer",
      outline: o ? "solid 3px ".concat(n.colors.accent) : "none"
    };
  });
  P.StyledClearIcon = I, I.displayName = "StyledClearIcon", I.displayName = "StyledClearIcon";
  function C(e, n) {
    var o;
    return (o = {}, b(o, d.SIZE.mini, {
      paddingTop: n.scale100,
      paddingBottom: n.scale100,
      paddingLeft: n.scale550,
      paddingRight: n.scale550
    }), b(o, d.SIZE.compact, {
      paddingTop: n.scale200,
      paddingBottom: n.scale200,
      paddingLeft: n.scale550,
      paddingRight: n.scale550
    }), b(o, d.SIZE.default, {
      paddingTop: n.scale400,
      paddingBottom: n.scale400,
      paddingLeft: n.scale550,
      paddingRight: n.scale550
    }), b(o, d.SIZE.large, {
      paddingTop: n.scale550,
      paddingBottom: n.scale550,
      paddingLeft: n.scale550,
      paddingRight: n.scale550
    }), o)[e];
  }
  function E(e, n, o, p, c) {
    var S = e === d.ADJOINED.both || e === d.ADJOINED.left && p !== "rtl" || e === d.ADJOINED.right && p === "rtl" || c && p === "rtl", j = e === d.ADJOINED.both || e === d.ADJOINED.right && p !== "rtl" || e === d.ADJOINED.left && p === "rtl" || c && p !== "rtl";
    return {
      paddingLeft: S ? o.scale550 : "0px",
      paddingRight: j ? o.scale550 : "0px"
    };
  }
  function w(e, n) {
    var o;
    return (o = {}, b(o, d.SIZE.mini, n.font100), b(o, d.SIZE.compact, n.font200), b(o, d.SIZE.default, n.font300), b(o, d.SIZE.large, n.font400), o)[e];
  }
  function D(e, n, o) {
    var p = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, c = arguments.length > 4 ? arguments[4] : void 0;
    return e ? {
      borderLeftColor: c.inputFillDisabled,
      borderRightColor: c.inputFillDisabled,
      borderTopColor: c.inputFillDisabled,
      borderBottomColor: c.inputFillDisabled,
      backgroundColor: c.inputFillDisabled
    } : n ? {
      borderLeftColor: c.borderSelected,
      borderRightColor: c.borderSelected,
      borderTopColor: c.borderSelected,
      borderBottomColor: c.borderSelected,
      backgroundColor: c.inputFillActive
    } : o ? {
      borderLeftColor: c.inputBorderError,
      borderRightColor: c.inputBorderError,
      borderTopColor: c.inputBorderError,
      borderBottomColor: c.inputBorderError,
      backgroundColor: c.inputFillError
    } : p ? {
      borderLeftColor: c.inputBorderPositive,
      borderRightColor: c.inputBorderPositive,
      borderTopColor: c.inputBorderPositive,
      borderBottomColor: c.inputBorderPositive,
      backgroundColor: c.inputFillPositive
    } : {
      borderLeftColor: c.inputBorder,
      borderRightColor: c.inputBorder,
      borderTopColor: c.inputBorder,
      borderBottomColor: c.inputBorder,
      backgroundColor: c.inputFill
    };
  }
  function z(e, n) {
    var o = n.inputBorderRadius;
    return e === d.SIZE.mini && (o = n.inputBorderRadiusMini), {
      borderTopLeftRadius: o,
      borderBottomLeftRadius: o,
      borderTopRightRadius: o,
      borderBottomRightRadius: o
    };
  }
  var B = function(e) {
    var n = e.$isFocused, o = e.$adjoined, p = e.$error, c = e.$disabled, S = e.$positive, j = e.$size, _ = e.$theme, T = e.$theme, N = T.borders, W = T.colors, le = T.sizing, ue = T.typography, X = T.animation, se = e.$hasIconTrailing;
    return m(m(m(m({
      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: X.timing200,
      transitionTimingFunction: X.easeOutCurve
    }, z(j, N)), w(j, ue)), D(c, n, p, S, W)), E(o, j, le, _.direction, se));
  };
  P.getRootStyles = B;
  var $ = (0, f.styled)("div", B);
  P.Root = $, $.displayName = "Root", $.displayName = "Root";
  function k(e, n) {
    var o;
    return (o = {}, b(o, d.SIZE.mini, {
      paddingRight: n.scale400,
      paddingLeft: n.scale400
    }), b(o, d.SIZE.compact, {
      paddingRight: n.scale400,
      paddingLeft: n.scale400
    }), b(o, d.SIZE.default, {
      paddingRight: n.scale300,
      paddingLeft: n.scale300
    }), b(o, d.SIZE.large, {
      paddingRight: n.scale200,
      paddingLeft: n.scale200
    }), o)[e];
  }
  function M(e, n, o, p, c) {
    return e ? {
      color: c.inputEnhancerTextDisabled,
      backgroundColor: c.inputFillDisabled
    } : n ? {
      color: c.contentPrimary,
      backgroundColor: c.inputFillActive
    } : o ? {
      color: c.contentPrimary,
      backgroundColor: c.inputFillError
    } : p ? {
      color: c.contentPrimary,
      backgroundColor: c.inputFillPositive
    } : {
      color: c.contentPrimary,
      backgroundColor: c.inputFill
    };
  }
  var i = (0, f.styled)("div", function(e) {
    var n = e.$size, o = e.$disabled, p = e.$isFocused, c = e.$error, S = e.$positive, j = e.$theme, _ = j.colors, T = j.sizing, N = j.typography, W = j.animation;
    return m(m(m({
      display: "flex",
      alignItems: "center",
      justifyContent: "center",
      transitionProperty: "color, background-color",
      transitionDuration: W.timing200,
      transitionTimingFunction: W.easeOutCurve
    }, w(n, N)), k(n, T)), M(o, p, c, S, _));
  });
  P.InputEnhancer = i, i.displayName = "InputEnhancer", i.displayName = "InputEnhancer";
  function r(e, n, o, p, c) {
    return e ? {
      color: c.inputTextDisabled,
      backgroundColor: c.inputFillDisabled
    } : n ? {
      color: c.contentPrimary,
      backgroundColor: c.inputFillActive
    } : o ? {
      color: c.contentPrimary,
      backgroundColor: c.inputFillError
    } : p ? {
      color: c.contentPrimary,
      backgroundColor: c.inputFillPositive
    } : {
      color: c.contentPrimary,
      backgroundColor: c.inputFill
    };
  }
  var u = function(e) {
    var n = e.$isFocused, o = e.$error, p = e.$disabled, c = e.$positive, S = e.$size, j = e.$theme, _ = j.colors, T = j.typography, N = j.animation;
    return m(m({
      display: "flex",
      width: "100%",
      transitionProperty: "background-color",
      transitionDuration: N.timing200,
      transitionTimingFunction: N.easeOutCurve
    }, w(S, T)), r(p, n, o, c, _));
  };
  P.getInputContainerStyles = u;
  var s = (0, f.styled)("div", u);
  P.InputContainer = s, s.displayName = "InputContainer", s.displayName = "InputContainer";
  function t(e, n, o, p) {
    return e ? {
      color: p.inputTextDisabled,
      "-webkit-text-fill-color": p.inputTextDisabled,
      caretColor: p.contentPrimary,
      "::placeholder": {
        color: p.inputPlaceholderDisabled
      }
    } : {
      color: p.contentPrimary,
      caretColor: p.contentPrimary,
      "::placeholder": {
        color: p.inputPlaceholder
      }
    };
  }
  var a = function(e) {
    var n = e.$disabled, o = e.$isFocused, p = e.$error, c = e.$size, S = e.$theme, j = S.colors, _ = S.sizing, T = S.typography;
    return m(m(m({
      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: n ? "not-allowed" : "text",
      margin: "0",
      paddingTop: "0",
      paddingBottom: "0",
      paddingLeft: "0",
      paddingRight: "0"
    }, w(c, T)), C(c, _)), t(n, o, p, j));
  };
  P.getInputStyles = a;
  var l = (0, f.styled)("input", a);
  return P.Input = l, l.displayName = "Input", l.displayName = "Input", P;
}
var He = /* @__PURE__ */ Ze();
const Ve = /* @__PURE__ */ ie("div", {
  target: "e1ipygm11"
})({
  name: "1ucqwki",
  styles: "position:absolute;top:50%;right:2.05em"
}), Ue = /* @__PURE__ */ ie(he, {
  shouldForwardProp: ve,
  target: "e1ipygm10"
})(({
  theme: f,
  $isHighlighted: d
}) => ({
  paddingRight: f.spacing.lg,
  paddingLeft: f.spacing.lg,
  paddingTop: f.spacing.sm,
  paddingBottom: f.spacing.sm,
  background: d ? f.colors.darkenedBgMix15 : void 0,
  "&:hover, &:active, &:focus-visible": {
    background: f.colors.darkenedBgMix15
  }
}), "");
function Je({
  disabled: f,
  element: d,
  widgetMgr: h,
  fragmentId: y
}) {
  const [v, m] = _e({
    getStateFromWidgetMgr: Ye,
    getDefaultStateFromProto: Ge,
    getCurrStateFromProto: Xe,
    updateWidgetMgrState: qe,
    element: d,
    widgetMgr: h,
    fragmentId: y
  }), b = U.useContext(ce), O = J(d.default) && !f, g = de(), I = {
    Select: {
      props: {
        disabled: f,
        overrides: {
          ControlContainer: {
            style: {
              height: g.sizes.minElementHeight,
              // Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
              borderLeftWidth: g.sizes.borderWidth,
              borderRightWidth: g.sizes.borderWidth,
              borderTopWidth: g.sizes.borderWidth,
              borderBottomWidth: g.sizes.borderWidth
            }
          },
          IconsContainer: {
            style: () => ({
              paddingRight: g.spacing.sm
            })
          },
          ValueContainer: {
            style: () => ({
              lineHeight: g.lineHeights.inputWidget,
              // Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
              paddingRight: g.spacing.sm,
              paddingLeft: g.spacing.md,
              paddingBottom: g.spacing.sm,
              paddingTop: g.spacing.sm
            })
          },
          SingleValue: {
            style: {
              fontWeight: g.fontWeights.normal
            },
            props: {
              "data-testid": "stTimeInputTimeDisplay"
            }
          },
          Dropdown: {
            style: () => ({
              paddingTop: g.spacing.none,
              paddingBottom: g.spacing.none,
              // Somehow this adds an additional shadow, even though we already have
              // one on the popover, so we need to remove it here.
              boxShadow: "none",
              maxHeight: g.sizes.maxDropdownHeight
            })
          },
          DropdownListItem: {
            component: Ue
          },
          // Nudge the dropdown menu by 1px so the focus state doesn't get cut off
          Popover: {
            props: {
              ignoreBoundary: b,
              overrides: {
                Body: {
                  style: () => ({
                    marginTop: g.spacing.px
                  })
                }
              }
            }
          },
          Placeholder: {
            style: () => ({
              color: g.colors.fadedText60
            })
          },
          SelectArrow: {
            component: me,
            props: {
              overrides: {
                Svg: {
                  style: () => ({
                    width: g.iconSizes.xl,
                    height: g.iconSizes.xl
                  })
                }
              }
            }
          }
        }
      }
    }
  }, C = U.useCallback((w) => {
    const D = w === null ? null : Ke(w);
    m({
      value: D,
      fromUi: !0
    });
  }, [m]), E = U.useCallback(() => {
    C(null);
  }, [C]);
  return /* @__PURE__ */ L.jsxs("div", {
    className: "stTimeInput",
    "data-testid": "stTimeInput",
    children: [/* @__PURE__ */ L.jsx(pe, {
      label: d.label,
      disabled: f,
      labelVisibility: fe(d.labelVisibility?.value),
      children: d.help && /* @__PURE__ */ L.jsx(ge, {
        children: /* @__PURE__ */ L.jsx(be, {
          content: d.help,
          placement: ye.TOP_RIGHT
        })
      })
    }), /* @__PURE__ */ L.jsx(Be, {
      format: "24",
      step: d.step ? Number(d.step) : 900,
      value: J(v) ? void 0 : Qe(v),
      onChange: C,
      overrides: I,
      nullable: O,
      creatable: !0,
      "aria-label": d.label
    }), O && !J(v) && // The time picker doesn't have a built-in clearable functionality.
    // Therefore, we are adding the clear button here.
    /* @__PURE__ */ L.jsx(Ve, {
      onClick: E,
      "data-testid": "stTimeInputClearButton",
      children: /* @__PURE__ */ L.jsx(He.StyledClearIcon, {
        overrides: {
          Svg: {
            style: {
              color: g.colors.grayTextColor,
              // setting this width and height makes the clear-icon align with dropdown arrows of other input fields
              padding: g.spacing.threeXS,
              height: g.sizes.clearIconSize,
              width: g.sizes.clearIconSize,
              ":hover": {
                fill: g.colors.bodyText
              }
            }
          }
        },
        $isFocusVisible: !1
      })
    })]
  });
}
function Ye(f, d) {
  return f.getStringValue(d) ?? null;
}
function Ge(f) {
  return f.default ?? null;
}
function Xe(f) {
  return f.value ?? null;
}
function qe(f, d, h, y) {
  d.setStringValue(f, h.value, {
    fromUi: h.fromUi
  }, y);
}
function Ke(f) {
  const d = f.getHours().toString().padStart(2, "0"), h = f.getMinutes().toString().padStart(2, "0");
  return `${d}:${h}`;
}
function Qe(f) {
  if (f === null) return null;
  const [d, h] = f.split(":").map(Number), y = /* @__PURE__ */ new Date();
  return y.setHours(d), y.setMinutes(h), y;
}
const nt = U.memo(Je);
export {
  nt as default
};
//# sourceMappingURL=index-0Kn1AVK2-D01v8HS6.js.map
