@livestore/devtools-vite 0.4.0-dev.24 → 0.4.0-dev.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import { s as Be, R as Y, r as O } from "./devtools-react-bundle-CKWwCQfK.js";
2
- const Fe = /* @__PURE__ */ Be("div")({
1
+ import { s as Te, R as X, r as T } from "./devtools-react-bundle-DdRG383z.js";
2
+ const Be = /* @__PURE__ */ Te("div")({
3
3
  name: "NumberOverlayEditorStyle",
4
4
  class: "gdg-n15fjm3e",
5
5
  propsAsIs: !1
6
6
  });
7
- function pe(e, t) {
7
+ function Se(e, t) {
8
8
  var r = {};
9
9
  for (var n in e)
10
10
  Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
@@ -13,13 +13,13 @@ function pe(e, t) {
13
13
  t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
14
14
  return r;
15
15
  }
16
- var ee;
16
+ var re;
17
17
  (function(e) {
18
18
  e.event = "event", e.props = "prop";
19
- })(ee || (ee = {}));
19
+ })(re || (re = {}));
20
20
  function q() {
21
21
  }
22
- function _e(e) {
22
+ function Fe(e) {
23
23
  var t, r = void 0;
24
24
  return function() {
25
25
  for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
@@ -31,19 +31,19 @@ function _e(e) {
31
31
  function ae(e) {
32
32
  return !!(e || "").match(/\d/);
33
33
  }
34
- function z(e) {
34
+ function Y(e) {
35
35
  return e == null;
36
36
  }
37
- function je(e) {
37
+ function _e(e) {
38
38
  return typeof e == "number" && isNaN(e);
39
39
  }
40
- function xe(e) {
41
- return z(e) || je(e) || typeof e == "number" && !isFinite(e);
40
+ function pe(e) {
41
+ return Y(e) || _e(e) || typeof e == "number" && !isFinite(e);
42
42
  }
43
- function ye(e) {
43
+ function xe(e) {
44
44
  return e.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&");
45
45
  }
46
- function Me(e) {
46
+ function je(e) {
47
47
  switch (e) {
48
48
  case "lakh":
49
49
  return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
@@ -54,19 +54,19 @@ function Me(e) {
54
54
  }
55
55
  }
56
56
  function Le(e, t, r) {
57
- var n = Me(r), a = e.search(/[1-9]/);
57
+ var n = je(r), a = e.search(/[1-9]/);
58
58
  return a = a === -1 ? e.length : a, e.substring(0, a) + e.substring(a, e.length).replace(n, "$1" + t);
59
59
  }
60
- function de(e) {
61
- var t = O.useRef(e);
60
+ function Me(e) {
61
+ var t = T.useRef(e);
62
62
  t.current = e;
63
- var r = O.useRef(function() {
63
+ var r = T.useRef(function() {
64
64
  for (var n = [], a = arguments.length; a--; ) n[a] = arguments[a];
65
65
  return t.current.apply(t, n);
66
66
  });
67
67
  return r.current;
68
68
  }
69
- function ce(e, t) {
69
+ function se(e, t) {
70
70
  t === void 0 && (t = !0);
71
71
  var r = e[0] === "-", n = r && t;
72
72
  e = e.replace("-", "");
@@ -86,35 +86,35 @@ function ke(e) {
86
86
  var r = e.split("."), n = r[0].replace(/^0+/, "") || "0", a = r[1] || "";
87
87
  return (t ? "-" : "") + n + (a ? "." + a : "");
88
88
  }
89
- function be(e, t, r) {
89
+ function ye(e, t, r) {
90
90
  for (var n = "", a = r ? "0" : "", i = 0; i <= t - 1; i++)
91
91
  n += e[i] || a;
92
92
  return n;
93
93
  }
94
- function ge(e, t) {
94
+ function de(e, t) {
95
95
  return Array(t + 1).join(e);
96
96
  }
97
- function Ve(e) {
97
+ function be(e) {
98
98
  var t = e + "", r = t[0] === "-" ? "-" : "";
99
99
  r && (t = t.substring(1));
100
100
  var n = t.split(/[eE]/g), a = n[0], i = n[1];
101
101
  if (i = Number(i), !i)
102
102
  return r + a;
103
103
  a = a.replace(".", "");
104
- var f = 1 + i, S = a.length;
105
- return f < 0 ? a = "0." + ge("0", Math.abs(f)) + a : f >= S ? a = a + ge("0", f - S) : a = (a.substring(0, f) || "0") + "." + a.substring(f), r + a;
104
+ var f = 1 + i, m = a.length;
105
+ return f < 0 ? a = "0." + de("0", Math.abs(f)) + a : f >= m ? a = a + de("0", f - m) : a = (a.substring(0, f) || "0") + "." + a.substring(f), r + a;
106
106
  }
107
- function me(e, t, r) {
107
+ function ge(e, t, r) {
108
108
  if (["", "-"].indexOf(e) !== -1)
109
109
  return e;
110
- var n = (e.indexOf(".") !== -1 || r) && t, a = ce(e), i = a.beforeDecimal, f = a.afterDecimal, S = a.hasNegation, m = parseFloat("0." + (f || "0")), p = f.length <= t ? "0." + f : m.toFixed(t), h = p.split("."), c = i;
110
+ var n = (e.indexOf(".") !== -1 || r) && t, a = se(e), i = a.beforeDecimal, f = a.afterDecimal, m = a.hasNegation, S = parseFloat("0." + (f || "0")), p = f.length <= t ? "0." + f : S.toFixed(t), h = p.split("."), c = i;
111
111
  i && Number(h[0]) && (c = i.split("").reverse().reduce(function(I, C, g) {
112
112
  return I.length > g ? (Number(I[0]) + Number(C)).toString() + I.substring(1, I.length) : C + I;
113
113
  }, h[0]));
114
- var x = be(h[1] || "", t, r), y = S ? "-" : "", l = n ? "." : "";
115
- return "" + y + c + l + x;
114
+ var x = ye(h[1] || "", t, r), y = m ? "-" : "", s = n ? "." : "";
115
+ return "" + y + c + s + x;
116
116
  }
117
- function J(e, t) {
117
+ function H(e, t) {
118
118
  if (e.value = e.value, e !== null) {
119
119
  if (e.createTextRange) {
120
120
  var r = e.createTextRange();
@@ -123,7 +123,7 @@ function J(e, t) {
123
123
  return e.selectionStart || e.selectionStart === 0 ? (e.focus(), e.setSelectionRange(t, t), !0) : (e.focus(), !1);
124
124
  }
125
125
  }
126
- var Ne = _e(function(e, t) {
126
+ var Ve = Fe(function(e, t) {
127
127
  for (var r = 0, n = 0, a = e.length, i = t.length; e[r] === t[r] && r < a; )
128
128
  r++;
129
129
  for (; e[a - 1 - n] === t[i - 1 - n] && i - n > r && a - n > r; )
@@ -142,7 +142,7 @@ var Ne = _e(function(e, t) {
142
142
  function Ke(e, t, r) {
143
143
  return Math.min(Math.max(e, t), r);
144
144
  }
145
- function se(e) {
145
+ function ce(e) {
146
146
  return Math.max(e.selectionStart, e.selectionEnd);
147
147
  }
148
148
  function We() {
@@ -167,22 +167,22 @@ function $e(e) {
167
167
  }
168
168
  function Ge(e, t, r, n, a, i, f) {
169
169
  f === void 0 && (f = $e);
170
- var S = a.findIndex(function(k) {
170
+ var m = a.findIndex(function(k) {
171
171
  return k;
172
- }), m = e.slice(0, S);
173
- !t && !r.startsWith(m) && (t = m, r = m + r, n = n + m.length);
172
+ }), S = e.slice(0, m);
173
+ !t && !r.startsWith(S) && (t = S, r = S + r, n = n + S.length);
174
174
  for (var p = r.length, h = e.length, c = {}, x = new Array(p), y = 0; y < p; y++) {
175
175
  x[y] = -1;
176
- for (var l = 0, I = h; l < I; l++) {
176
+ for (var s = 0, I = h; s < I; s++) {
177
177
  var C = f({
178
178
  currentValue: r,
179
179
  lastValue: t,
180
180
  formattedValue: e,
181
181
  currentValueIndex: y,
182
- formattedValueIndex: l
182
+ formattedValueIndex: s
183
183
  });
184
- if (C && c[l] !== !0) {
185
- x[y] = l, c[l] = !0;
184
+ if (C && c[s] !== !0) {
185
+ x[y] = s, c[s] = !0;
186
186
  break;
187
187
  }
188
188
  }
@@ -195,7 +195,7 @@ function Ge(e, t, r, n, a, i, f) {
195
195
  var F = g === -1 || x[g] === -1 ? 0 : x[g] + 1;
196
196
  return F > B ? B : n - F < B - n ? F : B;
197
197
  }
198
- function he(e, t, r, n) {
198
+ function me(e, t, r, n) {
199
199
  var a = e.length;
200
200
  if (t = Ke(t, 0, a), n === "left") {
201
201
  for (; t >= 0 && !r[t]; )
@@ -215,33 +215,24 @@ function Ze(e) {
215
215
  t[r] = !!(ae(e[r]) || ae(e[r - 1]));
216
216
  return t;
217
217
  }
218
- function we(e, t, r, n, a, i) {
218
+ function Ne(e, t, r, n, a, i) {
219
219
  i === void 0 && (i = q);
220
- var f = de(function(l, I) {
220
+ var f = Me(function(s, I) {
221
221
  var C, g;
222
- return xe(l) ? (g = "", C = "") : typeof l == "number" || I ? (g = typeof l == "number" ? Ve(l) : l, C = n(g)) : (g = a(l, void 0), C = n(g)), { formattedValue: C, numAsString: g };
223
- }), S = O.useState(function() {
224
- return f(z(e) ? t : e, r);
225
- }), m = S[0], p = S[1], h = de(function(l, I) {
226
- l.formattedValue !== m.formattedValue && p({
227
- formattedValue: l.formattedValue,
228
- numAsString: l.value
229
- }), i(l, I);
230
- }), c = e, x = r;
231
- z(e) && (c = m.numAsString, x = !0);
222
+ return pe(s) ? (g = "", C = "") : typeof s == "number" || I ? (g = typeof s == "number" ? be(s) : s, C = n(g)) : (g = a(s, void 0), C = n(g)), { formattedValue: C, numAsString: g };
223
+ }), m = T.useState(function() {
224
+ return f(Y(e) ? t : e, r);
225
+ }), S = m[0], p = m[1], h = function(s, I) {
226
+ s.formattedValue !== S.formattedValue && p({
227
+ formattedValue: s.formattedValue,
228
+ numAsString: s.value
229
+ }), i(s, I);
230
+ }, c = e, x = r;
231
+ Y(e) && (c = S.numAsString, x = !0);
232
232
  var y = f(c, x);
233
- return O.useMemo(function() {
233
+ return T.useMemo(function() {
234
234
  p(y);
235
- }, [y.formattedValue]), O.useEffect(function() {
236
- if (!z(t) && z(e) && m.formattedValue !== "") {
237
- var l = parseFloat(m.numAsString);
238
- h({
239
- formattedValue: m.formattedValue,
240
- value: m.numAsString,
241
- floatValue: isNaN(l) ? void 0 : l
242
- }, { event: void 0, source: ee.props });
243
- }
244
- }, []), [m, h];
235
+ }, [y.formattedValue]), [S, h];
245
236
  }
246
237
  function qe(e) {
247
238
  return e.replace(/[^0-9]/g, "");
@@ -256,14 +247,14 @@ function He(e) {
256
247
  r === void 0 && (r = "input");
257
248
  var n = e.customInput, a = e.renderText, i = e.getInputRef, f = e.format;
258
249
  f === void 0 && (f = ze);
259
- var S = e.removeFormatting;
260
- S === void 0 && (S = qe);
261
- var m = e.defaultValue, p = e.valueIsNumericString, h = e.onValueChange, c = e.isAllowed, x = e.onChange;
250
+ var m = e.removeFormatting;
251
+ m === void 0 && (m = qe);
252
+ var S = e.defaultValue, p = e.valueIsNumericString, h = e.onValueChange, c = e.isAllowed, x = e.onChange;
262
253
  x === void 0 && (x = q);
263
254
  var y = e.onKeyDown;
264
255
  y === void 0 && (y = q);
265
- var l = e.onMouseUp;
266
- l === void 0 && (l = q);
256
+ var s = e.onMouseUp;
257
+ s === void 0 && (s = q);
267
258
  var I = e.onFocus;
268
259
  I === void 0 && (I = q);
269
260
  var C = e.onBlur;
@@ -272,13 +263,13 @@ function He(e) {
272
263
  B === void 0 && (B = Ze);
273
264
  var F = e.isValidInputCharacter;
274
265
  F === void 0 && (F = ae);
275
- var k = e.isCharacterSame, j = pe(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), H = we(g, m, !!p, f, S, h), P = H[0], V = P.formattedValue, M = P.numAsString, W = H[1], L = O.useRef(), U = O.useRef({ formattedValue: V, numAsString: M }), $ = function(o, u) {
266
+ var k = e.isCharacterSame, j = Se(e, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]), z = Ne(g, S, !!p, f, m, h), P = z[0], V = P.formattedValue, L = P.numAsString, W = z[1], M = T.useRef(), U = T.useRef({ formattedValue: V, numAsString: L }), $ = function(o, u) {
276
267
  U.current = { formattedValue: o.formattedValue, numAsString: o.value }, W(o, u);
277
- }, Q = O.useState(!1), te = Q[0], d = Q[1], s = O.useRef(null), N = O.useRef({
268
+ }, J = T.useState(!1), ee = J[0], d = J[1], l = T.useRef(null), N = T.useRef({
278
269
  setCaretTimeout: null,
279
270
  focusTimeout: null
280
271
  });
281
- O.useEffect(function() {
272
+ T.useEffect(function() {
282
273
  return d(!0), function() {
283
274
  clearTimeout(N.current.setCaretTimeout), clearTimeout(N.current.focusTimeout);
284
275
  };
@@ -291,43 +282,43 @@ function He(e) {
291
282
  floatValue: isNaN(v) ? void 0 : v
292
283
  };
293
284
  }, E = function(o, u, v) {
294
- o.selectionStart === 0 && o.selectionEnd === o.value.length || (J(o, u), N.current.setCaretTimeout = setTimeout(function() {
295
- o.value === v && o.selectionStart !== u && J(o, u);
285
+ o.selectionStart === 0 && o.selectionEnd === o.value.length || (H(o, u), N.current.setCaretTimeout = setTimeout(function() {
286
+ o.value === v && o.selectionStart !== u && H(o, u);
296
287
  }, 0));
297
- }, T = function(o, u, v) {
298
- return he(o, u, B(o), v);
299
- }, X = function(o, u, v) {
288
+ }, O = function(o, u, v) {
289
+ return me(o, u, B(o), v);
290
+ }, Q = function(o, u, v) {
300
291
  var w = B(u), _ = Ge(u, V, o, v, w, F, k);
301
- return _ = he(u, _, w), _;
292
+ return _ = me(u, _, w), _;
302
293
  }, oe = function(o) {
303
294
  var u = o.formattedValue;
304
295
  u === void 0 && (u = "");
305
296
  var v = o.input, w = o.source, _ = o.event, D = o.numAsString, b;
306
297
  if (v) {
307
- var K = o.inputValue || v.value, G = se(v);
308
- v.value = u, b = X(K, u, G), b !== void 0 && E(v, b, u);
298
+ var K = o.inputValue || v.value, G = ce(v);
299
+ v.value = u, b = Q(K, u, G), b !== void 0 && E(v, b, u);
309
300
  }
310
301
  u !== V && $(A(u, D), { event: _, source: w });
311
302
  };
312
- O.useEffect(function() {
303
+ T.useEffect(function() {
313
304
  var o = U.current, u = o.formattedValue, v = o.numAsString;
314
- (V !== u || M !== v) && $(A(V, M), {
305
+ (V !== u || L !== v) && $(A(V, L), {
315
306
  event: void 0,
316
- source: ee.props
307
+ source: re.props
317
308
  });
318
- }, [V, M]);
319
- var re = s.current ? se(s.current) : void 0, ne = typeof window < "u" ? O.useLayoutEffect : O.useEffect;
309
+ }, [V, L]);
310
+ var te = l.current ? ce(l.current) : void 0, ne = typeof window < "u" ? T.useLayoutEffect : T.useEffect;
320
311
  ne(function() {
321
- var o = s.current;
312
+ var o = l.current;
322
313
  if (V !== U.current.formattedValue && o) {
323
- var u = X(U.current.formattedValue, V, re);
314
+ var u = Q(U.current.formattedValue, V, te);
324
315
  o.value = V, E(o, u, V);
325
316
  }
326
317
  }, [V]);
327
318
  var ue = function(o, u, v) {
328
- var w = u.target, _ = L.current ? Pe(L.current, w.selectionEnd) : Ne(V, o), D = Object.assign(Object.assign({}, _), { lastValue: V }), b = S(o, D), K = R(b);
329
- if (b = S(K, void 0), c && !c(A(K, b))) {
330
- var G = u.target, Z = se(G), le = X(o, V, Z);
319
+ var w = u.target, _ = M.current ? Pe(M.current, w.selectionEnd) : Ve(V, o), D = Object.assign(Object.assign({}, _), { lastValue: V }), b = m(o, D), K = R(b);
320
+ if (b = m(K, void 0), c && !c(A(K, b))) {
321
+ var G = u.target, Z = ce(G), le = Q(o, V, Z);
331
322
  return G.value = V, E(G, le, V), !1;
332
323
  }
333
324
  return oe({
@@ -341,11 +332,11 @@ function He(e) {
341
332
  }, fe = function(o, u) {
342
333
  u === void 0 && (u = 0);
343
334
  var v = o.selectionStart, w = o.selectionEnd;
344
- L.current = { selectionStart: v, selectionEnd: w + u };
335
+ M.current = { selectionStart: v, selectionEnd: w + u };
336
+ }, De = function(o) {
337
+ var u = o.target, v = u.value, w = ue(v, o, re.event);
338
+ w && x(o), M.current = void 0;
345
339
  }, Ie = function(o) {
346
- var u = o.target, v = u.value, w = ue(v, o, ee.event);
347
- w && x(o), L.current = void 0;
348
- }, Ce = function(o) {
349
340
  var u = o.target, v = o.key, w = u.selectionStart, _ = u.selectionEnd, D = u.value;
350
341
  D === void 0 && (D = "");
351
342
  var b;
@@ -360,58 +351,58 @@ function He(e) {
360
351
  var Z = b;
361
352
  if (G) {
362
353
  var le = v === "ArrowLeft" ? "left" : "right";
363
- Z = T(D, b, le), Z !== b && o.preventDefault();
364
- } else v === "Delete" && !F(D[b]) ? Z = T(D, b, "right") : v === "Backspace" && !F(D[b]) && (Z = T(D, b, "left"));
354
+ Z = O(D, b, le), Z !== b && o.preventDefault();
355
+ } else v === "Delete" && !F(D[b]) ? Z = O(D, b, "right") : v === "Backspace" && !F(D[b]) && (Z = O(D, b, "left"));
365
356
  Z !== b && E(u, Z, D), y(o), fe(u, K);
366
- }, Ee = function(o) {
357
+ }, Ce = function(o) {
367
358
  var u = o.target, v = function() {
368
359
  var w = u.selectionStart, _ = u.selectionEnd, D = u.value;
369
360
  if (D === void 0 && (D = ""), w === _) {
370
- var b = T(D, w);
361
+ var b = O(D, w);
371
362
  b !== w && E(u, b, D);
372
363
  }
373
364
  };
374
365
  v(), requestAnimationFrame(function() {
375
366
  v();
376
- }), l(o), fe(u);
377
- }, Re = function(o) {
367
+ }), s(o), fe(u);
368
+ }, Ee = function(o) {
378
369
  o.persist && o.persist();
379
370
  var u = o.target, v = o.currentTarget;
380
- s.current = u, N.current.focusTimeout = setTimeout(function() {
371
+ l.current = u, N.current.focusTimeout = setTimeout(function() {
381
372
  var w = u.selectionStart, _ = u.selectionEnd, D = u.value;
382
373
  D === void 0 && (D = "");
383
- var b = T(D, w);
374
+ var b = O(D, w);
384
375
  b !== w && !(w === 0 && _ === D.length) && E(u, b, D), I(Object.assign(Object.assign({}, o), { currentTarget: v }));
385
376
  }, 0);
386
- }, Ae = function(o) {
387
- s.current = null, clearTimeout(N.current.focusTimeout), clearTimeout(N.current.setCaretTimeout), C(o);
388
- }, Oe = te && We() ? "numeric" : void 0, ve = Object.assign({ inputMode: Oe }, j, {
377
+ }, Re = function(o) {
378
+ l.current = null, clearTimeout(N.current.focusTimeout), clearTimeout(N.current.setCaretTimeout), C(o);
379
+ }, Ae = ee && We() ? "numeric" : void 0, ve = Object.assign({ inputMode: Ae }, j, {
389
380
  type: t,
390
381
  value: V,
391
- onChange: Ie,
392
- onKeyDown: Ce,
393
- onMouseUp: Ee,
394
- onFocus: Re,
395
- onBlur: Ae
382
+ onChange: De,
383
+ onKeyDown: Ie,
384
+ onMouseUp: Ce,
385
+ onFocus: Ee,
386
+ onBlur: Re
396
387
  });
397
388
  if (r === "text")
398
- return a ? Y.createElement(Y.Fragment, null, a(V, j) || null) : Y.createElement("span", Object.assign({}, j, { ref: i }), V);
389
+ return a ? X.createElement(X.Fragment, null, a(V, j) || null) : X.createElement("span", Object.assign({}, j, { ref: i }), V);
399
390
  if (n) {
400
- var Te = n;
401
- return Y.createElement(Te, Object.assign({}, ve, { ref: i }));
391
+ var Oe = n;
392
+ return X.createElement(Oe, Object.assign({}, ve, { ref: i }));
402
393
  }
403
- return Y.createElement("input", Object.assign({}, ve, { ref: i }));
394
+ return X.createElement("input", Object.assign({}, ve, { ref: i }));
404
395
  }
405
- function Se(e, t) {
396
+ function he(e, t) {
406
397
  var r = t.decimalScale, n = t.fixedDecimalScale, a = t.prefix;
407
398
  a === void 0 && (a = "");
408
399
  var i = t.suffix;
409
400
  i === void 0 && (i = "");
410
- var f = t.allowNegative, S = t.thousandsGroupStyle;
411
- if (S === void 0 && (S = "thousand"), e === "" || e === "-")
401
+ var f = t.allowNegative, m = t.thousandsGroupStyle;
402
+ if (m === void 0 && (m = "thousand"), e === "" || e === "-")
412
403
  return e;
413
- var m = ie(t), p = m.thousandSeparator, h = m.decimalSeparator, c = r !== 0 && e.indexOf(".") !== -1 || r && n, x = ce(e, f), y = x.beforeDecimal, l = x.afterDecimal, I = x.addNegation;
414
- return r !== void 0 && (l = be(l, r, !!n)), p && (y = Le(y, p, S)), a && (y = a + y), i && (l = l + i), I && (y = "-" + y), e = y + (c && h || "") + l, e;
404
+ var S = ie(t), p = S.thousandSeparator, h = S.decimalSeparator, c = r !== 0 && e.indexOf(".") !== -1 || r && n, x = se(e, f), y = x.beforeDecimal, s = x.afterDecimal, I = x.addNegation;
405
+ return r !== void 0 && (s = ye(s, r, !!n)), p && (y = Le(y, p, m)), a && (y = a + y), i && (s = s + i), I && (y = "-" + y), e = y + (c && h || "") + s, e;
415
406
  }
416
407
  function ie(e) {
417
408
  var t = e.decimalSeparator;
@@ -429,7 +420,7 @@ function Je(e, t) {
429
420
  return e = e.replace(/-/g, ""), a && !i && t && (e = "-" + e), e;
430
421
  }
431
422
  function Qe(e, t) {
432
- return new RegExp("(^-)|[0-9]|" + ye(e), "g");
423
+ return new RegExp("(^-)|[0-9]|" + xe(e), "g");
433
424
  }
434
425
  function Xe(e, t, r) {
435
426
  return e === "" ? !0 : !t?.match(/\d/) && !r?.match(/\d/) && typeof e == "string" && !isNaN(Number(e));
@@ -441,32 +432,32 @@ function Ye(e, t, r) {
441
432
  i === void 0 && (i = "");
442
433
  var f = r.suffix;
443
434
  f === void 0 && (f = "");
444
- var S = r.decimalScale, m = t.from, p = t.to, h = p.start, c = p.end, x = ie(r), y = x.allowedDecimalSeparators, l = x.decimalSeparator, I = e[c] === l;
435
+ var m = r.decimalScale, S = t.from, p = t.to, h = p.start, c = p.end, x = ie(r), y = x.allowedDecimalSeparators, s = x.decimalSeparator, I = e[c] === s;
445
436
  if (ae(e) && (e === i || e === f) && t.lastValue === "")
446
437
  return e;
447
438
  if (c - h === 1 && y.indexOf(e[h]) !== -1) {
448
- var C = S === 0 ? "" : l;
439
+ var C = m === 0 ? "" : s;
449
440
  e = e.substring(0, h) + C + e.substring(h + 1, e.length);
450
441
  }
451
- var g = function(s, N, R) {
442
+ var g = function(l, N, R) {
452
443
  var A = !1, E = !1;
453
- i.startsWith("-") ? A = !1 : s.startsWith("--") ? (A = !1, E = !0) : f.startsWith("-") && s.length === f.length ? A = !1 : s[0] === "-" && (A = !0);
454
- var T = A ? 1 : 0;
455
- return E && (T = 2), T && (s = s.substring(T), N -= T, R -= T), { value: s, start: N, end: R, hasNegation: A };
444
+ i.startsWith("-") ? A = !1 : l.startsWith("--") ? (A = !1, E = !0) : f.startsWith("-") && l.length === f.length ? A = !1 : l[0] === "-" && (A = !0);
445
+ var O = A ? 1 : 0;
446
+ return E && (O = 2), O && (l = l.substring(O), N -= O, R -= O), { value: l, start: N, end: R, hasNegation: A };
456
447
  }, B = g(e, h, c), F = B.hasNegation;
457
448
  n = B, e = n.value, h = n.start, c = n.end;
458
- var k = g(t.lastValue, m.start, m.end), j = k.start, H = k.end, P = k.value, V = e.substring(h, c);
459
- e.length && P.length && (j > P.length - f.length || H < i.length) && !(V && f.startsWith(V)) && (e = P);
460
- var M = 0;
461
- e.startsWith(i) ? M += i.length : h < i.length && (M = h), e = e.substring(M), c -= M;
462
- var W = e.length, L = e.length - f.length;
463
- e.endsWith(f) ? W = L : (c > L || c > e.length - f.length) && (W = c), e = e.substring(0, W), e = Je(F ? "-" + e : e, a), e = (e.match(Qe(l)) || []).join("");
464
- var U = e.indexOf(l);
465
- e = e.replace(new RegExp(ye(l), "g"), function(s, N) {
449
+ var k = g(t.lastValue, S.start, S.end), j = k.start, z = k.end, P = k.value, V = e.substring(h, c);
450
+ e.length && P.length && (j > P.length - f.length || z < i.length) && !(V && f.startsWith(V)) && (e = P);
451
+ var L = 0;
452
+ e.startsWith(i) ? L += i.length : h < i.length && (L = h), e = e.substring(L), c -= L;
453
+ var W = e.length, M = e.length - f.length;
454
+ e.endsWith(f) ? W = M : (c > M || c > e.length - f.length) && (W = c), e = e.substring(0, W), e = Je(F ? "-" + e : e, a), e = (e.match(Qe(s)) || []).join("");
455
+ var U = e.indexOf(s);
456
+ e = e.replace(new RegExp(xe(s), "g"), function(l, N) {
466
457
  return N === U ? "." : "";
467
458
  });
468
- var $ = ce(e, a), Q = $.beforeDecimal, te = $.afterDecimal, d = $.addNegation;
469
- return p.end - p.start < m.end - m.start && Q === "" && I && !parseFloat(te) && (e = d ? "-" : ""), e;
459
+ var $ = se(e, a), J = $.beforeDecimal, ee = $.afterDecimal, d = $.addNegation;
460
+ return p.end - p.start < S.end - S.start && J === "" && I && !parseFloat(ee) && (e = d ? "-" : ""), e;
470
461
  }
471
462
  function et(e, t) {
472
463
  var r = t.prefix;
@@ -476,7 +467,7 @@ function et(e, t) {
476
467
  var a = Array.from({ length: e.length + 1 }).map(function() {
477
468
  return !0;
478
469
  }), i = e[0] === "-";
479
- a.fill(!1, 0, Math.min(r.length + (i ? 1 : 0), e.length));
470
+ a.fill(!1, 0, r.length + (i ? 1 : 0));
480
471
  var f = e.length;
481
472
  return a.fill(!1, f - n.length + 1, f + 1), a;
482
473
  }
@@ -502,19 +493,19 @@ function rt(e) {
502
493
  a === void 0 && (a = q);
503
494
  var i = e.onBlur;
504
495
  i === void 0 && (i = q);
505
- var f = e.thousandSeparator, S = e.decimalScale, m = e.fixedDecimalScale, p = e.prefix;
496
+ var f = e.thousandSeparator, m = e.decimalScale, S = e.fixedDecimalScale, p = e.prefix;
506
497
  p === void 0 && (p = "");
507
- var h = e.defaultValue, c = e.value, x = e.valueIsNumericString, y = e.onValueChange, l = pe(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), I = ie(e), C = I.decimalSeparator, g = I.allowedDecimalSeparators, B = function(d) {
508
- return Se(d, e);
509
- }, F = function(d, s) {
510
- return Ye(d, s, e);
511
- }, k = z(c) ? h : c, j = x ?? Xe(k, p, t);
512
- z(c) ? z(h) || (j = j || typeof h == "number") : j = j || typeof c == "number";
513
- var H = function(d) {
514
- return xe(d) ? d : (typeof d == "number" && (d = Ve(d)), j && typeof S == "number" ? me(d, S, !!m) : d);
515
- }, P = we(H(c), H(h), !!j, B, F, y), V = P[0], M = V.numAsString, W = V.formattedValue, L = P[1], U = function(d) {
516
- var s = d.target, N = d.key, R = s.selectionStart, A = s.selectionEnd, E = s.value;
517
- if (E === void 0 && (E = ""), (N === "Backspace" || N === "Delete") && A < p.length && E !== "-") {
498
+ var h = e.defaultValue, c = e.value, x = e.valueIsNumericString, y = e.onValueChange, s = Se(e, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]), I = ie(e), C = I.decimalSeparator, g = I.allowedDecimalSeparators, B = function(d) {
499
+ return he(d, e);
500
+ }, F = function(d, l) {
501
+ return Ye(d, l, e);
502
+ }, k = Y(c) ? h : c, j = x ?? Xe(k, p, t);
503
+ Y(c) ? Y(h) || (j = j || typeof h == "number") : j = j || typeof c == "number";
504
+ var z = function(d) {
505
+ return pe(d) ? d : (typeof d == "number" && (d = be(d)), j && typeof m == "number" ? ge(d, m, !!S) : d);
506
+ }, P = Ne(z(c), z(h), !!j, B, F, y), V = P[0], L = V.numAsString, W = V.formattedValue, M = P[1], U = function(d) {
507
+ var l = d.target, N = d.key, R = l.selectionStart, A = l.selectionEnd, E = l.value;
508
+ if (E === void 0 && (E = ""), (N === "Backspace" || N === "Delete") && A < p.length) {
518
509
  d.preventDefault();
519
510
  return;
520
511
  }
@@ -522,37 +513,37 @@ function rt(e) {
522
513
  a(d);
523
514
  return;
524
515
  }
525
- N === "Backspace" && E[0] === "-" && R === p.length + 1 && r && J(s, 1), S && m && (N === "Backspace" && E[R - 1] === C ? (J(s, R - 1), d.preventDefault()) : N === "Delete" && E[R] === C && d.preventDefault()), g?.includes(N) && E[R] === C && J(s, R + 1);
526
- var T = f === !0 ? "," : f;
527
- N === "Backspace" && E[R - 1] === T && J(s, R - 1), N === "Delete" && E[R] === T && J(s, R + 1), a(d);
516
+ N === "Backspace" && E[0] === "-" && R === p.length + 1 && r && H(l, 1), m && S && (N === "Backspace" && E[R - 1] === C ? (H(l, R - 1), d.preventDefault()) : N === "Delete" && E[R] === C && d.preventDefault()), g?.includes(N) && E[R] === C && H(l, R + 1);
517
+ var O = f === !0 ? "," : f;
518
+ N === "Backspace" && E[R - 1] === O && H(l, R - 1), N === "Delete" && E[R] === O && H(l, R + 1), a(d);
528
519
  }, $ = function(d) {
529
- var s = M;
530
- if (s.match(/\d/g) || (s = ""), n || (s = ke(s)), m && S && (s = me(s, S, m)), s !== M) {
531
- var N = Se(s, e);
532
- L({
520
+ var l = L;
521
+ if (l.match(/\d/g) || (l = ""), n || (l = ke(l)), S && m && (l = ge(l, m, S)), l !== L) {
522
+ var N = he(l, e);
523
+ M({
533
524
  formattedValue: N,
534
- value: s,
535
- floatValue: parseFloat(s)
525
+ value: l,
526
+ floatValue: parseFloat(l)
536
527
  }, {
537
528
  event: d,
538
- source: ee.event
529
+ source: re.event
539
530
  });
540
531
  }
541
532
  i(d);
542
- }, Q = function(d) {
533
+ }, J = function(d) {
543
534
  return d === C ? !0 : ae(d);
544
- }, te = function(d) {
545
- var s = d.currentValue, N = d.lastValue, R = d.formattedValue, A = d.currentValueIndex, E = d.formattedValueIndex, T = s[A], X = R[E], oe = Ne(N, s), re = oe.to, ne = function(ue) {
535
+ }, ee = function(d) {
536
+ var l = d.currentValue, N = d.lastValue, R = d.formattedValue, A = d.currentValueIndex, E = d.formattedValueIndex, O = l[A], Q = R[E], oe = Ve(N, l), te = oe.to, ne = function(ue) {
546
537
  return F(ue).indexOf(".") + p.length;
547
538
  };
548
- return c === 0 && m && S && s[re.start] === C && ne(s) < A && ne(R) > E ? !1 : A >= re.start && A < re.end && g && g.includes(T) && X === C ? !0 : T === X;
539
+ return c === 0 && S && m && l[te.start] === C && ne(l) < A && ne(R) > E ? !1 : A >= te.start && A < te.end && g && g.includes(O) && Q === C ? !0 : O === Q;
549
540
  };
550
- return Object.assign(Object.assign({}, l), {
541
+ return Object.assign(Object.assign({}, s), {
551
542
  value: W,
552
543
  valueIsNumericString: !1,
553
- isValidInputCharacter: Q,
554
- isCharacterSame: te,
555
- onValueChange: L,
544
+ isValidInputCharacter: J,
545
+ isCharacterSame: ee,
546
+ onValueChange: M,
556
547
  format: B,
557
548
  removeFormatting: F,
558
549
  getCaretBoundary: function(d) {
@@ -564,34 +555,34 @@ function rt(e) {
564
555
  }
565
556
  function at(e) {
566
557
  var t = rt(e);
567
- return Y.createElement(He, Object.assign({}, t));
558
+ return X.createElement(He, Object.assign({}, t));
568
559
  }
569
- function De() {
560
+ function we() {
570
561
  return Intl.NumberFormat()?.formatToParts(1.1)?.find((r) => r.type === "decimal")?.value ?? ".";
571
562
  }
572
563
  function nt() {
573
- return De() === "." ? "," : ".";
564
+ return we() === "." ? "," : ".";
574
565
  }
575
566
  const ot = (e) => {
576
- const { value: t, onChange: r, disabled: n, highlight: a, validatedSelection: i, fixedDecimals: f, allowNegative: S, thousandSeparator: m, decimalSeparator: p } = e, h = O.useRef();
577
- return O.useLayoutEffect(() => {
567
+ const { value: t, onChange: r, disabled: n, highlight: a, validatedSelection: i, fixedDecimals: f, allowNegative: m, thousandSeparator: S, decimalSeparator: p } = e, h = T.useRef();
568
+ return T.useLayoutEffect(() => {
578
569
  if (i !== void 0) {
579
570
  const c = typeof i == "number" ? [i, null] : i;
580
571
  h.current?.setSelectionRange(c[0], c[1]);
581
572
  }
582
- }, [i]), O.createElement(
583
- Fe,
573
+ }, [i]), T.createElement(
574
+ Be,
584
575
  null,
585
- O.createElement(at, {
576
+ T.createElement(at, {
586
577
  autoFocus: !0,
587
578
  getInputRef: h,
588
579
  className: "gdg-input",
589
580
  onFocus: (c) => c.target.setSelectionRange(a ? 0 : c.target.value.length, c.target.value.length),
590
581
  disabled: n === !0,
591
582
  decimalScale: f,
592
- allowNegative: S,
593
- thousandSeparator: m ?? nt(),
594
- decimalSeparator: p ?? De(),
583
+ allowNegative: m,
584
+ thousandSeparator: S ?? nt(),
585
+ decimalSeparator: p ?? we(),
595
586
  value: Object.is(t, -0) ? "-" : t ?? "",
596
587
  // decimalScale={3}
597
588
  // prefix={"$"}