tf-checkout-react 1.0.96-beta.0 → 1.0.99-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { AxiosInstance } from 'axios';
1
+ import { AxiosInstance, AxiosResponse } from 'axios';
2
2
  interface IPublicRequest extends AxiosInstance {
3
3
  setGuestToken: (token: string) => void;
4
4
  setAccessToken: (token: string) => void;
@@ -7,29 +7,28 @@ interface IPublicRequest extends AxiosInstance {
7
7
  export declare const publicRequest: IPublicRequest;
8
8
  export declare const setXSourceOrigin: (sourceOrigin: string) => void;
9
9
  export declare const setCustomHeader: (response: any) => void;
10
- export declare const handleSetAccessToken: (token: any) => void;
11
- export declare function getEvent(id: string | number): Promise<import("axios").AxiosResponse<any, any>>;
12
- export declare function getTickets(id: string | number, promoCode: string): Promise<import("axios").AxiosResponse<any, any>>;
13
- export declare const addToCart: (id: string | number, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
14
- export declare const getCart: () => Promise<import("axios").AxiosResponse<any, any>>;
15
- export declare const postOnCheckout: (data: any, accessToken: string) => Promise<import("axios").AxiosResponse<any, any>>;
10
+ export declare function getEvent(id: string | number): Promise<AxiosResponse<any, any>>;
11
+ export declare function getTickets(id: string | number, promoCode: string): Promise<AxiosResponse<any, any>>;
12
+ export declare const addToCart: (id: string | number, data: any) => Promise<AxiosResponse<any, any>>;
13
+ export declare const getCart: () => Promise<AxiosResponse<any, any>>;
14
+ export declare const postOnCheckout: (data: any, accessToken?: string | undefined) => Promise<AxiosResponse<any, any>>;
16
15
  export declare const authorize: (data: {
17
16
  email: string;
18
17
  password: string;
19
- }) => Promise<import("axios").AxiosResponse<any, any>>;
20
- export declare const register: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
21
- export declare const getAccessToken: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
22
- export declare const getPaymentData: (hash: string) => Promise<import("axios").AxiosResponse<any, any>>;
23
- export declare const handlePaymentData: (orderHash: string, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
24
- export declare const handlePaymentSuccess: (orderHash: string) => Promise<import("axios").AxiosResponse<any, any>>;
25
- export declare const handleFreeSuccess: (orderHash: string) => Promise<import("axios").AxiosResponse<any, any>>;
18
+ }) => Promise<AxiosResponse<any, any>>;
19
+ export declare const register: (data: FormData) => Promise<AxiosResponse<any, any>>;
20
+ export declare const getAccessToken: (data: FormData) => Promise<AxiosResponse<any, any>>;
21
+ export declare const getPaymentData: (hash: string) => Promise<AxiosResponse<any, any>>;
22
+ export declare const handlePaymentData: (orderHash: string, data: any) => Promise<AxiosResponse<any, any>>;
23
+ export declare const handlePaymentSuccess: (orderHash: string) => Promise<AxiosResponse<any, any>>;
24
+ export declare const handleFreeSuccess: (orderHash: string) => Promise<AxiosResponse<any, any>>;
26
25
  export declare const getProfileData: (accessToken?: string | undefined) => Promise<any>;
27
- export declare const getCountries: () => Promise<import("axios").AxiosResponse<any, any>>;
28
- export declare const getConfirmationData: (orderHash: string) => Promise<import("axios").AxiosResponse<any, any>>;
29
- export declare const getStates: (countryId: string) => Promise<import("axios").AxiosResponse<any, any>>;
30
- export declare const getOrders: (page: number, limit: number, eventSlug: string) => Promise<import("axios").AxiosResponse<any, any>>;
31
- export declare const getOrderDetails: (orderId: string) => Promise<import("axios").AxiosResponse<any, any>>;
32
- export declare const addToWaitingList: (id: number, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
33
- export declare const getConditions: (eventId: string) => Promise<import("axios").AxiosResponse<any, any>>;
34
- export declare const postReferralVisits: (eventId: string, referralId: string) => Promise<import("axios").AxiosResponse<any, any>>;
26
+ export declare const getCountries: () => Promise<AxiosResponse<any, any>>;
27
+ export declare const getConfirmationData: (orderHash: string) => Promise<AxiosResponse<any, any>>;
28
+ export declare const getStates: (countryId: string) => Promise<AxiosResponse<any, any>>;
29
+ export declare const getOrders: (page: number, limit: number, eventSlug: string) => Promise<AxiosResponse<any, any>>;
30
+ export declare const getOrderDetails: (orderId: string) => Promise<AxiosResponse<any, any>>;
31
+ export declare const addToWaitingList: (id: number, data: any) => Promise<AxiosResponse<any, any>>;
32
+ export declare const getConditions: (eventId: string) => Promise<AxiosResponse<any, any>>;
33
+ export declare const postReferralVisits: (eventId: string, referralId: string) => Promise<AxiosResponse<any, any>>;
35
34
  export {};
@@ -9,10 +9,7 @@ export interface IBillingInfoPage {
9
9
  data?: IBillingInfoData[];
10
10
  ticketHoldersFields?: IBillingInfoData;
11
11
  handleSubmit?: (values: FormikValues, formikHelpers: FormikHelpers<FormikValues>, eventId: any, res: any) => void;
12
- onRegisterSuccess?: (value: {
13
- accessToken: string;
14
- refreshToken: string;
15
- }) => void;
12
+ onRegisterSuccess?: () => void;
16
13
  onRegisterError?: (e: AxiosError, email: string) => void;
17
14
  onSubmitError?: (e: AxiosError) => void;
18
15
  onGetCartSuccess?: (res: any) => void;
@@ -42,5 +39,6 @@ export interface IBillingInfoPage {
42
39
  onSkipBillingPage: (data: any) => void;
43
40
  skipPage?: boolean;
44
41
  canSkipHolderNames?: boolean;
42
+ shouldFetchCountries?: boolean;
45
43
  }
46
- export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames }: IBillingInfoPage) => JSX.Element;
44
+ export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames, shouldFetchCountries, }: IBillingInfoPage) => JSX.Element;
@@ -5,7 +5,8 @@ interface CountdownTypes {
5
5
  timezone?: string;
6
6
  title?: string;
7
7
  message?: string;
8
+ showMessage?: boolean;
8
9
  callback?: () => void;
9
10
  }
10
- declare function Countdown({ startDate, timezone, title, message, callback }: CountdownTypes): JSX.Element;
11
+ declare function Countdown({ startDate, timezone, title, message, showMessage, callback }: CountdownTypes): JSX.Element;
11
12
  export default Countdown;
@@ -37,5 +37,5 @@ export interface ITicket {
37
37
  export interface ISelectedTickets {
38
38
  [key: string]: string | number;
39
39
  }
40
- export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList }: IGetTickets) => JSX.Element;
40
+ export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, }: IGetTickets) => JSX.Element;
41
41
  export {};
@@ -1113,9 +1113,12 @@ function setCustomCookie(name, value, days) {
1113
1113
  expires = '; expires=' + date.toUTCString();
1114
1114
  }
1115
1115
 
1116
- document.cookie = name + '=' + (value || '') + expires + '; path=/';
1116
+ if (document) {
1117
+ document.cookie = name + '=' + (value || '') + expires + '; path=/';
1118
+ }
1117
1119
  }
1118
1120
  function getCookieByName(cname) {
1121
+ if (!document) return '';
1119
1122
  var name = cname + '=';
1120
1123
  var ca = document.cookie.split(';');
1121
1124
 
@@ -1134,7 +1137,9 @@ function getCookieByName(cname) {
1134
1137
  return '';
1135
1138
  }
1136
1139
  function deleteCookieByName(name) {
1137
- document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
1140
+ if (document) {
1141
+ document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
1142
+ }
1138
1143
  }
1139
1144
 
1140
1145
  var isWindowDefined = typeof window !== 'undefined';
@@ -1218,6 +1223,15 @@ publicRequest.interceptors.request.use(function (config) {
1218
1223
 
1219
1224
  return config;
1220
1225
  });
1226
+ publicRequest.interceptors.response.use(function (response) {
1227
+ var xtfCookie = _get(response, 'headers.x-tf-ecommerce');
1228
+
1229
+ if (xtfCookie) {
1230
+ setCustomCookie('X-TF-ECOMMERCE', xtfCookie);
1231
+ }
1232
+
1233
+ return response;
1234
+ });
1221
1235
 
1222
1236
  publicRequest.setGuestToken = function (token) {
1223
1237
  return publicRequest.defaults.headers.common['Authorization-Guest'] = token;
@@ -1248,14 +1262,6 @@ var setCustomHeader = function setCustomHeader(response) {
1248
1262
  }
1249
1263
  }
1250
1264
  };
1251
- var handleSetAccessToken = function handleSetAccessToken(token) {
1252
- if (token) {
1253
- if (isWindowDefined) {
1254
- window.localStorage.setItem('access_token', token);
1255
- publicRequest.setAccessToken(token);
1256
- }
1257
- }
1258
- };
1259
1265
  function getEvent(id) {
1260
1266
  var response = publicRequest.get("v1/event/" + id, {
1261
1267
  headers: ttfHeaders
@@ -1404,7 +1410,7 @@ var LoginModal = function LoginModal(_ref) {
1404
1410
  },
1405
1411
  onSubmit: function () {
1406
1412
  var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
1407
- var email, password, body, resAutorize, xtfCookie, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
1413
+ var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
1408
1414
 
1409
1415
  return runtime_1.wrap(function _callee$(_context) {
1410
1416
  while (1) {
@@ -1420,23 +1426,20 @@ var LoginModal = function LoginModal(_ref) {
1420
1426
  return authorize(body);
1421
1427
 
1422
1428
  case 5:
1423
- resAutorize = _context.sent;
1424
- xtfCookie = _get(resAutorize, 'headers.x-tf-ecommerce');
1425
- setCustomCookie('X-TF-ECOMMERCE', xtfCookie);
1426
1429
  profileResponse = null;
1427
- _context.prev = 9;
1428
- _context.next = 12;
1430
+ _context.prev = 6;
1431
+ _context.next = 9;
1429
1432
  return getProfileData();
1430
1433
 
1431
- case 12:
1434
+ case 9:
1432
1435
  profileResponse = _context.sent;
1433
1436
  onGetProfileDataSuccess(profileResponse.data);
1434
- _context.next = 20;
1437
+ _context.next = 17;
1435
1438
  break;
1436
1439
 
1437
- case 16:
1438
- _context.prev = 16;
1439
- _context.t0 = _context["catch"](9);
1440
+ case 13:
1441
+ _context.prev = 13;
1442
+ _context.t0 = _context["catch"](6);
1440
1443
 
1441
1444
  if (axios.isAxiosError(_context.t0)) {
1442
1445
  onGetProfileDataError(_context.t0);
@@ -1444,7 +1447,7 @@ var LoginModal = function LoginModal(_ref) {
1444
1447
 
1445
1448
  return _context.abrupt("return");
1446
1449
 
1447
- case 20:
1450
+ case 17:
1448
1451
  profileSpecifiedData = _get(profileResponse, 'data.data');
1449
1452
  profileDataObj = {
1450
1453
  id: profileSpecifiedData.id,
@@ -1460,11 +1463,11 @@ var LoginModal = function LoginModal(_ref) {
1460
1463
  }
1461
1464
 
1462
1465
  onLogin();
1463
- _context.next = 29;
1466
+ _context.next = 26;
1464
1467
  break;
1465
1468
 
1466
- case 26:
1467
- _context.prev = 26;
1469
+ case 23:
1470
+ _context.prev = 23;
1468
1471
  _context.t1 = _context["catch"](1);
1469
1472
 
1470
1473
  if (axios.isAxiosError(_context.t1)) {
@@ -1474,12 +1477,12 @@ var LoginModal = function LoginModal(_ref) {
1474
1477
  setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
1475
1478
  }
1476
1479
 
1477
- case 29:
1480
+ case 26:
1478
1481
  case "end":
1479
1482
  return _context.stop();
1480
1483
  }
1481
1484
  }
1482
- }, _callee, null, [[1, 26], [9, 16]]);
1485
+ }, _callee, null, [[1, 23], [6, 13]]);
1483
1486
  }));
1484
1487
 
1485
1488
  function onSubmit(_x) {
@@ -1576,7 +1579,7 @@ var RegisterModal = function RegisterModal(_ref) {
1576
1579
  },
1577
1580
  onSubmit: function () {
1578
1581
  var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
1579
- var firstName, lastName, email, password, confirmPassword, bodyFormData, resRegister, access_token, profileResponse, profileSpecifiedData, profileDataObj;
1582
+ var firstName, lastName, email, password, confirmPassword, bodyFormData, profileResponse, profileSpecifiedData, profileDataObj;
1580
1583
  return runtime_1.wrap(function _callee$(_context) {
1581
1584
  while (1) {
1582
1585
  switch (_context.prev = _context.next) {
@@ -1594,27 +1597,24 @@ var RegisterModal = function RegisterModal(_ref) {
1594
1597
  return register(bodyFormData);
1595
1598
 
1596
1599
  case 11:
1597
- resRegister = _context.sent;
1598
- access_token = _get(resRegister, 'data.data.attributes.access_token');
1599
- handleSetAccessToken(access_token);
1600
1600
  profileResponse = null;
1601
- _context.prev = 15;
1602
- _context.next = 18;
1603
- return getProfileData(access_token);
1601
+ _context.prev = 12;
1602
+ _context.next = 15;
1603
+ return getProfileData();
1604
1604
 
1605
- case 18:
1605
+ case 15:
1606
1606
  profileResponse = _context.sent;
1607
1607
  onGetProfileDataSuccess(profileResponse.data);
1608
- _context.next = 26;
1608
+ _context.next = 23;
1609
1609
  break;
1610
1610
 
1611
- case 22:
1612
- _context.prev = 22;
1613
- _context.t0 = _context["catch"](15);
1611
+ case 19:
1612
+ _context.prev = 19;
1613
+ _context.t0 = _context["catch"](12);
1614
1614
  onGetProfileDataError(_context.t0.response);
1615
1615
  return _context.abrupt("return");
1616
1616
 
1617
- case 26:
1617
+ case 23:
1618
1618
  profileSpecifiedData = _get(profileResponse, 'data.data');
1619
1619
  profileDataObj = {
1620
1620
  id: profileSpecifiedData.id,
@@ -1624,18 +1624,17 @@ var RegisterModal = function RegisterModal(_ref) {
1624
1624
  };
1625
1625
 
1626
1626
  if (typeof window !== 'undefined') {
1627
- window.localStorage.setItem('access_token', access_token);
1628
1627
  window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1629
1628
  }
1630
1629
 
1631
1630
  onClose();
1632
1631
 
1633
- case 30:
1632
+ case 27:
1634
1633
  case "end":
1635
1634
  return _context.stop();
1636
1635
  }
1637
1636
  }
1638
- }, _callee, null, [[15, 22]]);
1637
+ }, _callee, null, [[12, 19]]);
1639
1638
  }));
1640
1639
 
1641
1640
  function onSubmit(_x) {
@@ -2162,7 +2161,8 @@ var LogicRunner = function LogicRunner(_ref) {
2162
2161
  setValues = _ref.setValues,
2163
2162
  setUserValues = _ref.setUserValues,
2164
2163
  onGetStatesSuccess = _ref.onGetStatesSuccess,
2165
- onGetStatesError = _ref.onGetStatesError;
2164
+ onGetStatesError = _ref.onGetStatesError,
2165
+ shouldFetchCountries = _ref.shouldFetchCountries;
2166
2166
  var prevCountry = React.useRef(values.country);
2167
2167
  React.useEffect(function () {
2168
2168
  var fetchStates = /*#__PURE__*/function () {
@@ -2217,7 +2217,7 @@ var LogicRunner = function LogicRunner(_ref) {
2217
2217
  };
2218
2218
  }();
2219
2219
 
2220
- fetchStates();
2220
+ shouldFetchCountries && fetchStates();
2221
2221
  }, [values.country, setStates, setFieldValue]);
2222
2222
  var userDataEncoded = typeof window !== 'undefined' ? window.localStorage.getItem('user_data') : '';
2223
2223
  React.useEffect(function () {
@@ -2317,7 +2317,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2317
2317
  _ref3$skipPage = _ref3.skipPage,
2318
2318
  skipPage = _ref3$skipPage === void 0 ? false : _ref3$skipPage,
2319
2319
  _ref3$canSkipHolderNa = _ref3.canSkipHolderNames,
2320
- canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa;
2320
+ canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa,
2321
+ _ref3$shouldFetchCoun = _ref3.shouldFetchCountries,
2322
+ shouldFetchCountries = _ref3$shouldFetchCoun === void 0 ? true : _ref3$shouldFetchCoun;
2321
2323
 
2322
2324
  var themeMui = styles$1.createTheme(themeOptions);
2323
2325
  var isWindowDefined = typeof window !== 'undefined';
@@ -2491,7 +2493,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2491
2493
  };
2492
2494
  }();
2493
2495
 
2494
- fetchCountries();
2496
+ shouldFetchCountries && fetchCountries();
2495
2497
  fetchCart();
2496
2498
  }, []); // fetch cart data
2497
2499
 
@@ -2551,7 +2553,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2551
2553
  case 0:
2552
2554
  _context4.prev = 0;
2553
2555
 
2554
- if (!(isWindowDefined && token || xtfCookie)) {
2556
+ if (!(isWindowDefined && token || isLoggedIn)) {
2555
2557
  _context4.next = 10;
2556
2558
  break;
2557
2559
  }
@@ -2598,7 +2600,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2598
2600
 
2599
2601
  React.useEffect(function () {
2600
2602
  fetchUserData(access_token);
2601
- }, [access_token, xtfCookie]);
2603
+ }, [access_token, isLoggedIn]);
2602
2604
  React.useEffect(function () {
2603
2605
  var collectPaymentData = /*#__PURE__*/function () {
2604
2606
  var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
@@ -2693,7 +2695,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2693
2695
  enableReinitialize: true,
2694
2696
  onSubmit: function () {
2695
2697
  var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(values, formikHelpers) {
2696
- var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData, access_token_register, resRegister, refreshToken, tokens, _e$response, _e$response$data, _error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, res, _e$response2, _e$response3;
2698
+ var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData, _e$response, _e$response$data, _error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, res, _e$response2, _e$response3;
2697
2699
 
2698
2700
  return runtime_1.wrap(function _callee6$(_context6) {
2699
2701
  while (1) {
@@ -2740,27 +2742,18 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2740
2742
  lastNameLogged: lastNameLogged
2741
2743
  }, showDOB);
2742
2744
  bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration);
2743
- access_token_register = null;
2744
- _context6.prev = 18;
2745
- _context6.next = 21;
2745
+ _context6.prev = 17;
2746
+ _context6.next = 20;
2746
2747
  return register(bodyFormData);
2747
2748
 
2748
- case 21:
2749
- resRegister = _context6.sent;
2750
- access_token_register = _get(resRegister, 'data.data.attributes.access_token');
2751
- refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
2752
- handleSetAccessToken(access_token_register);
2753
- tokens = {
2754
- accessToken: access_token_register,
2755
- refreshToken: refreshToken
2756
- };
2757
- onRegisterSuccess(tokens);
2758
- _context6.next = 33;
2749
+ case 20:
2750
+ onRegisterSuccess();
2751
+ _context6.next = 27;
2759
2752
  break;
2760
2753
 
2761
- case 29:
2762
- _context6.prev = 29;
2763
- _context6.t0 = _context6["catch"](18);
2754
+ case 23:
2755
+ _context6.prev = 23;
2756
+ _context6.t0 = _context6["catch"](17);
2764
2757
 
2765
2758
  if (axios.isAxiosError(_context6.t0)) {
2766
2759
  _error = _context6.t0 == null ? void 0 : (_e$response = _context6.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message;
@@ -2785,11 +2778,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2785
2778
 
2786
2779
  return _context6.abrupt("return");
2787
2780
 
2788
- case 33:
2789
- _context6.next = 35;
2790
- return getProfileData(access_token_register);
2781
+ case 27:
2782
+ _context6.next = 29;
2783
+ return getProfileData();
2791
2784
 
2792
- case 35:
2785
+ case 29:
2793
2786
  profileData = _context6.sent;
2794
2787
  profileSpecifiedData = _get(profileData, 'data.data');
2795
2788
  profileDataObj = setLoggedUserData(profileSpecifiedData);
@@ -2799,17 +2792,17 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2799
2792
  }
2800
2793
 
2801
2794
  checkoutBody = collectCheckoutBody(values);
2802
- _context6.next = 42;
2803
- return postOnCheckout(checkoutBody, access_token_register);
2795
+ _context6.next = 36;
2796
+ return postOnCheckout(checkoutBody);
2804
2797
 
2805
- case 42:
2798
+ case 36:
2806
2799
  res = _context6.sent;
2807
2800
  handleSubmit(values, formikHelpers, eventId, res);
2808
- _context6.next = 49;
2801
+ _context6.next = 43;
2809
2802
  break;
2810
2803
 
2811
- case 46:
2812
- _context6.prev = 46;
2804
+ case 40:
2805
+ _context6.prev = 40;
2813
2806
  _context6.t1 = _context6["catch"](0);
2814
2807
 
2815
2808
  if (axios.isAxiosError(_context6.t1)) {
@@ -2833,12 +2826,12 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2833
2826
  onSubmitError(_context6.t1);
2834
2827
  }
2835
2828
 
2836
- case 49:
2829
+ case 43:
2837
2830
  case "end":
2838
2831
  return _context6.stop();
2839
2832
  }
2840
2833
  }
2841
- }, _callee6, null, [[0, 46], [18, 29]]);
2834
+ }, _callee6, null, [[0, 40], [17, 23]]);
2842
2835
  }));
2843
2836
 
2844
2837
  function onSubmit(_x2, _x3) {
@@ -2857,7 +2850,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
2857
2850
  setValues: props.setValues,
2858
2851
  setUserValues: setUserValues,
2859
2852
  onGetStatesSuccess: onGetStatesSuccess,
2860
- onGetStatesError: onGetStatesError
2853
+ onGetStatesError: onGetStatesError,
2854
+ shouldFetchCountries: shouldFetchCountries
2861
2855
  }), React__default.createElement("div", {
2862
2856
  className: "billing-info-container " + theme
2863
2857
  }, error && !hideErrorsAlertSection && React__default.createElement(material.Alert, {
@@ -4069,12 +4063,13 @@ var TicketRow = function TicketRow(_ref) {
4069
4063
  }, option.value);
4070
4064
  })))));
4071
4065
  var returnValue = '';
4066
+ var isSoldOut = ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut;
4072
4067
 
4073
- if (ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut) {
4068
+ if (isSoldOut) {
4074
4069
  returnValue = soldOutMessage;
4075
4070
  }
4076
4071
 
4077
- if (ticketTier.displayTicket) {
4072
+ if (ticketTier.displayTicket && !isSoldOut) {
4078
4073
  returnValue = onSaleContent;
4079
4074
  }
4080
4075
 
@@ -4108,7 +4103,7 @@ var TicketsSection = function TicketsSection(_ref) {
4108
4103
  }
4109
4104
 
4110
4105
  var ticketIsFree = (+ticket.cost || +ticket.price) === 0;
4111
- var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "$ " + (+ticket.cost || +ticket.price).toFixed(2);
4106
+ var ticketPrice = isSoldOut ? '' : ticketIsFree ? 'FREE' : "$ " + (+ticket.cost || +ticket.price).toFixed(2);
4112
4107
  return React__default.createElement("div", {
4113
4108
  key: ticket.id || ticket.name,
4114
4109
  className: "event-detail__tier " + (isSoldOut ? 'disabled' : '')
@@ -4385,6 +4380,8 @@ function Countdown(_ref) {
4385
4380
  title = _ref$title === void 0 ? '' : _ref$title,
4386
4381
  _ref$message = _ref.message,
4387
4382
  message = _ref$message === void 0 ? '' : _ref$message,
4383
+ _ref$showMessage = _ref.showMessage,
4384
+ showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
4388
4385
  _ref$callback = _ref.callback,
4389
4386
  callback = _ref$callback === void 0 ? function () {} : _ref$callback;
4390
4387
 
@@ -4446,7 +4443,7 @@ function Countdown(_ref) {
4446
4443
  className: 'countdown'
4447
4444
  }, React__default.createElement("div", null, React__default.createElement("p", {
4448
4445
  className: 'title'
4449
- }, title), React__default.createElement("p", null, duration)), React__default.createElement("p", {
4446
+ }, title), React__default.createElement("p", null, duration)), showMessage && React__default.createElement("p", {
4450
4447
  className: 'message'
4451
4448
  }, message)));
4452
4449
  }
@@ -4822,6 +4819,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
4822
4819
  return item.salesStarted && !item.salesEnded && !item.soldOut;
4823
4820
  });
4824
4821
 
4822
+ var eventHasTickets = !_isEmpty(tickets);
4823
+ var isSalesClosed = event == null ? void 0 : event.salesEnded;
4825
4824
  var themeMui = material.createTheme(themeOptions);
4826
4825
  React.useEffect(function () {
4827
4826
  isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
@@ -4842,20 +4841,23 @@ var TicketsContainer = function TicketsContainer(_ref) {
4842
4841
  }), React__default.createElement("div", {
4843
4842
  className: "get-tickets-page " + theme,
4844
4843
  style: contentStyle
4845
- }, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, React__default.createElement(TicketsSection, {
4844
+ }, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, !isSalesClosed && React__default.createElement(TicketsSection, {
4846
4845
  ticketsList: tickets,
4847
4846
  selectedTickets: selectedTickets,
4848
4847
  handleTicketSelect: handleTicketSelect,
4849
4848
  promoCodeIsApplied: promoCodeIsApplied
4850
- }), event != null && event.salesEnded ? React__default.createElement("p", {
4851
- className: 'event-closed-message'
4849
+ }), isSalesClosed ? React__default.createElement("p", {
4850
+ className: "event-closed-message"
4852
4851
  }, "Sales for this event are closed.") : !(event != null && event.salesStarted) && event != null && event.salesStart ? React__default.createElement(Countdown, {
4853
4852
  startDate: event.salesStart,
4854
4853
  timezone: event.timezone,
4855
4854
  title: "Sales start in:",
4856
4855
  message: "No tickets are currently available for this event.",
4856
+ showMessage: !eventHasTickets,
4857
4857
  callback: updateTickets
4858
- }) : null, showWaitingList && event.salesStarted && !hideWaitingList && React__default.createElement(WaitingList, {
4858
+ }) : !eventHasTickets ? React__default.createElement("p", {
4859
+ className: "message"
4860
+ }, "No tickets are currently available for this event.") : null, showWaitingList && event.salesStarted && !hideWaitingList && React__default.createElement(WaitingList, {
4859
4861
  tickets: tickets,
4860
4862
  eventId: eventId
4861
4863
  }), React__default.createElement(PromoCodeSection, {
@@ -4868,7 +4870,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
4868
4870
  isPromotionsEnabled: isPromotionsEnabled,
4869
4871
  isAccessCodeEnabled: isAccessCodeEnabled,
4870
4872
  isAllTicketsSoldOut: isAllTicketsSoldOut
4871
- }), (isTicketOnSale || !(event != null && event.salesEnded)) && React__default.createElement(Button$1, {
4873
+ }), (isTicketOnSale || !(event != null && event.salesEnded)) && !isSalesClosed && (event == null ? void 0 : event.salesStarted) && React__default.createElement(Button$1, {
4872
4874
  "aria-hidden": true,
4873
4875
  className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
4874
4876
  onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}