@odynn/awayz-core 0.6.2 → 0.6.4

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.
Files changed (42) hide show
  1. package/dist/{AccountService-CoynF2Xc.js → AccountService-DSlN1q1q.js} +1 -1
  2. package/dist/{TripsService-41qvbwrn.js → TripsService-CeG6Pctf.js} +1 -1
  3. package/dist/assets/_styles.css +1 -1
  4. package/dist/assets/_styles2.css +1 -1
  5. package/dist/assets/_styles3.css +1 -1
  6. package/dist/assets/_styles4.css +1 -1
  7. package/dist/assets/_styles5.css +1 -1
  8. package/dist/components/Bookings/FlightBooking/FlightBooking.js +6 -6
  9. package/dist/components/Bookings/HotelBooking/HotelBooking.js +1 -1
  10. package/dist/components/CashValue/CashValue.js +118 -119
  11. package/dist/components/CashValue/CashValue.stories.js +10 -10
  12. package/dist/components/Menu/Menu.js +1 -1
  13. package/dist/components/Wallet/Card/Card.js +1 -1
  14. package/dist/components/Wallet/Card/Card.stories.js +7 -7
  15. package/dist/configs/index.js +6 -0
  16. package/dist/hooks/index.js +12 -0
  17. package/dist/hooks/useAwayzAuth/useAwayzAuth.js +10 -10
  18. package/dist/hooks/useBookingManagement/useBookingManagement.js +5 -5
  19. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +13 -13
  20. package/dist/hooks/useSearchLimit.js +1 -1
  21. package/dist/hooks/useTripManagement/useTripManagement.js +5 -5
  22. package/dist/hooks/useTripManagement/useTripManagement.test.js +8 -8
  23. package/dist/hooks/useWallet/useWallet.js +5 -5
  24. package/dist/hooks/useWallet/useWallet.test.js +7 -7
  25. package/dist/{keys-DcSEucOc.js → keys-D66VvSIm.js} +2 -2
  26. package/dist/lib/configs/index.d.ts +3 -0
  27. package/dist/lib/hooks/index.d.ts +6 -0
  28. package/dist/lib/main.d.ts +4 -8
  29. package/dist/main.js +45 -44
  30. package/dist/providers/AwayzProvider.js +4 -4
  31. package/dist/services/account/AccountService.js +2 -2
  32. package/dist/services/bookings/BookingService.js +2 -2
  33. package/dist/services/currency/CurrencyService.js +5 -5
  34. package/dist/services/index.js +1 -1
  35. package/dist/services/instance.js +2 -2
  36. package/dist/services/instanceConfig.js +2 -2
  37. package/dist/services/noRetryInstance.js +1 -1
  38. package/dist/services/preferences/PreferencesService.js +1 -1
  39. package/dist/services/rewards/RewardsService.js +1 -1
  40. package/dist/services/trips/TripsService.js +2 -2
  41. package/dist/services/wallet/WalletService.js +1 -1
  42. package/package.json +1 -1
@@ -5,46 +5,24 @@ import { u as D, a as ot, c as A, b as q, d as ve, e as st, f as it, g as G, o a
5
5
  import { r as yt, R as gt } from "../../index-Cv-wvFlM.js";
6
6
  import { useQuery as Ct } from "@tanstack/react-query";
7
7
  import "../../arrayExtensions-DlcBOj5a.js";
8
- import { E as wt } from "../../AccountService-CoynF2Xc.js";
8
+ import { E as wt } from "../../AccountService-DSlN1q1q.js";
9
9
  import { b as de } from "../../index-CDh8vAM_.js";
10
- import "../../context/AwayzContext.js";
11
- import "../../configs/awayzClient.js";
12
- import { useAwayzContext as Et } from "../../hooks/useAwayzContext.js";
13
- import "../../services/noRetryInstance.js";
14
- import { CurrencyService as Pt } from "../../services/currency/CurrencyService.js";
15
- import { EInvalidAmountDisplayOption as O, EToolTipPosition as bt } from "./CashValueTypes.js";
16
- import '../../assets/_styles.css';import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';/* empty css */
10
+ import { EInvalidAmountDisplayOption as O, EToolTipPosition as Et } from "./CashValueTypes.js";
11
+ import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
17
12
  import "react-i18next";
18
13
  /* empty css */
19
14
  /* empty css */
20
15
  /* empty css */
16
+ import "../../configs/awayzClient.js";
17
+ import { useAwayzContext as Pt } from "../../hooks/useAwayzContext.js";
18
+ import "../../context/AwayzContext.js";
19
+ import "../../services/noRetryInstance.js";
20
+ import { CurrencyService as bt } from "../../services/currency/CurrencyService.js";
21
21
  /* empty css */
22
- const pe = (e, t) => {
23
- var r = new Intl.NumberFormat("en-US", {
24
- style: "currency",
25
- currency: t ?? "USD"
26
- });
27
- if (!e) return r.format(0);
28
- const n = parseFloat(e.toString());
29
- return r.format(n);
30
- }, xt = (e, t) => {
31
- var r = new Intl.NumberFormat("en-US", {
32
- style: "currency",
33
- currency: t ?? "USD"
34
- });
35
- return r.format(Math.round(e)).toString().split(".")[0];
36
- }, j = (e, t, r = 0) => {
37
- const n = parseFloat((e == null ? void 0 : e.toString()) || "0");
38
- return new Intl.NumberFormat("en-US", {
39
- style: "currency",
40
- currency: t ?? "USD",
41
- maximumFractionDigits: r
42
- }).format(isNaN(n) ? 0 : n);
43
- };
44
22
  // @__NO_SIDE_EFFECTS__
45
- function Tt(e) {
46
- const t = /* @__PURE__ */ At(e), r = s.forwardRef((n, o) => {
47
- const { children: i, ...c } = n, l = s.Children.toArray(i), a = l.find(St);
23
+ function xt(e) {
24
+ const t = /* @__PURE__ */ Tt(e), r = s.forwardRef((n, o) => {
25
+ const { children: i, ...c } = n, l = s.Children.toArray(i), a = l.find(Rt);
48
26
  if (a) {
49
27
  const d = a.props.children, p = l.map((h) => h === a ? s.Children.count(d) > 1 ? s.Children.only(null) : s.isValidElement(d) ? d.props.children : null : h);
50
28
  return /* @__PURE__ */ u(t, { ...c, ref: o, children: s.isValidElement(d) ? s.cloneElement(d, void 0, p) : null });
@@ -54,11 +32,11 @@ function Tt(e) {
54
32
  return r.displayName = `${e}.Slot`, r;
55
33
  }
56
34
  // @__NO_SIDE_EFFECTS__
57
- function At(e) {
35
+ function Tt(e) {
58
36
  const t = s.forwardRef((r, n) => {
59
- const { children: o, ...i } = r, c = s.isValidElement(o) ? Ot(o) : void 0, l = D(c, n);
37
+ const { children: o, ...i } = r, c = s.isValidElement(o) ? Nt(o) : void 0, l = D(c, n);
60
38
  if (s.isValidElement(o)) {
61
- const a = Nt(i, o.props);
39
+ const a = St(i, o.props);
62
40
  return o.type !== s.Fragment && (a.ref = l), s.cloneElement(o, a);
63
41
  }
64
42
  return s.Children.count(o) > 1 ? s.Children.only(null) : null;
@@ -67,14 +45,14 @@ function At(e) {
67
45
  }
68
46
  var ye = Symbol("radix.slottable");
69
47
  // @__NO_SIDE_EFFECTS__
70
- function Rt(e) {
48
+ function At(e) {
71
49
  const t = ({ children: r }) => /* @__PURE__ */ u(rt, { children: r });
72
50
  return t.displayName = `${e}.Slottable`, t.__radixId = ye, t;
73
51
  }
74
- function St(e) {
52
+ function Rt(e) {
75
53
  return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ye;
76
54
  }
77
- function Nt(e, t) {
55
+ function St(e, t) {
78
56
  const r = { ...t };
79
57
  for (const n in t) {
80
58
  const o = e[n], i = t[n];
@@ -85,12 +63,12 @@ function Nt(e, t) {
85
63
  }
86
64
  return { ...e, ...r };
87
65
  }
88
- function Ot(e) {
66
+ function Nt(e) {
89
67
  var n, o;
90
68
  let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning;
91
69
  return r ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
92
70
  }
93
- var Dt = [
71
+ var Ot = [
94
72
  "a",
95
73
  "button",
96
74
  "div",
@@ -108,17 +86,17 @@ var Dt = [
108
86
  "span",
109
87
  "svg",
110
88
  "ul"
111
- ], S = Dt.reduce((e, t) => {
112
- const r = /* @__PURE__ */ Tt(`Primitive.${t}`), n = s.forwardRef((o, i) => {
89
+ ], S = Ot.reduce((e, t) => {
90
+ const r = /* @__PURE__ */ xt(`Primitive.${t}`), n = s.forwardRef((o, i) => {
113
91
  const { asChild: c, ...l } = o, a = c ? r : t;
114
92
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(a, { ...l, ref: i });
115
93
  });
116
94
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
117
95
  }, {});
118
- function _t(e, t) {
96
+ function Dt(e, t) {
119
97
  e && yt.flushSync(() => e.dispatchEvent(t));
120
98
  }
121
- var Lt = "DismissableLayer", z = "dismissableLayer.update", It = "dismissableLayer.pointerDownOutside", Mt = "dismissableLayer.focusOutside", fe, ge = s.createContext({
99
+ var _t = "DismissableLayer", z = "dismissableLayer.update", Lt = "dismissableLayer.pointerDownOutside", It = "dismissableLayer.focusOutside", pe, ge = s.createContext({
122
100
  layers: /* @__PURE__ */ new Set(),
123
101
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
124
102
  branches: /* @__PURE__ */ new Set()
@@ -132,10 +110,10 @@ var Lt = "DismissableLayer", z = "dismissableLayer.update", It = "dismissableLay
132
110
  onInteractOutside: c,
133
111
  onDismiss: l,
134
112
  ...a
135
- } = e, d = s.useContext(ge), [p, h] = s.useState(null), f = (p == null ? void 0 : p.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = s.useState({}), y = D(t, (g) => h(g)), m = Array.from(d.layers), [C] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), E = m.indexOf(C), w = p ? m.indexOf(p) : -1, x = d.layersWithOutsidePointerEventsDisabled.size > 0, P = w >= E, T = kt((g) => {
113
+ } = e, d = s.useContext(ge), [p, h] = s.useState(null), f = (p == null ? void 0 : p.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = s.useState({}), y = D(t, (g) => h(g)), m = Array.from(d.layers), [C] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), E = m.indexOf(C), w = p ? m.indexOf(p) : -1, x = d.layersWithOutsidePointerEventsDisabled.size > 0, P = w >= E, T = Ft((g) => {
136
114
  const N = g.target, k = [...d.branches].some((I) => I.contains(N));
137
115
  !P || k || (o == null || o(g), c == null || c(g), g.defaultPrevented || l == null || l());
138
- }, f), b = $t((g) => {
116
+ }, f), b = kt((g) => {
139
117
  const N = g.target;
140
118
  [...d.branches].some((I) => I.contains(N)) || (i == null || i(g), c == null || c(g), g.defaultPrevented || l == null || l());
141
119
  }, f);
@@ -143,11 +121,11 @@ var Lt = "DismissableLayer", z = "dismissableLayer.update", It = "dismissableLay
143
121
  w === d.layers.size - 1 && (n == null || n(g), !g.defaultPrevented && l && (g.preventDefault(), l()));
144
122
  }, f), s.useEffect(() => {
145
123
  if (p)
146
- return r && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (fe = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(p)), d.layers.add(p), he(), () => {
147
- r && d.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = fe);
124
+ return r && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (pe = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(p)), d.layers.add(p), fe(), () => {
125
+ r && d.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = pe);
148
126
  };
149
127
  }, [p, f, r, d]), s.useEffect(() => () => {
150
- p && (d.layers.delete(p), d.layersWithOutsidePointerEventsDisabled.delete(p), he());
128
+ p && (d.layers.delete(p), d.layersWithOutsidePointerEventsDisabled.delete(p), fe());
151
129
  }, [p, d]), s.useEffect(() => {
152
130
  const g = () => v({});
153
131
  return document.addEventListener(z, g), () => document.removeEventListener(z, g);
@@ -170,8 +148,8 @@ var Lt = "DismissableLayer", z = "dismissableLayer.update", It = "dismissableLay
170
148
  );
171
149
  }
172
150
  );
173
- Ce.displayName = Lt;
174
- var Ht = "DismissableLayerBranch", Ft = s.forwardRef((e, t) => {
151
+ Ce.displayName = _t;
152
+ var Mt = "DismissableLayerBranch", Ht = s.forwardRef((e, t) => {
175
153
  const r = s.useContext(ge), n = s.useRef(null), o = D(t, n);
176
154
  return s.useEffect(() => {
177
155
  const i = n.current;
@@ -181,8 +159,8 @@ var Ht = "DismissableLayerBranch", Ft = s.forwardRef((e, t) => {
181
159
  };
182
160
  }, [r.branches]), /* @__PURE__ */ u(S.div, { ...e, ref: o });
183
161
  });
184
- Ft.displayName = Ht;
185
- function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
162
+ Ht.displayName = Mt;
163
+ function Ft(e, t = globalThis == null ? void 0 : globalThis.document) {
186
164
  const r = q(e), n = s.useRef(!1), o = s.useRef(() => {
187
165
  });
188
166
  return s.useEffect(() => {
@@ -190,7 +168,7 @@ function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
190
168
  if (l.target && !n.current) {
191
169
  let a = function() {
192
170
  we(
193
- It,
171
+ Lt,
194
172
  r,
195
173
  d,
196
174
  { discrete: !0 }
@@ -212,11 +190,11 @@ function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
212
190
  onPointerDownCapture: () => n.current = !0
213
191
  };
214
192
  }
215
- function $t(e, t = globalThis == null ? void 0 : globalThis.document) {
193
+ function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
216
194
  const r = q(e), n = s.useRef(!1);
217
195
  return s.useEffect(() => {
218
196
  const o = (i) => {
219
- i.target && !n.current && we(Mt, r, { originalEvent: i }, {
197
+ i.target && !n.current && we(It, r, { originalEvent: i }, {
220
198
  discrete: !1
221
199
  });
222
200
  };
@@ -226,15 +204,15 @@ function $t(e, t = globalThis == null ? void 0 : globalThis.document) {
226
204
  onBlurCapture: () => n.current = !1
227
205
  };
228
206
  }
229
- function he() {
207
+ function fe() {
230
208
  const e = new CustomEvent(z);
231
209
  document.dispatchEvent(e);
232
210
  }
233
211
  function we(e, t, r, { discrete: n }) {
234
212
  const o = r.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: r });
235
- t && o.addEventListener(e, t, { once: !0 }), n ? _t(o, i) : o.dispatchEvent(i);
213
+ t && o.addEventListener(e, t, { once: !0 }), n ? Dt(o, i) : o.dispatchEvent(i);
236
214
  }
237
- var Wt = "Arrow", Ee = s.forwardRef((e, t) => {
215
+ var $t = "Arrow", Ee = s.forwardRef((e, t) => {
238
216
  const { children: r, width: n = 10, height: o = 5, ...i } = e;
239
217
  return /* @__PURE__ */ u(
240
218
  S.svg,
@@ -249,10 +227,10 @@ var Wt = "Arrow", Ee = s.forwardRef((e, t) => {
249
227
  }
250
228
  );
251
229
  });
252
- Ee.displayName = Wt;
253
- var Bt = Ee, K = "Popper", [Pe, be] = ve(K), [Ut, xe] = Pe(K), Te = (e) => {
230
+ Ee.displayName = $t;
231
+ var Wt = Ee, K = "Popper", [Pe, be] = ve(K), [Bt, xe] = Pe(K), Te = (e) => {
254
232
  const { __scopePopper: t, children: r } = e, [n, o] = s.useState(null);
255
- return /* @__PURE__ */ u(Ut, { scope: t, anchor: n, onAnchorChange: o, children: r });
233
+ return /* @__PURE__ */ u(Bt, { scope: t, anchor: n, onAnchorChange: o, children: r });
256
234
  };
257
235
  Te.displayName = K;
258
236
  var Ae = "PopperAnchor", Re = s.forwardRef(
@@ -264,7 +242,7 @@ var Ae = "PopperAnchor", Re = s.forwardRef(
264
242
  }
265
243
  );
266
244
  Re.displayName = Ae;
267
- var Q = "PopperContent", [Yt, Vt] = Pe(Q), Se = s.forwardRef(
245
+ var Q = "PopperContent", [Ut, Yt] = Pe(Q), Se = s.forwardRef(
268
246
  (e, t) => {
269
247
  var oe, se, ie, ae, ce, le;
270
248
  const {
@@ -284,7 +262,7 @@ var Q = "PopperContent", [Yt, Vt] = Pe(Q), Se = s.forwardRef(
284
262
  ...m
285
263
  } = e, C = xe(Q, r), [E, w] = s.useState(null), x = D(t, (M) => w(M)), [P, T] = s.useState(null), b = st(P), g = (b == null ? void 0 : b.width) ?? 0, N = (b == null ? void 0 : b.height) ?? 0, k = n + (i !== "center" ? "-" + i : ""), I = typeof p == "number" ? p : { top: 0, right: 0, bottom: 0, left: 0, ...p }, te = Array.isArray(d) ? d : [d], Ye = te.length > 0, $ = {
286
264
  padding: I,
287
- boundary: te.filter(Gt),
265
+ boundary: te.filter(jt),
288
266
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
289
267
  altBoundary: Ye
290
268
  }, { refs: Ve, floatingStyles: re, placement: je, isPositioned: W, middlewareData: _ } = it({
@@ -314,7 +292,7 @@ var Q = "PopperContent", [Yt, Vt] = Pe(Q), Se = s.forwardRef(
314
292
  }
315
293
  }),
316
294
  P && dt({ element: P, padding: l }),
317
- zt({ arrowWidth: g, arrowHeight: N }),
295
+ Gt({ arrowWidth: g, arrowHeight: N }),
318
296
  f && pt({ strategy: "referenceHidden", ...$ })
319
297
  ]
320
298
  }), [ne, Ge] = De(je), B = q(y);
@@ -349,7 +327,7 @@ var Q = "PopperContent", [Yt, Vt] = Pe(Q), Se = s.forwardRef(
349
327
  },
350
328
  dir: e.dir,
351
329
  children: /* @__PURE__ */ u(
352
- Yt,
330
+ Ut,
353
331
  {
354
332
  scope: r,
355
333
  placedSide: ne,
@@ -379,13 +357,13 @@ var Q = "PopperContent", [Yt, Vt] = Pe(Q), Se = s.forwardRef(
379
357
  }
380
358
  );
381
359
  Se.displayName = Q;
382
- var Ne = "PopperArrow", jt = {
360
+ var Ne = "PopperArrow", Vt = {
383
361
  top: "bottom",
384
362
  right: "left",
385
363
  bottom: "top",
386
364
  left: "right"
387
365
  }, Oe = s.forwardRef(function(t, r) {
388
- const { __scopePopper: n, ...o } = t, i = Vt(Ne, n), c = jt[i.placedSide];
366
+ const { __scopePopper: n, ...o } = t, i = Yt(Ne, n), c = Vt[i.placedSide];
389
367
  return (
390
368
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
391
369
  // doesn't report size as we'd expect on SVG elements.
@@ -414,7 +392,7 @@ var Ne = "PopperArrow", jt = {
414
392
  visibility: i.shouldHideArrow ? "hidden" : void 0
415
393
  },
416
394
  children: /* @__PURE__ */ u(
417
- Bt,
395
+ Wt,
418
396
  {
419
397
  ...o,
420
398
  ref: r,
@@ -430,10 +408,10 @@ var Ne = "PopperArrow", jt = {
430
408
  );
431
409
  });
432
410
  Oe.displayName = Ne;
433
- function Gt(e) {
411
+ function jt(e) {
434
412
  return e !== null;
435
413
  }
436
- var zt = (e) => ({
414
+ var Gt = (e) => ({
437
415
  name: "transformOrigin",
438
416
  options: e,
439
417
  fn(t) {
@@ -447,15 +425,15 @@ function De(e) {
447
425
  const [t, r = "center"] = e.split("-");
448
426
  return [t, r];
449
427
  }
450
- var Xt = Te, Zt = Re, qt = Se, Kt = Oe, Qt = "Portal", _e = s.forwardRef((e, t) => {
428
+ var zt = Te, Xt = Re, Zt = Se, qt = Oe, Kt = "Portal", _e = s.forwardRef((e, t) => {
451
429
  var l;
452
430
  const { container: r, ...n } = e, [o, i] = s.useState(!1);
453
431
  G(() => i(!0), []);
454
432
  const c = r || o && ((l = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : l.body);
455
433
  return c ? gt.createPortal(/* @__PURE__ */ u(S.div, { ...n, ref: t }), c) : null;
456
434
  });
457
- _e.displayName = Qt;
458
- var Jt = Object.freeze({
435
+ _e.displayName = Kt;
436
+ var Qt = Object.freeze({
459
437
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
460
438
  position: "absolute",
461
439
  border: 0,
@@ -467,23 +445,23 @@ var Jt = Object.freeze({
467
445
  clip: "rect(0, 0, 0, 0)",
468
446
  whiteSpace: "nowrap",
469
447
  wordWrap: "normal"
470
- }), er = "VisuallyHidden", Le = s.forwardRef(
448
+ }), Jt = "VisuallyHidden", Le = s.forwardRef(
471
449
  (e, t) => /* @__PURE__ */ u(
472
450
  S.span,
473
451
  {
474
452
  ...e,
475
453
  ref: t,
476
- style: { ...Jt, ...e.style }
454
+ style: { ...Qt, ...e.style }
477
455
  }
478
456
  )
479
457
  );
480
- Le.displayName = er;
481
- var tr = Le, [Y, jr] = ve("Tooltip", [
458
+ Le.displayName = Jt;
459
+ var er = Le, [Y, jr] = ve("Tooltip", [
482
460
  be
483
- ]), V = be(), Ie = "TooltipProvider", rr = 700, X = "tooltip.open", [nr, J] = Y(Ie), Me = (e) => {
461
+ ]), V = be(), Ie = "TooltipProvider", tr = 700, X = "tooltip.open", [rr, J] = Y(Ie), Me = (e) => {
484
462
  const {
485
463
  __scopeTooltip: t,
486
- delayDuration: r = rr,
464
+ delayDuration: r = tr,
487
465
  skipDelayDuration: n = 300,
488
466
  disableHoverableContent: o = !1,
489
467
  children: i
@@ -492,7 +470,7 @@ var tr = Le, [Y, jr] = ve("Tooltip", [
492
470
  const d = a.current;
493
471
  return () => window.clearTimeout(d);
494
472
  }, []), /* @__PURE__ */ u(
495
- nr,
473
+ rr,
496
474
  {
497
475
  scope: t,
498
476
  isOpenDelayedRef: c,
@@ -516,7 +494,7 @@ var tr = Le, [Y, jr] = ve("Tooltip", [
516
494
  );
517
495
  };
518
496
  Me.displayName = Ie;
519
- var H = "Tooltip", [or, F] = Y(H), He = (e) => {
497
+ var H = "Tooltip", [nr, F] = Y(H), He = (e) => {
520
498
  const {
521
499
  __scopeTooltip: t,
522
500
  children: r,
@@ -543,8 +521,8 @@ var H = "Tooltip", [or, F] = Y(H), He = (e) => {
543
521
  }, [m, w]);
544
522
  return s.useEffect(() => () => {
545
523
  v.current && (window.clearTimeout(v.current), v.current = 0);
546
- }, []), /* @__PURE__ */ u(Xt, { ...d, children: /* @__PURE__ */ u(
547
- or,
524
+ }, []), /* @__PURE__ */ u(zt, { ...d, children: /* @__PURE__ */ u(
525
+ nr,
548
526
  {
549
527
  scope: t,
550
528
  contentId: f,
@@ -569,7 +547,7 @@ He.displayName = H;
569
547
  var Z = "TooltipTrigger", Fe = s.forwardRef(
570
548
  (e, t) => {
571
549
  const { __scopeTooltip: r, ...n } = e, o = F(Z, r), i = J(Z, r), c = V(r), l = s.useRef(null), a = D(t, l, o.onTriggerChange), d = s.useRef(!1), p = s.useRef(!1), h = s.useCallback(() => d.current = !1, []);
572
- return s.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ u(Zt, { asChild: !0, ...c, children: /* @__PURE__ */ u(
550
+ return s.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ u(Xt, { asChild: !0, ...c, children: /* @__PURE__ */ u(
573
551
  S.button,
574
552
  {
575
553
  "aria-describedby": o.open ? o.contentId : void 0,
@@ -595,24 +573,24 @@ var Z = "TooltipTrigger", Fe = s.forwardRef(
595
573
  }
596
574
  );
597
575
  Fe.displayName = Z;
598
- var ee = "TooltipPortal", [sr, ir] = Y(ee, {
576
+ var ee = "TooltipPortal", [or, sr] = Y(ee, {
599
577
  forceMount: void 0
600
578
  }), ke = (e) => {
601
579
  const { __scopeTooltip: t, forceMount: r, children: n, container: o } = e, i = F(ee, t);
602
- return /* @__PURE__ */ u(sr, { scope: t, forceMount: r, children: /* @__PURE__ */ u(me, { present: r || i.open, children: /* @__PURE__ */ u(_e, { asChild: !0, container: o, children: n }) }) });
580
+ return /* @__PURE__ */ u(or, { scope: t, forceMount: r, children: /* @__PURE__ */ u(me, { present: r || i.open, children: /* @__PURE__ */ u(_e, { asChild: !0, container: o, children: n }) }) });
603
581
  };
604
582
  ke.displayName = ee;
605
583
  var L = "TooltipContent", $e = s.forwardRef(
606
584
  (e, t) => {
607
- const r = ir(L, e.__scopeTooltip), { forceMount: n = r.forceMount, side: o = "top", ...i } = e, c = F(L, e.__scopeTooltip);
608
- return /* @__PURE__ */ u(me, { present: n || c.open, children: c.disableHoverableContent ? /* @__PURE__ */ u(We, { side: o, ...i, ref: t }) : /* @__PURE__ */ u(ar, { side: o, ...i, ref: t }) });
585
+ const r = sr(L, e.__scopeTooltip), { forceMount: n = r.forceMount, side: o = "top", ...i } = e, c = F(L, e.__scopeTooltip);
586
+ return /* @__PURE__ */ u(me, { present: n || c.open, children: c.disableHoverableContent ? /* @__PURE__ */ u(We, { side: o, ...i, ref: t }) : /* @__PURE__ */ u(ir, { side: o, ...i, ref: t }) });
609
587
  }
610
- ), ar = s.forwardRef((e, t) => {
588
+ ), ir = s.forwardRef((e, t) => {
611
589
  const r = F(L, e.__scopeTooltip), n = J(L, e.__scopeTooltip), o = s.useRef(null), i = D(t, o), [c, l] = s.useState(null), { trigger: a, onClose: d } = r, p = o.current, { onPointerInTransitChange: h } = n, f = s.useCallback(() => {
612
590
  l(null), h(!1);
613
591
  }, [h]), v = s.useCallback(
614
592
  (y, m) => {
615
- const C = y.currentTarget, E = { x: y.clientX, y: y.clientY }, w = dr(E, C.getBoundingClientRect()), x = pr(E, w), P = fr(m.getBoundingClientRect()), T = vr([...x, ...P]);
593
+ const C = y.currentTarget, E = { x: y.clientX, y: y.clientY }, w = ur(E, C.getBoundingClientRect()), x = dr(E, w), P = pr(m.getBoundingClientRect()), T = hr([...x, ...P]);
616
594
  l(T), h(!0);
617
595
  },
618
596
  [h]
@@ -627,13 +605,13 @@ var L = "TooltipContent", $e = s.forwardRef(
627
605
  }, [a, p, v, f]), s.useEffect(() => {
628
606
  if (c) {
629
607
  const y = (m) => {
630
- const C = m.target, E = { x: m.clientX, y: m.clientY }, w = (a == null ? void 0 : a.contains(C)) || (p == null ? void 0 : p.contains(C)), x = !hr(E, c);
608
+ const C = m.target, E = { x: m.clientX, y: m.clientY }, w = (a == null ? void 0 : a.contains(C)) || (p == null ? void 0 : p.contains(C)), x = !fr(E, c);
631
609
  w ? f() : x && (f(), d());
632
610
  };
633
611
  return document.addEventListener("pointermove", y), () => document.removeEventListener("pointermove", y);
634
612
  }
635
613
  }, [a, p, c, d, f]), /* @__PURE__ */ u(We, { ...e, ref: i });
636
- }), [cr, lr] = Y(H, { isInside: !1 }), ur = /* @__PURE__ */ Rt("TooltipContent"), We = s.forwardRef(
614
+ }), [ar, cr] = Y(H, { isInside: !1 }), lr = /* @__PURE__ */ At("TooltipContent"), We = s.forwardRef(
637
615
  (e, t) => {
638
616
  const {
639
617
  __scopeTooltip: r,
@@ -661,7 +639,7 @@ var L = "TooltipContent", $e = s.forwardRef(
661
639
  onFocusOutside: (h) => h.preventDefault(),
662
640
  onDismiss: p,
663
641
  children: /* @__PURE__ */ R(
664
- qt,
642
+ Zt,
665
643
  {
666
644
  "data-state": a.stateAttribute,
667
645
  ...d,
@@ -676,8 +654,8 @@ var L = "TooltipContent", $e = s.forwardRef(
676
654
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
677
655
  },
678
656
  children: [
679
- /* @__PURE__ */ u(ur, { children: n }),
680
- /* @__PURE__ */ u(cr, { scope: r, isInside: !0, children: /* @__PURE__ */ u(tr, { id: a.contentId, role: "tooltip", children: o || n }) })
657
+ /* @__PURE__ */ u(lr, { children: n }),
658
+ /* @__PURE__ */ u(ar, { scope: r, isInside: !0, children: /* @__PURE__ */ u(er, { id: a.contentId, role: "tooltip", children: o || n }) })
681
659
  ]
682
660
  }
683
661
  )
@@ -689,14 +667,14 @@ $e.displayName = L;
689
667
  var Be = "TooltipArrow", Ue = s.forwardRef(
690
668
  (e, t) => {
691
669
  const { __scopeTooltip: r, ...n } = e, o = V(r);
692
- return lr(
670
+ return cr(
693
671
  Be,
694
672
  r
695
- ).isInside ? null : /* @__PURE__ */ u(Kt, { ...o, ...n, ref: t });
673
+ ).isInside ? null : /* @__PURE__ */ u(qt, { ...o, ...n, ref: t });
696
674
  }
697
675
  );
698
676
  Ue.displayName = Be;
699
- function dr(e, t) {
677
+ function ur(e, t) {
700
678
  const r = Math.abs(t.top - e.y), n = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
701
679
  switch (Math.min(r, n, o, i)) {
702
680
  case i:
@@ -711,7 +689,7 @@ function dr(e, t) {
711
689
  throw new Error("unreachable");
712
690
  }
713
691
  }
714
- function pr(e, t, r = 5) {
692
+ function dr(e, t, r = 5) {
715
693
  const n = [];
716
694
  switch (t) {
717
695
  case "top":
@@ -741,7 +719,7 @@ function pr(e, t, r = 5) {
741
719
  }
742
720
  return n;
743
721
  }
744
- function fr(e) {
722
+ function pr(e) {
745
723
  const { top: t, right: r, bottom: n, left: o } = e;
746
724
  return [
747
725
  { x: o, y: t },
@@ -750,7 +728,7 @@ function fr(e) {
750
728
  { x: o, y: n }
751
729
  ];
752
730
  }
753
- function hr(e, t) {
731
+ function fr(e, t) {
754
732
  const { x: r, y: n } = e;
755
733
  let o = !1;
756
734
  for (let i = 0, c = t.length - 1; i < t.length; c = i++) {
@@ -759,11 +737,11 @@ function hr(e, t) {
759
737
  }
760
738
  return o;
761
739
  }
762
- function vr(e) {
740
+ function hr(e) {
763
741
  const t = e.slice();
764
- return t.sort((r, n) => r.x < n.x ? -1 : r.x > n.x ? 1 : r.y < n.y ? -1 : r.y > n.y ? 1 : 0), mr(t);
742
+ return t.sort((r, n) => r.x < n.x ? -1 : r.x > n.x ? 1 : r.y < n.y ? -1 : r.y > n.y ? 1 : 0), vr(t);
765
743
  }
766
- function mr(e) {
744
+ function vr(e) {
767
745
  if (e.length <= 1) return e.slice();
768
746
  const t = [];
769
747
  for (let n = 0; n < e.length; n++) {
@@ -788,20 +766,41 @@ function mr(e) {
788
766
  }
789
767
  return r.pop(), t.length === 1 && r.length === 1 && t[0].x === r[0].x && t[0].y === r[0].y ? t : t.concat(r);
790
768
  }
791
- var yr = Me, gr = He, Cr = Fe, wr = ke, Er = $e, Pr = Ue;
792
- const br = 1e3 * 60 * 60, Gr = ({
769
+ var mr = Me, yr = He, gr = Fe, Cr = ke, wr = $e, Er = Ue;
770
+ const he = (e, t) => {
771
+ var r = new Intl.NumberFormat("en-US", {
772
+ style: "currency",
773
+ currency: t ?? "USD"
774
+ });
775
+ if (!e) return r.format(0);
776
+ const n = parseFloat(e.toString());
777
+ return r.format(n);
778
+ }, Pr = (e, t) => {
779
+ var r = new Intl.NumberFormat("en-US", {
780
+ style: "currency",
781
+ currency: t ?? "USD"
782
+ });
783
+ return r.format(Math.round(e)).toString().split(".")[0];
784
+ }, j = (e, t, r = 0) => {
785
+ const n = parseFloat((e == null ? void 0 : e.toString()) || "0");
786
+ return new Intl.NumberFormat("en-US", {
787
+ style: "currency",
788
+ currency: t ?? "USD",
789
+ maximumFractionDigits: r
790
+ }).format(isNaN(n) ? 0 : n);
791
+ }, br = 1e3 * 60 * 60, Gr = ({
793
792
  amount: e,
794
793
  currency: t,
795
- position: r = bt.RIGHT,
794
+ position: r = Et.RIGHT,
796
795
  zeroDisplayOption: n = O.NA,
797
796
  customDisplay: o,
798
797
  decimalPlaces: i = 0,
799
798
  showConversion: c = !0
800
799
  }) => {
801
800
  var v, y;
802
- const { user: l } = Et(), a = ((v = l == null ? void 0 : l.preferences) == null ? void 0 : v.currency) ?? ((y = l == null ? void 0 : l.userRegion) == null ? void 0 : y.currency), d = a !== t, { data: p, isPending: h } = Ct({
801
+ const { user: l } = Pt(), a = ((v = l == null ? void 0 : l.preferences) == null ? void 0 : v.currency) ?? ((y = l == null ? void 0 : l.userRegion) == null ? void 0 : y.currency), d = a !== t, { data: p, isPending: h } = Ct({
803
802
  queryKey: [wt.CONVERT_CURRENCY, t, a],
804
- queryFn: () => Pt.convertCurrency({
803
+ queryFn: () => bt.convertCurrency({
805
804
  baseCurrency: t,
806
805
  targetCurrency: a
807
806
  }),
@@ -828,9 +827,9 @@ const br = 1e3 * 60 * 60, Gr = ({
828
827
  case O.DISPLAY_AS_ZERO:
829
828
  return /* @__PURE__ */ u("span", { children: "0" });
830
829
  case O.DISPLAY_AS_ZERO_WITH_CURRENCY:
831
- return /* @__PURE__ */ u("span", { children: pe(0, a ?? t) });
830
+ return /* @__PURE__ */ u("span", { children: he(0, a ?? t) });
832
831
  case O.DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL:
833
- return /* @__PURE__ */ u("span", { children: xt(0, a ?? t) });
832
+ return /* @__PURE__ */ u("span", { children: Pr(0, a ?? t) });
834
833
  case O.CUSTOM:
835
834
  return /* @__PURE__ */ u("span", { children: f == 0 ? o : "N/A" });
836
835
  default:
@@ -874,23 +873,23 @@ const br = 1e3 * 60 * 60, Gr = ({
874
873
  ) : "N/A",
875
874
  " ",
876
875
  "≈ ",
877
- pe(1, a)
876
+ he(1, a)
878
877
  ] }) })
879
878
  ] })
880
879
  }
881
880
  )
882
881
  ] });
883
- }, xr = ({ children: e, trigger: t, position: r }) => /* @__PURE__ */ u(yr, { delayDuration: 100, children: /* @__PURE__ */ R(gr, { children: [
884
- /* @__PURE__ */ u(Cr, { asChild: !0, children: t }),
885
- /* @__PURE__ */ u(wr, { children: /* @__PURE__ */ R(
886
- Er,
882
+ }, xr = ({ children: e, trigger: t, position: r }) => /* @__PURE__ */ u(mr, { delayDuration: 100, children: /* @__PURE__ */ R(yr, { children: [
883
+ /* @__PURE__ */ u(gr, { asChild: !0, children: t }),
884
+ /* @__PURE__ */ u(Cr, { children: /* @__PURE__ */ R(
885
+ wr,
887
886
  {
888
887
  className: `tooltip-content ${r}`,
889
888
  side: r,
890
889
  align: "center",
891
890
  children: [
892
891
  e,
893
- /* @__PURE__ */ u(Pr, { className: "tooltip-arrow" })
892
+ /* @__PURE__ */ u(Er, { className: "tooltip-arrow" })
894
893
  ]
895
894
  }
896
895
  ) })
@@ -1,20 +1,20 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { CashValue as n } from "./CashValue.js";
3
- import { AwayzProvider as a } from "../../providers/AwayzProvider.js";
4
- import "react";
5
- import "../../context/AwayzContext.js";
6
- import "@tanstack/react-query";
7
- import "../../arrayExtensions-DlcBOj5a.js";
8
- import "../../AccountService-CoynF2Xc.js";
9
- import "../../configs/awayzClient.js";
10
- import { EAuthFlow as i } from "../../types/EAuthFlow.js";
11
- import "../../services/noRetryInstance.js";
12
3
  import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
13
- import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';/* empty css */
4
+ import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
5
+ import "../../arrayExtensions-DlcBOj5a.js";
6
+ import "react";
14
7
  import "react-i18next";
15
8
  /* empty css */
16
9
  /* empty css */
17
10
  /* empty css */
11
+ import "../../configs/awayzClient.js";
12
+ import "../../context/AwayzContext.js";
13
+ import "@tanstack/react-query";
14
+ import "../../AccountService-DSlN1q1q.js";
15
+ import { AwayzProvider as a } from "../../providers/AwayzProvider.js";
16
+ import "../../services/noRetryInstance.js";
17
+ import { EAuthFlow as i } from "../../types/EAuthFlow.js";
18
18
  const h = {
19
19
  title: "Core/Cash Value",
20
20
  component: n,
@@ -3,7 +3,7 @@ import * as a from "react";
3
3
  import Z, { useState as or } from "react";
4
4
  import { q as ie, d as me, u as T, a as ar, c as R, b as U, e as ir, f as cr, g as Ue, o as sr, s as ur, h as lr, i as dr, j as fr, k as pr, l as vr, m as mr, n as oe, p as Qe, P as Oe } from "../../index-BC-KTkxU.js";
5
5
  import { r as hr, R as gr } from "../../index-Cv-wvFlM.js";
6
- import '../../assets/_styles3.css';/* empty css */
6
+ import '../../assets/_styles2.css';/* empty css */
7
7
  import { c as br, d as yr } from "../../index-CDh8vAM_.js";
8
8
  // @__NO_SIDE_EFFECTS__
9
9
  function ht(e) {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import '../../../assets/_styles2.css';/* empty css */
2
+ import '../../../assets/_styles.css';/* empty css */
3
3
  import { a as l } from "../../../index-CDh8vAM_.js";
4
4
  import "../../../arrayExtensions-DlcBOj5a.js";
5
5
  import "react";