import { j as O } from "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f775.js";
import {
  R as ee,
  r as _,
} from "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77.js";
import {
  u as Me,
  r as Le,
  U as Y,
} from "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f774.js";
import {
  m as ke,
  C as Pe,
  ah as pe,
} from "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7723.js";
import { M as de } from "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7789.js";
import {
  o as $e,
  r as ve,
  I as xe,
} from "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f777.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f773.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f772.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f779.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7710.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7720.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f778.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7763.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7764.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77152.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77156.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7735.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7747.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77146.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77153.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77107.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7736.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7737.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7738.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77154.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f7760.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f77155.js";
import "./v_7_4_3_25_2ff64573-14a6-4762-a634-9cd350f14f776.js";
function be(e, a) {
  var r = {};
  for (var n in e)
    Object.prototype.hasOwnProperty.call(e, n) &&
      a.indexOf(n) < 0 &&
      (r[n] = e[n]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var t = 0, n = Object.getOwnPropertySymbols(e); t < n.length; t++)
      a.indexOf(n[t]) < 0 &&
        Object.prototype.propertyIsEnumerable.call(e, n[t]) &&
        (r[n[t]] = e[n[t]]);
  return r;
}
var ne;
(function (e) {
  ((e.event = "event"), (e.props = "prop"));
})(ne || (ne = {}));
function q() {}
function Ke(e) {
  var a,
    r = void 0;
  return function () {
    for (var n = [], t = arguments.length; t--; ) n[t] = arguments[t];
    return (
      (a &&
        n.length === a.length &&
        n.every(function (i, l) {
          return i === a[l];
        })) ||
        ((a = n), (r = e.apply(void 0, n))),
      r
    );
  };
}
function ie(e) {
  return !!(e || "").match(/\d/);
}
function ae(e) {
  return e == null;
}
function Ue(e) {
  return typeof e == "number" && isNaN(e);
}
function we(e) {
  return ae(e) || Ue(e) || (typeof e == "number" && !isFinite(e));
}
function De(e) {
  return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
}
function We(e) {
  switch (e) {
    case "lakh":
      return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
    case "wan":
      return /(\d)(?=(\d{4})+(?!\d))/g;
    default:
      return /(\d)(?=(\d{3})+(?!\d))/g;
  }
}
function Ge(e, a, r) {
  var n = We(r),
    t = e.search(/[1-9]/);
  return (
    (t = t === -1 ? e.length : t),
    e.substring(0, t) + e.substring(t, e.length).replace(n, "$1" + a)
  );
}
function ze(e) {
  var a = _.useRef(e);
  a.current = e;
  var r = _.useRef(function () {
    for (var n = [], t = arguments.length; t--; ) n[t] = arguments[t];
    return a.current.apply(a, n);
  });
  return r.current;
}
function ge(e, a) {
  a === void 0 && (a = !0);
  var r = e[0] === "-",
    n = r && a;
  e = e.replace("-", "");
  var t = e.split("."),
    i = t[0],
    l = t[1] || "";
  return { beforeDecimal: i, afterDecimal: l, hasNegation: r, addNegation: n };
}
function Ze(e) {
  if (!e) return e;
  var a = e[0] === "-";
  a && (e = e.substring(1, e.length));
  var r = e.split("."),
    n = r[0].replace(/^0+/, "") || "0",
    t = r[1] || "";
  return (a ? "-" : "") + n + (t ? "." + t : "");
}
function Ce(e, a, r) {
  for (var n = "", t = r ? "0" : "", i = 0; i <= a - 1; i++) n += e[i] || t;
  return n;
}
function Se(e, a) {
  return Array(a + 1).join(e);
}
function Ie(e) {
  var a = e + "",
    r = a[0] === "-" ? "-" : "";
  r && (a = a.substring(1));
  var n = a.split(/[eE]/g),
    t = n[0],
    i = n[1];
  if (((i = Number(i)), !i)) return r + t;
  t = t.replace(".", "");
  var l = 1 + i,
    c = t.length;
  return (
    l < 0
      ? (t = "0." + Se("0", Math.abs(l)) + t)
      : l >= c
        ? (t = t + Se("0", l - c))
        : (t = (t.substring(0, l) || "0") + "." + t.substring(l)),
    r + t
  );
}
function Ve(e, a, r) {
  if (["", "-"].indexOf(e) !== -1) return e;
  var n = (e.indexOf(".") !== -1 || r) && a,
    t = ge(e),
    i = t.beforeDecimal,
    l = t.afterDecimal,
    c = t.hasNegation,
    x = parseFloat("0." + (l || "0")),
    S = l.length <= a ? "0." + l : x.toFixed(a),
    p = S.split("."),
    m = i;
  i &&
    Number(p[0]) &&
    (m = i
      .split("")
      .reverse()
      .reduce(function (y, I, g) {
        return y.length > g
          ? (Number(y[0]) + Number(I)).toString() + y.substring(1, y.length)
          : I + y;
      }, p[0]));
  var h = Ce(p[1] || "", a, r),
    V = c ? "-" : "",
    f = n ? "." : "";
  return "" + V + m + f + h;
}
function J(e, a) {
  if (((e.value = e.value), e !== null)) {
    if (e.createTextRange) {
      var r = e.createTextRange();
      return (r.move("character", a), r.select(), !0);
    }
    return e.selectionStart || e.selectionStart === 0
      ? (e.focus(), e.setSelectionRange(a, a), !0)
      : (e.focus(), !1);
  }
}
var Ee = Ke(function (e, a) {
    for (var r = 0, n = 0, t = e.length, i = a.length; e[r] === a[r] && r < t; )
      r++;
    for (; e[t - 1 - n] === a[i - 1 - n] && i - n > r && t - n > r; ) n++;
    return { from: { start: r, end: t - n }, to: { start: r, end: i - n } };
  }),
  qe = function (e, a) {
    var r = Math.min(e.selectionStart, a);
    return {
      from: { start: r, end: e.selectionEnd },
      to: { start: r, end: a },
    };
  };
function He(e, a, r) {
  return Math.min(Math.max(e, a), r);
}
function me(e) {
  return Math.max(e.selectionStart, e.selectionEnd);
}
function Je() {
  return (
    typeof navigator < "u" &&
    !(navigator.platform && /iPhone|iPod/.test(navigator.platform))
  );
}
function Qe(e) {
  return {
    from: { start: 0, end: 0 },
    to: { start: 0, end: e.length },
    lastValue: "",
  };
}
function Xe(e) {
  var a = e.currentValue,
    r = e.formattedValue,
    n = e.currentValueIndex,
    t = e.formattedValueIndex;
  return a[n] === r[t];
}
function Ye(e, a, r, n, t, i, l) {
  l === void 0 && (l = Xe);
  var c = t.findIndex(function (P) {
      return P;
    }),
    x = e.slice(0, c);
  !a && !r.startsWith(x) && ((a = x), (r = x + r), (n = n + x.length));
  for (
    var S = r.length, p = e.length, m = {}, h = new Array(S), V = 0;
    V < S;
    V++
  ) {
    h[V] = -1;
    for (var f = 0, y = p; f < y; f++) {
      var I = l({
        currentValue: r,
        lastValue: a,
        formattedValue: e,
        currentValueIndex: V,
        formattedValueIndex: f,
      });
      if (I && m[f] !== !0) {
        ((h[V] = f), (m[f] = !0));
        break;
      }
    }
  }
  for (var g = n; g < S && (h[g] === -1 || !i(r[g])); ) g++;
  var B = g === S || h[g] === -1 ? p : h[g];
  for (g = n - 1; g > 0 && h[g] === -1; ) g--;
  var T = g === -1 || h[g] === -1 ? 0 : h[g] + 1;
  return T > B ? B : n - T < B - n ? T : B;
}
function ye(e, a, r, n) {
  var t = e.length;
  if (((a = He(a, 0, t)), n === "left")) {
    for (; a >= 0 && !r[a]; ) a--;
    a === -1 && (a = r.indexOf(!0));
  } else {
    for (; a <= t && !r[a]; ) a++;
    a > t && (a = r.lastIndexOf(!0));
  }
  return (a === -1 && (a = t), a);
}
function ea(e) {
  for (
    var a = Array.from({ length: e.length + 1 }).map(function () {
        return !0;
      }),
      r = 0,
      n = a.length;
    r < n;
    r++
  )
    a[r] = !!(ie(e[r]) || ie(e[r - 1]));
  return a;
}
function Re(e, a, r, n, t, i) {
  i === void 0 && (i = q);
  var l = ze(function (f, y) {
      var I, g;
      return (
        we(f)
          ? ((g = ""), (I = ""))
          : typeof f == "number" || y
            ? ((g = typeof f == "number" ? Ie(f) : f), (I = n(g)))
            : ((g = t(f, void 0)), (I = n(g))),
        { formattedValue: I, numAsString: g }
      );
    }),
    c = _.useState(function () {
      return l(ae(e) ? a : e, r);
    }),
    x = c[0],
    S = c[1],
    p = function (f, y) {
      (f.formattedValue !== x.formattedValue &&
        S({ formattedValue: f.formattedValue, numAsString: f.value }),
        i(f, y));
    },
    m = e,
    h = r;
  ae(e) && ((m = x.numAsString), (h = !0));
  var V = l(m, h);
  return (
    _.useMemo(
      function () {
        S(V);
      },
      [V.formattedValue],
    ),
    [x, p]
  );
}
function aa(e) {
  return e.replace(/[^0-9]/g, "");
}
function ra(e) {
  return e;
}
function ta(e) {
  var a = e.type;
  a === void 0 && (a = "text");
  var r = e.displayType;
  r === void 0 && (r = "input");
  var n = e.customInput,
    t = e.renderText,
    i = e.getInputRef,
    l = e.format;
  l === void 0 && (l = ra);
  var c = e.removeFormatting;
  c === void 0 && (c = aa);
  var x = e.defaultValue,
    S = e.valueIsNumericString,
    p = e.onValueChange,
    m = e.isAllowed,
    h = e.onChange;
  h === void 0 && (h = q);
  var V = e.onKeyDown;
  V === void 0 && (V = q);
  var f = e.onMouseUp;
  f === void 0 && (f = q);
  var y = e.onFocus;
  y === void 0 && (y = q);
  var I = e.onBlur;
  I === void 0 && (I = q);
  var g = e.value,
    B = e.getCaretBoundary;
  B === void 0 && (B = ea);
  var T = e.isValidInputCharacter;
  T === void 0 && (T = ie);
  var P = e.isCharacterSame,
    M = be(e, [
      "type",
      "displayType",
      "customInput",
      "renderText",
      "getInputRef",
      "format",
      "removeFormatting",
      "defaultValue",
      "valueIsNumericString",
      "onValueChange",
      "isAllowed",
      "onChange",
      "onKeyDown",
      "onMouseUp",
      "onFocus",
      "onBlur",
      "value",
      "getCaretBoundary",
      "isValidInputCharacter",
      "isCharacterSame",
    ]),
    H = Re(g, x, !!S, l, c, p),
    $ = H[0],
    b = $.formattedValue,
    L = $.numAsString,
    U = H[1],
    k = _.useRef(),
    W = _.useRef({ formattedValue: b, numAsString: L }),
    G = function (o, u) {
      ((W.current = { formattedValue: o.formattedValue, numAsString: o.value }),
        U(o, u));
    },
    Q = _.useState(!1),
    re = Q[0],
    v = Q[1],
    s = _.useRef(null),
    w = _.useRef({ setCaretTimeout: null, focusTimeout: null });
  _.useEffect(function () {
    return (
      v(!0),
      function () {
        (clearTimeout(w.current.setCaretTimeout),
          clearTimeout(w.current.focusTimeout));
      }
    );
  }, []);
  var R = l,
    j = function (o, u) {
      var d = parseFloat(u);
      return { formattedValue: o, value: u, floatValue: isNaN(d) ? void 0 : d };
    },
    E = function (o, u, d) {
      (o.selectionStart === 0 && o.selectionEnd === o.value.length) ||
        (J(o, u),
        (w.current.setCaretTimeout = setTimeout(function () {
          o.value === d && o.selectionStart !== u && J(o, u);
        }, 0)));
    },
    A = function (o, u, d) {
      return ye(o, u, B(o), d);
    },
    X = function (o, u, d) {
      var D = B(u),
        F = Ye(u, b, o, d, D, T, P);
      return ((F = ye(u, F, D)), F);
    },
    le = function (o) {
      var u = o.formattedValue;
      u === void 0 && (u = "");
      var d = o.input,
        D = o.source,
        F = o.event,
        C = o.numAsString,
        N;
      if (d) {
        var K = o.inputValue || d.value,
          z = me(d);
        ((d.value = u), (N = X(K, u, z)), N !== void 0 && E(d, N, u));
      }
      u !== b && G(j(u, C), { event: F, source: D });
    };
  _.useEffect(
    function () {
      var o = W.current,
        u = o.formattedValue,
        d = o.numAsString;
      (b !== u || L !== d) && G(j(b, L), { event: void 0, source: ne.props });
    },
    [b, L],
  );
  var te = s.current ? me(s.current) : void 0,
    oe = typeof window < "u" ? _.useLayoutEffect : _.useEffect;
  oe(
    function () {
      var o = s.current;
      if (b !== W.current.formattedValue && o) {
        var u = X(W.current.formattedValue, b, te);
        ((o.value = b), E(o, u, b));
      }
    },
    [b],
  );
  var fe = function (o, u, d) {
      var D = u.target,
        F = k.current ? qe(k.current, D.selectionEnd) : Ee(b, o),
        C = Object.assign(Object.assign({}, F), { lastValue: b }),
        N = c(o, C),
        K = R(N);
      if (((N = c(K, void 0)), m && !m(j(K, N)))) {
        var z = u.target,
          Z = me(z),
          ce = X(o, b, Z);
        return ((z.value = b), E(z, ce, b), !1);
      }
      return (
        le({
          formattedValue: K,
          numAsString: N,
          inputValue: o,
          event: u,
          source: d,
          input: u.target,
        }),
        !0
      );
    },
    se = function (o, u) {
      u === void 0 && (u = 0);
      var d = o.selectionStart,
        D = o.selectionEnd;
      k.current = { selectionStart: d, selectionEnd: D + u };
    },
    je = function (o) {
      var u = o.target,
        d = u.value,
        D = fe(d, o, ne.event);
      (D && h(o), (k.current = void 0));
    },
    Ae = function (o) {
      var u = o.target,
        d = o.key,
        D = u.selectionStart,
        F = u.selectionEnd,
        C = u.value;
      C === void 0 && (C = "");
      var N;
      d === "ArrowLeft" || d === "Backspace"
        ? (N = Math.max(D - 1, 0))
        : d === "ArrowRight"
          ? (N = Math.min(D + 1, C.length))
          : d === "Delete" && (N = D);
      var K = 0;
      d === "Delete" && D === F && (K = 1);
      var z = d === "ArrowLeft" || d === "ArrowRight";
      if (N === void 0 || (D !== F && !z)) {
        (V(o), se(u, K));
        return;
      }
      var Z = N;
      if (z) {
        var ce = d === "ArrowLeft" ? "left" : "right";
        ((Z = A(C, N, ce)), Z !== N && o.preventDefault());
      } else
        d === "Delete" && !T(C[N])
          ? (Z = A(C, N, "right"))
          : d === "Backspace" && !T(C[N]) && (Z = A(C, N, "left"));
      (Z !== N && E(u, Z, C), V(o), se(u, K));
    },
    Oe = function (o) {
      var u = o.target,
        d = function () {
          var D = u.selectionStart,
            F = u.selectionEnd,
            C = u.value;
          if ((C === void 0 && (C = ""), D === F)) {
            var N = A(C, D);
            N !== D && E(u, N, C);
          }
        };
      (d(),
        requestAnimationFrame(function () {
          d();
        }),
        f(o),
        se(u));
    },
    Be = function (o) {
      o.persist && o.persist();
      var u = o.target,
        d = o.currentTarget;
      ((s.current = u),
        (w.current.focusTimeout = setTimeout(function () {
          var D = u.selectionStart,
            F = u.selectionEnd,
            C = u.value;
          C === void 0 && (C = "");
          var N = A(C, D);
          (N !== D && !(D === 0 && F === C.length) && E(u, N, C),
            y(Object.assign(Object.assign({}, o), { currentTarget: d })));
        }, 0)));
    },
    Te = function (o) {
      ((s.current = null),
        clearTimeout(w.current.focusTimeout),
        clearTimeout(w.current.setCaretTimeout),
        I(o));
    },
    Fe = re && Je() ? "numeric" : void 0,
    he = Object.assign({ inputMode: Fe }, M, {
      type: a,
      value: b,
      onChange: je,
      onKeyDown: Ae,
      onMouseUp: Oe,
      onFocus: Be,
      onBlur: Te,
    });
  if (r === "text")
    return t
      ? ee.createElement(ee.Fragment, null, t(b, M) || null)
      : ee.createElement("span", Object.assign({}, M, { ref: i }), b);
  if (n) {
    var _e = n;
    return ee.createElement(_e, Object.assign({}, he, { ref: i }));
  }
  return ee.createElement("input", Object.assign({}, he, { ref: i }));
}
function Ne(e, a) {
  var r = a.decimalScale,
    n = a.fixedDecimalScale,
    t = a.prefix;
  t === void 0 && (t = "");
  var i = a.suffix;
  i === void 0 && (i = "");
  var l = a.allowNegative,
    c = a.thousandsGroupStyle;
  if ((c === void 0 && (c = "thousand"), e === "" || e === "-")) return e;
  var x = ue(a),
    S = x.thousandSeparator,
    p = x.decimalSeparator,
    m = (r !== 0 && e.indexOf(".") !== -1) || (r && n),
    h = ge(e, l),
    V = h.beforeDecimal,
    f = h.afterDecimal,
    y = h.addNegation;
  return (
    r !== void 0 && (f = Ce(f, r, !!n)),
    S && (V = Ge(V, S, c)),
    t && (V = t + V),
    i && (f = f + i),
    y && (V = "-" + V),
    (e = V + ((m && p) || "") + f),
    e
  );
}
function ue(e) {
  var a = e.decimalSeparator;
  a === void 0 && (a = ".");
  var r = e.thousandSeparator,
    n = e.allowedDecimalSeparators;
  return (
    r === !0 && (r = ","),
    n || (n = [a, "."]),
    { decimalSeparator: a, thousandSeparator: r, allowedDecimalSeparators: n }
  );
}
function na(e, a) {
  e === void 0 && (e = "");
  var r = new RegExp("(-)"),
    n = new RegExp("(-)(.)*(-)"),
    t = r.test(e),
    i = n.test(e);
  return ((e = e.replace(/-/g, "")), t && !i && a && (e = "-" + e), e);
}
function ia(e, a) {
  return new RegExp("(^-)|[0-9]|" + De(e), "g");
}
function oa(e, a, r) {
  return e === ""
    ? !0
    : !a?.match(/\d/) &&
        !r?.match(/\d/) &&
        typeof e == "string" &&
        !isNaN(Number(e));
}
function ua(e, a, r) {
  var n;
  a === void 0 && (a = Qe(e));
  var t = r.allowNegative,
    i = r.prefix;
  i === void 0 && (i = "");
  var l = r.suffix;
  l === void 0 && (l = "");
  var c = r.decimalScale,
    x = a.from,
    S = a.to,
    p = S.start,
    m = S.end,
    h = ue(r),
    V = h.allowedDecimalSeparators,
    f = h.decimalSeparator,
    y = e[m] === f;
  if (ie(e) && (e === i || e === l) && a.lastValue === "") return e;
  if (m - p === 1 && V.indexOf(e[p]) !== -1) {
    var I = c === 0 ? "" : f;
    e = e.substring(0, p) + I + e.substring(p + 1, e.length);
  }
  var g = function (s, w, R) {
      var j = !1,
        E = !1;
      i.startsWith("-")
        ? (j = !1)
        : s.startsWith("--")
          ? ((j = !1), (E = !0))
          : l.startsWith("-") && s.length === l.length
            ? (j = !1)
            : s[0] === "-" && (j = !0);
      var A = j ? 1 : 0;
      return (
        E && (A = 2),
        A && ((s = s.substring(A)), (w -= A), (R -= A)),
        { value: s, start: w, end: R, hasNegation: j }
      );
    },
    B = g(e, p, m),
    T = B.hasNegation;
  ((n = B), (e = n.value), (p = n.start), (m = n.end));
  var P = g(a.lastValue, x.start, x.end),
    M = P.start,
    H = P.end,
    $ = P.value,
    b = e.substring(p, m);
  e.length &&
    $.length &&
    (M > $.length - l.length || H < i.length) &&
    !(b && l.startsWith(b)) &&
    (e = $);
  var L = 0;
  (e.startsWith(i) ? (L += i.length) : p < i.length && (L = p),
    (e = e.substring(L)),
    (m -= L));
  var U = e.length,
    k = e.length - l.length;
  (e.endsWith(l) ? (U = k) : (m > k || m > e.length - l.length) && (U = m),
    (e = e.substring(0, U)),
    (e = na(T ? "-" + e : e, t)),
    (e = (e.match(ia(f)) || []).join("")));
  var W = e.indexOf(f);
  e = e.replace(new RegExp(De(f), "g"), function (s, w) {
    return w === W ? "." : "";
  });
  var G = ge(e, t),
    Q = G.beforeDecimal,
    re = G.afterDecimal,
    v = G.addNegation;
  return (
    S.end - S.start < x.end - x.start &&
      Q === "" &&
      y &&
      !parseFloat(re) &&
      (e = v ? "-" : ""),
    e
  );
}
function la(e, a) {
  var r = a.prefix;
  r === void 0 && (r = "");
  var n = a.suffix;
  n === void 0 && (n = "");
  var t = Array.from({ length: e.length + 1 }).map(function () {
      return !0;
    }),
    i = e[0] === "-";
  t.fill(!1, 0, r.length + (i ? 1 : 0));
  var l = e.length;
  return (t.fill(!1, l - n.length + 1, l + 1), t);
}
function fa(e) {
  var a = ue(e),
    r = a.thousandSeparator,
    n = a.decimalSeparator,
    t = e.prefix;
  t === void 0 && (t = "");
  var i = e.allowNegative;
  if ((i === void 0 && (i = !0), r === n))
    throw new Error(
      `
        Decimal separator can't be same as thousand separator.
        thousandSeparator: ` +
        r +
        ` (thousandSeparator = {true} is same as thousandSeparator = ",")
        decimalSeparator: ` +
        n +
        ` (default value for decimalSeparator is .)
     `,
    );
  return (
    t.startsWith("-") &&
      i &&
      (console.error(
        `
      Prefix can't start with '-' when allowNegative is true.
      prefix: ` +
          t +
          `
      allowNegative: ` +
          i +
          `
    `,
      ),
      (i = !1)),
    Object.assign(Object.assign({}, e), { allowNegative: i })
  );
}
function sa(e) {
  ((e = fa(e)),
    e.decimalSeparator,
    e.allowedDecimalSeparators,
    e.thousandsGroupStyle);
  var a = e.suffix,
    r = e.allowNegative,
    n = e.allowLeadingZeros,
    t = e.onKeyDown;
  t === void 0 && (t = q);
  var i = e.onBlur;
  i === void 0 && (i = q);
  var l = e.thousandSeparator,
    c = e.decimalScale,
    x = e.fixedDecimalScale,
    S = e.prefix;
  S === void 0 && (S = "");
  var p = e.defaultValue,
    m = e.value,
    h = e.valueIsNumericString,
    V = e.onValueChange,
    f = be(e, [
      "decimalSeparator",
      "allowedDecimalSeparators",
      "thousandsGroupStyle",
      "suffix",
      "allowNegative",
      "allowLeadingZeros",
      "onKeyDown",
      "onBlur",
      "thousandSeparator",
      "decimalScale",
      "fixedDecimalScale",
      "prefix",
      "defaultValue",
      "value",
      "valueIsNumericString",
      "onValueChange",
    ]),
    y = ue(e),
    I = y.decimalSeparator,
    g = y.allowedDecimalSeparators,
    B = function (v) {
      return Ne(v, e);
    },
    T = function (v, s) {
      return ua(v, s, e);
    },
    P = ae(m) ? p : m,
    M = h ?? oa(P, S, a);
  ae(m)
    ? ae(p) || (M = M || typeof p == "number")
    : (M = M || typeof m == "number");
  var H = function (v) {
      return we(v)
        ? v
        : (typeof v == "number" && (v = Ie(v)),
          M && typeof c == "number" ? Ve(v, c, !!x) : v);
    },
    $ = Re(H(m), H(p), !!M, B, T, V),
    b = $[0],
    L = b.numAsString,
    U = b.formattedValue,
    k = $[1],
    W = function (v) {
      var s = v.target,
        w = v.key,
        R = s.selectionStart,
        j = s.selectionEnd,
        E = s.value;
      if (
        (E === void 0 && (E = ""),
        (w === "Backspace" || w === "Delete") && j < S.length)
      ) {
        v.preventDefault();
        return;
      }
      if (R !== j) {
        t(v);
        return;
      }
      (w === "Backspace" && E[0] === "-" && R === S.length + 1 && r && J(s, 1),
        c &&
          x &&
          (w === "Backspace" && E[R - 1] === I
            ? (J(s, R - 1), v.preventDefault())
            : w === "Delete" && E[R] === I && v.preventDefault()),
        g?.includes(w) && E[R] === I && J(s, R + 1));
      var A = l === !0 ? "," : l;
      (w === "Backspace" && E[R - 1] === A && J(s, R - 1),
        w === "Delete" && E[R] === A && J(s, R + 1),
        t(v));
    },
    G = function (v) {
      var s = L;
      if (
        (s.match(/\d/g) || (s = ""),
        n || (s = Ze(s)),
        x && c && (s = Ve(s, c, x)),
        s !== L)
      ) {
        var w = Ne(s, e);
        k(
          { formattedValue: w, value: s, floatValue: parseFloat(s) },
          { event: v, source: ne.event },
        );
      }
      i(v);
    },
    Q = function (v) {
      return v === I ? !0 : ie(v);
    },
    re = function (v) {
      var s = v.currentValue,
        w = v.lastValue,
        R = v.formattedValue,
        j = v.currentValueIndex,
        E = v.formattedValueIndex,
        A = s[j],
        X = R[E],
        le = Ee(w, s),
        te = le.to,
        oe = function (fe) {
          return T(fe).indexOf(".") + S.length;
        };
      return m === 0 && x && c && s[te.start] === I && oe(s) < j && oe(R) > E
        ? !1
        : j >= te.start && j < te.end && g && g.includes(A) && X === I
          ? !0
          : A === X;
    };
  return Object.assign(Object.assign({}, f), {
    value: U,
    valueIsNumericString: !1,
    isValidInputCharacter: Q,
    isCharacterSame: re,
    onValueChange: k,
    format: B,
    removeFormatting: T,
    getCaretBoundary: function (v) {
      return la(v, e);
    },
    onKeyDown: W,
    onBlur: G,
  });
}
function ca(e) {
  var a = sa(e);
  return ee.createElement(ta, Object.assign({}, a));
}
function Pa({ model: e, val: a }) {
  const { language: r, idioma: n } = Me(),
    { open: t } = ke(),
    { activePerfil: i, updateActivePerfil: l } = Pe(),
    [c, x] = _.useState(
      a || { id: "", descricao: "", data: "", hora: "", valor: "" },
    ),
    S = async () => {
      if ((await pe("perfilDoContato")) === !0) return;
      ((c.id = Le()),
        (c.data = `${Y.dayDate().day}/${Y.dayDate().month}/${Y.dayDate().year}`),
        (c.hora = `${Y.timeDate().hours}:${Y.timeDate().minutes}:${Y.timeDate().seconds}`));
      const f = [c, ...i.valNegocio];
      (l("valNegocio", f),
        t(O.jsx(de, {})),
        xe({ type: "Success", message: r.addedValue, position: "top-right" }));
    },
    p = async () => {
      if ((await pe("perfilDoContato")) === !0) return;
      const f = i.valNegocio.map((y) => (y.id === c.id ? c : y));
      (l("valNegocio", f),
        t(O.jsx(de, {})),
        xe({ type: "Success", message: r.editedValue, position: "top-right" }));
    },
    m = (f, y) => {
      x({ ...c, [f]: y });
    },
    h = { pt: "₹", en: "₹", es: "₹" };
  return O.jsxs("div", {
    className: "w-[600px] grid gap-4",
    children: [
      O.jsxs($e, {
        children: [e === "Edit" ? r.edit : r.create, " ", r.businessValue],
      }),
      O.jsxs("div", {
        className: "form-control w-full",
        children: [
          O.jsx("label", {
            className: "label",
            children: O.jsx("span", {
              className: "label-text",
              children: r.description,
            }),
          }),
          O.jsx("input", {
            type: "text",
            placeholder: r.valueDescription,
            className: "input input-bordered w-full input-sm",
            value: c.descricao,
            onChange: (f) => m("descricao", f.target.value),
          }),
        ],
      }),
      O.jsxs("div", {
        className: "form-control w-full",
        children: [
          O.jsx("label", {
            className: "label",
            children: O.jsx("span", {
              className: "label-text",
              children: r.businessValue,
            }),
          }),
          O.jsx(ca, {
            placeholder: h[n] + " 0.00",
            className: "input input-bordered w-full input-sm",
            value: c.valor,
            onValueChange: (f) => m("valor", f.value),
            thousandSeparator: ",",
            decimalSeparator: ".",
            prefix: h[n] + " ",
            allowNegative: !1,
            decimalScale: 2,
            fixedDecimalScale: !0,
          }),
        ],
      }),
      O.jsxs("div", {
        className: "flex justify-between pt-4 resize-none",
        children: [
          O.jsx(ve, { name: r.cancel, funcao: () => t(O.jsx(de, {})) }),
          e === "Create"
            ? O.jsx(ve, { name: r.create, funcao: S })
            : O.jsx(ve, { name: r.edit, funcao: p }),
        ],
      }),
    ],
  });
}
export { Pa as default };
