tf-checkout-react 1.0.78 → 1.0.82
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.
- package/dist/components/billing-info-container/index.d.ts +3 -2
- package/dist/components/paymentContainer/index.d.ts +5 -2
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +9 -1
- package/dist/hooks/usePrevious.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +172 -79
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +176 -83
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/billing-info-container/index.tsx +39 -9
- package/src/components/common/CheckboxField.tsx +13 -9
- package/src/components/paymentContainer/index.tsx +6 -3
- package/src/components/stripePayment/index.tsx +3 -3
- package/src/components/ticketsContainer/PromoCodeSection.tsx +45 -32
- package/src/components/ticketsContainer/index.tsx +100 -85
- package/src/hooks/usePrevious.tsx +9 -0
- package/src/utils/downloadPDF.tsx +11 -3
|
@@ -4,7 +4,7 @@ import { FormikHelpers, FormikValues } from 'formik';
|
|
|
4
4
|
import './style.css';
|
|
5
5
|
import { IBillingInfoData } from '../../types';
|
|
6
6
|
import { ThemeOptions } from '@mui/material';
|
|
7
|
-
import { CSSProperties } from '@mui/
|
|
7
|
+
import { CSSProperties } from '@mui/styles';
|
|
8
8
|
export interface IBillingInfoPage {
|
|
9
9
|
data?: IBillingInfoData[];
|
|
10
10
|
ticketHoldersFields?: IBillingInfoData;
|
|
@@ -27,6 +27,7 @@ export interface IBillingInfoPage {
|
|
|
27
27
|
onAuthorizeError?: (e: AxiosError) => void;
|
|
28
28
|
onLogin?: () => void;
|
|
29
29
|
onLoginSuccess?: () => void;
|
|
30
|
+
onErrorClose?: () => void;
|
|
30
31
|
initialValues?: FormikValues;
|
|
31
32
|
buttonName?: string;
|
|
32
33
|
theme?: 'light' | 'dark';
|
|
@@ -38,4 +39,4 @@ export interface IBillingInfoPage {
|
|
|
38
39
|
checkbox?: CSSProperties;
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
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 }: IBillingInfoPage) => JSX.Element;
|
|
42
|
+
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 }: IBillingInfoPage) => JSX.Element;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { AxiosError } from 'axios';
|
|
3
|
+
import { StripeElementsOptions } from '@stripe/stripe-js';
|
|
3
4
|
import './style.css';
|
|
4
5
|
import { IPaymentField } from '../../types';
|
|
5
6
|
import { StripeCardNumberElementOptions } from '@stripe/stripe-js';
|
|
6
7
|
import { ThemeOptions } from '@mui/material';
|
|
8
|
+
import { CSSProperties } from "@mui/styles";
|
|
7
9
|
export interface IPaymentPage {
|
|
8
10
|
paymentFields: IPaymentField[];
|
|
9
11
|
handlePayment: any;
|
|
@@ -20,5 +22,6 @@ export interface IPaymentPage {
|
|
|
20
22
|
input?: CSSProperties;
|
|
21
23
|
checkbox?: CSSProperties;
|
|
22
24
|
};
|
|
25
|
+
elementsOptions?: StripeElementsOptions;
|
|
23
26
|
}
|
|
24
|
-
export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, }: IPaymentPage) => JSX.Element;
|
|
27
|
+
export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, elementsOptions }: IPaymentPage) => JSX.Element;
|
|
@@ -5,8 +5,9 @@ export interface IPromoCodeSectionProps {
|
|
|
5
5
|
showPromoInput: boolean;
|
|
6
6
|
isPromotionsEnabled: boolean;
|
|
7
7
|
isAllTicketsSoldOut: boolean;
|
|
8
|
+
isAccessCodeEnabled?: boolean;
|
|
8
9
|
setPromoCode: (value: string) => void;
|
|
9
10
|
setPromoCodeUpdated: (value: string) => void;
|
|
10
11
|
setShowPromoInput: (value: boolean) => void;
|
|
11
12
|
}
|
|
12
|
-
export declare const PromoCodeSection: ({ promoCode, promoCodeIsApplied, showPromoInput, isPromotionsEnabled,
|
|
13
|
+
export declare const PromoCodeSection: ({ promoCode, promoCodeIsApplied, showPromoInput, isPromotionsEnabled, setPromoCode, setPromoCodeUpdated, setShowPromoInput, isAccessCodeEnabled, }: IPromoCodeSectionProps) => JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AxiosError } from 'axios';
|
|
3
3
|
import './style.css';
|
|
4
|
+
import { ThemeOptions } from '@mui/material';
|
|
5
|
+
import { CSSProperties } from '@mui/styles';
|
|
4
6
|
interface CartSuccess {
|
|
5
7
|
skip_billing_page: boolean;
|
|
6
8
|
names_required: boolean;
|
|
@@ -20,6 +22,12 @@ export interface IGetTickets {
|
|
|
20
22
|
theme?: 'light' | 'dark';
|
|
21
23
|
queryPromoCode?: string;
|
|
22
24
|
isPromotionsEnabled?: boolean;
|
|
25
|
+
themeOptions?: ThemeOptions & {
|
|
26
|
+
input?: CSSProperties;
|
|
27
|
+
checkbox?: CSSProperties;
|
|
28
|
+
};
|
|
29
|
+
isAccessCodeEnabled?: boolean;
|
|
30
|
+
hideSessionButtons?: boolean;
|
|
23
31
|
}
|
|
24
32
|
export interface ITicket {
|
|
25
33
|
id: string | number;
|
|
@@ -28,5 +36,5 @@ export interface ITicket {
|
|
|
28
36
|
export interface ISelectedTickets {
|
|
29
37
|
[key: string]: string | number;
|
|
30
38
|
}
|
|
31
|
-
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, }: IGetTickets) => JSX.Element;
|
|
39
|
+
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons }: IGetTickets) => JSX.Element;
|
|
32
40
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePrevious: <T extends unknown>(value: T) => T | undefined;
|
|
@@ -12,6 +12,7 @@ var _identity = _interopDefault(require('lodash/identity'));
|
|
|
12
12
|
var _map = _interopDefault(require('lodash/map'));
|
|
13
13
|
var _get = _interopDefault(require('lodash/get'));
|
|
14
14
|
var _includes = _interopDefault(require('lodash/includes'));
|
|
15
|
+
var _isEqual = _interopDefault(require('lodash/isEqual'));
|
|
15
16
|
var axios = _interopDefault(require('axios'));
|
|
16
17
|
var _forEach = _interopDefault(require('lodash/forEach'));
|
|
17
18
|
var material = require('@mui/material');
|
|
@@ -45,6 +46,7 @@ var FormControl = _interopDefault(require('@mui/material/FormControl'));
|
|
|
45
46
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
|
46
47
|
var SVG = _interopDefault(require('react-inlinesvg'));
|
|
47
48
|
var moment = _interopDefault(require('moment-timezone'));
|
|
49
|
+
var privateTheming = require('@mui/private-theming');
|
|
48
50
|
var Table = _interopDefault(require('@mui/material/Table'));
|
|
49
51
|
var TableBody = _interopDefault(require('@mui/material/TableBody'));
|
|
50
52
|
var TableCell = _interopDefault(require('@mui/material/TableCell'));
|
|
@@ -1005,7 +1007,7 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1005
1007
|
}
|
|
1006
1008
|
}).then( /*#__PURE__*/function () {
|
|
1007
1009
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
1008
|
-
var blobValue;
|
|
1010
|
+
var blobValue, fileNameHeader, fileName;
|
|
1009
1011
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1010
1012
|
while (1) {
|
|
1011
1013
|
switch (_context.prev = _context.next) {
|
|
@@ -1015,9 +1017,14 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1015
1017
|
|
|
1016
1018
|
case 2:
|
|
1017
1019
|
blobValue = _context.sent;
|
|
1018
|
-
|
|
1020
|
+
fileNameHeader = response.headers.get("content-disposition") || '';
|
|
1021
|
+
fileName = fileNameHeader.split('"')[1];
|
|
1022
|
+
return _context.abrupt("return", {
|
|
1023
|
+
blobValue: blobValue,
|
|
1024
|
+
fileName: fileName
|
|
1025
|
+
});
|
|
1019
1026
|
|
|
1020
|
-
case
|
|
1027
|
+
case 6:
|
|
1021
1028
|
case "end":
|
|
1022
1029
|
return _context.stop();
|
|
1023
1030
|
}
|
|
@@ -1028,12 +1035,20 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1028
1035
|
return function (_x) {
|
|
1029
1036
|
return _ref.apply(this, arguments);
|
|
1030
1037
|
};
|
|
1031
|
-
}()).then(function (
|
|
1038
|
+
}()).then(function (_ref2) {
|
|
1039
|
+
var blobValue = _ref2.blobValue,
|
|
1040
|
+
fileName = _ref2.fileName;
|
|
1041
|
+
if (!fileName) return;
|
|
1032
1042
|
var file = new Blob([blobValue], {
|
|
1033
1043
|
type: 'application/pdf'
|
|
1034
1044
|
});
|
|
1035
1045
|
var fileURL = URL.createObjectURL(file);
|
|
1036
|
-
|
|
1046
|
+
var link = document.createElement('a');
|
|
1047
|
+
link.href = fileURL;
|
|
1048
|
+
link.setAttribute('download', fileName);
|
|
1049
|
+
document.body.appendChild(link);
|
|
1050
|
+
link.click();
|
|
1051
|
+
document.body.removeChild(link);
|
|
1037
1052
|
});
|
|
1038
1053
|
};
|
|
1039
1054
|
|
|
@@ -1906,18 +1921,22 @@ var CustomField = function CustomField(_ref) {
|
|
|
1906
1921
|
|
|
1907
1922
|
var _excluded$1 = ["label", "field", "selectOptions", "theme", "setFieldValue"];
|
|
1908
1923
|
var CheckboxField = function CheckboxField(_ref) {
|
|
1924
|
+
var _rest$form, _field$name, _rest$form2, _field$name2;
|
|
1925
|
+
|
|
1909
1926
|
var label = _ref.label,
|
|
1910
1927
|
field = _ref.field,
|
|
1911
1928
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1912
1929
|
|
|
1913
1930
|
var customTheme = styles.useTheme();
|
|
1914
|
-
return React__default.createElement(
|
|
1931
|
+
return React__default.createElement(material.FormControl, {
|
|
1932
|
+
error: !!(rest != null && (_rest$form = rest.form) != null && _rest$form.errors && rest.form.errors[(_field$name = field == null ? void 0 : field.name) != null ? _field$name : ""])
|
|
1933
|
+
}, React__default.createElement(FormGroup, null, React__default.createElement(FormControlLabel, {
|
|
1915
1934
|
control: React__default.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1916
1935
|
label: label,
|
|
1917
1936
|
componentsProps: {
|
|
1918
1937
|
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
1919
1938
|
}
|
|
1920
|
-
}));
|
|
1939
|
+
})), !!(rest != null && (_rest$form2 = rest.form) != null && _rest$form2.errors && rest.form.errors[(_field$name2 = field == null ? void 0 : field.name) != null ? _field$name2 : ""]) ? React__default.createElement(material.FormHelperText, null, "Required") : null);
|
|
1921
1940
|
};
|
|
1922
1941
|
|
|
1923
1942
|
var SelectField = function SelectField(_ref) {
|
|
@@ -2082,6 +2101,14 @@ var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
|
2082
2101
|
}, rest));
|
|
2083
2102
|
};
|
|
2084
2103
|
|
|
2104
|
+
var usePrevious = function usePrevious(value) {
|
|
2105
|
+
var ref = React.useRef();
|
|
2106
|
+
React.useEffect(function () {
|
|
2107
|
+
ref.current = value;
|
|
2108
|
+
});
|
|
2109
|
+
return ref.current;
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2085
2112
|
var LogicRunner = function LogicRunner(_ref) {
|
|
2086
2113
|
var values = _ref.values,
|
|
2087
2114
|
setStates = _ref.setStates,
|
|
@@ -2219,7 +2246,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2219
2246
|
_ref3$onGetStatesErro = _ref3.onGetStatesError,
|
|
2220
2247
|
onGetStatesError = _ref3$onGetStatesErro === void 0 ? function () {} : _ref3$onGetStatesErro,
|
|
2221
2248
|
_ref3$onGetProfileDat = _ref3.onGetProfileDataSuccess,
|
|
2222
|
-
|
|
2249
|
+
_onGetProfileDataSuccess = _ref3$onGetProfileDat === void 0 ? function () {} : _ref3$onGetProfileDat,
|
|
2223
2250
|
_ref3$onGetProfileDat2 = _ref3.onGetProfileDataError,
|
|
2224
2251
|
onGetProfileDataError = _ref3$onGetProfileDat2 === void 0 ? function () {} : _ref3$onGetProfileDat2,
|
|
2225
2252
|
_ref3$onAuthorizeSucc = _ref3.onAuthorizeSuccess,
|
|
@@ -2234,7 +2261,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2234
2261
|
_ref3$accountInfoTitl = _ref3.accountInfoTitle,
|
|
2235
2262
|
accountInfoTitle = _ref3$accountInfoTitl === void 0 ? '' : _ref3$accountInfoTitl,
|
|
2236
2263
|
hideLogo = _ref3.hideLogo,
|
|
2237
|
-
themeOptions = _ref3.themeOptions
|
|
2264
|
+
themeOptions = _ref3.themeOptions,
|
|
2265
|
+
_ref3$onErrorClose = _ref3.onErrorClose,
|
|
2266
|
+
onErrorClose = _ref3$onErrorClose === void 0 ? function () {} : _ref3$onErrorClose;
|
|
2267
|
+
|
|
2238
2268
|
var themeMui = styles$1.createTheme(themeOptions);
|
|
2239
2269
|
var isWindowDefined = typeof window !== 'undefined';
|
|
2240
2270
|
var userData = isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
@@ -2298,6 +2328,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2298
2328
|
userValues = _useState11[0],
|
|
2299
2329
|
setUserValues = _useState11[1];
|
|
2300
2330
|
|
|
2331
|
+
var _useState12 = React.useState(null),
|
|
2332
|
+
error = _useState12[0],
|
|
2333
|
+
setError = _useState12[1];
|
|
2334
|
+
|
|
2301
2335
|
var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
|
|
2302
2336
|
|
|
2303
2337
|
var firstNameLogged = _get(userData, 'first_name', '') || _get(userValues, 'first_name', '');
|
|
@@ -2309,9 +2343,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2309
2343
|
|
|
2310
2344
|
var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
|
|
2311
2345
|
|
|
2312
|
-
var
|
|
2346
|
+
var ttfOptIn = _get(cartInfoData, 'ttfOptIn', false);
|
|
2347
|
+
|
|
2348
|
+
var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true); // Get prevProps
|
|
2349
|
+
|
|
2350
|
+
|
|
2351
|
+
var prevData = usePrevious(data);
|
|
2313
2352
|
|
|
2314
|
-
if (!_get(dataWithUniqueIds, '[0].uniqueId')) {
|
|
2353
|
+
if (!_get(dataWithUniqueIds, '[0].uniqueId') || !_isEqual(prevData, data)) {
|
|
2315
2354
|
setDataWithUniqueIds(assingUniqueIds(data));
|
|
2316
2355
|
}
|
|
2317
2356
|
|
|
@@ -2466,7 +2505,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2466
2505
|
lastName: profileDataObj.last_name
|
|
2467
2506
|
}));
|
|
2468
2507
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
2469
|
-
|
|
2508
|
+
|
|
2509
|
+
_onGetProfileDataSuccess(userDataResponse.data);
|
|
2470
2510
|
|
|
2471
2511
|
case 10:
|
|
2472
2512
|
_context4.next = 15;
|
|
@@ -2502,12 +2542,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2502
2542
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({}, initialValues, {
|
|
2503
2543
|
country: _get(userData, 'country', '') || "1",
|
|
2504
2544
|
state: _get(userData, 'state', '') || "1",
|
|
2505
|
-
brand_opt_in: optedInFieldValue
|
|
2545
|
+
brand_opt_in: optedInFieldValue,
|
|
2546
|
+
ttf_opt_in: ttfOptIn
|
|
2506
2547
|
}), userValues),
|
|
2507
2548
|
enableReinitialize: true,
|
|
2508
2549
|
onSubmit: function () {
|
|
2509
2550
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(values, formikHelpers) {
|
|
2510
|
-
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData, access_token_register, resRegister, refreshToken, tokens, _e$response, _e$response$data,
|
|
2551
|
+
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;
|
|
2511
2552
|
|
|
2512
2553
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
2513
2554
|
while (1) {
|
|
@@ -2516,7 +2557,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2516
2557
|
_context5.prev = 0;
|
|
2517
2558
|
|
|
2518
2559
|
if (!isLoggedIn) {
|
|
2519
|
-
_context5.next =
|
|
2560
|
+
_context5.next = 17;
|
|
2520
2561
|
break;
|
|
2521
2562
|
}
|
|
2522
2563
|
|
|
@@ -2548,10 +2589,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2548
2589
|
|
|
2549
2590
|
case 12:
|
|
2550
2591
|
_res = _context5.sent;
|
|
2592
|
+
_context5.next = 15;
|
|
2593
|
+
return getPaymentData(_res.data.data.attributes.hash);
|
|
2594
|
+
|
|
2595
|
+
case 15:
|
|
2551
2596
|
handleSubmit(values, formikHelpers, eventId, _res);
|
|
2552
2597
|
return _context5.abrupt("return");
|
|
2553
2598
|
|
|
2554
|
-
case
|
|
2599
|
+
case 17:
|
|
2555
2600
|
checkoutBodyForRegistration = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
2556
2601
|
emailLogged: emailLogged,
|
|
2557
2602
|
firstNameLogged: firstNameLogged,
|
|
@@ -2559,11 +2604,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2559
2604
|
}, showDOB);
|
|
2560
2605
|
bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration);
|
|
2561
2606
|
access_token_register = null;
|
|
2562
|
-
_context5.prev =
|
|
2563
|
-
_context5.next =
|
|
2607
|
+
_context5.prev = 20;
|
|
2608
|
+
_context5.next = 23;
|
|
2564
2609
|
return register(bodyFormData);
|
|
2565
2610
|
|
|
2566
|
-
case
|
|
2611
|
+
case 23:
|
|
2567
2612
|
resRegister = _context5.sent;
|
|
2568
2613
|
access_token_register = _get(resRegister, 'data.data.attributes.access_token');
|
|
2569
2614
|
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
@@ -2573,26 +2618,26 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2573
2618
|
refreshToken: refreshToken
|
|
2574
2619
|
};
|
|
2575
2620
|
onRegisterSuccess(tokens);
|
|
2576
|
-
_context5.next =
|
|
2621
|
+
_context5.next = 35;
|
|
2577
2622
|
break;
|
|
2578
2623
|
|
|
2579
|
-
case
|
|
2580
|
-
_context5.prev =
|
|
2581
|
-
_context5.t0 = _context5["catch"](
|
|
2624
|
+
case 31:
|
|
2625
|
+
_context5.prev = 31;
|
|
2626
|
+
_context5.t0 = _context5["catch"](20);
|
|
2582
2627
|
|
|
2583
2628
|
if (axios.isAxiosError(_context5.t0)) {
|
|
2584
|
-
|
|
2629
|
+
_error = _context5.t0 == null ? void 0 : (_e$response = _context5.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message;
|
|
2585
2630
|
|
|
2586
|
-
if (_includes(
|
|
2587
|
-
formikHelpers.setFieldError('holderAge',
|
|
2631
|
+
if (_includes(_error, 'You must be aged')) {
|
|
2632
|
+
formikHelpers.setFieldError('holderAge', _error);
|
|
2588
2633
|
}
|
|
2589
2634
|
|
|
2590
|
-
if (
|
|
2591
|
-
formikHelpers.setFieldError('password',
|
|
2592
|
-
formikHelpers.setFieldError('confirmPassword',
|
|
2635
|
+
if (_error != null && _error.password) {
|
|
2636
|
+
formikHelpers.setFieldError('password', _error.password);
|
|
2637
|
+
formikHelpers.setFieldError('confirmPassword', _error.password);
|
|
2593
2638
|
}
|
|
2594
2639
|
|
|
2595
|
-
if (
|
|
2640
|
+
if (_error != null && _error.email && !onLogin) {
|
|
2596
2641
|
// False will stand for outside controll
|
|
2597
2642
|
setAlreadyHasUser(true);
|
|
2598
2643
|
setShowModalLogin(true);
|
|
@@ -2603,11 +2648,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2603
2648
|
|
|
2604
2649
|
return _context5.abrupt("return");
|
|
2605
2650
|
|
|
2606
|
-
case
|
|
2607
|
-
_context5.next =
|
|
2651
|
+
case 35:
|
|
2652
|
+
_context5.next = 37;
|
|
2608
2653
|
return getProfileData(access_token_register);
|
|
2609
2654
|
|
|
2610
|
-
case
|
|
2655
|
+
case 37:
|
|
2611
2656
|
profileData = _context5.sent;
|
|
2612
2657
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
2613
2658
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
@@ -2621,17 +2666,21 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2621
2666
|
firstNameLogged: firstNameLogged,
|
|
2622
2667
|
lastNameLogged: lastNameLogged
|
|
2623
2668
|
}, showDOB);
|
|
2624
|
-
_context5.next =
|
|
2669
|
+
_context5.next = 44;
|
|
2625
2670
|
return postOnCheckout(checkoutBody, access_token_register);
|
|
2626
2671
|
|
|
2627
|
-
case
|
|
2672
|
+
case 44:
|
|
2628
2673
|
res = _context5.sent;
|
|
2674
|
+
_context5.next = 47;
|
|
2675
|
+
return getPaymentData(res.data.data.attributes.hash);
|
|
2676
|
+
|
|
2677
|
+
case 47:
|
|
2629
2678
|
handleSubmit(values, formikHelpers, eventId, res);
|
|
2630
|
-
_context5.next =
|
|
2679
|
+
_context5.next = 53;
|
|
2631
2680
|
break;
|
|
2632
2681
|
|
|
2633
|
-
case
|
|
2634
|
-
_context5.prev =
|
|
2682
|
+
case 50:
|
|
2683
|
+
_context5.prev = 50;
|
|
2635
2684
|
_context5.t1 = _context5["catch"](0);
|
|
2636
2685
|
|
|
2637
2686
|
if (axios.isAxiosError(_context5.t1)) {
|
|
@@ -2644,15 +2693,23 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2644
2693
|
}
|
|
2645
2694
|
}
|
|
2646
2695
|
|
|
2696
|
+
if ((_e$response3 = _context5.t1.response) != null && _e$response3.data.message) {
|
|
2697
|
+
if (typeof document !== undefined) {
|
|
2698
|
+
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
setError(_get(_context5.t1, 'response.data.message'));
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2647
2704
|
onSubmitError(_context5.t1);
|
|
2648
2705
|
}
|
|
2649
2706
|
|
|
2650
|
-
case
|
|
2707
|
+
case 53:
|
|
2651
2708
|
case "end":
|
|
2652
2709
|
return _context5.stop();
|
|
2653
2710
|
}
|
|
2654
2711
|
}
|
|
2655
|
-
}, _callee5, null, [[0,
|
|
2712
|
+
}, _callee5, null, [[0, 50], [20, 31]]);
|
|
2656
2713
|
}));
|
|
2657
2714
|
|
|
2658
2715
|
function onSubmit(_x2, _x3) {
|
|
@@ -2674,7 +2731,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2674
2731
|
onGetStatesError: onGetStatesError
|
|
2675
2732
|
}), React__default.createElement("div", {
|
|
2676
2733
|
className: "billing-info-container " + theme
|
|
2677
|
-
},
|
|
2734
|
+
}, error && React__default.createElement(material.Alert, {
|
|
2735
|
+
severity: "error",
|
|
2736
|
+
onClose: onErrorClose,
|
|
2737
|
+
variant: "filled"
|
|
2738
|
+
}, error), !isLoggedIn && React__default.createElement("div", {
|
|
2678
2739
|
className: "account-actions-block"
|
|
2679
2740
|
}, React__default.createElement("div", null, accountInfoTitle), React__default.createElement("div", null, "Login & skip ahead:"), React__default.createElement("div", {
|
|
2680
2741
|
className: "login-block"
|
|
@@ -2746,13 +2807,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2746
2807
|
var groupClassname = group.groupClassname,
|
|
2747
2808
|
groupItems = group.groupItems;
|
|
2748
2809
|
return React__default.createElement("div", {
|
|
2749
|
-
key: group.
|
|
2810
|
+
key: group.id
|
|
2750
2811
|
}, React__default.createElement("div", {
|
|
2751
2812
|
className: groupClassname
|
|
2752
2813
|
}, _map(groupItems, function (element) {
|
|
2753
2814
|
return React__default.createElement("div", {
|
|
2754
2815
|
className: element.className,
|
|
2755
|
-
key: element.
|
|
2816
|
+
key: element.name
|
|
2756
2817
|
}, React__default.createElement(formik.Field, {
|
|
2757
2818
|
name: element.name + "-" + index,
|
|
2758
2819
|
label: element.label,
|
|
@@ -2786,7 +2847,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2786
2847
|
userExpired: userExpired,
|
|
2787
2848
|
onAuthorizeSuccess: onAuthorizeSuccess,
|
|
2788
2849
|
onAuthorizeError: onAuthorizeError,
|
|
2789
|
-
onGetProfileDataSuccess: onGetProfileDataSuccess
|
|
2850
|
+
onGetProfileDataSuccess: function onGetProfileDataSuccess(data) {
|
|
2851
|
+
fetchCart();
|
|
2852
|
+
|
|
2853
|
+
_onGetProfileDataSuccess(data);
|
|
2854
|
+
},
|
|
2790
2855
|
onGetProfileDataError: onGetProfileDataError
|
|
2791
2856
|
}), showModalRegister && React__default.createElement(RegisterModal, {
|
|
2792
2857
|
onClose: function onClose() {
|
|
@@ -2795,7 +2860,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2795
2860
|
onRegister: function onRegister() {
|
|
2796
2861
|
setShowModalRegister(false);
|
|
2797
2862
|
},
|
|
2798
|
-
onGetProfileDataSuccess: onGetProfileDataSuccess
|
|
2863
|
+
onGetProfileDataSuccess: function onGetProfileDataSuccess(data) {
|
|
2864
|
+
fetchCart();
|
|
2865
|
+
|
|
2866
|
+
_onGetProfileDataSuccess(data);
|
|
2867
|
+
},
|
|
2799
2868
|
onGetProfileDataError: onGetProfileDataError
|
|
2800
2869
|
}));
|
|
2801
2870
|
};
|
|
@@ -3019,7 +3088,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3019
3088
|
}, React__default.createElement("span", {
|
|
3020
3089
|
className: "card_label_text"
|
|
3021
3090
|
}, "Card number"), React__default.createElement(reactStripeJs.CardNumberElement, {
|
|
3022
|
-
options: _extends({}, options
|
|
3091
|
+
options: _extends({}, options, stripeCardOptions),
|
|
3023
3092
|
onReady: _identity,
|
|
3024
3093
|
onChange: _identity,
|
|
3025
3094
|
onBlur: _identity,
|
|
@@ -3029,13 +3098,13 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3029
3098
|
}, React__default.createElement("span", {
|
|
3030
3099
|
className: "card_label_text"
|
|
3031
3100
|
}, "Expiration date"), React__default.createElement(reactStripeJs.CardExpiryElement, {
|
|
3032
|
-
options: _extends({}, options
|
|
3101
|
+
options: _extends({}, options, stripeCardOptions)
|
|
3033
3102
|
})), React__default.createElement("label", {
|
|
3034
3103
|
className: "cvc_element"
|
|
3035
3104
|
}, React__default.createElement("span", {
|
|
3036
3105
|
className: "card_label_text"
|
|
3037
3106
|
}, "CVC"), React__default.createElement(reactStripeJs.CardCvcElement, {
|
|
3038
|
-
options: _extends({}, options
|
|
3107
|
+
options: _extends({}, options, stripeCardOptions)
|
|
3039
3108
|
})), !disableZipSection && React__default.createElement("label", {
|
|
3040
3109
|
className: "zip_element"
|
|
3041
3110
|
}, React__default.createElement("p", {
|
|
@@ -3127,7 +3196,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3127
3196
|
stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
|
|
3128
3197
|
_ref$disableZipSectio = _ref.disableZipSection,
|
|
3129
3198
|
disableZipSection = _ref$disableZipSectio === void 0 ? false : _ref$disableZipSectio,
|
|
3130
|
-
themeOptions = _ref.themeOptions
|
|
3199
|
+
themeOptions = _ref.themeOptions,
|
|
3200
|
+
elementsOptions = _ref.elementsOptions;
|
|
3131
3201
|
|
|
3132
3202
|
var _useState = React.useState(initialReviewValues),
|
|
3133
3203
|
reviewData = _useState[0],
|
|
@@ -3348,7 +3418,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3348
3418
|
}, "Please provide your payment information"), showErrorText && React__default.createElement("p", {
|
|
3349
3419
|
className: "payment_info__error"
|
|
3350
3420
|
}, errorText), React__default.createElement("div", null, React__default.createElement(reactStripeJs.Elements, {
|
|
3351
|
-
stripe: getStripePromise(reviewData)
|
|
3421
|
+
stripe: getStripePromise(reviewData),
|
|
3422
|
+
options: elementsOptions
|
|
3352
3423
|
}, React__default.createElement(CheckoutForm, {
|
|
3353
3424
|
stripe_client_secret: _get(reviewData, 'payment_method.stripe_client_secret'),
|
|
3354
3425
|
total: orderData.total,
|
|
@@ -4023,10 +4094,42 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4023
4094
|
promoCodeIsApplied = _ref.promoCodeIsApplied,
|
|
4024
4095
|
showPromoInput = _ref.showPromoInput,
|
|
4025
4096
|
isPromotionsEnabled = _ref.isPromotionsEnabled,
|
|
4026
|
-
isAllTicketsSoldOut = _ref.isAllTicketsSoldOut,
|
|
4027
4097
|
setPromoCode = _ref.setPromoCode,
|
|
4028
4098
|
setPromoCodeUpdated = _ref.setPromoCodeUpdated,
|
|
4029
|
-
setShowPromoInput = _ref.setShowPromoInput
|
|
4099
|
+
setShowPromoInput = _ref.setShowPromoInput,
|
|
4100
|
+
isAccessCodeEnabled = _ref.isAccessCodeEnabled;
|
|
4101
|
+
var isPromoCodeHasValue = !!promoCode.trim();
|
|
4102
|
+
|
|
4103
|
+
var renderInputField = function renderInputField() {
|
|
4104
|
+
return React__default.createElement("div", {
|
|
4105
|
+
className: "promo-code-block"
|
|
4106
|
+
}, React__default.createElement("div", {
|
|
4107
|
+
className: "promo-code-block"
|
|
4108
|
+
}, React__default.createElement("p", {
|
|
4109
|
+
className: "promo-code-text"
|
|
4110
|
+
}, isAccessCodeEnabled ? 'Access code required' : 'Promo code')), React__default.createElement("input", {
|
|
4111
|
+
className: "promo-code-input",
|
|
4112
|
+
placeholder: "",
|
|
4113
|
+
onChange: function onChange(e) {
|
|
4114
|
+
setPromoCode(e.target.value);
|
|
4115
|
+
},
|
|
4116
|
+
onKeyPress: function onKeyPress(event) {
|
|
4117
|
+
if (event.key === 'Enter' && isPromoCodeHasValue) {
|
|
4118
|
+
setPromoCodeUpdated(promoCode);
|
|
4119
|
+
setShowPromoInput(false);
|
|
4120
|
+
}
|
|
4121
|
+
}
|
|
4122
|
+
}), React__default.createElement(Button$1, {
|
|
4123
|
+
className: "promo-submit-button",
|
|
4124
|
+
onClick: function onClick() {
|
|
4125
|
+
if (isPromoCodeHasValue) {
|
|
4126
|
+
setPromoCodeUpdated(promoCode);
|
|
4127
|
+
setShowPromoInput(false);
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
}, isAccessCodeEnabled ? 'ENTER' : 'APPLY'));
|
|
4131
|
+
};
|
|
4132
|
+
|
|
4030
4133
|
return React__default.createElement("div", null, promoCodeIsApplied ? React__default.createElement("div", {
|
|
4031
4134
|
className: "alert-info"
|
|
4032
4135
|
}, React__default.createElement(SVG, {
|
|
@@ -4036,33 +4139,13 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4036
4139
|
}
|
|
4037
4140
|
}), React__default.createElement("p", {
|
|
4038
4141
|
className: "promo-code-success"
|
|
4039
|
-
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, showPromoInput && React__default.createElement(
|
|
4040
|
-
className: "promo-code-block"
|
|
4041
|
-
}, React__default.createElement("label", null, "PROMO CODE"), React__default.createElement("input", {
|
|
4042
|
-
placeholder: "",
|
|
4043
|
-
onChange: function onChange(e) {
|
|
4044
|
-
setPromoCode(e.target.value);
|
|
4045
|
-
},
|
|
4046
|
-
onKeyPress: function onKeyPress(event) {
|
|
4047
|
-
if (event.key === 'Enter') {
|
|
4048
|
-
setPromoCodeUpdated(promoCode);
|
|
4049
|
-
}
|
|
4050
|
-
}
|
|
4051
|
-
}), React__default.createElement(Button$1, {
|
|
4052
|
-
className: "promo-apply-button",
|
|
4053
|
-
placeholder: "Promo Code",
|
|
4054
|
-
onClick: function onClick() {
|
|
4055
|
-
setPromoCodeUpdated(promoCode);
|
|
4056
|
-
}
|
|
4057
|
-
}, "Apply")), isPromotionsEnabled && !showPromoInput && isAllTicketsSoldOut && React__default.createElement("p", {
|
|
4058
|
-
className: "promo-code-text"
|
|
4059
|
-
}, "Access code needed"), isPromotionsEnabled && !showPromoInput ? React__default.createElement(Button$1, {
|
|
4142
|
+
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, showPromoInput && renderInputField(), isPromotionsEnabled && !showPromoInput && !isAccessCodeEnabled ? React__default.createElement(Button$1, {
|
|
4060
4143
|
className: "promo-code-button",
|
|
4061
4144
|
placeholder: "Promo Codes",
|
|
4062
4145
|
onClick: function onClick() {
|
|
4063
4146
|
setShowPromoInput(true);
|
|
4064
4147
|
}
|
|
4065
|
-
}, "Got a promo code? Click here") : null);
|
|
4148
|
+
}, "Got a promo code? Click here") : !isPromotionsEnabled && !showPromoInput && isAccessCodeEnabled && !promoCodeIsApplied ? renderInputField() : null);
|
|
4066
4149
|
};
|
|
4067
4150
|
|
|
4068
4151
|
var isTimeExpired = function isTimeExpired(startDate, timezone) {
|
|
@@ -4167,7 +4250,12 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4167
4250
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
4168
4251
|
queryPromoCode = _ref$queryPromoCode === void 0 ? '' : _ref$queryPromoCode,
|
|
4169
4252
|
_ref$isPromotionsEnab = _ref.isPromotionsEnabled,
|
|
4170
|
-
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab
|
|
4253
|
+
isPromotionsEnabled = _ref$isPromotionsEnab === void 0 ? true : _ref$isPromotionsEnab,
|
|
4254
|
+
themeOptions = _ref.themeOptions,
|
|
4255
|
+
_ref$isAccessCodeEnab = _ref.isAccessCodeEnabled,
|
|
4256
|
+
isAccessCodeEnabled = _ref$isAccessCodeEnab === void 0 ? false : _ref$isAccessCodeEnab,
|
|
4257
|
+
_ref$hideSessionButto = _ref.hideSessionButtons,
|
|
4258
|
+
hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto;
|
|
4171
4259
|
|
|
4172
4260
|
var _useState = React.useState({}),
|
|
4173
4261
|
selectedTickets = _useState[0],
|
|
@@ -4298,6 +4386,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4298
4386
|
setTickets(_get(attributes, 'tickets'));
|
|
4299
4387
|
setShowWaitingList(attributes.showWaitingList);
|
|
4300
4388
|
onGetTicketsSuccess(response.data);
|
|
4389
|
+
setPromoCode('');
|
|
4301
4390
|
}
|
|
4302
4391
|
|
|
4303
4392
|
if (eventResponse.data.success) {
|
|
@@ -4460,6 +4549,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4460
4549
|
var isAllTicketsSoldOut = !_some(tickets, function (item) {
|
|
4461
4550
|
return !(item.sold_out || item.soldOut);
|
|
4462
4551
|
});
|
|
4552
|
+
var themeMui = material.createTheme(themeOptions);
|
|
4463
4553
|
React.useEffect(function () {
|
|
4464
4554
|
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
4465
4555
|
return function () {
|
|
@@ -4472,7 +4562,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4472
4562
|
isWindowDefined && window.document.removeEventListener('custom-login', handleExternalLogin);
|
|
4473
4563
|
};
|
|
4474
4564
|
}, []);
|
|
4475
|
-
return React__default.createElement(
|
|
4565
|
+
return React__default.createElement(privateTheming.ThemeProvider, {
|
|
4566
|
+
theme: themeMui
|
|
4567
|
+
}, React__default.createElement("div", {
|
|
4476
4568
|
className: "get-tickets-page " + theme,
|
|
4477
4569
|
style: contentStyle
|
|
4478
4570
|
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, React__default.createElement(TicketsSection, {
|
|
@@ -4486,7 +4578,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4486
4578
|
title: "Sales start in:",
|
|
4487
4579
|
message: "No tickets are currently available for this event.",
|
|
4488
4580
|
callback: updateTickets
|
|
4489
|
-
}) : null, showWaitingList && React__default.createElement(WaitingList, {
|
|
4581
|
+
}) : null, showWaitingList && event.salesStarted && React__default.createElement(WaitingList, {
|
|
4490
4582
|
tickets: tickets,
|
|
4491
4583
|
eventId: eventId
|
|
4492
4584
|
}), React__default.createElement(PromoCodeSection, {
|
|
@@ -4497,12 +4589,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4497
4589
|
setPromoCodeUpdated: setPromoCodeUpdated,
|
|
4498
4590
|
setShowPromoInput: setShowPromoInput,
|
|
4499
4591
|
isPromotionsEnabled: isPromotionsEnabled,
|
|
4592
|
+
isAccessCodeEnabled: isAccessCodeEnabled,
|
|
4500
4593
|
isAllTicketsSoldOut: isAllTicketsSoldOut
|
|
4501
4594
|
}), !isAllTicketsSoldOut && React__default.createElement(Button$1, {
|
|
4502
4595
|
"aria-hidden": true,
|
|
4503
4596
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|
|
4504
4597
|
onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
|
|
4505
|
-
}, getTicketsLabel || 'GET TICKETS'), isLogged ? React__default.createElement("div", {
|
|
4598
|
+
}, getTicketsLabel || 'GET TICKETS'), isLogged && !hideSessionButtons ? React__default.createElement("div", {
|
|
4506
4599
|
className: "session-wrapper"
|
|
4507
4600
|
}, React__default.createElement("span", {
|
|
4508
4601
|
className: "session-container"
|
|
@@ -4519,7 +4612,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4519
4612
|
}, "Log out"))) : ''), showLoginModal ? React__default.createElement(LoginModal, {
|
|
4520
4613
|
onClose: handleOnClose,
|
|
4521
4614
|
onLogin: handleOnLogin
|
|
4522
|
-
}) : null);
|
|
4615
|
+
}) : null));
|
|
4523
4616
|
};
|
|
4524
4617
|
|
|
4525
4618
|
var EventInfoItem = function EventInfoItem(_ref) {
|