@appfunnel-dev/sdk 2.0.0-canary.5 → 2.0.0-canary.7

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.
@@ -9,6 +9,197 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefault(React);
11
11
 
12
+ // node_modules/@stripe/stripe-js/dist/pure.js
13
+ var require_pure = chunkEMMSS5I5_cjs.__commonJS({
14
+ "node_modules/@stripe/stripe-js/dist/pure.js"(exports) {
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ function _typeof2(obj) {
17
+ "@babel/helpers - typeof";
18
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
19
+ _typeof2 = function(obj2) {
20
+ return typeof obj2;
21
+ };
22
+ } else {
23
+ _typeof2 = function(obj2) {
24
+ return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
25
+ };
26
+ }
27
+ return _typeof2(obj);
28
+ }
29
+ var RELEASE_TRAIN = "dahlia";
30
+ var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion2(version) {
31
+ return version === 3 ? "v3" : version;
32
+ };
33
+ var ORIGIN = "https://js.stripe.com";
34
+ var STRIPE_JS_URL = "".concat(ORIGIN, "/").concat(RELEASE_TRAIN, "/stripe.js");
35
+ var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
36
+ var STRIPE_JS_URL_REGEX = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
37
+ var EXISTING_SCRIPT_MESSAGE = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";
38
+ var isStripeJSURL = function isStripeJSURL2(url) {
39
+ return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);
40
+ };
41
+ var findScript = function findScript2() {
42
+ var scripts = document.querySelectorAll('script[src^="'.concat(ORIGIN, '"]'));
43
+ for (var i = 0; i < scripts.length; i++) {
44
+ var script = scripts[i];
45
+ if (!isStripeJSURL(script.src)) {
46
+ continue;
47
+ }
48
+ return script;
49
+ }
50
+ return null;
51
+ };
52
+ var injectScript = function injectScript2(params) {
53
+ var queryString = params && !params.advancedFraudSignals ? "?advancedFraudSignals=false" : "";
54
+ var script = document.createElement("script");
55
+ script.src = "".concat(STRIPE_JS_URL).concat(queryString);
56
+ var headOrBody = document.head || document.body;
57
+ if (!headOrBody) {
58
+ throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
59
+ }
60
+ headOrBody.appendChild(script);
61
+ return script;
62
+ };
63
+ var registerWrapper = function registerWrapper2(stripe, startTime) {
64
+ if (!stripe || !stripe._registerWrapper) {
65
+ return;
66
+ }
67
+ stripe._registerWrapper({
68
+ name: "stripe-js",
69
+ version: "9.9.0",
70
+ startTime
71
+ });
72
+ };
73
+ var stripePromise = null;
74
+ var onErrorListener = null;
75
+ var onLoadListener = null;
76
+ var onError = function onError2(reject) {
77
+ return function(cause) {
78
+ reject(new Error("Failed to load Stripe.js", {
79
+ cause
80
+ }));
81
+ };
82
+ };
83
+ var onLoad = function onLoad2(resolve, reject) {
84
+ return function() {
85
+ if (window.Stripe) {
86
+ resolve(window.Stripe);
87
+ } else {
88
+ reject(new Error("Stripe.js not available"));
89
+ }
90
+ };
91
+ };
92
+ var loadScript = function loadScript2(params) {
93
+ if (stripePromise !== null) {
94
+ return stripePromise;
95
+ }
96
+ stripePromise = new Promise(function(resolve, reject) {
97
+ if (typeof window === "undefined" || typeof document === "undefined") {
98
+ resolve(null);
99
+ return;
100
+ }
101
+ if (window.Stripe && params) {
102
+ console.warn(EXISTING_SCRIPT_MESSAGE);
103
+ }
104
+ if (window.Stripe) {
105
+ resolve(window.Stripe);
106
+ return;
107
+ }
108
+ try {
109
+ var script = findScript();
110
+ if (script && params) {
111
+ console.warn(EXISTING_SCRIPT_MESSAGE);
112
+ } else if (!script) {
113
+ script = injectScript(params);
114
+ } else if (script && onLoadListener !== null && onErrorListener !== null) {
115
+ var _script$parentNode;
116
+ script.removeEventListener("load", onLoadListener);
117
+ script.removeEventListener("error", onErrorListener);
118
+ (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
119
+ script = injectScript(params);
120
+ }
121
+ onLoadListener = onLoad(resolve, reject);
122
+ onErrorListener = onError(reject);
123
+ script.addEventListener("load", onLoadListener);
124
+ script.addEventListener("error", onErrorListener);
125
+ } catch (error) {
126
+ reject(error);
127
+ return;
128
+ }
129
+ });
130
+ return stripePromise["catch"](function(error) {
131
+ stripePromise = null;
132
+ return Promise.reject(error);
133
+ });
134
+ };
135
+ var initStripe = function initStripe2(maybeStripe, args, startTime) {
136
+ if (maybeStripe === null) {
137
+ return null;
138
+ }
139
+ var pk = args[0];
140
+ if (typeof pk !== "string") {
141
+ throw new Error("Expected publishable key to be of type string, got type ".concat(_typeof2(pk), " instead."));
142
+ }
143
+ var isTestKey = pk.match(/^pk_test/);
144
+ var version = runtimeVersionToUrlVersion(maybeStripe.version);
145
+ var expectedVersion = RELEASE_TRAIN;
146
+ if (isTestKey && version !== expectedVersion) {
147
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.9.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
148
+ }
149
+ var stripe = maybeStripe.apply(void 0, args);
150
+ registerWrapper(stripe, startTime);
151
+ return stripe;
152
+ };
153
+ var validateLoadParams = function validateLoadParams2(params) {
154
+ var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
155
+ if (params === null || _typeof2(params) !== "object") {
156
+ throw new Error(errorMessage);
157
+ }
158
+ if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === "boolean") {
159
+ return params;
160
+ }
161
+ throw new Error(errorMessage);
162
+ };
163
+ var loadParams;
164
+ var loadStripeCalled = false;
165
+ var loadStripe2 = function loadStripe3() {
166
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
167
+ args[_key] = arguments[_key];
168
+ }
169
+ loadStripeCalled = true;
170
+ var startTime = Date.now();
171
+ return loadScript(loadParams).then(function(maybeStripe) {
172
+ return initStripe(maybeStripe, args, startTime);
173
+ });
174
+ };
175
+ loadStripe2.setLoadParameters = function(params) {
176
+ if (loadStripeCalled && loadParams) {
177
+ var validatedParams = validateLoadParams(params);
178
+ var parameterKeys = Object.keys(validatedParams);
179
+ var sameParameters = parameterKeys.reduce(function(previousValue, currentValue) {
180
+ var _loadParams;
181
+ return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]);
182
+ }, true);
183
+ if (sameParameters) {
184
+ return;
185
+ }
186
+ }
187
+ if (loadStripeCalled) {
188
+ throw new Error("You cannot change load parameters after calling loadStripe");
189
+ }
190
+ loadParams = validateLoadParams(params);
191
+ };
192
+ exports.loadStripe = loadStripe2;
193
+ }
194
+ });
195
+
196
+ // node_modules/@stripe/stripe-js/pure/index.js
197
+ var require_pure2 = chunkEMMSS5I5_cjs.__commonJS({
198
+ "node_modules/@stripe/stripe-js/pure/index.js"(exports, module) {
199
+ module.exports = require_pure();
200
+ }
201
+ });
202
+
12
203
  // ../../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
13
204
  var require_react_is_production_min = chunkEMMSS5I5_cjs.__commonJS({
14
205
  "../../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
@@ -944,168 +1135,8 @@ var require_prop_types = chunkEMMSS5I5_cjs.__commonJS({
944
1135
  }
945
1136
  });
946
1137
 
947
- // node_modules/@stripe/stripe-js/dist/index.mjs
948
- function _typeof(obj) {
949
- "@babel/helpers - typeof";
950
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
951
- _typeof = function(obj2) {
952
- return typeof obj2;
953
- };
954
- } else {
955
- _typeof = function(obj2) {
956
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
957
- };
958
- }
959
- return _typeof(obj);
960
- }
961
- var RELEASE_TRAIN = "dahlia";
962
- var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion2(version) {
963
- return version === 3 ? "v3" : version;
964
- };
965
- var ORIGIN = "https://js.stripe.com";
966
- var STRIPE_JS_URL = "".concat(ORIGIN, "/").concat(RELEASE_TRAIN, "/stripe.js");
967
- var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
968
- var STRIPE_JS_URL_REGEX = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
969
- var EXISTING_SCRIPT_MESSAGE = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";
970
- var isStripeJSURL = function isStripeJSURL2(url) {
971
- return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);
972
- };
973
- var findScript = function findScript2() {
974
- var scripts = document.querySelectorAll('script[src^="'.concat(ORIGIN, '"]'));
975
- for (var i = 0; i < scripts.length; i++) {
976
- var script = scripts[i];
977
- if (!isStripeJSURL(script.src)) {
978
- continue;
979
- }
980
- return script;
981
- }
982
- return null;
983
- };
984
- var injectScript = function injectScript2(params) {
985
- var queryString = "";
986
- var script = document.createElement("script");
987
- script.src = "".concat(STRIPE_JS_URL).concat(queryString);
988
- var headOrBody = document.head || document.body;
989
- if (!headOrBody) {
990
- throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
991
- }
992
- headOrBody.appendChild(script);
993
- return script;
994
- };
995
- var registerWrapper = function registerWrapper2(stripe, startTime) {
996
- if (!stripe || !stripe._registerWrapper) {
997
- return;
998
- }
999
- stripe._registerWrapper({
1000
- name: "stripe-js",
1001
- version: "9.9.0",
1002
- startTime
1003
- });
1004
- };
1005
- var stripePromise$1 = null;
1006
- var onErrorListener = null;
1007
- var onLoadListener = null;
1008
- var onError = function onError2(reject) {
1009
- return function(cause) {
1010
- reject(new Error("Failed to load Stripe.js", {
1011
- cause
1012
- }));
1013
- };
1014
- };
1015
- var onLoad = function onLoad2(resolve, reject) {
1016
- return function() {
1017
- if (window.Stripe) {
1018
- resolve(window.Stripe);
1019
- } else {
1020
- reject(new Error("Stripe.js not available"));
1021
- }
1022
- };
1023
- };
1024
- var loadScript = function loadScript2(params) {
1025
- if (stripePromise$1 !== null) {
1026
- return stripePromise$1;
1027
- }
1028
- stripePromise$1 = new Promise(function(resolve, reject) {
1029
- if (typeof window === "undefined" || typeof document === "undefined") {
1030
- resolve(null);
1031
- return;
1032
- }
1033
- if (window.Stripe) {
1034
- resolve(window.Stripe);
1035
- return;
1036
- }
1037
- try {
1038
- var script = findScript();
1039
- if (script && params) ; else if (!script) {
1040
- script = injectScript(params);
1041
- } else if (script && onLoadListener !== null && onErrorListener !== null) {
1042
- var _script$parentNode;
1043
- script.removeEventListener("load", onLoadListener);
1044
- script.removeEventListener("error", onErrorListener);
1045
- (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
1046
- script = injectScript(params);
1047
- }
1048
- onLoadListener = onLoad(resolve, reject);
1049
- onErrorListener = onError(reject);
1050
- script.addEventListener("load", onLoadListener);
1051
- script.addEventListener("error", onErrorListener);
1052
- } catch (error) {
1053
- reject(error);
1054
- return;
1055
- }
1056
- });
1057
- return stripePromise$1["catch"](function(error) {
1058
- stripePromise$1 = null;
1059
- return Promise.reject(error);
1060
- });
1061
- };
1062
- var initStripe = function initStripe2(maybeStripe, args, startTime) {
1063
- if (maybeStripe === null) {
1064
- return null;
1065
- }
1066
- var pk = args[0];
1067
- if (typeof pk !== "string") {
1068
- throw new Error("Expected publishable key to be of type string, got type ".concat(_typeof(pk), " instead."));
1069
- }
1070
- var isTestKey = pk.match(/^pk_test/);
1071
- var version = runtimeVersionToUrlVersion(maybeStripe.version);
1072
- var expectedVersion = RELEASE_TRAIN;
1073
- if (isTestKey && version !== expectedVersion) {
1074
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.9.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
1075
- }
1076
- var stripe = maybeStripe.apply(void 0, args);
1077
- registerWrapper(stripe, startTime);
1078
- return stripe;
1079
- };
1080
- var stripePromise;
1081
- var loadCalled = false;
1082
- var getStripePromise = function getStripePromise2() {
1083
- if (stripePromise) {
1084
- return stripePromise;
1085
- }
1086
- stripePromise = loadScript(null)["catch"](function(error) {
1087
- stripePromise = null;
1088
- return Promise.reject(error);
1089
- });
1090
- return stripePromise;
1091
- };
1092
- Promise.resolve().then(function() {
1093
- return getStripePromise();
1094
- })["catch"](function(error) {
1095
- if (!loadCalled) {
1096
- console.warn(error);
1097
- }
1098
- });
1099
- var loadStripe = function loadStripe2() {
1100
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1101
- args[_key] = arguments[_key];
1102
- }
1103
- loadCalled = true;
1104
- var startTime = Date.now();
1105
- return getStripePromise().then(function(maybeStripe) {
1106
- return initStripe(maybeStripe, args, startTime);
1107
- });
1108
- };
1138
+ // src/drivers/stripe.tsx
1139
+ var import_pure = chunkEMMSS5I5_cjs.__toESM(require_pure2(), 1);
1109
1140
 
1110
1141
  // node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs
1111
1142
  var react_stripe_esm_exports = {};
@@ -1258,13 +1289,13 @@ function _toPropertyKey(t) {
1258
1289
  var i = _toPrimitive(t, "string");
1259
1290
  return "symbol" == typeof i ? i : i + "";
1260
1291
  }
1261
- function _typeof2(o) {
1292
+ function _typeof(o) {
1262
1293
  "@babel/helpers - typeof";
1263
- return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
1294
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
1264
1295
  return typeof o2;
1265
1296
  } : function(o2) {
1266
1297
  return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
1267
- }, _typeof2(o);
1298
+ }, _typeof(o);
1268
1299
  }
1269
1300
  function _unsupportedIterableToArray(r, a) {
1270
1301
  if (r) {
@@ -1304,7 +1335,7 @@ var usePrevious = function usePrevious2(value) {
1304
1335
  return ref.current;
1305
1336
  };
1306
1337
  var isUnknownObject = function isUnknownObject2(raw) {
1307
- return raw !== null && _typeof2(raw) === "object";
1338
+ return raw !== null && _typeof(raw) === "object";
1308
1339
  };
1309
1340
  var isPromise = function isPromise2(raw) {
1310
1341
  return isUnknownObject(raw) && typeof raw.then === "function";
@@ -1797,7 +1828,7 @@ var EmbeddedCheckoutServerElement = function EmbeddedCheckoutServerElement2(_ref
1797
1828
  };
1798
1829
  var EmbeddedCheckout = isServer ? EmbeddedCheckoutServerElement : EmbeddedCheckoutClientElement;
1799
1830
  var FinancialAccountDisclosure = function FinancialAccountDisclosure2(_ref) {
1800
- var rawStripeProp = _ref.stripe, onLoad3 = _ref.onLoad, onError3 = _ref.onError, options = _ref.options;
1831
+ var rawStripeProp = _ref.stripe, onLoad = _ref.onLoad, onError = _ref.onError, options = _ref.options;
1801
1832
  var businessName = options === null || options === void 0 ? void 0 : options.businessName;
1802
1833
  var learnMoreLink = options === null || options === void 0 ? void 0 : options.learnMoreLink;
1803
1834
  var containerRef = React__default.default.useRef(null);
@@ -1808,9 +1839,9 @@ var FinancialAccountDisclosure = function FinancialAccountDisclosure2(_ref) {
1808
1839
  React__default.default.useEffect(function() {
1809
1840
  var isMounted = true;
1810
1841
  if (parsed.tag === "async") {
1811
- parsed.stripePromise.then(function(stripePromise2) {
1812
- if (stripePromise2 && isMounted) {
1813
- setStripeState(stripePromise2);
1842
+ parsed.stripePromise.then(function(stripePromise) {
1843
+ if (stripePromise && isMounted) {
1844
+ setStripeState(stripePromise);
1814
1845
  }
1815
1846
  });
1816
1847
  } else if (parsed.tag === "sync") {
@@ -1852,14 +1883,14 @@ var FinancialAccountDisclosure = function FinancialAccountDisclosure2(_ref) {
1852
1883
  _yield$stripeState$cr = _context.sent;
1853
1884
  disclosureContent = _yield$stripeState$cr.htmlElement;
1854
1885
  error = _yield$stripeState$cr.error;
1855
- if (error && onError3) {
1856
- onError3(error);
1886
+ if (error && onError) {
1887
+ onError(error);
1857
1888
  } else if (disclosureContent) {
1858
1889
  container = containerRef.current;
1859
1890
  container.innerHTML = "";
1860
1891
  container.appendChild(disclosureContent);
1861
- if (onLoad3) {
1862
- onLoad3();
1892
+ if (onLoad) {
1893
+ onLoad();
1863
1894
  }
1864
1895
  }
1865
1896
  case 8:
@@ -1874,13 +1905,13 @@ var FinancialAccountDisclosure = function FinancialAccountDisclosure2(_ref) {
1874
1905
  };
1875
1906
  })();
1876
1907
  createDisclosure();
1877
- }, [stripeState, businessName, learnMoreLink, onLoad3, onError3]);
1908
+ }, [stripeState, businessName, learnMoreLink, onLoad, onError]);
1878
1909
  return /* @__PURE__ */ React__default.default.createElement("div", {
1879
1910
  ref: containerRef
1880
1911
  });
1881
1912
  };
1882
1913
  var IssuingDisclosure = function IssuingDisclosure2(_ref) {
1883
- var rawStripeProp = _ref.stripe, onLoad3 = _ref.onLoad, onError3 = _ref.onError, options = _ref.options;
1914
+ var rawStripeProp = _ref.stripe, onLoad = _ref.onLoad, onError = _ref.onError, options = _ref.options;
1884
1915
  var issuingProgramID = options === null || options === void 0 ? void 0 : options.issuingProgramID;
1885
1916
  var publicCardProgramName = options === null || options === void 0 ? void 0 : options.publicCardProgramName;
1886
1917
  var learnMoreLink = options === null || options === void 0 ? void 0 : options.learnMoreLink;
@@ -1892,9 +1923,9 @@ var IssuingDisclosure = function IssuingDisclosure2(_ref) {
1892
1923
  React__default.default.useEffect(function() {
1893
1924
  var isMounted = true;
1894
1925
  if (parsed.tag === "async") {
1895
- parsed.stripePromise.then(function(stripePromise2) {
1896
- if (stripePromise2 && isMounted) {
1897
- setStripeState(stripePromise2);
1926
+ parsed.stripePromise.then(function(stripePromise) {
1927
+ if (stripePromise && isMounted) {
1928
+ setStripeState(stripePromise);
1898
1929
  }
1899
1930
  });
1900
1931
  } else if (parsed.tag === "sync") {
@@ -1937,14 +1968,14 @@ var IssuingDisclosure = function IssuingDisclosure2(_ref) {
1937
1968
  _yield$stripeState$cr = _context.sent;
1938
1969
  disclosureContent = _yield$stripeState$cr.htmlElement;
1939
1970
  error = _yield$stripeState$cr.error;
1940
- if (error && onError3) {
1941
- onError3(error);
1971
+ if (error && onError) {
1972
+ onError(error);
1942
1973
  } else if (disclosureContent) {
1943
1974
  container = containerRef.current;
1944
1975
  container.innerHTML = "";
1945
1976
  container.appendChild(disclosureContent);
1946
- if (onLoad3) {
1947
- onLoad3();
1977
+ if (onLoad) {
1978
+ onLoad();
1948
1979
  }
1949
1980
  }
1950
1981
  case 8:
@@ -1959,7 +1990,7 @@ var IssuingDisclosure = function IssuingDisclosure2(_ref) {
1959
1990
  };
1960
1991
  })();
1961
1992
  createDisclosure();
1962
- }, [stripeState, issuingProgramID, publicCardProgramName, learnMoreLink, onLoad3, onError3]);
1993
+ }, [stripeState, issuingProgramID, publicCardProgramName, learnMoreLink, onLoad, onError]);
1963
1994
  return /* @__PURE__ */ React__default.default.createElement("div", {
1964
1995
  ref: containerRef
1965
1996
  });
@@ -1992,10 +2023,30 @@ var IssuingCardCopyButtonElement = createElementComponent("issuingCardCopyButton
1992
2023
 
1993
2024
  // src/drivers/stripe.tsx
1994
2025
  var stripeInstances = /* @__PURE__ */ new Map();
2026
+ function isNullOriginPreview() {
2027
+ if (typeof window === "undefined") return false;
2028
+ try {
2029
+ const origin = window.origin ?? window.location?.origin;
2030
+ return origin === "null";
2031
+ } catch {
2032
+ return false;
2033
+ }
2034
+ }
2035
+ var fraudSignalsConfigured = false;
2036
+ function configureFraudSignals() {
2037
+ if (fraudSignalsConfigured) return;
2038
+ fraudSignalsConfigured = true;
2039
+ if (!isNullOriginPreview()) return;
2040
+ try {
2041
+ import_pure.loadStripe.setLoadParameters({ advancedFraudSignals: false });
2042
+ } catch {
2043
+ }
2044
+ }
1995
2045
  async function loadProvider(publishableKey) {
1996
2046
  let stripe = stripeInstances.get(publishableKey);
1997
2047
  if (!stripe) {
1998
- stripe = loadStripe(publishableKey);
2048
+ configureFraudSignals();
2049
+ stripe = (0, import_pure.loadStripe)(publishableKey);
1999
2050
  stripeInstances.set(publishableKey, stripe);
2000
2051
  }
2001
2052
  return { rsj: react_stripe_esm_exports, stripe };
@@ -2157,7 +2208,7 @@ function ConfirmForm({
2157
2208
  secretKind,
2158
2209
  onStart,
2159
2210
  onPaymentAdded,
2160
- onError: onError3,
2211
+ onError,
2161
2212
  reportFailure,
2162
2213
  finish
2163
2214
  }) {
@@ -2174,19 +2225,19 @@ function ConfirmForm({
2174
2225
  const { error, setupIntent } = await stripe.confirmSetup({ elements, redirect: "if_required" });
2175
2226
  if (error) {
2176
2227
  reportFailure(error.setup_intent?.id);
2177
- return onError3(fromStripeError(error));
2228
+ return onError(fromStripeError(error));
2178
2229
  }
2179
2230
  await finish(setupIntent?.id);
2180
2231
  } else {
2181
2232
  const { error, paymentIntent } = await stripe.confirmPayment({ elements, redirect: "if_required" });
2182
2233
  if (error) {
2183
2234
  reportFailure(error.payment_intent?.id);
2184
- return onError3(fromStripeError(error));
2235
+ return onError(fromStripeError(error));
2185
2236
  }
2186
2237
  await finish(paymentIntent?.id);
2187
2238
  }
2188
2239
  } catch (e) {
2189
- onError3(chunkVAOR77NW_cjs.toCheckoutError(e));
2240
+ onError(chunkVAOR77NW_cjs.toCheckoutError(e));
2190
2241
  } finally {
2191
2242
  setSubmitting(false);
2192
2243
  }
@@ -2249,6 +2300,7 @@ object-assign/index.js:
2249
2300
  *)
2250
2301
  */
2251
2302
 
2303
+ exports.isNullOriginPreview = isNullOriginPreview;
2252
2304
  exports.stripeCheckoutDriver = stripeCheckoutDriver;
2253
2305
  //# sourceMappingURL=driver-stripe.cjs.map
2254
2306
  //# sourceMappingURL=driver-stripe.cjs.map