@adyen/adyen-platform-experience-web 0.1.1 → 0.1.2

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 (71) hide show
  1. package/dist/ModalContent-e2777391.js +2 -0
  2. package/dist/{ModalContent-83a84ba5.js.map → ModalContent-e2777391.js.map} +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/es/components/external/BaseElement.js +1 -1
  5. package/dist/es/components/external/TransactionDetails/components/TransactionData.js +3 -3
  6. package/dist/es/components/external/TransactionDetails/components/TransactionDataSkeleton.js +1 -1
  7. package/dist/es/components/external/Transactions/components/Balances/Balances.js +33 -34
  8. package/dist/es/components/external/Transactions/components/ModalContent.js +1 -1
  9. package/dist/es/components/external/Transactions/components/SummaryItem/SummaryItem.js +8 -8
  10. package/dist/es/components/external/Transactions/components/SummaryItem/constants.js +5 -4
  11. package/dist/es/components/external/Transactions/components/TransactionList.js +72 -69
  12. package/dist/es/components/external/Transactions/components/TransactionTotals/TransactionTotals.js +51 -45
  13. package/dist/es/components/external/Transactions/components/TransactionsOverview.js +77 -74
  14. package/dist/es/components/external/Transactions/hooks/useMaxWidths.js +9 -9
  15. package/dist/es/components/external/UIElement.js +4 -4
  16. package/dist/es/components/internal/Button/Button.js +12 -12
  17. package/dist/es/components/internal/Calendar/components/CalendarControls/CalendarControls.js +4 -4
  18. package/dist/es/components/internal/DataGrid/DataGrid.js +7 -7
  19. package/dist/es/components/internal/DataGrid/components/InteractiveBody.js +1 -1
  20. package/dist/es/components/internal/DataGrid/components/SkeletonBody.js +1 -1
  21. package/dist/es/components/internal/DataGrid/components/TableBody.js +3 -3
  22. package/dist/es/components/internal/DataGrid/components/TableCells.js +1 -1
  23. package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.js +3 -3
  24. package/dist/es/components/internal/ExpandableCard/ExpandableCard.js +7 -7
  25. package/dist/es/components/internal/FilterBar/filters/BaseFilter/BaseFilter.js +4 -4
  26. package/dist/es/components/internal/FormFields/InputBase.js +17 -17
  27. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  28. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  29. package/dist/es/components/internal/Modal/Modal.js +12 -11
  30. package/dist/es/components/internal/Popover/Popover.js +4 -4
  31. package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.js +1 -1
  32. package/dist/es/core/Auth/AuthContext.js +1 -1
  33. package/dist/es/core/Auth/AuthProvider.js +4 -4
  34. package/dist/es/core/Context/CoreContext.js +1 -1
  35. package/dist/es/core/Context/CoreProvider.js +1 -1
  36. package/dist/es/core/Localization/Localization.js +57 -56
  37. package/dist/es/core/Localization/amount/amount-util.js +14 -14
  38. package/dist/es/core/core.js +3 -3
  39. package/dist/es/external/preact/compat/dist/compat.module.js +54 -55
  40. package/dist/es/external/preact/dist/preact.module.js +309 -0
  41. package/dist/es/external/preact/hooks/dist/hooks.module.js +3 -3
  42. package/dist/es/external/preact/jsx-runtime/dist/jsxRuntime.module.js +4 -4
  43. package/dist/es/hooks/useModalDetails/useModalDetails.js +24 -18
  44. package/dist/es/index.js +13 -13
  45. package/dist/index-0c9f4def.js +12 -0
  46. package/dist/index-0c9f4def.js.map +1 -0
  47. package/dist/style.css +1 -1
  48. package/dist/types/components/external/TransactionDetails/index.d.ts +1 -1
  49. package/dist/types/components/external/TransactionDetails/index.d.ts.map +1 -1
  50. package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts +2 -2
  51. package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts.map +1 -1
  52. package/dist/types/components/external/Transactions/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  53. package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts +1 -0
  54. package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts.map +1 -1
  55. package/dist/types/components/external/Transactions/components/TransactionList.d.ts.map +1 -1
  56. package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts +2 -1
  57. package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts.map +1 -1
  58. package/dist/types/components/external/Transactions/components/TransactionsOverview.d.ts.map +1 -1
  59. package/dist/types/components/external/Transactions/hooks/useMaxWidths.d.ts.map +1 -1
  60. package/dist/types/components/external/Transactions/types.d.ts +2 -2
  61. package/dist/types/components/external/Transactions/types.d.ts.map +1 -1
  62. package/dist/types/components/internal/Modal/Modal.d.ts.map +1 -1
  63. package/dist/types/core/Localization/Localization.d.ts.map +1 -1
  64. package/dist/types/core/Localization/amount/amount-util.d.ts +1 -5
  65. package/dist/types/core/Localization/amount/amount-util.d.ts.map +1 -1
  66. package/dist/types/hooks/useModalDetails/types.d.ts +1 -1
  67. package/dist/types/hooks/useModalDetails/types.d.ts.map +1 -1
  68. package/package.json +4 -2
  69. package/dist/ModalContent-83a84ba5.js +0 -2
  70. package/dist/index-ff45d757.js +0 -12
  71. package/dist/index-ff45d757.js.map +0 -1
@@ -2,27 +2,28 @@ import { jsx as e } from "../../../external/preact/jsx-runtime/dist/jsxRuntime.m
2
2
  import s from "../Button/Button.js";
3
3
  import { ButtonVariant as _ } from "../Button/types.js";
4
4
  import g from "../../../core/Context/useCoreContext.js";
5
- import { useRef as L, useCallback as c, useEffect as C } from "../../../external/preact/hooks/dist/hooks.module.js";
5
+ import { useRef as L, useCallback as c, useEffect as k } from "../../../external/preact/hooks/dist/hooks.module.js";
6
6
  import m from "classnames";
7
7
  import "./Modal.scss.js";
8
- function k(d) {
8
+ import { Fragment as C } from "../../../external/preact/dist/preact.module.js";
9
+ function x(d) {
9
10
  return !(!d || !("nodeType" in d));
10
11
  }
11
- function M({
12
+ function A({
12
13
  title: d,
13
14
  children: i,
14
15
  classNameModifiers: u = [],
15
16
  isOpen: a,
16
17
  onClose: l,
17
18
  isDismissible: r = !0,
18
- headerWithBorder: y = !0,
19
+ headerWithBorder: h = !0,
19
20
  size: o = "fluid",
20
- ...h
21
+ ...y
21
22
  }) {
22
23
  const t = L(null), { i18n: w } = g(), v = c(
23
24
  (n) => {
24
25
  var p;
25
- r && a && k(n.target) && !((p = t == null ? void 0 : t.current) != null && p.contains(n.target)) && l();
26
+ r && a && x(n.target) && !((p = t == null ? void 0 : t.current) != null && p.contains(n.target)) && l();
26
27
  },
27
28
  [r, a, l]
28
29
  ), f = c(
@@ -31,7 +32,7 @@ function M({
31
32
  },
32
33
  [a, r, l]
33
34
  );
34
- return C(() => (a ? window.addEventListener("keydown", f) : window.removeEventListener("keydown", f), () => window.removeEventListener("keydown", f)), [a, f]), /* @__PURE__ */ e(
35
+ return k(() => (a ? window.addEventListener("keydown", f) : window.removeEventListener("keydown", f), () => window.removeEventListener("keydown", f)), [a, f]), /* @__PURE__ */ e(C, { children: a && /* @__PURE__ */ e(
35
36
  "div",
36
37
  {
37
38
  className: m(
@@ -43,7 +44,7 @@ function M({
43
44
  "aria-modal": "true",
44
45
  "aria-hidden": !open,
45
46
  onClick: v,
46
- ...h,
47
+ ...y,
47
48
  children: /* @__PURE__ */ e(
48
49
  "div",
49
50
  {
@@ -61,7 +62,7 @@ function M({
61
62
  {
62
63
  className: m("adyen-fp-modal__header", {
63
64
  "adyen-fp-modal__header--with-title": d,
64
- "adyen-fp-modal__header--with-border-bottom": y
65
+ "adyen-fp-modal__header--with-border-bottom": h
65
66
  }),
66
67
  children: [
67
68
  d && /* @__PURE__ */ e("div", { className: "adyen-fp-modal__header__title", children: d }),
@@ -91,8 +92,8 @@ function M({
91
92
  }
92
93
  )
93
94
  }
94
- );
95
+ ) });
95
96
  }
96
97
  export {
97
- M as default
98
+ A as default
98
99
  };
@@ -17,7 +17,7 @@ import { useMemo as $, useRef as O, useCallback as P, useEffect as ro } from "..
17
17
  import "./Popover.scss.js";
18
18
  import "./PopoverContainer.scss.js";
19
19
  import eo from "../../../hooks/useReflex/hooks/useReflex.js";
20
- import { Fragment as no } from "preact";
20
+ import { Fragment as no } from "../../../external/preact/dist/preact.module.js";
21
21
  const to = (u) => {
22
22
  var m;
23
23
  let s;
@@ -61,7 +61,7 @@ function Lo({
61
61
  ), A = O(E), F = O(), L = Q(
62
62
  Y([0, 15], r, m, j.BOTTOM),
63
63
  o
64
- ), V = X(s ? null : L, w), k = eo(
64
+ ), k = X(s ? null : L, w), V = eo(
65
65
  P((t) => {
66
66
  t instanceof Element && (cancelAnimationFrame(F.current), F.current = requestAnimationFrame(() => {
67
67
  if (y.current === a || !(y.current = a))
@@ -70,7 +70,7 @@ function Lo({
70
70
  c == null || c.focus();
71
71
  }));
72
72
  }, []),
73
- s ? L : V
73
+ s ? L : k
74
74
  ), B = $(
75
75
  () => ({
76
76
  [`${i}--medium`]: l === M.MEDIUM,
@@ -85,7 +85,7 @@ function Lo({
85
85
  "div",
86
86
  {
87
87
  id: "popover",
88
- ref: k,
88
+ ref: V,
89
89
  ...S,
90
90
  className: oo(`${i} ${K}`, B),
91
91
  style: { display: "none" },
@@ -4,7 +4,7 @@ import { ButtonVariant as r } from "../../Button/types.js";
4
4
  import "./PopoverDismissButton.scss.js";
5
5
  import s from "../../../../core/Context/useCoreContext.js";
6
6
  import { memo as l } from "../../../../external/preact/compat/dist/compat.module.js";
7
- import { Fragment as m } from "preact";
7
+ import { Fragment as m } from "../../../../external/preact/dist/preact.module.js";
8
8
  function a({ image: t = !0, onClick: e }) {
9
9
  const { i18n: i } = s();
10
10
  return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(
@@ -1,4 +1,4 @@
1
- import { createContext as t } from "preact";
1
+ import { createContext as t } from "../../external/preact/dist/preact.module.js";
2
2
  import { EMPTY_OBJECT as o } from "../../utils/common/constants.js";
3
3
  const r = t({
4
4
  token: "",
@@ -1,7 +1,7 @@
1
- import { jsx as d } from "../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
2
- import { AuthContext as m } from "./AuthContext.js";
3
- import { toChildArray as u } from "preact";
4
- const a = ({ token: r, endpoints: o, children: t, updateCore: e, sessionSetupError: i }) => /* @__PURE__ */ d(m.Provider, { value: { token: r, endpoints: o, updateCore: e, sessionSetupError: i }, children: u(t) }), f = a;
1
+ import { jsx as a } from "../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
2
+ import { AuthContext as d } from "./AuthContext.js";
3
+ import { toChildArray as m } from "../../external/preact/dist/preact.module.js";
4
+ const s = ({ token: r, endpoints: o, children: t, updateCore: e, sessionSetupError: i }) => /* @__PURE__ */ a(d.Provider, { value: { token: r, endpoints: o, updateCore: e, sessionSetupError: i }, children: m(t) }), f = s;
5
5
  export {
6
6
  f as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { createContext as o } from "preact";
1
+ import { createContext as o } from "../../external/preact/dist/preact.module.js";
2
2
  import t from "../Localization/Localization.js";
3
3
  const r = o({
4
4
  i18n: new t().i18n,
@@ -1,5 +1,5 @@
1
1
  import { jsx as i } from "../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
2
- import { toChildArray as f } from "preact";
2
+ import { toChildArray as f } from "../../external/preact/dist/preact.module.js";
3
3
  import { useMemo as t, useEffect as d } from "../../external/preact/hooks/dist/hooks.module.js";
4
4
  import { CoreContext as l } from "./CoreContext.js";
5
5
  import p from "../../hooks/useBooleanState/useBooleanState.js";
@@ -1,89 +1,89 @@
1
- var R = Object.defineProperty;
2
- var _ = (r, t, e) => t in r ? R(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var S = (r, t, e) => (_(r, typeof t != "symbol" ? t + "" : t, e), e), O = (r, t, e) => {
1
+ var b = Object.defineProperty;
2
+ var S = (r, t, e) => t in r ? b(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var w = (r, t, e) => (S(r, typeof t != "symbol" ? t + "" : t, e), e), z = (r, t, e) => {
4
4
  if (!t.has(r))
5
5
  throw TypeError("Cannot " + e);
6
6
  };
7
- var s = (r, t, e) => (O(r, t, "read from private field"), e ? e.call(r) : t.get(r)), a = (r, t, e) => {
7
+ var s = (r, t, e) => (z(r, t, "read from private field"), e ? e.call(r) : t.get(r)), a = (r, t, e) => {
8
8
  if (t.has(r))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  t instanceof WeakSet ? t.add(r) : t.set(r, e);
11
- }, n = (r, t, e, o) => (O(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
12
- var v = (r, t, e) => (O(r, t, "access private method"), e);
11
+ }, n = (r, t, e, o) => (z(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
12
+ var O = (r, t, e) => (z(r, t, "access private method"), e);
13
13
  import { getLocalisedAmount as $ } from "./amount/amount-util.js";
14
- import { FALLBACK_LOCALE as z, defaultTranslation as F } from "./constants/locale.js";
15
- import { DEFAULT_LOCALES as C, DEFAULT_DATETIME_FORMAT as U } from "./constants/localization.js";
14
+ import { FALLBACK_LOCALE as C, defaultTranslation as F } from "./constants/locale.js";
15
+ import { DEFAULT_LOCALES as v, DEFAULT_DATETIME_FORMAT as U } from "./constants/localization.js";
16
16
  import { createTranslationsLoader as x, getLocalizationProxyDescriptors as P } from "./localization-utils.js";
17
- import { toTwoLetterCode as E, formatCustomTranslations as W, getTranslation as M } from "./utils.js";
18
- import { struct as j, noop as k } from "../../utils/common/index.js";
19
- import B from "../../utils/watchable/index.js";
20
- import { en_US as I } from "./translations/index.js";
21
- import K from "./datetime/restamper/restamper.js";
17
+ import { toTwoLetterCode as R, formatCustomTranslations as M, getTranslation as j } from "./utils.js";
18
+ import { struct as k, noop as B } from "../../utils/common/index.js";
19
+ import I from "../../utils/watchable/index.js";
20
+ import { en_US as K } from "./translations/index.js";
21
+ import W from "./datetime/restamper/restamper.js";
22
22
  import { systemToTimezone as Z } from "./datetime/restamper/utils.js";
23
- var h, T, y, f, w, l, A, c, m, d, u, D, b;
24
- class rt {
25
- constructor(t = z, e) {
26
- a(this, D);
27
- a(this, h, z);
28
- a(this, T, E(s(this, h)));
29
- a(this, y, C);
23
+ var l, g, T, f, y, h, D, c, m, d, p, A, E;
24
+ class st {
25
+ constructor(t = C, e) {
26
+ a(this, A);
27
+ a(this, l, C);
28
+ a(this, g, R(s(this, l)));
29
+ a(this, T, v);
30
30
  a(this, f, void 0);
31
- a(this, w, F);
32
- a(this, l, x.call(this));
33
- a(this, A, Promise.resolve());
31
+ a(this, y, F);
32
+ a(this, h, x.call(this));
33
+ a(this, D, Promise.resolve());
34
34
  a(this, c, void 0);
35
35
  a(this, m, void 0);
36
- a(this, d, B({ timestamp: () => performance.now() }));
37
- a(this, u, K());
38
- S(this, "watch", s(this, d).watch.bind(void 0));
39
- S(this, "i18n", j(P.call(this)));
40
- S(this, "preferredTranslations");
41
- this.watch(k), this.preferredTranslations = e && e.reduce((o, i) => ({ ...o, ...i }), {
42
- [z]: I.en_US
36
+ a(this, d, I({ timestamp: () => performance.now() }));
37
+ a(this, p, W());
38
+ w(this, "watch", s(this, d).watch.bind(void 0));
39
+ w(this, "i18n", k(P.call(this)));
40
+ w(this, "preferredTranslations");
41
+ this.watch(B), this.preferredTranslations = e && e.reduce((o, i) => ({ ...o, ...i }), {
42
+ [C]: K.en_US
43
43
  }), this.locale = t;
44
44
  }
45
45
  get customTranslations() {
46
46
  return s(this, f) ?? {};
47
47
  }
48
48
  set customTranslations(t) {
49
- let e, o = [...C];
49
+ let e, o = [...v];
50
50
  if (t != null) {
51
- e = W(t, C);
51
+ e = M(t, v);
52
52
  const i = Object.keys(e);
53
- o = [...C, ...i].filter(
54
- (g, L, p) => p.indexOf(g) === L
53
+ o = [...v, ...i].filter(
54
+ (L, u, _) => _.indexOf(L) === u
55
55
  );
56
56
  }
57
- s(this, l).supportedLocales = o, v(this, D, b).call(this, e);
57
+ s(this, h).supportedLocales = o, O(this, A, E).call(this, e);
58
58
  }
59
59
  get languageCode() {
60
- return s(this, T);
60
+ return s(this, g);
61
61
  }
62
62
  get lastRefreshTimestamp() {
63
63
  return s(this, d).snapshot.timestamp;
64
64
  }
65
65
  get locale() {
66
- return s(this, h);
66
+ return s(this, l);
67
67
  }
68
68
  set locale(t) {
69
69
  if (t != null) {
70
- if (s(this, l).locale = t, s(this, h) === s(this, l).locale)
70
+ if (s(this, h).locale = t, s(this, l) === s(this, h).locale)
71
71
  return;
72
- v(this, D, b).call(this, s(this, f));
72
+ O(this, A, E).call(this, s(this, f));
73
73
  } else
74
- this.locale = z;
74
+ this.locale = C;
75
75
  }
76
76
  get ready() {
77
- return s(this, A);
77
+ return s(this, D);
78
78
  }
79
79
  get supportedLocales() {
80
- return s(this, y);
80
+ return s(this, T);
81
81
  }
82
82
  get timezone() {
83
- return s(this, u).tz.current;
83
+ return s(this, p).tz.current;
84
84
  }
85
85
  set timezone(t) {
86
- s(this, u).tz = t;
86
+ s(this, p).tz = t;
87
87
  }
88
88
  /**
89
89
  * Returns a translated string from a key in the current {@link Localization.locale}
@@ -92,7 +92,7 @@ class rt {
92
92
  * @returns Translated string
93
93
  */
94
94
  get(t, e) {
95
- const o = M(s(this, w), t, e);
95
+ const o = j(s(this, y), t, e);
96
96
  return o !== null ? o : t;
97
97
  }
98
98
  /**
@@ -102,11 +102,12 @@ class rt {
102
102
  * @param options - Options for String.prototype.toLocaleString
103
103
  */
104
104
  amount(t, e, o) {
105
- const { hideSymbol: i, showSign: g, ...L } = o || {}, p = $(t, s(this, h), e, i, {
105
+ const { hideCurrency: i, ...L } = o || {}, u = $(t, s(this, l), e, i, {
106
106
  ...L,
107
- currencyDisplay: "symbol"
107
+ currencyDisplay: "symbol",
108
+ signDisplay: "never"
108
109
  });
109
- return g && t !== 0 ? p.includes("-") ? `- ${p.replace("-", "")}` : `+ ${p}` : p;
110
+ return t < 0 ? `- ${u}` : u;
110
111
  }
111
112
  /**
112
113
  * Returns a localized string for a date
@@ -114,20 +115,20 @@ class rt {
114
115
  * @param options - Options for {@link Date.toLocaleDateString}
115
116
  */
116
117
  date(t, e = {}) {
117
- const o = { ...U, timeZone: s(this, u).tz.current, ...e };
118
- return new Date(t).toLocaleDateString(s(this, h), o);
118
+ const o = { ...U, timeZone: s(this, p).tz.current, ...e };
119
+ return new Date(t).toLocaleDateString(s(this, l), o);
119
120
  }
120
121
  /**
121
122
  * Returns a localized string for a full date
122
123
  * @param date - Date to be localized
123
124
  */
124
125
  fullDate(t) {
125
- const e = Z(s(this, u), t), [, o, i, g, L] = new Date(e).toString().split(/\s+/g);
126
- return `${o} ${i}, ${g}, ${L}`;
126
+ const e = Z(s(this, p), t), [, o, i, L, u] = new Date(e).toString().split(/\s+/g);
127
+ return `${o} ${i}, ${L}, ${u}`;
127
128
  }
128
129
  }
129
- h = new WeakMap(), T = new WeakMap(), y = new WeakMap(), f = new WeakMap(), w = new WeakMap(), l = new WeakMap(), A = new WeakMap(), c = new WeakMap(), m = new WeakMap(), d = new WeakMap(), u = new WeakMap(), D = new WeakSet(), b = function(t) {
130
- s(this, m) === void 0 && n(this, A, new Promise((i) => {
130
+ l = new WeakMap(), g = new WeakMap(), T = new WeakMap(), f = new WeakMap(), y = new WeakMap(), h = new WeakMap(), D = new WeakMap(), c = new WeakMap(), m = new WeakMap(), d = new WeakMap(), p = new WeakMap(), A = new WeakSet(), E = function(t) {
131
+ s(this, m) === void 0 && n(this, D, new Promise((i) => {
131
132
  n(this, m, () => {
132
133
  i(s(this, c)), n(this, c, n(this, m, void 0));
133
134
  });
@@ -136,12 +137,12 @@ h = new WeakMap(), T = new WeakMap(), y = new WeakMap(), f = new WeakMap(), w =
136
137
  var i;
137
138
  s(this, c) === o && ((i = s(this, m)) == null || i.call(this));
138
139
  }, o = n(this, c, (async () => {
139
- n(this, w, await s(this, l).load(t)), n(this, h, s(this, l).locale), n(this, y, s(this, l).supportedLocales), n(this, f, t), n(this, T, E(s(this, h))), s(this, d).notify();
140
+ n(this, y, await s(this, h).load(t)), n(this, l, s(this, h).locale), n(this, T, s(this, h).supportedLocales), n(this, f, t), n(this, g, R(s(this, l))), s(this, d).notify();
140
141
  })());
141
142
  o.then(e).catch((i) => {
142
143
  e(), console.error(i);
143
144
  });
144
145
  };
145
146
  export {
146
- rt as default
147
+ st as default
147
148
  };
@@ -1,26 +1,26 @@
1
- import i from "../constants/currency-codes.js";
1
+ import u from "../constants/currency-codes.js";
2
2
  import a from "../constants/currency-decimals.js";
3
- const m = (t) => a[t] || 100, y = (t) => !!i[t], D = (t) => y(t) ? i[t] : null, p = (t, e) => {
4
- const r = m(e);
3
+ const l = (t) => a[t] || 100, y = (t) => !!u[t], A = (t) => y(t) ? u[t] : null, C = (t, e) => {
4
+ const r = l(e);
5
5
  return parseInt(String(t), 10) / r;
6
- }, S = (t, e, r, n = !1, o = {}) => {
7
- const c = t.toString(), s = p(c, r), l = e.replace("_", "-"), u = {
6
+ }, D = (t, e, r, o = !1, n = {}) => {
7
+ const c = t.toString(), s = C(c, r), i = e.replace("_", "-"), m = {
8
8
  style: "currency",
9
9
  currency: r,
10
10
  currencyDisplay: "symbol",
11
- ...o
11
+ ...n
12
12
  };
13
13
  try {
14
- return n ? g({ amount: s, currencyCode: r, locale: l }) : s.toLocaleString(l, u);
14
+ return o ? f(i, m, s) : s.toLocaleString(i, m);
15
15
  } catch {
16
16
  return c;
17
17
  }
18
- }, g = ({ locale: t, amount: e, currencyCode: r }) => new Intl.NumberFormat(t, { style: "currency", currency: r, currencyDisplay: "symbol" }).formatToParts(e).filter((n) => n.type !== "currency").reduce((n, o) => n + o.value, "").trim();
18
+ }, f = (t, e, r) => Intl.NumberFormat(t, e).formatToParts(r).filter((o) => o.type !== "currency").reduce((o, n) => o + n.value, "").trim();
19
19
  export {
20
- D as getCurrencyCode,
21
- p as getDecimalAmount,
22
- m as getDivider,
23
- S as getLocalisedAmount,
24
- y as isValidCurrencyCode,
25
- g as showCurrencyWithoutSymbol
20
+ f as formatAmountWithoutCurrency,
21
+ A as getCurrencyCode,
22
+ C as getDecimalAmount,
23
+ l as getDivider,
24
+ D as getLocalisedAmount,
25
+ y as isValidCurrencyCode
26
26
  };
@@ -82,10 +82,10 @@ class a {
82
82
  }
83
83
  }
84
84
  s(a, "version", {
85
- version: "0.1.1",
86
- revision: "7297bc9",
85
+ version: "0.1.2",
86
+ revision: "dd1e06a",
87
87
  branch: "main",
88
- buildId: "@adyen/adyen-fp-web-b6fd87aa-a010-4af9-b41f-173e2e285cf1"
88
+ buildId: "@adyen/adyen-fp-web-0a8cca55-50c0-42f1-8c0c-a713f57c131e"
89
89
  });
90
90
  const E = a;
91
91
  export {
@@ -1,7 +1,7 @@
1
- import { Component as s, options as _, createElement as c, Fragment as y, toChildArray as v, render as b } from "preact";
2
- import { Component as J, Fragment as ee, createContext as te, createElement as re, createRef as ne } from "preact";
3
- import { useCallback as ie, useContext as ue, useEffect as _e, useImperativeHandle as ae, useLayoutEffect as le, useMemo as ce, useReducer as se, useRef as fe, useState as pe } from "../../hooks/dist/hooks.module.js";
4
- function S(e, t) {
1
+ import { Component as s, options as a, createElement as c, Fragment as y, toChildArray as v, render as b } from "../../dist/preact.module.js";
2
+ import { createContext as J } from "../../dist/preact.module.js";
3
+ import { useCallback as te, useContext as re, useEffect as ne, useImperativeHandle as oe, useLayoutEffect as ie, useMemo as ue, useReducer as ae, useRef as le, useState as _e } from "../../hooks/dist/hooks.module.js";
4
+ function R(e, t) {
5
5
  for (var r in t)
6
6
  e[r] = t[r];
7
7
  return e;
@@ -31,32 +31,32 @@ function q(e, t) {
31
31
  (C.prototype = new s()).isPureReactComponent = !0, C.prototype.shouldComponentUpdate = function(e, t) {
32
32
  return h(this.props, e) || h(this.state, t);
33
33
  };
34
- var g = _.__b;
35
- _.__b = function(e) {
34
+ var g = a.__b;
35
+ a.__b = function(e) {
36
36
  e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), g && g(e);
37
37
  };
38
- var W = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
38
+ var $ = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
39
39
  function K(e) {
40
40
  function t(r) {
41
- var n = S({}, r);
41
+ var n = R({}, r);
42
42
  return delete n.ref, e(n, r.ref || null);
43
43
  }
44
- return t.$$typeof = W, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
44
+ return t.$$typeof = $, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
45
45
  }
46
- var A = _.__e;
47
- _.__e = function(e, t, r, n) {
46
+ var W = a.__e;
47
+ a.__e = function(e, t, r, n) {
48
48
  if (e.then) {
49
49
  for (var o, i = t; i = i.__; )
50
50
  if ((o = i.__c) && o.__c)
51
51
  return t.__e == null && (t.__e = r.__e, t.__k = r.__k), o.__c(e, t);
52
52
  }
53
- A(e, t, r, n);
53
+ W(e, t, r, n);
54
54
  };
55
- var k = _.unmount;
55
+ var k = a.unmount;
56
56
  function O(e, t, r) {
57
57
  return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(n) {
58
58
  typeof n.__c == "function" && n.__c();
59
- }), e.__c.__H = null), (e = S({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
59
+ }), e.__c.__H = null), (e = R({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
60
60
  return O(n, t, r);
61
61
  })), e;
62
62
  }
@@ -90,17 +90,17 @@ function Q(e) {
90
90
  function f() {
91
91
  this.u = null, this.o = null;
92
92
  }
93
- _.unmount = function(e) {
93
+ a.unmount = function(e) {
94
94
  var t = e.__c;
95
95
  t && t.__R && t.__R(), t && e.__h === !0 && (e.type = null), k && k(e);
96
96
  }, (d.prototype = new s()).__c = function(e, t) {
97
97
  var r = t.__c, n = this;
98
98
  n.t == null && (n.t = []), n.t.push(r);
99
99
  var o = U(n.__v), i = !1, u = function() {
100
- i || (i = !0, r.__R = null, o ? o(a) : a());
100
+ i || (i = !0, r.__R = null, o ? o(l) : l());
101
101
  };
102
102
  r.__R = u;
103
- var a = function() {
103
+ var l = function() {
104
104
  if (!--n.__u) {
105
105
  if (n.state.__a) {
106
106
  var p = n.state.__a;
@@ -110,8 +110,8 @@ _.unmount = function(e) {
110
110
  for (n.setState({ __a: n.__b = null }); m = n.t.pop(); )
111
111
  m.forceUpdate();
112
112
  }
113
- }, l = t.__h === !0;
114
- n.__u++ || l || n.setState({ __a: n.__b = n.__v.__k[0] }), e.then(u, u);
113
+ }, _ = t.__h === !0;
114
+ n.__u++ || _ || n.setState({ __a: n.__b = n.__v.__k[0] }), e.then(u, u);
115
115
  }, d.prototype.componentWillUnmount = function() {
116
116
  this.t = [];
117
117
  }, d.prototype.render = function(e, t) {
@@ -135,12 +135,12 @@ var N = function(e, t, r) {
135
135
  e.u = r = r[2];
136
136
  }
137
137
  };
138
- function L(e) {
138
+ function A(e) {
139
139
  return this.getChildContext = function() {
140
140
  return e.context;
141
141
  }, e.children;
142
142
  }
143
- function H(e) {
143
+ function L(e) {
144
144
  var t = this, r = e.i;
145
145
  t.componentWillUnmount = function() {
146
146
  b(null, t.l), t.l = null, t.i = null;
@@ -150,10 +150,10 @@ function H(e) {
150
150
  this.childNodes.push(n), t.i.appendChild(n);
151
151
  }, removeChild: function(n) {
152
152
  this.childNodes.splice(this.childNodes.indexOf(n) >>> 1, 1), t.i.removeChild(n);
153
- } }), b(c(L, { context: t.context }, e.__v), t.l);
153
+ } }), b(c(A, { context: t.context }, e.__v), t.l);
154
154
  }
155
155
  function X(e, t) {
156
- var r = c(H, { __v: e, i: t });
156
+ var r = c(L, { __v: e, i: t });
157
157
  return r.containerInfo = t, r;
158
158
  }
159
159
  (f.prototype = new s()).__a = function(e) {
@@ -177,7 +177,7 @@ function X(e, t) {
177
177
  N(e, r, t);
178
178
  });
179
179
  };
180
- var M = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, V = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, $ = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, z = /[A-Z0-9]/g, B = typeof document < "u", F = function(e) {
180
+ var B = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, H = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, M = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, V = /[A-Z0-9]/g, z = typeof document < "u", F = function(e) {
181
181
  return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
182
182
  };
183
183
  s.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
@@ -187,7 +187,7 @@ s.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveP
187
187
  Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
188
188
  } });
189
189
  });
190
- var x = _.event;
190
+ var x = a.event;
191
191
  function j() {
192
192
  }
193
193
  function D() {
@@ -196,59 +196,58 @@ function D() {
196
196
  function I() {
197
197
  return this.defaultPrevented;
198
198
  }
199
- _.event = function(e) {
199
+ a.event = function(e) {
200
200
  return x && (e = x(e)), e.persist = j, e.isPropagationStopped = D, e.isDefaultPrevented = I, e.nativeEvent = e;
201
201
  };
202
202
  var T = { enumerable: !1, configurable: !0, get: function() {
203
203
  return this.class;
204
- } }, P = _.vnode;
205
- _.vnode = function(e) {
204
+ } }, P = a.vnode;
205
+ a.vnode = function(e) {
206
206
  typeof e.type == "string" && function(t) {
207
207
  var r = t.props, n = t.type, o = {};
208
208
  for (var i in r) {
209
209
  var u = r[i];
210
- if (!(i === "value" && "defaultValue" in r && u == null || B && i === "children" && n === "noscript" || i === "class" || i === "className")) {
211
- var a = i.toLowerCase();
212
- i === "defaultValue" && "value" in r && r.value == null ? i = "value" : i === "download" && u === !0 ? u = "" : a === "ondoubleclick" ? i = "ondblclick" : a !== "onchange" || n !== "input" && n !== "textarea" || F(r.type) ? a === "onfocus" ? i = "onfocusin" : a === "onblur" ? i = "onfocusout" : $.test(i) ? i = a : n.indexOf("-") === -1 && V.test(i) ? i = i.replace(z, "-$&").toLowerCase() : u === null && (u = void 0) : a = i = "oninput", a === "oninput" && o[i = a] && (i = "oninputCapture"), o[i] = u;
210
+ if (!(i === "value" && "defaultValue" in r && u == null || z && i === "children" && n === "noscript" || i === "class" || i === "className")) {
211
+ var l = i.toLowerCase();
212
+ i === "defaultValue" && "value" in r && r.value == null ? i = "value" : i === "download" && u === !0 ? u = "" : l === "ondoubleclick" ? i = "ondblclick" : l !== "onchange" || n !== "input" && n !== "textarea" || F(r.type) ? l === "onfocus" ? i = "onfocusin" : l === "onblur" ? i = "onfocusout" : M.test(i) ? i = l : n.indexOf("-") === -1 && H.test(i) ? i = i.replace(V, "-$&").toLowerCase() : u === null && (u = void 0) : l = i = "oninput", l === "oninput" && o[i = l] && (i = "oninputCapture"), o[i] = u;
213
213
  }
214
214
  }
215
- n == "select" && o.multiple && Array.isArray(o.value) && (o.value = v(r.children).forEach(function(l) {
216
- l.props.selected = o.value.indexOf(l.props.value) != -1;
217
- })), n == "select" && o.defaultValue != null && (o.value = v(r.children).forEach(function(l) {
218
- l.props.selected = o.multiple ? o.defaultValue.indexOf(l.props.value) != -1 : o.defaultValue == l.props.value;
215
+ n == "select" && o.multiple && Array.isArray(o.value) && (o.value = v(r.children).forEach(function(_) {
216
+ _.props.selected = o.value.indexOf(_.props.value) != -1;
217
+ })), n == "select" && o.defaultValue != null && (o.value = v(r.children).forEach(function(_) {
218
+ _.props.selected = o.multiple ? o.defaultValue.indexOf(_.props.value) != -1 : o.defaultValue == _.props.value;
219
219
  })), r.class && !r.className ? (o.class = r.class, Object.defineProperty(o, "className", T)) : (r.className && !r.class || r.class && r.className) && (o.class = o.className = r.className), t.props = o;
220
- }(e), e.$$typeof = M, P && P(e);
220
+ }(e), e.$$typeof = B, P && P(e);
221
221
  };
222
- var w = _.__r;
223
- _.__r = function(e) {
222
+ var w = a.__r;
223
+ a.__r = function(e) {
224
224
  w && w(e), e.__c;
225
225
  };
226
- var R = _.diffed;
227
- _.diffed = function(e) {
228
- R && R(e);
226
+ var S = a.diffed;
227
+ a.diffed = function(e) {
228
+ S && S(e);
229
229
  var t = e.props, r = e.__e;
230
230
  r != null && e.type === "textarea" && "value" in t && t.value !== r.value && (r.value = t.value == null ? "" : t.value);
231
231
  };
232
232
  export {
233
- J as Component,
234
- ee as Fragment,
233
+ s as Component,
234
+ y as Fragment,
235
235
  C as PureComponent,
236
236
  d as Suspense,
237
237
  f as SuspenseList,
238
- te as createContext,
239
- re as createElement,
238
+ J as createContext,
239
+ c as createElement,
240
240
  X as createPortal,
241
- ne as createRef,
242
241
  K as forwardRef,
243
242
  Q as lazy,
244
243
  q as memo,
245
- ie as useCallback,
246
- ue as useContext,
247
- _e as useEffect,
248
- ae as useImperativeHandle,
249
- le as useLayoutEffect,
250
- ce as useMemo,
251
- se as useReducer,
252
- fe as useRef,
253
- pe as useState
244
+ te as useCallback,
245
+ re as useContext,
246
+ ne as useEffect,
247
+ oe as useImperativeHandle,
248
+ ie as useLayoutEffect,
249
+ ue as useMemo,
250
+ ae as useReducer,
251
+ le as useRef,
252
+ _e as useState
254
253
  };