mainstack-payments 1.0.54 → 1.0.56

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,12 +1,12 @@
1
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { I as b, u as A, a as v, b as E, v as H, C as k, F as x, T as z } from "./index-6ca76098.js";
1
+ import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
+ import { I as b, u as A, a as v, b as E, v as H, C as k, F as x, T as z } from "./index-9f474fd2.js";
3
3
  import { customSnackbar as B, SnackbarType as M, ExpandMoreIcon as $ } from "mainstack-design-system";
4
4
  import { memo as j, useState as T, useCallback as P } from "react";
5
5
  import "react-dom";
6
6
  import "axios";
7
7
  const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none", children: [
8
8
  /* @__PURE__ */ c("g", { clipPath: "url(#clip0_3703_1664)", children: [
9
- /* @__PURE__ */ t(
9
+ /* @__PURE__ */ a(
10
10
  "path",
11
11
  {
12
12
  fillRule: "evenodd",
@@ -15,7 +15,7 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
15
15
  fill: "#00D533"
16
16
  }
17
17
  ),
18
- /* @__PURE__ */ t(
18
+ /* @__PURE__ */ a(
19
19
  "path",
20
20
  {
21
21
  d: "M17.3184 14.4455C20.6877 15.1617 22.2274 16.5636 22.2274 18.9255C22.2274 21.8817 19.8186 24.0607 16.0531 24.3045L15.6872 26.0569C15.6567 26.2245 15.5042 26.3464 15.3213 26.3464H12.4247C12.1808 26.3464 12.0132 26.1179 12.0589 25.8893L12.5162 23.9388C10.6562 23.4055 9.14687 22.3693 8.27799 21.1045C8.17133 20.9369 8.2018 20.7236 8.35418 20.6017L10.3665 19.0322C10.5343 18.895 10.7781 18.9407 10.9002 19.1084C11.9673 20.6017 13.6138 21.4855 15.5958 21.4855C17.3796 21.4855 18.7211 20.6169 18.7211 19.3674C18.7211 18.4074 18.0503 17.9655 15.7788 17.4931C11.9065 16.655 10.3667 15.2226 10.3667 12.8607C10.3667 10.1179 12.6687 8.06074 16.1447 7.78645L16.5258 5.97312C16.5562 5.8055 16.7088 5.68359 16.8916 5.68359H19.7425C19.9713 5.68359 20.1541 5.89693 20.1084 6.1255L19.6663 8.15217C21.1604 8.60931 22.3799 9.43216 23.1423 10.4531C23.2642 10.6055 23.2337 10.8341 23.0813 10.956L21.2366 12.4645C21.0689 12.6017 20.8403 12.5712 20.7182 12.4036C19.773 11.2455 18.3094 10.5903 16.7086 10.5903C14.9248 10.5903 13.812 11.3674 13.812 12.4645C13.7815 13.3788 14.6506 13.8665 17.3184 14.4455Z",
@@ -23,7 +23,7 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
23
23
  }
24
24
  )
25
25
  ] }),
26
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t("clipPath", { id: "clip0_3703_1664", children: /* @__PURE__ */ t("rect", { width: "32", height: "32", rx: "16", fill: "white" }) }) })
26
+ /* @__PURE__ */ a("defs", { children: /* @__PURE__ */ a("clipPath", { id: "clip0_3703_1664", children: /* @__PURE__ */ a("rect", { width: "32", height: "32", rx: "16", fill: "white" }) }) })
27
27
  ] }), V = j(
28
28
  ({
29
29
  Request: i,
@@ -31,16 +31,16 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
31
31
  amount: l,
32
32
  currency: p,
33
33
  redirectUrl: o,
34
- checkForErrors: r
34
+ checkForErrors: h
35
35
  }) => {
36
- const C = A(), { mutate: h, isLoading: I } = v(i), { mutate: f, isLoading: L } = E(i), [_, m] = T(!1), u = I || L || _, g = P(async () => {
36
+ const m = A(), { mutate: r, isLoading: I } = v(i), { mutate: f, isLoading: L } = E(i), [_, C] = T(!1), u = I || L || _, g = P(async () => {
37
37
  var w;
38
38
  const n = H(), y = {
39
39
  ...d,
40
40
  reference: n
41
41
  };
42
42
  try {
43
- await h(
43
+ await r(
44
44
  {
45
45
  amount: l,
46
46
  reference: n,
@@ -57,7 +57,7 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
57
57
  }
58
58
  }
59
59
  );
60
- const { client_secret: a } = await f(
60
+ const { client_secret: t } = await f(
61
61
  {
62
62
  amount: l,
63
63
  currency: p,
@@ -73,10 +73,10 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
73
73
  }
74
74
  }
75
75
  );
76
- if (C) {
77
- m(!0);
78
- const { error: e } = await C.confirmPayment({
79
- clientSecret: a,
76
+ if (m) {
77
+ C(!0);
78
+ const { error: e } = await m.confirmPayment({
79
+ clientSecret: t,
80
80
  confirmParams: {
81
81
  payment_method_data: {
82
82
  // @ts-ignore
@@ -90,25 +90,25 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
90
90
  e.message ?? "Couldn't load Cash App integration"
91
91
  );
92
92
  }
93
- } catch (a) {
94
- m(!1), B(
95
- ((w = a == null ? void 0 : a.raw) == null ? void 0 : w.message) ?? a ?? "We couldn't complete your payment",
93
+ } catch (t) {
94
+ C(!1), console.error(t), B(
95
+ ((w = t == null ? void 0 : t.raw) == null ? void 0 : w.message) ?? (t == null ? void 0 : t.message) ?? t ?? "We couldn't complete your payment",
96
96
  M.error
97
97
  );
98
98
  }
99
99
  }, [
100
- C,
101
- h,
100
+ m,
101
+ r,
102
102
  f,
103
103
  l,
104
104
  p,
105
105
  d,
106
106
  o,
107
- m
107
+ C
108
108
  ]), S = P(async () => {
109
- await r() || g();
110
- }, [r, g]);
111
- return /* @__PURE__ */ t(
109
+ await h() || g();
110
+ }, [h, g]);
111
+ return /* @__PURE__ */ a(
112
112
  k,
113
113
  {
114
114
  onClick: S,
@@ -116,8 +116,8 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
116
116
  isLoading: u,
117
117
  children: /* @__PURE__ */ c(x, { justifyContent: "space-between", w: "full", alignItems: "center", children: [
118
118
  /* @__PURE__ */ c(x, { alignItems: "center", gap: "12px", children: [
119
- /* @__PURE__ */ t(F, { boxSize: "32px" }),
120
- /* @__PURE__ */ t(
119
+ /* @__PURE__ */ a(F, { boxSize: "32px" }),
120
+ /* @__PURE__ */ a(
121
121
  z,
122
122
  {
123
123
  color: "#111215",
@@ -130,7 +130,7 @@ const F = (i) => /* @__PURE__ */ c(b, { viewBox: "0 0 32 32", ...i, fill: "none"
130
130
  }
131
131
  )
132
132
  ] }),
133
- /* @__PURE__ */ t($, { transform: "rotate(-90deg)", boxSize: "24px" })
133
+ /* @__PURE__ */ a($, { transform: "rotate(-90deg)", boxSize: "24px" })
134
134
  ] })
135
135
  }
136
136
  );
@@ -1,18 +1,18 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { I as _, u as S, a as b, b as E, C as z, F as h, T as M, v as $ } from "./index-6ca76098.js";
1
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
+ import { I as _, u as S, a as b, b as E, C as z, F as h, T as M, v as $ } from "./index-9f474fd2.js";
3
3
  import { ExpandMoreIcon as j, customSnackbar as k, SnackbarType as v } from "mainstack-design-system";
4
4
  import { useState as B } from "react";
5
5
  import "react-dom";
6
6
  import "axios";
7
7
  const F = (s) => /* @__PURE__ */ c(_, { viewBox: "0 0 32 32", ...s, fill: "none", children: [
8
- /* @__PURE__ */ e("g", { clipPath: "url(#clip0_2605_970)", children: /* @__PURE__ */ e(
8
+ /* @__PURE__ */ n("g", { clipPath: "url(#clip0_2605_970)", children: /* @__PURE__ */ n(
9
9
  "path",
10
10
  {
11
11
  d: "M16 32C7.163 32 0 24.837 0 16C0 7.163 7.163 0 16 0C24.837 0 32 7.163 32 16C32 24.837 24.837 32 16 32ZM21.002 9.855L21.812 6.614L19.216 5.968L18.573 8.543C18.1498 8.40049 17.7157 8.29247 17.275 8.22L17.919 5.645L15.323 5L14.513 8.241C11.53 8.783 9.004 10.978 8.233 14.064C7.462 17.15 8.659 20.27 11.037 22.144L10.227 25.386L12.823 26.032L13.466 23.457C13.8892 23.5995 14.3233 23.7075 14.764 23.78L14.12 26.355L16.716 27L17.526 23.759C18.575 23.5709 19.5756 23.1744 20.4687 22.593C21.3619 22.0116 22.1294 21.2571 22.726 20.374L19.879 19.666C19.2215 20.3303 18.4022 20.8116 17.5018 21.0624C16.6014 21.3132 15.6512 21.3248 14.745 21.096C11.879 20.384 10.125 17.524 10.828 14.709C11.531 11.894 14.427 10.19 17.294 10.903C18.2012 11.1247 19.0347 11.5798 19.7118 12.223C20.3889 12.8663 20.8861 13.6753 21.154 14.57L24 15.278C23.8889 14.2194 23.5663 13.1938 23.0513 12.2623C22.5363 11.3307 21.8394 10.5121 21.002 9.855Z",
12
12
  fill: "#131316"
13
13
  }
14
14
  ) }),
15
- /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("clipPath", { id: "clip0_2605_970", children: /* @__PURE__ */ e("rect", { width: "32", height: "32", fill: "white" }) }) })
15
+ /* @__PURE__ */ n("defs", { children: /* @__PURE__ */ n("clipPath", { id: "clip0_2605_970", children: /* @__PURE__ */ n("rect", { width: "32", height: "32", fill: "white" }) }) })
16
16
  ] }), A = ({
17
17
  Request: s,
18
18
  metadata: C,
@@ -45,7 +45,7 @@ const F = (s) => /* @__PURE__ */ c(_, { viewBox: "0 0 32 32", ...s, fill: "none"
45
45
  }
46
46
  }
47
47
  );
48
- const { client_secret: n } = await w(
48
+ const { client_secret: e } = await w(
49
49
  {
50
50
  amount: r,
51
51
  currency: l,
@@ -64,7 +64,7 @@ const F = (s) => /* @__PURE__ */ c(_, { viewBox: "0 0 32 32", ...s, fill: "none"
64
64
  if (m) {
65
65
  p(!0);
66
66
  const { error: t } = await m.confirmPayment({
67
- clientSecret: n,
67
+ clientSecret: e,
68
68
  confirmParams: {
69
69
  payment_method_data: {
70
70
  // @ts-ignore
@@ -76,14 +76,14 @@ const F = (s) => /* @__PURE__ */ c(_, { viewBox: "0 0 32 32", ...s, fill: "none"
76
76
  if (t)
77
77
  throw new Error(t.message ?? "Couldn't load wallet integration");
78
78
  }
79
- } catch (n) {
80
- p(!1), k(
81
- ((f = n == null ? void 0 : n.raw) == null ? void 0 : f.message) ?? n ?? "We couldn't complete your payment",
79
+ } catch (e) {
80
+ p(!1), console.error(e), k(
81
+ ((f = e == null ? void 0 : e.raw) == null ? void 0 : f.message) ?? (e == null ? void 0 : e.message) ?? e ?? "We couldn't complete your payment",
82
82
  v.error
83
83
  );
84
84
  }
85
85
  };
86
- return /* @__PURE__ */ e(
86
+ return /* @__PURE__ */ n(
87
87
  z,
88
88
  {
89
89
  onClick: async () => {
@@ -93,8 +93,8 @@ const F = (s) => /* @__PURE__ */ c(_, { viewBox: "0 0 32 32", ...s, fill: "none"
93
93
  isLoading: d,
94
94
  children: /* @__PURE__ */ c(h, { justifyContent: "space-between", w: "full", alignItems: "center", children: [
95
95
  /* @__PURE__ */ c(h, { alignItems: "center", gap: "12px", children: [
96
- /* @__PURE__ */ e(F, { boxSize: "32px" }),
97
- /* @__PURE__ */ e(
96
+ /* @__PURE__ */ n(F, { boxSize: "32px" }),
97
+ /* @__PURE__ */ n(
98
98
  M,
99
99
  {
100
100
  color: "#111215",
@@ -107,7 +107,7 @@ const F = (s) => /* @__PURE__ */ c(_, { viewBox: "0 0 32 32", ...s, fill: "none"
107
107
  }
108
108
  )
109
109
  ] }),
110
- /* @__PURE__ */ e(j, { transform: "rotate(-90deg)", boxSize: "24px" })
110
+ /* @__PURE__ */ n(j, { transform: "rotate(-90deg)", boxSize: "24px" })
111
111
  ] })
112
112
  }
113
113
  );
@@ -11853,7 +11853,7 @@ function $6(e) {
11853
11853
  return t[n] === void 0 && (t[n] = e(n)), t[n];
11854
11854
  };
11855
11855
  }
11856
- var F6 = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, M6 = /* @__PURE__ */ $6(
11856
+ var F6 = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, M6 = /* @__PURE__ */ $6(
11857
11857
  function(e) {
11858
11858
  return F6.test(e) || e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) < 91;
11859
11859
  }
@@ -18979,9 +18979,11 @@ class On {
18979
18979
  * Run the configured transform pipeline over an input value.
18980
18980
  */
18981
18981
  cast(t, n = {}) {
18982
- let r = this.resolve(Object.assign({
18982
+ let r = this.resolve(Object.assign({}, n, {
18983
18983
  value: t
18984
- }, n)), a = n.assert === "ignore-optionality", o = r._cast(t, n);
18984
+ // parent: options.parent,
18985
+ // context: options.context,
18986
+ })), a = n.assert === "ignore-optionality", o = r._cast(t, n);
18985
18987
  if (n.assert !== !1 && !r.isType(o)) {
18986
18988
  if (a && Gr(o))
18987
18989
  return o;
@@ -18994,7 +18996,7 @@ attempted value: ${i}
18994
18996
  return o;
18995
18997
  }
18996
18998
  _cast(t, n) {
18997
- let r = t === void 0 ? t : this.transforms.reduce((a, o) => o.call(this, a, t, this), t);
18999
+ let r = t === void 0 ? t : this.transforms.reduce((a, o) => o.call(this, a, t, this, n), t);
18998
19000
  return r === void 0 && (r = this.getDefault(n)), r;
18999
19001
  }
19000
19002
  _validate(t, n = {}, r, a) {
@@ -19410,11 +19412,11 @@ class D1 extends On {
19410
19412
  return t instanceof String && (t = t.valueOf()), typeof t == "string";
19411
19413
  }
19412
19414
  }), this.withMutation(() => {
19413
- this.transform((t, n, r) => {
19414
- if (!r.spec.coerce || r.isType(t) || Array.isArray(t))
19415
+ this.transform((t, n) => {
19416
+ if (!this.spec.coerce || this.isType(t) || Array.isArray(t))
19415
19417
  return t;
19416
- const a = t != null && t.toString ? t.toString() : t;
19417
- return a === E7 ? t : a;
19418
+ const r = t != null && t.toString ? t.toString() : t;
19419
+ return r === E7 ? t : r;
19418
19420
  });
19419
19421
  });
19420
19422
  }
@@ -19586,7 +19588,7 @@ class Gl extends On {
19586
19588
  return k7(t) && !isNaN(t.getTime());
19587
19589
  }
19588
19590
  }), this.withMutation(() => {
19589
- this.transform((t, n, r) => !r.spec.coerce || r.isType(t) || t === null ? t : (t = y7(t), isNaN(t) ? Gl.INVALID_DATE : new Date(t)));
19591
+ this.transform((t, n) => !this.spec.coerce || this.isType(t) || t === null ? t : (t = y7(t), isNaN(t) ? Gl.INVALID_DATE : new Date(t)));
19590
19592
  });
19591
19593
  }
19592
19594
  prepareParam(t, n) {
@@ -19721,11 +19723,11 @@ class N1 extends On {
19721
19723
  __validating: n.__validating || !1
19722
19724
  }), u = !1;
19723
19725
  for (const d of s) {
19724
- let f = o[d], p = d in a;
19726
+ let f = o[d], p = d in a, g = a[d];
19725
19727
  if (f) {
19726
- let g, m = a[d];
19728
+ let m;
19727
19729
  c.path = (n.path ? `${n.path}.` : "") + d, f = f.resolve({
19728
- value: m,
19730
+ value: g,
19729
19731
  context: n.context,
19730
19732
  parent: l
19731
19733
  });
@@ -19734,13 +19736,10 @@ class N1 extends On {
19734
19736
  u = u || d in a;
19735
19737
  continue;
19736
19738
  }
19737
- g = !n.__validating || !v ? (
19738
- // TODO: use _cast, this is double resolving
19739
- f.cast(a[d], c)
19740
- ) : a[d], g !== void 0 && (l[d] = g);
19739
+ m = !n.__validating || !v ? f.cast(g, c) : g, m !== void 0 && (l[d] = m);
19741
19740
  } else
19742
- p && !i && (l[d] = a[d]);
19743
- (p !== d in l || l[d] !== a[d]) && (u = !0);
19741
+ p && !i && (l[d] = g);
19742
+ (p !== d in l || l[d] !== g) && (u = !0);
19744
19743
  }
19745
19744
  return u ? l : a;
19746
19745
  }
@@ -26424,7 +26423,7 @@ const j7 = (e) => /* @__PURE__ */ $(Rn, { viewBox: "0 0 32 32", ...e, fill: "non
26424
26423
  }
26425
26424
  )
26426
26425
  }
26427
- ), W7 = ra(() => Promise.resolve().then(() => Q7)), H7 = ra(() => Promise.resolve().then(() => iD)), K7 = ra(() => import("./CashAppPayment-79e65bad.js")), Z7 = ra(() => import("./CryptoPayments-871d68cf.js")), q7 = ra(() => Promise.resolve().then(() => nD)), Y7 = ra(
26426
+ ), W7 = ra(() => Promise.resolve().then(() => Q7)), H7 = ra(() => Promise.resolve().then(() => iD)), K7 = ra(() => import("./CashAppPayment-2d41e345.js")), Z7 = ra(() => import("./CryptoPayments-3c3e977d.js")), q7 = ra(() => Promise.resolve().then(() => nD)), Y7 = ra(
26428
26427
  () => Promise.resolve().then(() => uD)
26429
26428
  ), X7 = ra(
26430
26429
  () => Promise.resolve().then(() => lD).then((e) => ({
@@ -1,4 +1,4 @@
1
- import { d as o, e as y, S as P, M as i, c, f as u, g as p, P as k, W as l, l as d, j as M, i as C, a as F, b as f, h, k as g } from "./index-6ca76098.js";
1
+ import { d as o, e as y, S as P, M as i, c, f as u, g as p, P as k, W as l, l as d, j as M, i as C, a as F, b as f, h, k as g } from "./index-9f474fd2.js";
2
2
  import "react/jsx-runtime";
3
3
  import "mainstack-design-system";
4
4
  import "react";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mainstack-payments",
3
3
  "type": "module",
4
- "version": "1.0.54",
4
+ "version": "1.0.56",
5
5
  "main": "build/mainstack-payments.js",
6
6
  "types": "build/src/index.d.ts",
7
7
  "files": [
@@ -17,7 +17,7 @@
17
17
  "install:husky": "run-script-os",
18
18
  "install:husky:default": "[ ! -d \"/node_modules/husky/\" ] || husky install",
19
19
  "install:husky:win32": "echo \"husky skipped\"",
20
- "postinstall": "yarn install:husky",
20
+ "postinstall": "yarn install:husky || npm run install:husky",
21
21
  "prepare": "yarn install:husky",
22
22
  "scriptname": "cmd",
23
23
  "prepublishOnly": "yarn build"
@@ -80,7 +80,7 @@
80
80
  "eslint-plugin-react": "^7.32.2",
81
81
  "eslint-plugin-react-hooks": "^4.6.0",
82
82
  "husky": "^8.0.3",
83
- "mainstack-design-system": "^0.7.27",
83
+ "mainstack-design-system": "^0.7.43",
84
84
  "react": "^18.3.1",
85
85
  "react-dom": "^18.3.1",
86
86
  "vite": "^4.1.0",