tf-checkout-react 1.7.2 → 1.7.3

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.
@@ -1140,6 +1140,66 @@ var logout = /*#__PURE__*/function () {
1140
1140
  return _ref5.apply(this, arguments);
1141
1141
  };
1142
1142
  }();
1143
+ /**
1144
+ * Checks whether a given email address already exists via the `/ajax/contact-email` endpoint.
1145
+ *
1146
+ * The underlying API is expected to return a JSON object containing:
1147
+ * - `exists`: `1` if the email exists, `0` otherwise
1148
+ * - `error`: `1` if an error occurred, `0` otherwise
1149
+ * - `message`: an optional error message when `error === 1`
1150
+ *
1151
+ * This function normalizes that response to an object with:
1152
+ * - `exists`: a boolean indicating whether the email exists
1153
+ * - `error`: an optional string containing an error message, if any
1154
+ *
1155
+ * On network or unexpected errors, it returns `{ exists: false, error: 'Failed to check email' }`.
1156
+ *
1157
+ * @param {string} email - The email address to check for existence.
1158
+ * @returns {Promise<{ exists: boolean; error?: string }>} A promise that resolves to the normalized
1159
+ * result of the email existence check.
1160
+ */
1161
+ var checkEmailExists = /*#__PURE__*/function () {
1162
+ var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(email) {
1163
+ var _publicRequest$defaul, formData, baseUrl, url, response;
1164
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1165
+ while (1) switch (_context6.prev = _context6.next) {
1166
+ case 0:
1167
+ _context6.prev = 0;
1168
+ formData = new FormData();
1169
+ formData.append('email', email);
1170
+ formData.append('is_checkout_flow', 'true');
1171
+ baseUrl = ((_publicRequest$defaul = publicRequest.defaults.baseURL) == null ? void 0 : _publicRequest$defaul.replace('/api', '')) || '';
1172
+ url = baseUrl + "/ajax/contact-email";
1173
+ _context6.next = 8;
1174
+ return publicRequest.post(url, formData, {
1175
+ headers: {
1176
+ 'Content-Type': 'multipart/form-data'
1177
+ }
1178
+ });
1179
+ case 8:
1180
+ response = _context6.sent;
1181
+ return _context6.abrupt("return", {
1182
+ exists: response.data.exists === 1,
1183
+ error: response.data.error === 1 ? response.data.message : undefined
1184
+ });
1185
+ case 12:
1186
+ _context6.prev = 12;
1187
+ _context6.t0 = _context6["catch"](0);
1188
+ console.error('Error checking email:', _context6.t0);
1189
+ return _context6.abrupt("return", {
1190
+ exists: false,
1191
+ error: 'Failed to check email'
1192
+ });
1193
+ case 16:
1194
+ case "end":
1195
+ return _context6.stop();
1196
+ }
1197
+ }, _callee6, null, [[0, 12]]);
1198
+ }));
1199
+ return function checkEmailExists(_x4) {
1200
+ return _ref6.apply(this, arguments);
1201
+ };
1202
+ }();
1143
1203
 
1144
1204
  var getOrders = /*#__PURE__*/function () {
1145
1205
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(page, limit, eventSlug) {
@@ -2403,6 +2463,50 @@ var usePixel = /*#__PURE__*/function () {
2403
2463
  };
2404
2464
  }();
2405
2465
 
2466
+ var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
2467
+ var combineValidators = function combineValidators() {
2468
+ for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
2469
+ validators[_key] = arguments[_key];
2470
+ }
2471
+ return function () {
2472
+ for (var i = 0; i < validators.length; ++i) {
2473
+ var error_message = validators[i].apply(validators, arguments);
2474
+ if (error_message) return error_message;
2475
+ }
2476
+ };
2477
+ };
2478
+ function isFalsy(item) {
2479
+ try {
2480
+ if (!item ||
2481
+ // handles most, like false, 0, null, etc
2482
+ typeof item === 'object' && Object.keys(item).length === 0 &&
2483
+ // for empty objects, like {}, []
2484
+ !(typeof item.addEventListener === 'function') // omit webpage elements
2485
+ ) {
2486
+ return true;
2487
+ }
2488
+ } catch (err) {
2489
+ return true;
2490
+ }
2491
+ return false;
2492
+ }
2493
+ var requiredValidator = function requiredValidator(value, message) {
2494
+ var errorMessage = '';
2495
+ if (isFalsy(typeof value === 'string' ? value.trim() : value)) {
2496
+ errorMessage = message || 'Required';
2497
+ }
2498
+ return errorMessage;
2499
+ };
2500
+ var emailValidator = function emailValidator(email) {
2501
+ return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
2502
+ };
2503
+ var passwordValidator = function passwordValidator(password) {
2504
+ if (!password || password.length < 6) {
2505
+ return 'The password must be at least 6 characters.';
2506
+ }
2507
+ return '';
2508
+ };
2509
+
2406
2510
  var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
2407
2511
  return !value ? '' : getCurrencySymbolByCurrency(currency) + " " + value;
2408
2512
  };
@@ -2678,44 +2782,6 @@ var cartAdapter = function cartAdapter(cart) {
2678
2782
  };
2679
2783
  };
2680
2784
 
2681
- var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
2682
- var combineValidators = function combineValidators() {
2683
- for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
2684
- validators[_key] = arguments[_key];
2685
- }
2686
- return function () {
2687
- for (var i = 0; i < validators.length; ++i) {
2688
- var error_message = validators[i].apply(validators, arguments);
2689
- if (error_message) return error_message;
2690
- }
2691
- };
2692
- };
2693
- function isFalsy(item) {
2694
- try {
2695
- if (!item ||
2696
- // handles most, like false, 0, null, etc
2697
- typeof item === 'object' && Object.keys(item).length === 0 &&
2698
- // for empty objects, like {}, []
2699
- !(typeof item.addEventListener === 'function') // omit webpage elements
2700
- ) {
2701
- return true;
2702
- }
2703
- } catch (err) {
2704
- return true;
2705
- }
2706
- return false;
2707
- }
2708
- var requiredValidator = function requiredValidator(value, message) {
2709
- var errorMessage = '';
2710
- if (isFalsy(typeof value === 'string' ? value.trim() : value)) {
2711
- errorMessage = message || 'Required';
2712
- }
2713
- return errorMessage;
2714
- };
2715
- var emailValidator = function emailValidator(email) {
2716
- return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
2717
- };
2718
-
2719
2785
  var CheckboxField = function CheckboxField(_ref) {
2720
2786
  var label = _ref.label,
2721
2787
  field = _ref.field,
@@ -4794,7 +4860,9 @@ var LoginModal = function LoginModal(_ref) {
4794
4860
  _ref$showSignUpButton = _ref.showSignUpButton,
4795
4861
  showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
4796
4862
  _ref$showPoweredByIma = _ref.showPoweredByImage,
4797
- showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
4863
+ showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma,
4864
+ _ref$registerUrl = _ref.registerUrl,
4865
+ registerUrl = _ref$registerUrl === void 0 ? 'https://www.ticketfairy.com/register' : _ref$registerUrl;
4798
4866
  var _useState = useState(''),
4799
4867
  error = _useState[0],
4800
4868
  setError = _useState[1];
@@ -4922,9 +4990,16 @@ var LoginModal = function LoginModal(_ref) {
4922
4990
  onClick: onForgotPassword
4923
4991
  }, "Forgot password?")), showSignUpButton && React.createElement("div", {
4924
4992
  className: "forgot-password"
4925
- }, React.createElement("span", {
4993
+ }, onSignup !== _identity ? React.createElement("span", {
4926
4994
  "aria-hidden": "true",
4927
- onClick: onSignup
4995
+ onClick: onSignup,
4996
+ style: {
4997
+ cursor: 'pointer'
4998
+ }
4999
+ }, "Sign up") : React.createElement("a", {
5000
+ href: registerUrl,
5001
+ target: "_blank",
5002
+ rel: "noopener noreferrer"
4928
5003
  }, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
4929
5004
  }))));
4930
5005
  };
@@ -5986,6 +6061,7 @@ var LogicRunner = function LogicRunner(_ref) {
5986
6061
  email: '',
5987
6062
  phone: ''
5988
6063
  });
6064
+ var hasLoadedUserData = useRef(false);
5989
6065
  useEffect(function () {
5990
6066
  var fetchStates = /*#__PURE__*/function () {
5991
6067
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -6064,145 +6140,222 @@ var LogicRunner = function LogicRunner(_ref) {
6064
6140
  }, [values.firstName, values.lastName, values.email, values.phone, setFieldValue]);
6065
6141
  var userDataEncoded = isBrowser ? window.localStorage.getItem('user_data') : '';
6066
6142
  useEffect(function () {
6067
- // set user data from local storage
6143
+ // set user data from local storage only on initial load
6068
6144
  var getStoredUserData = function getStoredUserData() {
6069
- if (isBrowser) {
6070
- if (userDataEncoded) {
6071
- try {
6072
- var parsedData = JSON.parse(userDataEncoded);
6073
- var mappedValues = {
6074
- firstName: (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
6075
- lastName: (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
6076
- email: (parsedData == null ? void 0 : parsedData.email) || '',
6077
- phone: (parsedData == null ? void 0 : parsedData.phone) || '',
6078
- confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
6079
- state: (parsedData == null ? void 0 : parsedData.state) || '',
6080
- street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
6081
- country: (parsedData == null ? void 0 : parsedData.country) || '1',
6082
- zip: (parsedData == null ? void 0 : parsedData.zip) || '',
6083
- brand_opt_in: brandOptIn ? brandOptIn : (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
6084
- city: (parsedData == null ? void 0 : parsedData.city) || '',
6085
- confirmPassword: '',
6086
- password: '',
6087
- 'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
6088
- 'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
6089
- 'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || '',
6090
- 'holderPhone-0': (parsedData == null ? void 0 : parsedData.phone) || ''
6091
- };
6092
- var extraDataJSON = window.localStorage.getItem('extraData');
6093
- var extraData = extraDataJSON ? JSON.parse(extraDataJSON) : null;
6094
- setValues(_extends({}, values, mappedValues, extraData != null ? extraData : {}));
6095
- setUserValues(mappedValues);
6096
- } catch (e) {}
6097
- }
6145
+ if (isBrowser && userDataEncoded && !hasLoadedUserData.current) {
6146
+ try {
6147
+ var parsedData = JSON.parse(userDataEncoded);
6148
+ var mappedValues = {
6149
+ firstName: (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
6150
+ lastName: (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
6151
+ email: (parsedData == null ? void 0 : parsedData.email) || '',
6152
+ phone: (parsedData == null ? void 0 : parsedData.phone) || '',
6153
+ confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
6154
+ state: (parsedData == null ? void 0 : parsedData.state) || '',
6155
+ street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
6156
+ country: (parsedData == null ? void 0 : parsedData.country) || '1',
6157
+ zip: (parsedData == null ? void 0 : parsedData.zip) || '',
6158
+ brand_opt_in: brandOptIn ? brandOptIn : (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
6159
+ city: (parsedData == null ? void 0 : parsedData.city) || '',
6160
+ confirmPassword: '',
6161
+ password: '',
6162
+ 'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
6163
+ 'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
6164
+ 'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || '',
6165
+ 'holderPhone-0': (parsedData == null ? void 0 : parsedData.phone) || ''
6166
+ };
6167
+ var extraDataJSON = window.localStorage.getItem('extraData');
6168
+ var extraData = extraDataJSON ? JSON.parse(extraDataJSON) : null;
6169
+ setValues(_extends({}, values, mappedValues, extraData != null ? extraData : {}));
6170
+ setUserValues(mappedValues);
6171
+ hasLoadedUserData.current = true;
6172
+ } catch (e) {}
6098
6173
  }
6099
6174
  };
6100
6175
  getStoredUserData();
6101
- }, [userDataEncoded, setValues, setUserValues, brandOptIn]);
6176
+ // Only run on mount or when userDataEncoded first becomes available
6177
+ // eslint-disable-next-line react-hooks/exhaustive-deps
6178
+ }, []);
6179
+ return null;
6180
+ };
6181
+ // Component to check if email exists
6182
+ /**
6183
+ * A utility component that checks if an email address already exists in the system.
6184
+ *
6185
+ * Performs debounced validation and existence checking for user email addresses.
6186
+ * Only checks when both email and confirmEmail match, are valid, and user is not logged in.
6187
+ *
6188
+ * @param email - The primary email address to check
6189
+ * @param confirmEmail - The confirmation email address (must match email)
6190
+ * @param isLoggedIn - Whether the user is currently logged in
6191
+ * @param setEmailExists - Callback function to update the email existence state
6192
+ *
6193
+ * @remarks
6194
+ * - Uses a 500ms debounce to avoid excessive API calls
6195
+ * - Validates email format using regex before checking existence
6196
+ * - Automatically returns false if user is logged in
6197
+ * - Returns null as it's a logic-only component with no UI
6198
+ */
6199
+ var EmailExistenceChecker = function EmailExistenceChecker(_ref4) {
6200
+ var email = _ref4.email,
6201
+ confirmEmail = _ref4.confirmEmail,
6202
+ isLoggedIn = _ref4.isLoggedIn,
6203
+ setEmailExists = _ref4.setEmailExists;
6204
+ useEffect(function () {
6205
+ var checkEmail = /*#__PURE__*/function () {
6206
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
6207
+ var result;
6208
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
6209
+ while (1) switch (_context2.prev = _context2.next) {
6210
+ case 0:
6211
+ if (!isLoggedIn) {
6212
+ _context2.next = 3;
6213
+ break;
6214
+ }
6215
+ setEmailExists(false);
6216
+ return _context2.abrupt("return");
6217
+ case 3:
6218
+ if (!(!email || !confirmEmail || email !== confirmEmail || !emailRegex.test(email))) {
6219
+ _context2.next = 6;
6220
+ break;
6221
+ }
6222
+ setEmailExists(false);
6223
+ return _context2.abrupt("return");
6224
+ case 6:
6225
+ _context2.prev = 6;
6226
+ _context2.next = 9;
6227
+ return checkEmailExists(email);
6228
+ case 9:
6229
+ result = _context2.sent;
6230
+ setEmailExists(result.exists);
6231
+ _context2.next = 16;
6232
+ break;
6233
+ case 13:
6234
+ _context2.prev = 13;
6235
+ _context2.t0 = _context2["catch"](6);
6236
+ setEmailExists(false);
6237
+ case 16:
6238
+ case "end":
6239
+ return _context2.stop();
6240
+ }
6241
+ }, _callee2, null, [[6, 13]]);
6242
+ }));
6243
+ return function checkEmail() {
6244
+ return _ref5.apply(this, arguments);
6245
+ };
6246
+ }();
6247
+ // Debounce the check
6248
+ var timeoutId = setTimeout(function () {
6249
+ checkEmail();
6250
+ }, 800);
6251
+ return function () {
6252
+ return clearTimeout(timeoutId);
6253
+ };
6254
+ }, [email, confirmEmail, isLoggedIn, setEmailExists]);
6102
6255
  return null;
6103
6256
  };
6104
- var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6257
+ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
6105
6258
  var _reviewData$payment_m, _checkoutUpdateData$a, _checkoutUpdateData$a2, _reviewData$payment_m2, _checkoutUpdateData$a3, _checkoutUpdateData$a4, _checkoutUpdateData$a5;
6106
- var _ref4$data = _ref4.data,
6107
- data = _ref4$data === void 0 ? [] : _ref4$data,
6108
- _ref4$ticketHoldersFi = _ref4.ticketHoldersFields,
6109
- ticketHoldersFields = _ref4$ticketHoldersFi === void 0 ? {
6259
+ var _ref6$data = _ref6.data,
6260
+ data = _ref6$data === void 0 ? [] : _ref6$data,
6261
+ _ref6$ticketHoldersFi = _ref6.ticketHoldersFields,
6262
+ ticketHoldersFields = _ref6$ticketHoldersFi === void 0 ? {
6110
6263
  id: 1,
6111
6264
  fields: []
6112
- } : _ref4$ticketHoldersFi,
6113
- _ref4$initialValues = _ref4.initialValues,
6114
- initialValues = _ref4$initialValues === void 0 ? {} : _ref4$initialValues,
6115
- _ref4$buttonName = _ref4.buttonName,
6116
- buttonName = _ref4$buttonName === void 0 ? 'Submit' : _ref4$buttonName,
6117
- _ref4$freeOrderButton = _ref4.freeOrderButtonName,
6118
- freeOrderButtonName = _ref4$freeOrderButton === void 0 ? 'Complete Registration' : _ref4$freeOrderButton,
6119
- _ref4$handleSubmit = _ref4.handleSubmit,
6120
- handleSubmit = _ref4$handleSubmit === void 0 ? _identity : _ref4$handleSubmit,
6121
- _ref4$theme = _ref4.theme,
6122
- theme = _ref4$theme === void 0 ? 'light' : _ref4$theme,
6123
- _ref4$onRegisterSucce = _ref4.onRegisterSuccess,
6124
- onRegisterSuccess = _ref4$onRegisterSucce === void 0 ? _identity : _ref4$onRegisterSucce,
6125
- _ref4$onRegisterError = _ref4.onRegisterError,
6126
- onRegisterError = _ref4$onRegisterError === void 0 ? _identity : _ref4$onRegisterError,
6127
- _ref4$onSubmitError = _ref4.onSubmitError,
6128
- onSubmitError = _ref4$onSubmitError === void 0 ? _identity : _ref4$onSubmitError,
6129
- _ref4$onGetCartSucces = _ref4.onGetCartSuccess,
6130
- onGetCartSuccess = _ref4$onGetCartSucces === void 0 ? _identity : _ref4$onGetCartSucces,
6131
- _ref4$onGetCartError = _ref4.onGetCartError,
6132
- onGetCartError = _ref4$onGetCartError === void 0 ? _identity : _ref4$onGetCartError,
6133
- _ref4$onGetCountriesS = _ref4.onGetCountriesSuccess,
6134
- onGetCountriesSuccess = _ref4$onGetCountriesS === void 0 ? _identity : _ref4$onGetCountriesS,
6135
- _ref4$onGetCountriesE = _ref4.onGetCountriesError,
6136
- onGetCountriesError = _ref4$onGetCountriesE === void 0 ? _identity : _ref4$onGetCountriesE,
6137
- _ref4$onGetStatesSucc = _ref4.onGetStatesSuccess,
6138
- onGetStatesSuccess = _ref4$onGetStatesSucc === void 0 ? _identity : _ref4$onGetStatesSucc,
6139
- _ref4$onGetStatesErro = _ref4.onGetStatesError,
6140
- onGetStatesError = _ref4$onGetStatesErro === void 0 ? _identity : _ref4$onGetStatesErro,
6141
- _ref4$onGetProfileDat = _ref4.onGetProfileDataSuccess,
6142
- _onGetProfileDataSuccess = _ref4$onGetProfileDat === void 0 ? _identity : _ref4$onGetProfileDat,
6143
- _ref4$onGetProfileDat2 = _ref4.onGetProfileDataError,
6144
- onGetProfileDataError = _ref4$onGetProfileDat2 === void 0 ? _identity : _ref4$onGetProfileDat2,
6145
- onLogin = _ref4.onLogin,
6146
- _ref4$onLoginSuccess = _ref4.onLoginSuccess,
6147
- onLoginSuccess = _ref4$onLoginSuccess === void 0 ? _identity : _ref4$onLoginSuccess,
6148
- _ref4$onCheckoutUpdat = _ref4.onCheckoutUpdateSuccess,
6149
- onCheckoutUpdateSuccess = _ref4$onCheckoutUpdat === void 0 ? _identity : _ref4$onCheckoutUpdat,
6150
- _ref4$onCheckoutUpdat2 = _ref4.onCheckoutUpdateError,
6151
- onCheckoutUpdateError = _ref4$onCheckoutUpdat2 === void 0 ? _identity : _ref4$onCheckoutUpdat2,
6152
- _ref4$isLoggedIn = _ref4.isLoggedIn,
6153
- pIsLoggedIn = _ref4$isLoggedIn === void 0 ? false : _ref4$isLoggedIn,
6154
- _ref4$accountInfoTitl = _ref4.accountInfoTitle,
6155
- accountInfoTitle = _ref4$accountInfoTitl === void 0 ? '' : _ref4$accountInfoTitl,
6156
- hideLogo = _ref4.hideLogo,
6157
- themeOptions = _ref4.themeOptions,
6158
- _ref4$onErrorClose = _ref4.onErrorClose,
6159
- onErrorClose = _ref4$onErrorClose === void 0 ? _identity : _ref4$onErrorClose,
6160
- _ref4$hideErrorsAlert = _ref4.hideErrorsAlertSection,
6161
- hideErrorsAlertSection = _ref4$hideErrorsAlert === void 0 ? false : _ref4$hideErrorsAlert,
6162
- _ref4$onSkipBillingPa = _ref4.onSkipBillingPage,
6163
- onSkipBillingPage = _ref4$onSkipBillingPa === void 0 ? _identity : _ref4$onSkipBillingPa,
6164
- _ref4$skipPage = _ref4.skipPage,
6165
- skipPage = _ref4$skipPage === void 0 ? false : _ref4$skipPage,
6166
- _ref4$canSkipHolderNa = _ref4.canSkipHolderNames,
6167
- canSkipHolderNames = _ref4$canSkipHolderNa === void 0 ? false : _ref4$canSkipHolderNa,
6168
- _ref4$onForgotPasswor = _ref4.onForgotPasswordSuccess,
6169
- onForgotPasswordSuccess = _ref4$onForgotPasswor === void 0 ? _identity : _ref4$onForgotPasswor,
6170
- _ref4$onForgotPasswor2 = _ref4.onForgotPasswordError,
6171
- onForgotPasswordError = _ref4$onForgotPasswor2 === void 0 ? _identity : _ref4$onForgotPasswor2,
6172
- _ref4$shouldFetchCoun = _ref4.shouldFetchCountries,
6173
- shouldFetchCountries = _ref4$shouldFetchCoun === void 0 ? true : _ref4$shouldFetchCoun,
6174
- _ref4$onCountdownFini = _ref4.onCountdownFinish,
6175
- onCountdownFinish = _ref4$onCountdownFini === void 0 ? _identity : _ref4$onCountdownFini,
6176
- _ref4$enableTimer = _ref4.enableTimer,
6177
- enableTimer = _ref4$enableTimer === void 0 ? false : _ref4$enableTimer,
6178
- logo = _ref4.logo,
6179
- _ref4$showForgotPassw = _ref4.showForgotPasswordButton,
6180
- showForgotPasswordButton = _ref4$showForgotPassw === void 0 ? false : _ref4$showForgotPassw,
6181
- _ref4$showSignUpButto = _ref4.showSignUpButton,
6182
- showSignUpButton = _ref4$showSignUpButto === void 0 ? false : _ref4$showSignUpButto,
6183
- _ref4$brandOptIn = _ref4.brandOptIn,
6184
- brandOptIn = _ref4$brandOptIn === void 0 ? false : _ref4$brandOptIn,
6185
- _ref4$showPoweredByIm = _ref4.showPoweredByImage,
6186
- showPoweredByImage = _ref4$showPoweredByIm === void 0 ? false : _ref4$showPoweredByIm,
6187
- customFieldsOrderKeys = _ref4.customFieldsOrderKeys,
6188
- customFieldsTicketHolderKeys = _ref4.customFieldsTicketHolderKeys,
6189
- _ref4$isCountryCodeEd = _ref4.isCountryCodeEditable,
6190
- isCountryCodeEditable = _ref4$isCountryCodeEd === void 0 ? true : _ref4$isCountryCodeEd,
6191
- _ref4$onPendingVerifi = _ref4.onPendingVerification,
6192
- onPendingVerification = _ref4$onPendingVerifi === void 0 ? _identity : _ref4$onPendingVerifi,
6193
- _ref4$onGetCheckoutCo = _ref4.onGetCheckoutConfigsSuccess,
6194
- onGetCheckoutConfigsSuccess = _ref4$onGetCheckoutCo === void 0 ? _identity : _ref4$onGetCheckoutCo,
6195
- _ref4$onGetCheckoutCo2 = _ref4.onGetCheckoutConfigsError,
6196
- onGetCheckoutConfigsError = _ref4$onGetCheckoutCo2 === void 0 ? _identity : _ref4$onGetCheckoutCo2,
6197
- _ref4$includeAddons = _ref4.includeAddons,
6198
- includeAddons = _ref4$includeAddons === void 0 ? false : _ref4$includeAddons,
6199
- addonsProps = _ref4.addonsProps,
6200
- addOnDataWithCustomFields = _ref4.addOnDataWithCustomFields,
6201
- _ref4$isSinglePageChe = _ref4.isSinglePageCheckout,
6202
- isSinglePageCheckout = _ref4$isSinglePageChe === void 0 ? false : _ref4$isSinglePageChe,
6203
- _ref4$paymentProps = _ref4.paymentProps,
6204
- paymentProps = _ref4$paymentProps === void 0 ? {} : _ref4$paymentProps,
6205
- paymentSectionAddon = _ref4.paymentSectionAddon;
6265
+ } : _ref6$ticketHoldersFi,
6266
+ _ref6$initialValues = _ref6.initialValues,
6267
+ initialValues = _ref6$initialValues === void 0 ? {} : _ref6$initialValues,
6268
+ _ref6$buttonName = _ref6.buttonName,
6269
+ buttonName = _ref6$buttonName === void 0 ? 'Submit' : _ref6$buttonName,
6270
+ _ref6$freeOrderButton = _ref6.freeOrderButtonName,
6271
+ freeOrderButtonName = _ref6$freeOrderButton === void 0 ? 'Complete Registration' : _ref6$freeOrderButton,
6272
+ _ref6$handleSubmit = _ref6.handleSubmit,
6273
+ handleSubmit = _ref6$handleSubmit === void 0 ? _identity : _ref6$handleSubmit,
6274
+ _ref6$theme = _ref6.theme,
6275
+ theme = _ref6$theme === void 0 ? 'light' : _ref6$theme,
6276
+ _ref6$onRegisterSucce = _ref6.onRegisterSuccess,
6277
+ onRegisterSuccess = _ref6$onRegisterSucce === void 0 ? _identity : _ref6$onRegisterSucce,
6278
+ _ref6$onRegisterError = _ref6.onRegisterError,
6279
+ onRegisterError = _ref6$onRegisterError === void 0 ? _identity : _ref6$onRegisterError,
6280
+ _ref6$onSubmitError = _ref6.onSubmitError,
6281
+ onSubmitError = _ref6$onSubmitError === void 0 ? _identity : _ref6$onSubmitError,
6282
+ _ref6$onGetCartSucces = _ref6.onGetCartSuccess,
6283
+ onGetCartSuccess = _ref6$onGetCartSucces === void 0 ? _identity : _ref6$onGetCartSucces,
6284
+ _ref6$onGetCartError = _ref6.onGetCartError,
6285
+ onGetCartError = _ref6$onGetCartError === void 0 ? _identity : _ref6$onGetCartError,
6286
+ _ref6$onGetCountriesS = _ref6.onGetCountriesSuccess,
6287
+ onGetCountriesSuccess = _ref6$onGetCountriesS === void 0 ? _identity : _ref6$onGetCountriesS,
6288
+ _ref6$onGetCountriesE = _ref6.onGetCountriesError,
6289
+ onGetCountriesError = _ref6$onGetCountriesE === void 0 ? _identity : _ref6$onGetCountriesE,
6290
+ _ref6$onGetStatesSucc = _ref6.onGetStatesSuccess,
6291
+ onGetStatesSuccess = _ref6$onGetStatesSucc === void 0 ? _identity : _ref6$onGetStatesSucc,
6292
+ _ref6$onGetStatesErro = _ref6.onGetStatesError,
6293
+ onGetStatesError = _ref6$onGetStatesErro === void 0 ? _identity : _ref6$onGetStatesErro,
6294
+ _ref6$onGetProfileDat = _ref6.onGetProfileDataSuccess,
6295
+ _onGetProfileDataSuccess = _ref6$onGetProfileDat === void 0 ? _identity : _ref6$onGetProfileDat,
6296
+ _ref6$onGetProfileDat2 = _ref6.onGetProfileDataError,
6297
+ onGetProfileDataError = _ref6$onGetProfileDat2 === void 0 ? _identity : _ref6$onGetProfileDat2,
6298
+ onLogin = _ref6.onLogin,
6299
+ _ref6$onLoginSuccess = _ref6.onLoginSuccess,
6300
+ onLoginSuccess = _ref6$onLoginSuccess === void 0 ? _identity : _ref6$onLoginSuccess,
6301
+ _ref6$onCheckoutUpdat = _ref6.onCheckoutUpdateSuccess,
6302
+ onCheckoutUpdateSuccess = _ref6$onCheckoutUpdat === void 0 ? _identity : _ref6$onCheckoutUpdat,
6303
+ _ref6$onCheckoutUpdat2 = _ref6.onCheckoutUpdateError,
6304
+ onCheckoutUpdateError = _ref6$onCheckoutUpdat2 === void 0 ? _identity : _ref6$onCheckoutUpdat2,
6305
+ _ref6$isLoggedIn = _ref6.isLoggedIn,
6306
+ pIsLoggedIn = _ref6$isLoggedIn === void 0 ? false : _ref6$isLoggedIn,
6307
+ _ref6$accountInfoTitl = _ref6.accountInfoTitle,
6308
+ accountInfoTitle = _ref6$accountInfoTitl === void 0 ? '' : _ref6$accountInfoTitl,
6309
+ hideLogo = _ref6.hideLogo,
6310
+ themeOptions = _ref6.themeOptions,
6311
+ _ref6$onErrorClose = _ref6.onErrorClose,
6312
+ onErrorClose = _ref6$onErrorClose === void 0 ? _identity : _ref6$onErrorClose,
6313
+ _ref6$hideErrorsAlert = _ref6.hideErrorsAlertSection,
6314
+ hideErrorsAlertSection = _ref6$hideErrorsAlert === void 0 ? false : _ref6$hideErrorsAlert,
6315
+ _ref6$onSkipBillingPa = _ref6.onSkipBillingPage,
6316
+ onSkipBillingPage = _ref6$onSkipBillingPa === void 0 ? _identity : _ref6$onSkipBillingPa,
6317
+ _ref6$skipPage = _ref6.skipPage,
6318
+ skipPage = _ref6$skipPage === void 0 ? false : _ref6$skipPage,
6319
+ _ref6$canSkipHolderNa = _ref6.canSkipHolderNames,
6320
+ canSkipHolderNames = _ref6$canSkipHolderNa === void 0 ? false : _ref6$canSkipHolderNa,
6321
+ _ref6$onForgotPasswor = _ref6.onForgotPasswordSuccess,
6322
+ onForgotPasswordSuccess = _ref6$onForgotPasswor === void 0 ? _identity : _ref6$onForgotPasswor,
6323
+ _ref6$onForgotPasswor2 = _ref6.onForgotPasswordError,
6324
+ onForgotPasswordError = _ref6$onForgotPasswor2 === void 0 ? _identity : _ref6$onForgotPasswor2,
6325
+ _ref6$shouldFetchCoun = _ref6.shouldFetchCountries,
6326
+ shouldFetchCountries = _ref6$shouldFetchCoun === void 0 ? true : _ref6$shouldFetchCoun,
6327
+ _ref6$onCountdownFini = _ref6.onCountdownFinish,
6328
+ onCountdownFinish = _ref6$onCountdownFini === void 0 ? _identity : _ref6$onCountdownFini,
6329
+ _ref6$enableTimer = _ref6.enableTimer,
6330
+ enableTimer = _ref6$enableTimer === void 0 ? false : _ref6$enableTimer,
6331
+ logo = _ref6.logo,
6332
+ _ref6$showForgotPassw = _ref6.showForgotPasswordButton,
6333
+ showForgotPasswordButton = _ref6$showForgotPassw === void 0 ? false : _ref6$showForgotPassw,
6334
+ _ref6$showSignUpButto = _ref6.showSignUpButton,
6335
+ showSignUpButton = _ref6$showSignUpButto === void 0 ? false : _ref6$showSignUpButto,
6336
+ _ref6$brandOptIn = _ref6.brandOptIn,
6337
+ brandOptIn = _ref6$brandOptIn === void 0 ? false : _ref6$brandOptIn,
6338
+ _ref6$showPoweredByIm = _ref6.showPoweredByImage,
6339
+ showPoweredByImage = _ref6$showPoweredByIm === void 0 ? false : _ref6$showPoweredByIm,
6340
+ customFieldsOrderKeys = _ref6.customFieldsOrderKeys,
6341
+ customFieldsTicketHolderKeys = _ref6.customFieldsTicketHolderKeys,
6342
+ _ref6$isCountryCodeEd = _ref6.isCountryCodeEditable,
6343
+ isCountryCodeEditable = _ref6$isCountryCodeEd === void 0 ? true : _ref6$isCountryCodeEd,
6344
+ _ref6$onPendingVerifi = _ref6.onPendingVerification,
6345
+ onPendingVerification = _ref6$onPendingVerifi === void 0 ? _identity : _ref6$onPendingVerifi,
6346
+ _ref6$onGetCheckoutCo = _ref6.onGetCheckoutConfigsSuccess,
6347
+ onGetCheckoutConfigsSuccess = _ref6$onGetCheckoutCo === void 0 ? _identity : _ref6$onGetCheckoutCo,
6348
+ _ref6$onGetCheckoutCo2 = _ref6.onGetCheckoutConfigsError,
6349
+ onGetCheckoutConfigsError = _ref6$onGetCheckoutCo2 === void 0 ? _identity : _ref6$onGetCheckoutCo2,
6350
+ _ref6$includeAddons = _ref6.includeAddons,
6351
+ includeAddons = _ref6$includeAddons === void 0 ? false : _ref6$includeAddons,
6352
+ addonsProps = _ref6.addonsProps,
6353
+ addOnDataWithCustomFields = _ref6.addOnDataWithCustomFields,
6354
+ _ref6$isSinglePageChe = _ref6.isSinglePageCheckout,
6355
+ isSinglePageCheckout = _ref6$isSinglePageChe === void 0 ? false : _ref6$isSinglePageChe,
6356
+ _ref6$paymentProps = _ref6.paymentProps,
6357
+ paymentProps = _ref6$paymentProps === void 0 ? {} : _ref6$paymentProps,
6358
+ paymentSectionAddon = _ref6.paymentSectionAddon;
6206
6359
  var _useState = useState(null),
6207
6360
  extraData = _useState[0],
6208
6361
  setExtraData = _useState[1];
@@ -6305,6 +6458,9 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6305
6458
  var _useState19 = useState(false),
6306
6459
  phoneValidationIsLoading = _useState19[0],
6307
6460
  setPhoneValidationIsLoading = _useState19[1];
6461
+ var _useState20 = useState(false),
6462
+ emailExists = _useState20[0],
6463
+ setEmailExists = _useState20[1];
6308
6464
  var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
6309
6465
  var firstNameLogged = _get(userData, 'first_name', '') || _get(userValues, 'first_name', '');
6310
6466
  var lastNameLogged = _get(userData, 'last_name', '') || _get(userValues, 'last_name', '');
@@ -6336,18 +6492,18 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6336
6492
  var collectOptionalBusinessCategory = configs == null ? void 0 : configs.collect_optional_business_category;
6337
6493
  var eventHasAddons = configs == null ? void 0 : configs.has_add_on;
6338
6494
  var hideBusinessCategoryField = !collectMandatoryBusinessCategory && !collectOptionalBusinessCategory;
6339
- var _useState20 = useState(),
6340
- pendingVerificationMessage = _useState20[0],
6341
- setPendingVerificationMessage = _useState20[1];
6342
- var _useState21 = useState({}),
6343
- reviewData = _useState21[0],
6344
- setReviewData = _useState21[1];
6495
+ var _useState21 = useState(),
6496
+ pendingVerificationMessage = _useState21[0],
6497
+ setPendingVerificationMessage = _useState21[1];
6345
6498
  var _useState22 = useState({}),
6346
- checkoutData = _useState22[0],
6347
- setCheckoutData = _useState22[1];
6348
- var _useState23 = useState(null),
6349
- checkoutUpdateData = _useState23[0],
6350
- setCheckoutUpdateData = _useState23[1];
6499
+ reviewData = _useState22[0],
6500
+ setReviewData = _useState22[1];
6501
+ var _useState23 = useState({}),
6502
+ checkoutData = _useState23[0],
6503
+ setCheckoutData = _useState23[1];
6504
+ var _useState24 = useState(null),
6505
+ checkoutUpdateData = _useState24[0],
6506
+ setCheckoutUpdateData = _useState24[1];
6351
6507
  var prevData = useRef(data);
6352
6508
  var addAddOnsInAttributes = useCallback(function (checkoutBody) {
6353
6509
  var selectedAddOns = window.localStorage.getItem('add_ons') || '{}';
@@ -6355,9 +6511,9 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6355
6511
  checkoutBody.attributes.add_ons = JSON.parse(selectedAddOns);
6356
6512
  checkoutBody.attributes.add_on_data_capture = JSON.parse(addOnDataCapture);
6357
6513
  }, []);
6358
- var _useState24 = useState({}),
6359
- singleCheckoutAddons = _useState24[0],
6360
- setSingleCheckoutAddOns = _useState24[1];
6514
+ var _useState25 = useState({}),
6515
+ singleCheckoutAddons = _useState25[0],
6516
+ setSingleCheckoutAddOns = _useState25[1];
6361
6517
  var orderIsFree = !Number(checkoutData == null ? void 0 : checkoutData.total);
6362
6518
  useEffect(function () {
6363
6519
  var hasUniqueId = _get(dataWithUniqueIds, '[0].uniqueId');
@@ -6388,37 +6544,37 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6388
6544
  useEffect(function () {
6389
6545
  // fetch countries data
6390
6546
  var fetchCountries = /*#__PURE__*/function () {
6391
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
6547
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
6392
6548
  var res;
6393
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
6394
- while (1) switch (_context2.prev = _context2.next) {
6549
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
6550
+ while (1) switch (_context3.prev = _context3.next) {
6395
6551
  case 0:
6396
- _context2.prev = 0;
6397
- _context2.next = 3;
6552
+ _context3.prev = 0;
6553
+ _context3.next = 3;
6398
6554
  return getCountries();
6399
6555
  case 3:
6400
- res = _context2.sent;
6556
+ res = _context3.sent;
6401
6557
  setCustomHeader(res);
6402
6558
  setCountries(res.data);
6403
6559
  setIsCountriesLoading(false);
6404
6560
  onGetCountriesSuccess(res.data);
6405
- _context2.next = 14;
6561
+ _context3.next = 14;
6406
6562
  break;
6407
6563
  case 10:
6408
- _context2.prev = 10;
6409
- _context2.t0 = _context2["catch"](0);
6410
- if (axios.isAxiosError(_context2.t0)) {
6411
- onGetCountriesError(_context2.t0);
6564
+ _context3.prev = 10;
6565
+ _context3.t0 = _context3["catch"](0);
6566
+ if (axios.isAxiosError(_context3.t0)) {
6567
+ onGetCountriesError(_context3.t0);
6412
6568
  }
6413
6569
  setIsCountriesLoading(false);
6414
6570
  case 14:
6415
6571
  case "end":
6416
- return _context2.stop();
6572
+ return _context3.stop();
6417
6573
  }
6418
- }, _callee2, null, [[0, 10]]);
6574
+ }, _callee3, null, [[0, 10]]);
6419
6575
  }));
6420
6576
  return function fetchCountries() {
6421
- return _ref5.apply(this, arguments);
6577
+ return _ref7.apply(this, arguments);
6422
6578
  };
6423
6579
  }();
6424
6580
  shouldFetchCountries && fetchCountries();
@@ -6434,17 +6590,17 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6434
6590
  }, [eventId, isSinglePageCheckout, shouldFetchCountries, onGetCountriesSuccess, onGetCountriesError]);
6435
6591
  // fetch cart data
6436
6592
  var fetchCart = /*#__PURE__*/function () {
6437
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
6593
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
6438
6594
  var res, cartInfo, _cartInfo$cart, cart;
6439
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
6440
- while (1) switch (_context3.prev = _context3.next) {
6595
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
6596
+ while (1) switch (_context4.prev = _context4.next) {
6441
6597
  case 0:
6442
- _context3.prev = 0;
6598
+ _context4.prev = 0;
6443
6599
  setCardLoading(true);
6444
- _context3.next = 4;
6600
+ _context4.next = 4;
6445
6601
  return getCart();
6446
6602
  case 4:
6447
- res = _context3.sent;
6603
+ res = _context4.sent;
6448
6604
  setCustomHeader(res);
6449
6605
  cartInfo = res.data.attributes;
6450
6606
  setCartInfo(cartInfo);
@@ -6453,44 +6609,44 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6453
6609
  return nanoid();
6454
6610
  }));
6455
6611
  onGetCartSuccess(res.data);
6456
- _context3.next = 16;
6612
+ _context4.next = 16;
6457
6613
  break;
6458
6614
  case 13:
6459
- _context3.prev = 13;
6460
- _context3.t0 = _context3["catch"](0);
6461
- if (axios.isAxiosError(_context3.t0)) {
6462
- onGetCartError(_context3.t0);
6615
+ _context4.prev = 13;
6616
+ _context4.t0 = _context4["catch"](0);
6617
+ if (axios.isAxiosError(_context4.t0)) {
6618
+ onGetCartError(_context4.t0);
6463
6619
  }
6464
6620
  case 16:
6465
- _context3.prev = 16;
6621
+ _context4.prev = 16;
6466
6622
  setCardLoading(false);
6467
- return _context3.finish(16);
6623
+ return _context4.finish(16);
6468
6624
  case 19:
6469
6625
  case "end":
6470
- return _context3.stop();
6626
+ return _context4.stop();
6471
6627
  }
6472
- }, _callee3, null, [[0, 13, 16, 19]]);
6628
+ }, _callee4, null, [[0, 13, 16, 19]]);
6473
6629
  }));
6474
6630
  return function fetchCart() {
6475
- return _ref6.apply(this, arguments);
6631
+ return _ref8.apply(this, arguments);
6476
6632
  };
6477
6633
  }();
6478
6634
  // fetch user data
6479
6635
  var fetchUserData = /*#__PURE__*/function () {
6480
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
6636
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
6481
6637
  var userDataResponse, profileSpecifiedData, profileDataObj;
6482
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
6483
- while (1) switch (_context4.prev = _context4.next) {
6638
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
6639
+ while (1) switch (_context5.prev = _context5.next) {
6484
6640
  case 0:
6485
- _context4.prev = 0;
6641
+ _context5.prev = 0;
6486
6642
  if (!isLoggedIn) {
6487
- _context4.next = 10;
6643
+ _context5.next = 10;
6488
6644
  break;
6489
6645
  }
6490
- _context4.next = 4;
6646
+ _context5.next = 4;
6491
6647
  return getProfileData();
6492
6648
  case 4:
6493
- userDataResponse = _context4.sent;
6649
+ userDataResponse = _context5.sent;
6494
6650
  profileSpecifiedData = _get(userDataResponse, 'data');
6495
6651
  profileDataObj = setLoggedUserData(profileSpecifiedData);
6496
6652
  setUserValues(_extends({}, profileDataObj, {
@@ -6500,22 +6656,22 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6500
6656
  window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
6501
6657
  _onGetProfileDataSuccess(userDataResponse.data);
6502
6658
  case 10:
6503
- _context4.next = 15;
6659
+ _context5.next = 15;
6504
6660
  break;
6505
6661
  case 12:
6506
- _context4.prev = 12;
6507
- _context4.t0 = _context4["catch"](0);
6508
- if (axios.isAxiosError(_context4.t0)) {
6509
- onGetProfileDataError(_context4.t0);
6662
+ _context5.prev = 12;
6663
+ _context5.t0 = _context5["catch"](0);
6664
+ if (axios.isAxiosError(_context5.t0)) {
6665
+ onGetProfileDataError(_context5.t0);
6510
6666
  }
6511
6667
  case 15:
6512
6668
  case "end":
6513
- return _context4.stop();
6669
+ return _context5.stop();
6514
6670
  }
6515
- }, _callee4, null, [[0, 12]]);
6671
+ }, _callee5, null, [[0, 12]]);
6516
6672
  }));
6517
6673
  return function fetchUserData() {
6518
- return _ref7.apply(this, arguments);
6674
+ return _ref9.apply(this, arguments);
6519
6675
  };
6520
6676
  }();
6521
6677
  useEffect(function () {
@@ -6524,19 +6680,19 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6524
6680
  }, [isLoggedIn]);
6525
6681
  useEffect(function () {
6526
6682
  var fetchCheckoutUpdate = /*#__PURE__*/function () {
6527
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
6683
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
6528
6684
  var checkoutUpdateResponse, checkoutAttributes, cartPriceBreakdown;
6529
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
6530
- while (1) switch (_context5.prev = _context5.next) {
6685
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
6686
+ while (1) switch (_context6.prev = _context6.next) {
6531
6687
  case 0:
6532
6688
  if (eventId) {
6533
- _context5.next = 2;
6689
+ _context6.next = 2;
6534
6690
  break;
6535
6691
  }
6536
- return _context5.abrupt("return");
6692
+ return _context6.abrupt("return");
6537
6693
  case 2:
6538
- _context5.prev = 2;
6539
- _context5.next = 5;
6694
+ _context6.prev = 2;
6695
+ _context6.next = 5;
6540
6696
  return updateCheckout({
6541
6697
  attributes: {
6542
6698
  event_id: eventId,
@@ -6544,7 +6700,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6544
6700
  }
6545
6701
  });
6546
6702
  case 5:
6547
- checkoutUpdateResponse = _context5.sent;
6703
+ checkoutUpdateResponse = _context6.sent;
6548
6704
  console.log('Stripe in [useEffect] fetchCheckoutUpdate', checkoutUpdateResponse);
6549
6705
  if (checkoutUpdateResponse.success) {
6550
6706
  checkoutAttributes = checkoutUpdateResponse.data.attributes;
@@ -6559,71 +6715,71 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6559
6715
  expires_at: expirationTime
6560
6716
  }, cartPriceBreakdown));
6561
6717
  }
6562
- _context5.next = 13;
6718
+ _context6.next = 13;
6563
6719
  break;
6564
6720
  case 10:
6565
- _context5.prev = 10;
6566
- _context5.t0 = _context5["catch"](2);
6567
- console.error('Failed to fetch checkout update:', _context5.t0);
6721
+ _context6.prev = 10;
6722
+ _context6.t0 = _context6["catch"](2);
6723
+ console.error('Failed to fetch checkout update:', _context6.t0);
6568
6724
  case 13:
6569
6725
  case "end":
6570
- return _context5.stop();
6726
+ return _context6.stop();
6571
6727
  }
6572
- }, _callee5, null, [[2, 10]]);
6728
+ }, _callee6, null, [[2, 10]]);
6573
6729
  }));
6574
6730
  return function fetchCheckoutUpdate() {
6575
- return _ref8.apply(this, arguments);
6731
+ return _ref10.apply(this, arguments);
6576
6732
  };
6577
6733
  }();
6578
6734
  fetchCheckoutUpdate();
6579
6735
  }, [eventId, additionalConfigs == null ? void 0 : additionalConfigs.resale]);
6580
6736
  useEffect(function () {
6581
6737
  var collectPaymentData = /*#__PURE__*/function () {
6582
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
6738
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
6583
6739
  var checkoutBody, checkoutResponse;
6584
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
6585
- while (1) switch (_context6.prev = _context6.next) {
6740
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
6741
+ while (1) switch (_context7.prev = _context7.next) {
6586
6742
  case 0:
6587
6743
  if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB && !loading && !isNewUser)) {
6588
- _context6.next = 20;
6744
+ _context7.next = 20;
6589
6745
  break;
6590
6746
  }
6591
6747
  setLoading(true);
6592
6748
  checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, userData);
6593
- _context6.prev = 3;
6749
+ _context7.prev = 3;
6594
6750
  if (isBrowser) {
6595
6751
  addAddOnsInAttributes(checkoutBody);
6596
6752
  }
6597
- _context6.next = 7;
6753
+ _context7.next = 7;
6598
6754
  return postOnCheckout(checkoutBody, flagFreeTicket);
6599
6755
  case 7:
6600
- checkoutResponse = _context6.sent;
6756
+ checkoutResponse = _context7.sent;
6601
6757
  removeReferralKey();
6602
6758
  removeAdditionalConfigs();
6603
6759
  onSkipBillingPage(checkoutResponse.data.attributes);
6604
6760
  setLoading(false);
6605
- _context6.next = 18;
6761
+ _context7.next = 18;
6606
6762
  break;
6607
6763
  case 14:
6608
- _context6.prev = 14;
6609
- _context6.t0 = _context6["catch"](3);
6610
- onSubmitError(_context6.t0);
6611
- if (_get(_context6.t0, 'response.data.data.hasUnverifiedOrder')) {
6612
- setPendingVerificationMessage(_get(_context6.t0, 'response.data.message'));
6764
+ _context7.prev = 14;
6765
+ _context7.t0 = _context7["catch"](3);
6766
+ onSubmitError(_context7.t0);
6767
+ if (_get(_context7.t0, 'response.data.data.hasUnverifiedOrder')) {
6768
+ setPendingVerificationMessage(_get(_context7.t0, 'response.data.message'));
6613
6769
  }
6614
6770
  case 18:
6615
- _context6.next = 21;
6771
+ _context7.next = 21;
6616
6772
  break;
6617
6773
  case 20:
6618
6774
  setLoading(false);
6619
6775
  case 21:
6620
6776
  case "end":
6621
- return _context6.stop();
6777
+ return _context7.stop();
6622
6778
  }
6623
- }, _callee6, null, [[3, 14]]);
6779
+ }, _callee7, null, [[3, 14]]);
6624
6780
  }));
6625
6781
  return function collectPaymentData() {
6626
- return _ref9.apply(this, arguments);
6782
+ return _ref11.apply(this, arguments);
6627
6783
  };
6628
6784
  }();
6629
6785
  collectPaymentData();
@@ -6751,24 +6907,24 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6751
6907
  }),
6752
6908
  processPayment = _useStripePayment.processPayment;
6753
6909
  var updateCheckoutWithAddOns = useCallback( /*#__PURE__*/function () {
6754
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(addOns) {
6910
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(addOns) {
6755
6911
  var mergedAddOns, _checkoutUpdateData, checkoutResponse, checkoutDataObj, errorMessage;
6756
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
6757
- while (1) switch (_context7.prev = _context7.next) {
6912
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
6913
+ while (1) switch (_context8.prev = _context8.next) {
6758
6914
  case 0:
6759
6915
  if (addOns === void 0) {
6760
6916
  addOns = {};
6761
6917
  }
6762
6918
  if (isSinglePageCheckout) {
6763
- _context7.next = 3;
6919
+ _context8.next = 3;
6764
6920
  break;
6765
6921
  }
6766
- return _context7.abrupt("return");
6922
+ return _context8.abrupt("return");
6767
6923
  case 3:
6768
6924
  mergedAddOns = _extends({}, singleCheckoutAddons); // Update existing entries and add new ones
6769
- Object.entries(addOns).forEach(function (_ref11) {
6770
- var key = _ref11[0],
6771
- value = _ref11[1];
6925
+ Object.entries(addOns).forEach(function (_ref13) {
6926
+ var key = _ref13[0],
6927
+ value = _ref13[1];
6772
6928
  var amount = Number(value);
6773
6929
  if (amount) {
6774
6930
  mergedAddOns[key] = amount;
@@ -6776,7 +6932,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6776
6932
  delete mergedAddOns[key];
6777
6933
  }
6778
6934
  });
6779
- _context7.prev = 5;
6935
+ _context8.prev = 5;
6780
6936
  _checkoutUpdateData = {
6781
6937
  attributes: {
6782
6938
  event_id: eventId,
@@ -6784,51 +6940,51 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6784
6940
  is_from_resale: additionalConfigs == null ? void 0 : additionalConfigs.resale
6785
6941
  }
6786
6942
  };
6787
- _context7.next = 9;
6943
+ _context8.next = 9;
6788
6944
  return updateCheckout(_checkoutUpdateData);
6789
6945
  case 9:
6790
- checkoutResponse = _context7.sent;
6946
+ checkoutResponse = _context8.sent;
6791
6947
  if (checkoutResponse.success) {
6792
6948
  checkoutDataObj = _get(checkoutResponse, 'data.attributes.cart_price_breakdown', {});
6793
6949
  setCheckoutData(checkoutDataObj);
6794
6950
  setSingleCheckoutAddOns(mergedAddOns);
6795
6951
  }
6796
- _context7.next = 18;
6952
+ _context8.next = 18;
6797
6953
  break;
6798
6954
  case 13:
6799
- _context7.prev = 13;
6800
- _context7.t0 = _context7["catch"](5);
6801
- errorMessage = _get(_context7.t0, 'response.data.message', 'Failed to update add-ons');
6955
+ _context8.prev = 13;
6956
+ _context8.t0 = _context8["catch"](5);
6957
+ errorMessage = _get(_context8.t0, 'response.data.message', 'Failed to update add-ons');
6802
6958
  setError(errorMessage);
6803
- onCheckoutUpdateError(_context7.t0);
6959
+ onCheckoutUpdateError(_context8.t0);
6804
6960
  case 18:
6805
6961
  case "end":
6806
- return _context7.stop();
6962
+ return _context8.stop();
6807
6963
  }
6808
- }, _callee7, null, [[5, 13]]);
6964
+ }, _callee8, null, [[5, 13]]);
6809
6965
  }));
6810
6966
  return function (_x) {
6811
- return _ref10.apply(this, arguments);
6967
+ return _ref12.apply(this, arguments);
6812
6968
  };
6813
6969
  }(), [eventId, isSinglePageCheckout, onCheckoutUpdateError, onCheckoutUpdateSuccess]);
6814
6970
  console.log({
6815
6971
  checkoutData: checkoutData
6816
6972
  });
6817
6973
  var handleAddOnSelect = useCallback( /*#__PURE__*/function () {
6818
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(selectedAddOns) {
6819
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
6820
- while (1) switch (_context8.prev = _context8.next) {
6974
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(selectedAddOns) {
6975
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
6976
+ while (1) switch (_context9.prev = _context9.next) {
6821
6977
  case 0:
6822
- _context8.next = 2;
6978
+ _context9.next = 2;
6823
6979
  return updateCheckoutWithAddOns(selectedAddOns);
6824
6980
  case 2:
6825
6981
  case "end":
6826
- return _context8.stop();
6982
+ return _context9.stop();
6827
6983
  }
6828
- }, _callee8);
6984
+ }, _callee9);
6829
6985
  }));
6830
6986
  return function (_x2) {
6831
- return _ref12.apply(this, arguments);
6987
+ return _ref14.apply(this, arguments);
6832
6988
  };
6833
6989
  }(), [updateCheckoutWithAddOns]);
6834
6990
  var onAddOnSelect = useCallback(function (id, value, addon, fieldUpdates) {
@@ -6912,16 +7068,16 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6912
7068
  }, initialValues), userValues, ticketHoldersFields, ticketsQuantity),
6913
7069
  enableReinitialize: false,
6914
7070
  onSubmit: function () {
6915
- var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(values, formikHelpers) {
7071
+ var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(values, formikHelpers) {
6916
7072
  var _checkoutBody$attribu2, _checkoutBody$attribu3, flagRequirePhoneLocal, holdersCount, hasHolderPhoneError, i, fieldName, value, userDataObj, profileData, profileSpecifiedData, checkoutBody, storedAddOnDataCapture, checkoutResponse, checkoutUpdateResponse, paymentResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$, attributes, order_details, cart, _order_details$ticket, ticket, updatedOrderData, isFreeTickets, paymentMethod, paymentPlanAvailable, hasUnverifiedOrder, message, _e$response, event;
6917
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
6918
- while (1) switch (_context9.prev = _context9.next) {
7073
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
7074
+ while (1) switch (_context10.prev = _context10.next) {
6919
7075
  case 0:
6920
- _context9.prev = 0;
7076
+ _context10.prev = 0;
6921
7077
  // Validation: if phone is required for ticket holders, mark errors and stop submit
6922
7078
  flagRequirePhoneLocal = Boolean(configs == null ? void 0 : configs.phone_required);
6923
7079
  if (!flagRequirePhoneLocal) {
6924
- _context9.next = 8;
7080
+ _context10.next = 8;
6925
7081
  break;
6926
7082
  }
6927
7083
  holdersCount = ticketsQuantity.length;
@@ -6936,17 +7092,17 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6936
7092
  }
6937
7093
  }
6938
7094
  if (!hasHolderPhoneError) {
6939
- _context9.next = 8;
7095
+ _context10.next = 8;
6940
7096
  break;
6941
7097
  }
6942
- return _context9.abrupt("return");
7098
+ return _context10.abrupt("return");
6943
7099
  case 8:
6944
7100
  if (!((!elementsRef.current || !stripeRef.current) && !orderIsFree)) {
6945
- _context9.next = 11;
7101
+ _context10.next = 11;
6946
7102
  break;
6947
7103
  }
6948
7104
  setError('Fill in the payment details');
6949
- return _context9.abrupt("return");
7105
+ return _context10.abrupt("return");
6950
7106
  case 11:
6951
7107
  if (isBrowser) {
6952
7108
  window.localStorage.setItem('extraData', JSON.stringify({
@@ -6961,21 +7117,21 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6961
7117
  // Guest checkout: no need to register, just get profile if logged in
6962
7118
  userDataObj = userData;
6963
7119
  if (!isLoggedIn) {
6964
- _context9.next = 28;
7120
+ _context10.next = 28;
6965
7121
  break;
6966
7122
  }
6967
- _context9.prev = 15;
6968
- _context9.next = 18;
7123
+ _context10.prev = 15;
7124
+ _context10.next = 18;
6969
7125
  return getProfileData();
6970
7126
  case 18:
6971
- profileData = _context9.sent;
7127
+ profileData = _context10.sent;
6972
7128
  profileSpecifiedData = _get(profileData, 'data');
6973
7129
  userDataObj = setLoggedUserData(profileSpecifiedData);
6974
- _context9.next = 26;
7130
+ _context10.next = 26;
6975
7131
  break;
6976
7132
  case 23:
6977
- _context9.prev = 23;
6978
- _context9.t0 = _context9["catch"](15);
7133
+ _context10.prev = 23;
7134
+ _context10.t0 = _context10["catch"](15);
6979
7135
  // If profile fetch fails, use values from form
6980
7136
  userDataObj = {
6981
7137
  email: values.email,
@@ -6984,7 +7140,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
6984
7140
  phone: values.phone
6985
7141
  };
6986
7142
  case 26:
6987
- _context9.next = 29;
7143
+ _context10.next = 29;
6988
7144
  break;
6989
7145
  case 28:
6990
7146
  // For guest checkout, use form values
@@ -7010,11 +7166,11 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7010
7166
  checkoutBody.attributes.add_on_data_capture = JSON.parse(storedAddOnDataCapture);
7011
7167
  }
7012
7168
  }
7013
- _context9.next = 35;
7169
+ _context10.next = 35;
7014
7170
  return postOnCheckout(checkoutBody, flagFreeTicket);
7015
7171
  case 35:
7016
- checkoutResponse = _context9.sent;
7017
- _context9.next = 38;
7172
+ checkoutResponse = _context10.sent;
7173
+ _context10.next = 38;
7018
7174
  return updateCheckout({
7019
7175
  attributes: {
7020
7176
  event_id: eventId,
@@ -7023,12 +7179,12 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7023
7179
  }
7024
7180
  });
7025
7181
  case 38:
7026
- checkoutUpdateResponse = _context9.sent;
7182
+ checkoutUpdateResponse = _context10.sent;
7027
7183
  console.log('Stripe checkoutUpdateResponse in billing-info-container', checkoutUpdateResponse);
7028
7184
  setCheckoutUpdateData(checkoutUpdateResponse.data.attributes);
7029
7185
  paymentResponse = null;
7030
7186
  if (!isSinglePageCheckout) {
7031
- _context9.next = 64;
7187
+ _context10.next = 64;
7032
7188
  break;
7033
7189
  }
7034
7190
  _checkoutResponse$dat = checkoutResponse.data.attributes, hash = _checkoutResponse$dat.hash, total = _checkoutResponse$dat.total;
@@ -7036,12 +7192,12 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7036
7192
  hash: hash,
7037
7193
  total: total
7038
7194
  }));
7039
- _context9.next = 47;
7195
+ _context10.next = 47;
7040
7196
  return getPaymentData(String(hash));
7041
7197
  case 47:
7042
- paymentDataResponse = _context9.sent;
7198
+ paymentDataResponse = _context10.sent;
7043
7199
  if (!paymentDataResponse.success) {
7044
- _context9.next = 64;
7200
+ _context10.next = 64;
7045
7201
  break;
7046
7202
  }
7047
7203
  attributes = paymentDataResponse.data.attributes;
@@ -7072,7 +7228,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7072
7228
  paymentPlanAvailable: paymentPlanAvailable
7073
7229
  });
7074
7230
  // Process payment using the hook
7075
- _context9.next = 61;
7231
+ _context10.next = 61;
7076
7232
  return processPayment(paymentDataResponse, values, formikHelpers, checkoutResponse, checkoutUpdateResponse, {
7077
7233
  attributes: attributes,
7078
7234
  isFreeTickets: isFreeTickets,
@@ -7080,29 +7236,29 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7080
7236
  eventId: eventId
7081
7237
  });
7082
7238
  case 61:
7083
- paymentResponse = _context9.sent;
7239
+ paymentResponse = _context10.sent;
7084
7240
  if (!(!paymentResponse && !isFreeTickets)) {
7085
- _context9.next = 64;
7241
+ _context10.next = 64;
7086
7242
  break;
7087
7243
  }
7088
- return _context9.abrupt("return");
7244
+ return _context10.abrupt("return");
7089
7245
  case 64:
7090
7246
  removeReferralKey();
7091
7247
  removeAdditionalConfigs();
7092
7248
  handleSubmit(values, formikHelpers, eventId, checkoutResponse, checkoutUpdateResponse, paymentResponse);
7093
- _context9.next = 76;
7249
+ _context10.next = 77;
7094
7250
  break;
7095
7251
  case 69:
7096
- _context9.prev = 69;
7097
- _context9.t1 = _context9["catch"](0);
7252
+ _context10.prev = 69;
7253
+ _context10.t1 = _context10["catch"](0);
7098
7254
  setLoading(false);
7099
- onSubmitError(_context9.t1);
7100
- hasUnverifiedOrder = _get(_context9.t1, 'response.data.data.hasUnverifiedOrder');
7101
- message = _get(_context9.t1, 'response.data.message', {});
7255
+ onSubmitError(_context10.t1);
7256
+ hasUnverifiedOrder = _get(_context10.t1, 'response.data.data.hasUnverifiedOrder');
7257
+ message = _get(_context10.t1, 'response.data.message', {});
7102
7258
  if (hasUnverifiedOrder && typeof message === 'string') {
7103
7259
  setPendingVerificationMessage(message);
7104
- } else if (axios.isAxiosError(_context9.t1)) {
7105
- if (((_e$response = _context9.t1.response) == null ? void 0 : _e$response.status) === 401 || _get(_context9.t1, 'response.data.error') === 'invalid_token') {
7260
+ } else if (axios.isAxiosError(_context10.t1)) {
7261
+ if (((_e$response = _context10.t1.response) == null ? void 0 : _e$response.status) === 401 || _get(_context10.t1, 'response.data.error') === 'invalid_token') {
7106
7262
  if (isBrowser) {
7107
7263
  window.localStorage.removeItem('user_data');
7108
7264
  setUserExpired(true);
@@ -7118,17 +7274,19 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7118
7274
  if (message && !hideErrorsAlertSection && typeof message === 'string') {
7119
7275
  setError(message);
7120
7276
  }
7121
- onSubmitError(_context9.t1);
7277
+ onSubmitError(_context10.t1);
7122
7278
  }
7123
- case 76:
7124
- _context9.prev = 76;
7279
+ // Keep form values intact - don't reset
7280
+ formikHelpers.setSubmitting(false);
7281
+ case 77:
7282
+ _context10.prev = 77;
7125
7283
  setLoading(false);
7126
- return _context9.finish(76);
7127
- case 79:
7284
+ return _context10.finish(77);
7285
+ case 80:
7128
7286
  case "end":
7129
- return _context9.stop();
7287
+ return _context10.stop();
7130
7288
  }
7131
- }, _callee9, null, [[0, 69, 76, 79], [15, 23]]);
7289
+ }, _callee10, null, [[0, 69, 77, 80], [15, 23]]);
7132
7290
  }));
7133
7291
  function onSubmit(_x3, _x4) {
7134
7292
  return _onSubmit.apply(this, arguments);
@@ -7150,6 +7308,11 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7150
7308
  onGetStatesSuccess: onGetStatesSuccess,
7151
7309
  onGetStatesError: onGetStatesError,
7152
7310
  shouldFetchCountries: shouldFetchCountries
7311
+ }), React.createElement(EmailExistenceChecker, {
7312
+ email: props.values.email || '',
7313
+ confirmEmail: props.values.confirmEmail || '',
7314
+ isLoggedIn: isLoggedIn,
7315
+ setEmailExists: setEmailExists
7153
7316
  }), React.createElement("div", {
7154
7317
  className: "billing-info-container " + theme
7155
7318
  }, !!error && React.createElement(SnackbarAlert, {
@@ -7257,7 +7420,24 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
7257
7420
  dateFormat: element.format,
7258
7421
  isCountryCodeEditable: isCountryCodeEditable
7259
7422
  }))));
7260
- })));
7423
+ })), group.groupItems.some(function (el) {
7424
+ return el.name === 'confirmEmail';
7425
+ }) && emailExists && !isLoggedIn && React.createElement("div", {
7426
+ className: "email-registered-message"
7427
+ }, React.createElement("p", {
7428
+ className: "email-registered-text"
7429
+ }, "\u2713 This email is already registered. Log in to auto-fill your information"), React.createElement(Button, {
7430
+ type: "button",
7431
+ variant: "contained",
7432
+ className: "email-login-button",
7433
+ onClick: function onClick() {
7434
+ if (onLogin) {
7435
+ onLogin();
7436
+ } else {
7437
+ setShowModalLogin(true);
7438
+ }
7439
+ }
7440
+ }, "Log in")));
7261
7441
  }));
7262
7442
  }), !_isEmpty(ticketHoldersFields.fields) && React.createElement("div", {
7263
7443
  className: "ticket-holders-fields"
@@ -7684,7 +7864,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
7684
7864
  while (1) switch (_context.prev = _context.next) {
7685
7865
  case 0:
7686
7866
  if (!hash) {
7687
- _context.next = 15;
7867
+ _context.next = 16;
7688
7868
  break;
7689
7869
  }
7690
7870
  _context.prev = 1;
@@ -7711,19 +7891,23 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
7711
7891
  label: 'Your ticket is currently',
7712
7892
  price: _data.currency.symbol + ((_data$product_price = _data.product_price) == null ? void 0 : _data$product_price.toFixed(2))
7713
7893
  });
7894
+ // Ensure order_hash is included in the data
7895
+ if (!_data.order_hash) {
7896
+ _data.order_hash = hash;
7897
+ }
7714
7898
  setData(_data);
7715
7899
  onGetConfirmationDataSuccess(confirmationDataResponse.data.attributes);
7716
- _context.next = 15;
7900
+ _context.next = 16;
7717
7901
  break;
7718
- case 12:
7719
- _context.prev = 12;
7902
+ case 13:
7903
+ _context.prev = 13;
7720
7904
  _context.t0 = _context["catch"](1);
7721
7905
  if (axios.isAxiosError(_context.t0)) onGetConfirmationDataError(_context.t0);
7722
- case 15:
7906
+ case 16:
7723
7907
  case "end":
7724
7908
  return _context.stop();
7725
7909
  }
7726
- }, _callee, null, [[1, 12]]);
7910
+ }, _callee, null, [[1, 13]]);
7727
7911
  }))();
7728
7912
  }, [hash]);
7729
7913
  var _useState2 = useState(false),
@@ -8124,160 +8308,6 @@ function Countdown(_ref) {
8124
8308
  }, message)));
8125
8309
  }
8126
8310
 
8127
- var generateQuantity = function generateQuantity(n) {
8128
- var quantityList = [];
8129
- for (var i = 1; i <= n; i++) {
8130
- quantityList.push({
8131
- label: i,
8132
- value: i
8133
- });
8134
- }
8135
- return quantityList;
8136
- };
8137
- var WaitingList = function WaitingList(_ref) {
8138
- var _ref$tickets = _ref.tickets,
8139
- tickets = _ref$tickets === void 0 ? {} : _ref$tickets,
8140
- eventId = _ref.eventId,
8141
- _ref$defaultMaxQuanti = _ref.defaultMaxQuantity,
8142
- defaultMaxQuantity = _ref$defaultMaxQuanti === void 0 ? 10 : _ref$defaultMaxQuanti;
8143
- var userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
8144
- var _useState = useState(false),
8145
- showSuccessMessage = _useState[0],
8146
- setShowSuccessMessage = _useState[1];
8147
- var _useState2 = useState(false),
8148
- loading = _useState2[0],
8149
- setLoading = _useState2[1];
8150
- var ticketTypesList = Object.values(tickets).map(function (d) {
8151
- return {
8152
- label: d.displayName,
8153
- value: d.id
8154
- };
8155
- });
8156
- var showTicketsField = Boolean(ticketTypesList.length);
8157
- var handleSubmit = /*#__PURE__*/function () {
8158
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
8159
- var response;
8160
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8161
- while (1) switch (_context.prev = _context.next) {
8162
- case 0:
8163
- _context.prev = 0;
8164
- setLoading(true);
8165
- _context.next = 4;
8166
- return addToWaitingList(eventId, {
8167
- attributes: values
8168
- });
8169
- case 4:
8170
- response = _context.sent;
8171
- if (response.success) {
8172
- setShowSuccessMessage(true);
8173
- }
8174
- _context.next = 10;
8175
- break;
8176
- case 8:
8177
- _context.prev = 8;
8178
- _context.t0 = _context["catch"](0);
8179
- case 10:
8180
- _context.prev = 10;
8181
- setLoading(false);
8182
- return _context.finish(10);
8183
- case 13:
8184
- case "end":
8185
- return _context.stop();
8186
- }
8187
- }, _callee, null, [[0, 8, 10, 13]]);
8188
- }));
8189
- return function handleSubmit(_x) {
8190
- return _ref2.apply(this, arguments);
8191
- };
8192
- }();
8193
- return React.createElement("div", {
8194
- className: "waiting-list"
8195
- }, showSuccessMessage ? React.createElement("div", {
8196
- className: "success-message"
8197
- }, React.createElement("p", {
8198
- className: "added-success-message"
8199
- }, "You've been added to the waiting list!"), React.createElement("p", null, "You'll be notified if tickets become available.")) : React.createElement(React.Fragment, null, React.createElement("h2", null, "WAITING LIST"), React.createElement(Formik, {
8200
- initialValues: {
8201
- ticketTypeId: '',
8202
- quantity: '',
8203
- firstName: userData.first_name || '',
8204
- lastName: userData.last_name || '',
8205
- email: userData.email || ''
8206
- },
8207
- onSubmit: handleSubmit
8208
- }, function (_ref3) {
8209
- var values = _ref3.values,
8210
- setFieldValue = _ref3.setFieldValue;
8211
- var selectedTicket = _find(tickets, function (n) {
8212
- return n.id === values.ticketTypeId;
8213
- });
8214
- return React.createElement(Form, null, React.createElement(ErrorFocus, null), showTicketsField && React.createElement(React.Fragment, null, React.createElement("div", {
8215
- className: "field-item"
8216
- }, React.createElement(Field, {
8217
- name: "ticketTypeId",
8218
- label: "Type of Ticket",
8219
- type: "select",
8220
- component: CustomField,
8221
- onChange: function onChange(e) {
8222
- setFieldValue('ticketTypeId', e.target.value);
8223
- setFieldValue('quantity', '');
8224
- },
8225
- selectOptions: [{
8226
- label: 'Type of Ticket',
8227
- value: '',
8228
- disabled: true
8229
- }].concat(ticketTypesList)
8230
- })), React.createElement("div", {
8231
- className: "field-item"
8232
- }, React.createElement(Field, {
8233
- name: "quantity",
8234
- label: "Quantity Requested",
8235
- type: "select",
8236
- component: CustomField,
8237
- selectOptions: [{
8238
- label: 'Quantity Requested',
8239
- value: '',
8240
- disabled: true
8241
- }].concat(generateQuantity((selectedTicket == null ? void 0 : selectedTicket.waitingListMaxQuantity) || (defaultMaxQuantity != null ? defaultMaxQuantity : 10)))
8242
- }))), React.createElement("div", {
8243
- className: "field-item"
8244
- }, React.createElement(Field, {
8245
- name: "firstName",
8246
- label: "First name",
8247
- validate: function validate(value) {
8248
- return requiredValidator(value, 'Please enter your First name');
8249
- },
8250
- component: CustomField
8251
- })), React.createElement("div", {
8252
- className: "field-item"
8253
- }, React.createElement(Field, {
8254
- name: "lastName",
8255
- label: "Last name",
8256
- validate: function validate(value) {
8257
- return requiredValidator(value, 'Please enter your Last name');
8258
- },
8259
- component: CustomField
8260
- })), React.createElement("div", {
8261
- className: "field-item"
8262
- }, React.createElement(Field, {
8263
- name: "email",
8264
- label: "Email",
8265
- validate: combineValidators(function (value) {
8266
- return requiredValidator(value, 'Please enter your Email');
8267
- }, function (value) {
8268
- return emailValidator(value);
8269
- }),
8270
- component: CustomField
8271
- })), React.createElement(Button, {
8272
- type: "submit",
8273
- variant: "contained",
8274
- className: "waiting-list-button"
8275
- }, loading ? React.createElement(CircularProgress$1, {
8276
- size: "22px"
8277
- }) : 'ADD TO WAITING LIST'));
8278
- })));
8279
- };
8280
-
8281
8311
  var getFormFieldsNotLoggedIn = function getFormFieldsNotLoggedIn(clientName) {
8282
8312
  return [{
8283
8313
  name: 'basic-info',
@@ -8303,13 +8333,13 @@ var getFormFieldsNotLoggedIn = function getFormFieldsNotLoggedIn(clientName) {
8303
8333
  label: 'Email',
8304
8334
  type: 'email',
8305
8335
  required: true,
8306
- onValidate: null
8336
+ onValidate: emailValidator
8307
8337
  }, {
8308
8338
  name: 'confirmEmail',
8309
8339
  label: 'Confirm Email',
8310
8340
  type: 'email',
8311
8341
  required: true,
8312
- onValidate: null
8342
+ onValidate: emailValidator
8313
8343
  }]
8314
8344
  }, {
8315
8345
  name: 'billing-info',
@@ -8366,13 +8396,13 @@ var getFormFieldsLoggedIn = function getFormFieldsLoggedIn(clientName) {
8366
8396
  label: 'Email',
8367
8397
  type: 'email',
8368
8398
  required: true,
8369
- onValidate: null
8399
+ onValidate: emailValidator
8370
8400
  }, {
8371
8401
  name: 'confirmEmail',
8372
8402
  label: 'Confirm Email',
8373
8403
  type: 'email',
8374
8404
  required: true,
8375
- onValidate: null
8405
+ onValidate: emailValidator
8376
8406
  }]
8377
8407
  }, {
8378
8408
  name: 'billing-info-logged-in',
@@ -8416,6 +8446,9 @@ var getValidateFunctions$1 = function getValidateFunctions(_ref) {
8416
8446
  if (element.onValidate) {
8417
8447
  validationFunctions.push(element.onValidate);
8418
8448
  }
8449
+ if (element.name === 'password') {
8450
+ validationFunctions.push(passwordValidator);
8451
+ }
8419
8452
  if (element.name === 'confirmEmail') {
8420
8453
  var isSameEmail = function isSameEmail(confirmEmail) {
8421
8454
  return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
@@ -9014,11 +9047,11 @@ var PreRegistration = function PreRegistration(_ref) {
9014
9047
  // Check if user already has a pre-registration when logged in
9015
9048
  useEffect(function () {
9016
9049
  if (!isLoggedIn || !isWindowDefined$2) return;
9017
- var savedHash = window.localStorage.getItem('pre-registration-hash');
9050
+ var savedHash = window.localStorage.getItem("pre-registration-hash-" + eventId);
9018
9051
  if (savedHash) {
9019
9052
  setIsPreRegistrationComplete(true);
9020
9053
  }
9021
- }, [isLoggedIn]);
9054
+ }, [isLoggedIn, eventId]);
9022
9055
  var themeMui = createTheme(themeOptions);
9023
9056
  var formFieldsLoggedIn = getFormFieldsLoggedIn(CONFIGS.CLIENT_NAME);
9024
9057
  var formFieldsNotLoggedIn = getFormFieldsNotLoggedIn(CONFIGS.CLIENT_NAME);
@@ -9170,7 +9203,7 @@ var PreRegistration = function PreRegistration(_ref) {
9170
9203
  case 13:
9171
9204
  confirmationData = _context2.sent;
9172
9205
  if (isWindowDefined$2) {
9173
- window.localStorage.setItem('pre-registration-hash', _get(confirmationData, 'attributes.hash'));
9206
+ window.localStorage.setItem("pre-registration-hash-" + eventId, _get(confirmationData, 'attributes.hash'));
9174
9207
  }
9175
9208
  setIsPreRegistrationComplete(true);
9176
9209
  onConfirmationSuccess(confirmationData);
@@ -9266,6 +9299,160 @@ var PreRegistration = function PreRegistration(_ref) {
9266
9299
  }))));
9267
9300
  };
9268
9301
 
9302
+ var generateQuantity = function generateQuantity(n) {
9303
+ var quantityList = [];
9304
+ for (var i = 1; i <= n; i++) {
9305
+ quantityList.push({
9306
+ label: i,
9307
+ value: i
9308
+ });
9309
+ }
9310
+ return quantityList;
9311
+ };
9312
+ var WaitingList = function WaitingList(_ref) {
9313
+ var _ref$tickets = _ref.tickets,
9314
+ tickets = _ref$tickets === void 0 ? {} : _ref$tickets,
9315
+ eventId = _ref.eventId,
9316
+ _ref$defaultMaxQuanti = _ref.defaultMaxQuantity,
9317
+ defaultMaxQuantity = _ref$defaultMaxQuanti === void 0 ? 10 : _ref$defaultMaxQuanti;
9318
+ var userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
9319
+ var _useState = useState(false),
9320
+ showSuccessMessage = _useState[0],
9321
+ setShowSuccessMessage = _useState[1];
9322
+ var _useState2 = useState(false),
9323
+ loading = _useState2[0],
9324
+ setLoading = _useState2[1];
9325
+ var ticketTypesList = Object.values(tickets).map(function (d) {
9326
+ return {
9327
+ label: d.displayName,
9328
+ value: d.id
9329
+ };
9330
+ });
9331
+ var showTicketsField = Boolean(ticketTypesList.length);
9332
+ var handleSubmit = /*#__PURE__*/function () {
9333
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
9334
+ var response;
9335
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9336
+ while (1) switch (_context.prev = _context.next) {
9337
+ case 0:
9338
+ _context.prev = 0;
9339
+ setLoading(true);
9340
+ _context.next = 4;
9341
+ return addToWaitingList(eventId, {
9342
+ attributes: values
9343
+ });
9344
+ case 4:
9345
+ response = _context.sent;
9346
+ if (response.success) {
9347
+ setShowSuccessMessage(true);
9348
+ }
9349
+ _context.next = 10;
9350
+ break;
9351
+ case 8:
9352
+ _context.prev = 8;
9353
+ _context.t0 = _context["catch"](0);
9354
+ case 10:
9355
+ _context.prev = 10;
9356
+ setLoading(false);
9357
+ return _context.finish(10);
9358
+ case 13:
9359
+ case "end":
9360
+ return _context.stop();
9361
+ }
9362
+ }, _callee, null, [[0, 8, 10, 13]]);
9363
+ }));
9364
+ return function handleSubmit(_x) {
9365
+ return _ref2.apply(this, arguments);
9366
+ };
9367
+ }();
9368
+ return React.createElement("div", {
9369
+ className: "waiting-list"
9370
+ }, showSuccessMessage ? React.createElement("div", {
9371
+ className: "success-message"
9372
+ }, React.createElement("p", {
9373
+ className: "added-success-message"
9374
+ }, "You've been added to the waiting list!"), React.createElement("p", null, "You'll be notified if tickets become available.")) : React.createElement(React.Fragment, null, React.createElement("h2", null, "WAITING LIST"), React.createElement(Formik, {
9375
+ initialValues: {
9376
+ ticketTypeId: '',
9377
+ quantity: '',
9378
+ firstName: userData.first_name || '',
9379
+ lastName: userData.last_name || '',
9380
+ email: userData.email || ''
9381
+ },
9382
+ onSubmit: handleSubmit
9383
+ }, function (_ref3) {
9384
+ var values = _ref3.values,
9385
+ setFieldValue = _ref3.setFieldValue;
9386
+ var selectedTicket = _find(tickets, function (n) {
9387
+ return n.id === values.ticketTypeId;
9388
+ });
9389
+ return React.createElement(Form, null, React.createElement(ErrorFocus, null), showTicketsField && React.createElement(React.Fragment, null, React.createElement("div", {
9390
+ className: "field-item"
9391
+ }, React.createElement(Field, {
9392
+ name: "ticketTypeId",
9393
+ label: "Type of Ticket",
9394
+ type: "select",
9395
+ component: CustomField,
9396
+ onChange: function onChange(e) {
9397
+ setFieldValue('ticketTypeId', e.target.value);
9398
+ setFieldValue('quantity', '');
9399
+ },
9400
+ selectOptions: [{
9401
+ label: 'Type of Ticket',
9402
+ value: '',
9403
+ disabled: true
9404
+ }].concat(ticketTypesList)
9405
+ })), React.createElement("div", {
9406
+ className: "field-item"
9407
+ }, React.createElement(Field, {
9408
+ name: "quantity",
9409
+ label: "Quantity Requested",
9410
+ type: "select",
9411
+ component: CustomField,
9412
+ selectOptions: [{
9413
+ label: 'Quantity Requested',
9414
+ value: '',
9415
+ disabled: true
9416
+ }].concat(generateQuantity((selectedTicket == null ? void 0 : selectedTicket.waitingListMaxQuantity) || (defaultMaxQuantity != null ? defaultMaxQuantity : 10)))
9417
+ }))), React.createElement("div", {
9418
+ className: "field-item"
9419
+ }, React.createElement(Field, {
9420
+ name: "firstName",
9421
+ label: "First name",
9422
+ validate: function validate(value) {
9423
+ return requiredValidator(value, 'Please enter your First name');
9424
+ },
9425
+ component: CustomField
9426
+ })), React.createElement("div", {
9427
+ className: "field-item"
9428
+ }, React.createElement(Field, {
9429
+ name: "lastName",
9430
+ label: "Last name",
9431
+ validate: function validate(value) {
9432
+ return requiredValidator(value, 'Please enter your Last name');
9433
+ },
9434
+ component: CustomField
9435
+ })), React.createElement("div", {
9436
+ className: "field-item"
9437
+ }, React.createElement(Field, {
9438
+ name: "email",
9439
+ label: "Email",
9440
+ validate: combineValidators(function (value) {
9441
+ return requiredValidator(value, 'Please enter your Email');
9442
+ }, function (value) {
9443
+ return emailValidator(value);
9444
+ }),
9445
+ component: CustomField
9446
+ })), React.createElement(Button, {
9447
+ type: "submit",
9448
+ variant: "contained",
9449
+ className: "waiting-list-button"
9450
+ }, loading ? React.createElement(CircularProgress$1, {
9451
+ size: "22px"
9452
+ }) : 'ADD TO WAITING LIST'));
9453
+ })));
9454
+ };
9455
+
9269
9456
  // This section is seperate because additional changes layter may be applied to Access Code
9270
9457
  var AccessCodeSection = function AccessCodeSection(_ref) {
9271
9458
  var code = _ref.code,
@@ -10258,11 +10445,45 @@ var TicketsContainer = function TicketsContainer(_ref) {
10258
10445
  }
10259
10446
  localStorage.setItem('selectedTicketsQuantity', value.toString());
10260
10447
  setSelectedTickets(function (prevState) {
10261
- var _ref3;
10448
+ var _ref4;
10449
+ // Allow multiple ticket types to be selected simultaneously when flag is enabled
10450
+ if ((event == null ? void 0 : event.allowMultipleTicketTypePurchases) === true) {
10451
+ var _extends2;
10452
+ // Check if we're switching between tables and regular tickets
10453
+ var hasExistingSelection = Object.keys(prevState).some(function (k) {
10454
+ return k !== 'isTable';
10455
+ });
10456
+ var switchingTicketType = hasExistingSelection && prevState.isTable !== isTable;
10457
+ // If switching from tables to regular tickets or vice versa, clear all selections
10458
+ if (switchingTicketType && Number(value) > 0) {
10459
+ var _ref3;
10460
+ return _ref3 = {}, _ref3[key] = value, _ref3.isTable = isTable, _ref3;
10461
+ }
10462
+ // If value is 0, remove this ticket from selection
10463
+ if (!value || Number(value) === 0) {
10464
+ var newState = _extends({}, prevState);
10465
+ delete newState[key];
10466
+ // If no ticket keys remain (only isTable left), return empty state
10467
+ var ticketKeys = Object.keys(newState).filter(function (k) {
10468
+ return k !== 'isTable';
10469
+ });
10470
+ if (ticketKeys.length === 0) {
10471
+ return {
10472
+ isTable: false
10473
+ };
10474
+ }
10475
+ return _extends({}, newState, {
10476
+ isTable: prevState.isTable
10477
+ });
10478
+ }
10479
+ // If value > 0, add or update this ticket while keeping others of the same type selected
10480
+ return _extends({}, prevState, (_extends2 = {}, _extends2[key] = value, _extends2.isTable = isTable, _extends2));
10481
+ }
10482
+ // Default behavior: only one ticket type at a time
10262
10483
  if (Object.keys(prevState)[0] !== key && !value) {
10263
10484
  return prevState;
10264
10485
  }
10265
- return _ref3 = {}, _ref3[key] = value, _ref3.isTable = isTable, _ref3;
10486
+ return _ref4 = {}, _ref4[key] = value, _ref4.isTable = isTable, _ref4;
10266
10487
  });
10267
10488
  };
10268
10489
  var handleOrdersClick = function handleOrdersClick() {
@@ -10274,9 +10495,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
10274
10495
  setError(null);
10275
10496
  };
10276
10497
  var handleBook = /*#__PURE__*/function () {
10277
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
10278
- var _product_options, _product_options2, _ticket_types;
10279
- var timeSlotTickets, ticket, optionName, ticketId, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse, _errorResponse$data, _errorResponse$data$d, errorResponse, _errorResponse$data2, message, _isInvalidLinkError, _isNotInvitedError;
10498
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
10499
+ var _product_options2;
10500
+ var timeSlotTickets, ticketsList, selectedTicketIds, ticketTypesData, totalProductCartQuantity, firstTicket, firstOptionName, firstTicketId, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse, _errorResponse$data, _errorResponse$data$d, errorResponse, _errorResponse$data2, message, _isInvalidLinkError, _isNotInvitedError;
10280
10501
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10281
10502
  while (1) switch (_context2.prev = _context2.next) {
10282
10503
  case 0:
@@ -10284,54 +10505,75 @@ var TicketsContainer = function TicketsContainer(_ref) {
10284
10505
  return slots;
10285
10506
  }));
10286
10507
  setHandleBookIsLoading(true);
10287
- ticket = event != null && event.isTimeSlotEvent ? _find(timeSlotTickets || [], function (item) {
10288
- return Number(selectedTickets[item.id]) > 0;
10289
- }) || {} : _find(tickets, function (item) {
10290
- return Number(selectedTickets[item.id]) > 0;
10291
- }) || {};
10292
- optionName = _get(ticket, 'optionName');
10293
- ticketId = _get(ticket, 'id');
10294
- productCartQuantity = +selectedTickets[ticket.id];
10295
- ticketQuantity = +selectedTickets[ticket.id];
10508
+ // Unified flow: works for both single and multiple ticket types
10509
+ ticketsList = event != null && event.isTimeSlotEvent ? timeSlotTickets : tickets; // Get all selected ticket IDs with quantity > 0 (excluding 'isTable' key)
10510
+ selectedTicketIds = Object.keys(selectedTickets).filter(function (key) {
10511
+ return key !== 'isTable' && Number(selectedTickets[key]) > 0;
10512
+ }); // Build ticket_types object with all selected tickets (works for 1 or N tickets)
10513
+ ticketTypesData = {};
10514
+ totalProductCartQuantity = 0;
10515
+ firstTicket = null;
10516
+ selectedTicketIds.forEach(function (ticketId) {
10517
+ var ticket = _find(ticketsList || [], function (item) {
10518
+ return String(item.id) === ticketId;
10519
+ });
10520
+ if (ticket) {
10521
+ var _product_options;
10522
+ if (!firstTicket) firstTicket = ticket;
10523
+ var optionName = _get(ticket, 'optionName');
10524
+ var quantity = +selectedTickets[ticketId];
10525
+ totalProductCartQuantity += quantity;
10526
+ ticketTypesData[ticketId] = {
10527
+ product_options: (_product_options = {}, _product_options[optionName] = ticketId, _product_options.ticket_price = ticket.price, _product_options),
10528
+ quantity: quantity
10529
+ };
10530
+ }
10531
+ });
10532
+ if (firstTicket) {
10533
+ _context2.next = 11;
10534
+ break;
10535
+ }
10536
+ setHandleBookIsLoading(false);
10537
+ return _context2.abrupt("return");
10538
+ case 11:
10539
+ firstOptionName = _get(firstTicket, 'optionName');
10540
+ firstTicketId = _get(firstTicket, 'id');
10296
10541
  data = {
10297
10542
  attributes: {
10298
10543
  alternative_view_id: null,
10299
- product_cart_quantity: productCartQuantity,
10300
- product_options: (_product_options = {}, _product_options[optionName] = ticketId, _product_options),
10544
+ product_cart_quantity: totalProductCartQuantity,
10545
+ product_options: (_product_options2 = {}, _product_options2[firstOptionName] = firstTicketId, _product_options2),
10301
10546
  product_id: eventId,
10302
- ticket_types: (_ticket_types = {}, _ticket_types[ticketId] = {
10303
- product_options: (_product_options2 = {}, _product_options2[optionName] = ticketId, _product_options2.ticket_price = ticket.price, _product_options2),
10304
- quantity: ticketQuantity
10305
- }, _ticket_types)
10547
+ ticket_types: ticketTypesData
10306
10548
  }
10307
10549
  };
10308
- _context2.prev = 8;
10550
+ _context2.prev = 14;
10309
10551
  onGetTicketsPress();
10310
- _context2.next = 12;
10552
+ _context2.next = 18;
10311
10553
  return addToCart(eventId, data);
10312
- case 12:
10554
+ case 18:
10313
10555
  result = _context2.sent;
10314
10556
  if (!enableAddOns) {
10315
- _context2.next = 19;
10557
+ _context2.next = 25;
10316
10558
  break;
10317
10559
  }
10318
- _context2.next = 16;
10560
+ _context2.next = 22;
10319
10561
  return getCheckoutPageConfigs();
10320
- case 16:
10562
+ case 22:
10321
10563
  _context2.t0 = _context2.sent;
10322
- _context2.next = 20;
10564
+ _context2.next = 26;
10323
10565
  break;
10324
- case 19:
10566
+ case 25:
10325
10567
  _context2.t0 = {
10326
10568
  status: 200,
10327
10569
  data: {
10328
10570
  attributes: _get(result, 'data.attributes')
10329
10571
  }
10330
10572
  };
10331
- case 20:
10573
+ case 26:
10332
10574
  pageConfigsDataResponse = _context2.t0;
10333
10575
  if (!(pageConfigsDataResponse.status === 200)) {
10334
- _context2.next = 44;
10576
+ _context2.next = 50;
10335
10577
  break;
10336
10578
  }
10337
10579
  pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
@@ -10343,29 +10585,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
10343
10585
  isBrowser && window.localStorage.removeItem('add_ons');
10344
10586
  isBrowser && window.localStorage.removeItem('checkoutAdditionalConfigs');
10345
10587
  if (!(skipBillingPage && !hasAddOn)) {
10346
- _context2.next = 43;
10588
+ _context2.next = 49;
10347
10589
  break;
10348
10590
  }
10349
10591
  // Get user data for checkout data
10350
10592
  userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '{}') : {};
10351
- checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
10593
+ checkoutBody = createCheckoutDataBodyWithDefaultHolder(totalProductCartQuantity, userData);
10352
10594
  if (!enableBillingInfoAutoCreate) {
10353
- _context2.next = 39;
10595
+ _context2.next = 45;
10354
10596
  break;
10355
10597
  }
10356
- _context2.next = 36;
10598
+ _context2.next = 42;
10357
10599
  return postOnCheckout(checkoutBody, freeTicket);
10358
- case 36:
10600
+ case 42:
10359
10601
  _context2.t1 = _context2.sent;
10360
- _context2.next = 40;
10602
+ _context2.next = 46;
10361
10603
  break;
10362
- case 39:
10604
+ case 45:
10363
10605
  _context2.t1 = null;
10364
- case 40:
10606
+ case 46:
10365
10607
  checkoutResponse = _context2.t1;
10366
10608
  hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
10367
10609
  total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
10368
- case 43:
10610
+ case 49:
10369
10611
  onAddToCartSuccess({
10370
10612
  skip_billing_page: skipBillingPage,
10371
10613
  event_id: String(eventId),
@@ -10376,12 +10618,12 @@ var TicketsContainer = function TicketsContainer(_ref) {
10376
10618
  cart: pageConfigsDataResponse.data.attributes.cart,
10377
10619
  currencySymbol: event == null ? void 0 : event.currency.symbol
10378
10620
  });
10379
- case 44:
10380
- _context2.next = 50;
10621
+ case 50:
10622
+ _context2.next = 56;
10381
10623
  break;
10382
- case 46:
10383
- _context2.prev = 46;
10384
- _context2.t2 = _context2["catch"](8);
10624
+ case 52:
10625
+ _context2.prev = 52;
10626
+ _context2.t2 = _context2["catch"](14);
10385
10627
  errorResponse = _get(_context2.t2, 'response', {});
10386
10628
  if (errorResponse != null && (_errorResponse$data = errorResponse.data) != null && (_errorResponse$data$d = _errorResponse$data.data) != null && _errorResponse$data$d.hasUnverifiedOrder) {
10387
10629
  setPendingVerificationMessage(errorResponse == null ? void 0 : (_errorResponse$data2 = errorResponse.data) == null ? void 0 : _errorResponse$data2.message);
@@ -10398,25 +10640,25 @@ var TicketsContainer = function TicketsContainer(_ref) {
10398
10640
  setError(message);
10399
10641
  }
10400
10642
  }
10401
- case 50:
10402
- _context2.prev = 50;
10643
+ case 56:
10644
+ _context2.prev = 56;
10403
10645
  setHandleBookIsLoading(false);
10404
- return _context2.finish(50);
10405
- case 53:
10646
+ return _context2.finish(56);
10647
+ case 59:
10406
10648
  case "end":
10407
10649
  return _context2.stop();
10408
10650
  }
10409
- }, _callee2, null, [[8, 46, 50, 53]]);
10651
+ }, _callee2, null, [[14, 52, 56, 59]]);
10410
10652
  }));
10411
10653
  return function handleBook() {
10412
- return _ref4.apply(this, arguments);
10654
+ return _ref5.apply(this, arguments);
10413
10655
  };
10414
10656
  }();
10415
10657
  var updateTickets = function updateTickets(isUpdatingCode, type) {
10416
10658
  getTicketsApi(isUpdatingCode, type);
10417
10659
  };
10418
10660
  var fetchUserData = /*#__PURE__*/function () {
10419
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10661
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10420
10662
  var userDataResponse, profileData, profileDataObj;
10421
10663
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10422
10664
  while (1) switch (_context3.prev = _context3.next) {
@@ -10435,7 +10677,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
10435
10677
  }, _callee3);
10436
10678
  }));
10437
10679
  return function fetchUserData() {
10438
- return _ref5.apply(this, arguments);
10680
+ return _ref6.apply(this, arguments);
10439
10681
  };
10440
10682
  }();
10441
10683
  var isTicketOnSale = event != null && event.isTimeSlotEvent ? true : _some(tickets, function (item) {
@@ -12270,7 +12512,9 @@ var LoginForm = function LoginForm(_ref) {
12270
12512
  _ref$showSignUpButton = _ref.showSignUpButton,
12271
12513
  showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
12272
12514
  _ref$showPoweredByIma = _ref.showPoweredByImage,
12273
- showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
12515
+ showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma,
12516
+ _ref$registerUrl = _ref.registerUrl,
12517
+ registerUrl = _ref$registerUrl === void 0 ? 'https://www.ticketfairy.com/register' : _ref$registerUrl;
12274
12518
  var _useState = useState(''),
12275
12519
  error = _useState[0],
12276
12520
  setError = _useState[1];
@@ -12391,9 +12635,16 @@ var LoginForm = function LoginForm(_ref) {
12391
12635
  onClick: onForgotPasswordButtonClick
12392
12636
  }, "Forgot password?")), showSignUpButton && React.createElement("div", {
12393
12637
  className: "forgot-password"
12394
- }, React.createElement("span", {
12638
+ }, onSignupButtonClick !== _identity ? React.createElement("span", {
12395
12639
  "aria-hidden": "true",
12396
- onClick: onSignupButtonClick
12640
+ onClick: onSignupButtonClick,
12641
+ style: {
12642
+ cursor: 'pointer'
12643
+ }
12644
+ }, "Sign up") : React.createElement("a", {
12645
+ href: registerUrl,
12646
+ target: "_blank",
12647
+ rel: "noopener noreferrer"
12397
12648
  }, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
12398
12649
  }));
12399
12650
  };