tf-checkout-react 1.0.97-beta.0 → 1.0.99-beta.2
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 +2 -1
- package/dist/components/common/SnackbarAlert.d.ts +13 -0
- package/dist/components/countdown/index.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +224 -83
- 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 +225 -84
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/utils/downloadPDF.d.ts +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +8 -3
- package/src/components/common/SnackbarAlert.tsx +54 -0
- package/src/components/countdown/index.tsx +3 -1
- package/src/components/orderDetailsContainer/ticketsTable.tsx +83 -60
- package/src/components/ticketsContainer/TicketRow.tsx +12 -6
- package/src/components/ticketsContainer/index.tsx +51 -34
- package/src/utils/cookies.ts +7 -2
- package/src/utils/downloadPDF.tsx +28 -6
|
@@ -39,5 +39,6 @@ export interface IBillingInfoPage {
|
|
|
39
39
|
onSkipBillingPage: (data: any) => void;
|
|
40
40
|
skipPage?: boolean;
|
|
41
41
|
canSkipHolderNames?: boolean;
|
|
42
|
+
shouldFetchCountries?: boolean;
|
|
42
43
|
}
|
|
43
|
-
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AlertColor, SnackbarOrigin } from '@mui/material';
|
|
3
|
+
interface ISnackbarAlertProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
type: AlertColor;
|
|
7
|
+
position?: SnackbarOrigin;
|
|
8
|
+
autoHideDuration?: number;
|
|
9
|
+
variant?: 'filled' | 'standard' | 'outlined';
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const SnackbarAlert: ({ isOpen, message, type, position, autoHideDuration, variant, onClose, }: ISnackbarAlertProps) => JSX.Element;
|
|
13
|
+
export default SnackbarAlert;
|
|
@@ -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;
|
|
@@ -29,6 +29,7 @@ export interface IGetTickets {
|
|
|
29
29
|
isAccessCodeEnabled?: boolean;
|
|
30
30
|
hideSessionButtons?: boolean;
|
|
31
31
|
hideWaitingList?: boolean;
|
|
32
|
+
enableBillingInfoAutoCreate?: boolean;
|
|
32
33
|
}
|
|
33
34
|
export interface ITicket {
|
|
34
35
|
id: string | number;
|
|
@@ -37,5 +38,5 @@ export interface ITicket {
|
|
|
37
38
|
export interface ISelectedTickets {
|
|
38
39
|
[key: string]: string | number;
|
|
39
40
|
}
|
|
40
|
-
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList }: IGetTickets) => JSX.Element;
|
|
41
|
+
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, }: IGetTickets) => JSX.Element;
|
|
41
42
|
export {};
|
|
@@ -1001,14 +1001,66 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
1001
1001
|
|
|
1002
1002
|
var ErrorFocus = /*#__PURE__*/formik.connect(ErrorFocusInternal);
|
|
1003
1003
|
|
|
1004
|
+
function setCustomCookie(name, value, days) {
|
|
1005
|
+
var expires = '';
|
|
1006
|
+
|
|
1007
|
+
if (days) {
|
|
1008
|
+
var date = new Date();
|
|
1009
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1010
|
+
expires = '; expires=' + date.toUTCString();
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
if (typeof window !== 'undefined') {
|
|
1014
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/';
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
function getCookieByName(cname) {
|
|
1018
|
+
if (typeof window === 'undefined') return '';
|
|
1019
|
+
var name = cname + '=';
|
|
1020
|
+
var ca = document.cookie.split(';');
|
|
1021
|
+
|
|
1022
|
+
for (var i = 0; i < ca.length; i++) {
|
|
1023
|
+
var c = ca[i];
|
|
1024
|
+
|
|
1025
|
+
while (c.charAt(0) == ' ') {
|
|
1026
|
+
c = c.substring(1);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
if (c.indexOf(name) == 0) {
|
|
1030
|
+
return c.substring(name.length, c.length);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
return '';
|
|
1035
|
+
}
|
|
1036
|
+
function deleteCookieByName(name) {
|
|
1037
|
+
if (typeof window !== 'undefined') {
|
|
1038
|
+
document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1004
1042
|
var downloadPDF = function downloadPDF(pdfUrl) {
|
|
1005
1043
|
if (typeof window === 'undefined') return;
|
|
1044
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
1006
1045
|
var accessToken = localStorage.getItem('access_token');
|
|
1007
|
-
if (!accessToken) return;
|
|
1008
|
-
|
|
1009
|
-
|
|
1046
|
+
if (!accessToken && !xtfCookie) return;
|
|
1047
|
+
var headers = {};
|
|
1048
|
+
|
|
1049
|
+
if (accessToken) {
|
|
1050
|
+
headers = {
|
|
1010
1051
|
Authorization: "Bearer " + accessToken
|
|
1011
|
-
}
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
if (xtfCookie) {
|
|
1056
|
+
headers = {
|
|
1057
|
+
'X-TF-ECOMMERCE': xtfCookie
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
return fetch(pdfUrl, {
|
|
1062
|
+
headers: headers,
|
|
1063
|
+
credentials: 'include'
|
|
1012
1064
|
}).then( /*#__PURE__*/function () {
|
|
1013
1065
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
1014
1066
|
var blobValue, fileNameHeader, fileName;
|
|
@@ -1021,7 +1073,7 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1021
1073
|
|
|
1022
1074
|
case 2:
|
|
1023
1075
|
blobValue = _context.sent;
|
|
1024
|
-
fileNameHeader = response.headers.get(
|
|
1076
|
+
fileNameHeader = response.headers.get('content-disposition') || '';
|
|
1025
1077
|
fileName = fileNameHeader.split('"')[1];
|
|
1026
1078
|
return _context.abrupt("return", {
|
|
1027
1079
|
blobValue: blobValue,
|
|
@@ -1042,7 +1094,11 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1042
1094
|
}()).then(function (_ref2) {
|
|
1043
1095
|
var blobValue = _ref2.blobValue,
|
|
1044
1096
|
fileName = _ref2.fileName;
|
|
1045
|
-
|
|
1097
|
+
|
|
1098
|
+
if (!fileName) {
|
|
1099
|
+
throw Error('Something went wrong.');
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1046
1102
|
var file = new Blob([blobValue], {
|
|
1047
1103
|
type: 'application/pdf'
|
|
1048
1104
|
});
|
|
@@ -1053,6 +1109,8 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1053
1109
|
document.body.appendChild(link);
|
|
1054
1110
|
link.click();
|
|
1055
1111
|
document.body.removeChild(link);
|
|
1112
|
+
})["catch"](function (error) {
|
|
1113
|
+
return error;
|
|
1056
1114
|
});
|
|
1057
1115
|
};
|
|
1058
1116
|
|
|
@@ -1104,39 +1162,6 @@ var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWit
|
|
|
1104
1162
|
return body;
|
|
1105
1163
|
};
|
|
1106
1164
|
|
|
1107
|
-
function setCustomCookie(name, value, days) {
|
|
1108
|
-
var expires = '';
|
|
1109
|
-
|
|
1110
|
-
if (days) {
|
|
1111
|
-
var date = new Date();
|
|
1112
|
-
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1113
|
-
expires = '; expires=' + date.toUTCString();
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
document.cookie = name + '=' + (value || '') + expires + '; path=/';
|
|
1117
|
-
}
|
|
1118
|
-
function getCookieByName(cname) {
|
|
1119
|
-
var name = cname + '=';
|
|
1120
|
-
var ca = document.cookie.split(';');
|
|
1121
|
-
|
|
1122
|
-
for (var i = 0; i < ca.length; i++) {
|
|
1123
|
-
var c = ca[i];
|
|
1124
|
-
|
|
1125
|
-
while (c.charAt(0) == ' ') {
|
|
1126
|
-
c = c.substring(1);
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
if (c.indexOf(name) == 0) {
|
|
1130
|
-
return c.substring(name.length, c.length);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
return '';
|
|
1135
|
-
}
|
|
1136
|
-
function deleteCookieByName(name) {
|
|
1137
|
-
document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
1165
|
var isWindowDefined = typeof window !== 'undefined';
|
|
1141
1166
|
var ttfHeaders = {
|
|
1142
1167
|
Accept: 'application/vnd.api+json',
|
|
@@ -2156,7 +2181,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2156
2181
|
setValues = _ref.setValues,
|
|
2157
2182
|
setUserValues = _ref.setUserValues,
|
|
2158
2183
|
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
2159
|
-
onGetStatesError = _ref.onGetStatesError
|
|
2184
|
+
onGetStatesError = _ref.onGetStatesError,
|
|
2185
|
+
shouldFetchCountries = _ref.shouldFetchCountries;
|
|
2160
2186
|
var prevCountry = React.useRef(values.country);
|
|
2161
2187
|
React.useEffect(function () {
|
|
2162
2188
|
var fetchStates = /*#__PURE__*/function () {
|
|
@@ -2211,7 +2237,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2211
2237
|
};
|
|
2212
2238
|
}();
|
|
2213
2239
|
|
|
2214
|
-
fetchStates();
|
|
2240
|
+
shouldFetchCountries && fetchStates();
|
|
2215
2241
|
}, [values.country, setStates, setFieldValue]);
|
|
2216
2242
|
var userDataEncoded = typeof window !== 'undefined' ? window.localStorage.getItem('user_data') : '';
|
|
2217
2243
|
React.useEffect(function () {
|
|
@@ -2311,7 +2337,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2311
2337
|
_ref3$skipPage = _ref3.skipPage,
|
|
2312
2338
|
skipPage = _ref3$skipPage === void 0 ? false : _ref3$skipPage,
|
|
2313
2339
|
_ref3$canSkipHolderNa = _ref3.canSkipHolderNames,
|
|
2314
|
-
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa
|
|
2340
|
+
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa,
|
|
2341
|
+
_ref3$shouldFetchCoun = _ref3.shouldFetchCountries,
|
|
2342
|
+
shouldFetchCountries = _ref3$shouldFetchCoun === void 0 ? true : _ref3$shouldFetchCoun;
|
|
2315
2343
|
|
|
2316
2344
|
var themeMui = styles$1.createTheme(themeOptions);
|
|
2317
2345
|
var isWindowDefined = typeof window !== 'undefined';
|
|
@@ -2485,7 +2513,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2485
2513
|
};
|
|
2486
2514
|
}();
|
|
2487
2515
|
|
|
2488
|
-
fetchCountries();
|
|
2516
|
+
shouldFetchCountries && fetchCountries();
|
|
2489
2517
|
fetchCart();
|
|
2490
2518
|
}, []); // fetch cart data
|
|
2491
2519
|
|
|
@@ -2842,7 +2870,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2842
2870
|
setValues: props.setValues,
|
|
2843
2871
|
setUserValues: setUserValues,
|
|
2844
2872
|
onGetStatesSuccess: onGetStatesSuccess,
|
|
2845
|
-
onGetStatesError: onGetStatesError
|
|
2873
|
+
onGetStatesError: onGetStatesError,
|
|
2874
|
+
shouldFetchCountries: shouldFetchCountries
|
|
2846
2875
|
}), React__default.createElement("div", {
|
|
2847
2876
|
className: "billing-info-container " + theme
|
|
2848
2877
|
}, error && !hideErrorsAlertSection && React__default.createElement(material.Alert, {
|
|
@@ -4023,7 +4052,7 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4023
4052
|
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
|
|
4024
4053
|
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
4025
4054
|
var ticketsClosedMessage = !ticketTier.salesStarted ? 'Sales not started' : 'Sales Ended';
|
|
4026
|
-
var onSaleContent =
|
|
4055
|
+
var onSaleContent = React__default.createElement("div", {
|
|
4027
4056
|
className: "get-tickets"
|
|
4028
4057
|
}, React__default.createElement(Box, {
|
|
4029
4058
|
className: "get-tickets__selectbox"
|
|
@@ -4053,17 +4082,17 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4053
4082
|
value: option.value
|
|
4054
4083
|
}, option.value);
|
|
4055
4084
|
})))));
|
|
4056
|
-
var returnValue = '';
|
|
4085
|
+
var returnValue = ''; // ticketTier.soldOut === false --> means that ticket is in the stock
|
|
4057
4086
|
|
|
4058
|
-
|
|
4059
|
-
returnValue = soldOutMessage;
|
|
4060
|
-
}
|
|
4087
|
+
var isSoldOut = ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut || ticketTier.soldOut === false;
|
|
4061
4088
|
|
|
4062
|
-
if (
|
|
4089
|
+
if (isSoldOut) {
|
|
4090
|
+
returnValue = soldOutMessage;
|
|
4091
|
+
} else if (isSalesClosed) {
|
|
4092
|
+
returnValue = ticketsClosedMessage;
|
|
4093
|
+
} else if (ticketTier.displayTicket && ticketTier.maxQuantity) {
|
|
4063
4094
|
returnValue = onSaleContent;
|
|
4064
|
-
}
|
|
4065
|
-
|
|
4066
|
-
if (_get(prevTicketTier, 'in_stock')) {
|
|
4095
|
+
} else if (_get(prevTicketTier, 'in_stock')) {
|
|
4067
4096
|
returnValue = 'SOON';
|
|
4068
4097
|
}
|
|
4069
4098
|
|
|
@@ -4370,6 +4399,8 @@ function Countdown(_ref) {
|
|
|
4370
4399
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4371
4400
|
_ref$message = _ref.message,
|
|
4372
4401
|
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4402
|
+
_ref$showMessage = _ref.showMessage,
|
|
4403
|
+
showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
|
|
4373
4404
|
_ref$callback = _ref.callback,
|
|
4374
4405
|
callback = _ref$callback === void 0 ? function () {} : _ref$callback;
|
|
4375
4406
|
|
|
@@ -4431,7 +4462,7 @@ function Countdown(_ref) {
|
|
|
4431
4462
|
className: 'countdown'
|
|
4432
4463
|
}, React__default.createElement("div", null, React__default.createElement("p", {
|
|
4433
4464
|
className: 'title'
|
|
4434
|
-
}, title), React__default.createElement("p", null, duration)), React__default.createElement("p", {
|
|
4465
|
+
}, title), React__default.createElement("p", null, duration)), showMessage && React__default.createElement("p", {
|
|
4435
4466
|
className: 'message'
|
|
4436
4467
|
}, message)));
|
|
4437
4468
|
}
|
|
@@ -4508,15 +4539,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4508
4539
|
_ref$hideSessionButto = _ref.hideSessionButtons,
|
|
4509
4540
|
hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto,
|
|
4510
4541
|
_ref$hideWaitingList = _ref.hideWaitingList,
|
|
4511
|
-
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList
|
|
4542
|
+
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList,
|
|
4543
|
+
_ref$enableBillingInf = _ref.enableBillingInfoAutoCreate,
|
|
4544
|
+
enableBillingInfoAutoCreate = _ref$enableBillingInf === void 0 ? true : _ref$enableBillingInf;
|
|
4512
4545
|
|
|
4513
4546
|
var _useState = React.useState({}),
|
|
4514
4547
|
selectedTickets = _useState[0],
|
|
4515
4548
|
setSelectedTickets = _useState[1];
|
|
4516
4549
|
|
|
4517
4550
|
var isWindowDefined = typeof window !== 'undefined';
|
|
4551
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
4518
4552
|
|
|
4519
|
-
var _useState2 = React.useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
4553
|
+
var _useState2 = React.useState((isWindowDefined ? !!window.localStorage.getItem('access_token') : false) || !!xtfCookie),
|
|
4520
4554
|
isLogged = _useState2[0],
|
|
4521
4555
|
setIsLogged = _useState2[1];
|
|
4522
4556
|
|
|
@@ -4729,7 +4763,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4729
4763
|
result = _context.sent;
|
|
4730
4764
|
|
|
4731
4765
|
if (!(result.status === 200)) {
|
|
4732
|
-
_context.next =
|
|
4766
|
+
_context.next = 31;
|
|
4733
4767
|
break;
|
|
4734
4768
|
}
|
|
4735
4769
|
|
|
@@ -4740,7 +4774,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4740
4774
|
hash = '';
|
|
4741
4775
|
|
|
4742
4776
|
if (!skipBillingPage) {
|
|
4743
|
-
_context.next =
|
|
4777
|
+
_context.next = 30;
|
|
4744
4778
|
break;
|
|
4745
4779
|
}
|
|
4746
4780
|
|
|
@@ -4749,14 +4783,28 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4749
4783
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
4750
4784
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
4751
4785
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
4752
|
-
|
|
4786
|
+
|
|
4787
|
+
if (!enableBillingInfoAutoCreate) {
|
|
4788
|
+
_context.next = 27;
|
|
4789
|
+
break;
|
|
4790
|
+
}
|
|
4791
|
+
|
|
4792
|
+
_context.next = 24;
|
|
4753
4793
|
return postOnCheckout(checkoutBody, access_token);
|
|
4754
4794
|
|
|
4755
|
-
case
|
|
4756
|
-
|
|
4795
|
+
case 24:
|
|
4796
|
+
_context.t0 = _context.sent;
|
|
4797
|
+
_context.next = 28;
|
|
4798
|
+
break;
|
|
4799
|
+
|
|
4800
|
+
case 27:
|
|
4801
|
+
_context.t0 = null;
|
|
4802
|
+
|
|
4803
|
+
case 28:
|
|
4804
|
+
checkoutResult = _context.t0;
|
|
4757
4805
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
4758
4806
|
|
|
4759
|
-
case
|
|
4807
|
+
case 30:
|
|
4760
4808
|
onAddToCartSuccess({
|
|
4761
4809
|
skip_billing_page: skipBillingPage,
|
|
4762
4810
|
names_required: nameIsRequired,
|
|
@@ -4765,29 +4813,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4765
4813
|
hash: hash
|
|
4766
4814
|
});
|
|
4767
4815
|
|
|
4768
|
-
case
|
|
4769
|
-
_context.next =
|
|
4816
|
+
case 31:
|
|
4817
|
+
_context.next = 36;
|
|
4770
4818
|
break;
|
|
4771
4819
|
|
|
4772
|
-
case
|
|
4773
|
-
_context.prev =
|
|
4774
|
-
_context.
|
|
4820
|
+
case 33:
|
|
4821
|
+
_context.prev = 33;
|
|
4822
|
+
_context.t1 = _context["catch"](6);
|
|
4775
4823
|
|
|
4776
|
-
if (axios.isAxiosError(_context.
|
|
4777
|
-
onAddToCartError(_context.
|
|
4824
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
4825
|
+
onAddToCartError(_context.t1);
|
|
4778
4826
|
}
|
|
4779
4827
|
|
|
4780
|
-
case
|
|
4781
|
-
_context.prev =
|
|
4828
|
+
case 36:
|
|
4829
|
+
_context.prev = 36;
|
|
4782
4830
|
setHandleBookIsLoading(false);
|
|
4783
|
-
return _context.finish(
|
|
4831
|
+
return _context.finish(36);
|
|
4784
4832
|
|
|
4785
|
-
case
|
|
4833
|
+
case 39:
|
|
4786
4834
|
case "end":
|
|
4787
4835
|
return _context.stop();
|
|
4788
4836
|
}
|
|
4789
4837
|
}
|
|
4790
|
-
}, _callee, null, [[6,
|
|
4838
|
+
}, _callee, null, [[6, 33, 36, 39]]);
|
|
4791
4839
|
}));
|
|
4792
4840
|
|
|
4793
4841
|
return function handleBook() {
|
|
@@ -4807,6 +4855,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4807
4855
|
return item.salesStarted && !item.salesEnded && !item.soldOut;
|
|
4808
4856
|
});
|
|
4809
4857
|
|
|
4858
|
+
var eventHasTickets = !_isEmpty(tickets);
|
|
4859
|
+
var isSalesClosed = event == null ? void 0 : event.salesEnded;
|
|
4810
4860
|
var themeMui = material.createTheme(themeOptions);
|
|
4811
4861
|
React.useEffect(function () {
|
|
4812
4862
|
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
@@ -4827,20 +4877,23 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4827
4877
|
}), React__default.createElement("div", {
|
|
4828
4878
|
className: "get-tickets-page " + theme,
|
|
4829
4879
|
style: contentStyle
|
|
4830
|
-
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, React__default.createElement(TicketsSection, {
|
|
4880
|
+
}, isLoading ? React__default.createElement(Loader$1, null) : React__default.createElement("div", null, !isSalesClosed && React__default.createElement(TicketsSection, {
|
|
4831
4881
|
ticketsList: tickets,
|
|
4832
4882
|
selectedTickets: selectedTickets,
|
|
4833
4883
|
handleTicketSelect: handleTicketSelect,
|
|
4834
4884
|
promoCodeIsApplied: promoCodeIsApplied
|
|
4835
|
-
}),
|
|
4836
|
-
className:
|
|
4885
|
+
}), isSalesClosed ? React__default.createElement("p", {
|
|
4886
|
+
className: "event-closed-message"
|
|
4837
4887
|
}, "Sales for this event are closed.") : !(event != null && event.salesStarted) && event != null && event.salesStart ? React__default.createElement(Countdown, {
|
|
4838
4888
|
startDate: event.salesStart,
|
|
4839
4889
|
timezone: event.timezone,
|
|
4840
4890
|
title: "Sales start in:",
|
|
4841
4891
|
message: "No tickets are currently available for this event.",
|
|
4892
|
+
showMessage: !eventHasTickets,
|
|
4842
4893
|
callback: updateTickets
|
|
4843
|
-
}) :
|
|
4894
|
+
}) : !eventHasTickets ? React__default.createElement("p", {
|
|
4895
|
+
className: "message"
|
|
4896
|
+
}, "No tickets are currently available for this event.") : null, showWaitingList && event.salesStarted && !hideWaitingList && React__default.createElement(WaitingList, {
|
|
4844
4897
|
tickets: tickets,
|
|
4845
4898
|
eventId: eventId
|
|
4846
4899
|
}), React__default.createElement(PromoCodeSection, {
|
|
@@ -4853,7 +4906,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4853
4906
|
isPromotionsEnabled: isPromotionsEnabled,
|
|
4854
4907
|
isAccessCodeEnabled: isAccessCodeEnabled,
|
|
4855
4908
|
isAllTicketsSoldOut: isAllTicketsSoldOut
|
|
4856
|
-
}), (isTicketOnSale || !(event != null && event.salesEnded)) && React__default.createElement(Button$1, {
|
|
4909
|
+
}), (isTicketOnSale || !(event != null && event.salesEnded)) && !isSalesClosed && (event == null ? void 0 : event.salesStarted) && React__default.createElement(Button$1, {
|
|
4857
4910
|
"aria-hidden": true,
|
|
4858
4911
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|
|
4859
4912
|
onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
|
|
@@ -5078,12 +5131,60 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5078
5131
|
})));
|
|
5079
5132
|
};
|
|
5080
5133
|
|
|
5134
|
+
var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
5135
|
+
var isOpen = _ref.isOpen,
|
|
5136
|
+
message = _ref.message,
|
|
5137
|
+
type = _ref.type,
|
|
5138
|
+
position = _ref.position,
|
|
5139
|
+
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
5140
|
+
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
5141
|
+
variant = _ref.variant,
|
|
5142
|
+
onClose = _ref.onClose;
|
|
5143
|
+
return React__default.createElement("div", {
|
|
5144
|
+
className: "snackbar-alert-container"
|
|
5145
|
+
}, React__default.createElement(material.Snackbar, {
|
|
5146
|
+
autoHideDuration: autoHideDuration,
|
|
5147
|
+
open: isOpen,
|
|
5148
|
+
anchorOrigin: position || {
|
|
5149
|
+
vertical: 'top',
|
|
5150
|
+
horizontal: 'center'
|
|
5151
|
+
},
|
|
5152
|
+
onClose: onClose,
|
|
5153
|
+
classes: {
|
|
5154
|
+
root: 'snackbar-alert-snackbar-root'
|
|
5155
|
+
}
|
|
5156
|
+
}, React__default.createElement(material.Alert, {
|
|
5157
|
+
severity: type,
|
|
5158
|
+
onClose: onClose,
|
|
5159
|
+
variant: variant || 'filled',
|
|
5160
|
+
classes: {
|
|
5161
|
+
icon: 'snackbar-alert-icon',
|
|
5162
|
+
root: 'snackbar-alert-alert-root',
|
|
5163
|
+
action: 'snackbar-alert-action',
|
|
5164
|
+
message: 'snackbar-alert-message',
|
|
5165
|
+
filled: 'snackbar-alert-filled'
|
|
5166
|
+
}
|
|
5167
|
+
}, message)));
|
|
5168
|
+
};
|
|
5169
|
+
|
|
5081
5170
|
var TicketsTable = function TicketsTable(_ref) {
|
|
5082
5171
|
var _ref$tickets = _ref.tickets,
|
|
5083
5172
|
tickets = _ref$tickets === void 0 ? [] : _ref$tickets;
|
|
5173
|
+
|
|
5174
|
+
var _useState = React.useState(null),
|
|
5175
|
+
pdfError = _useState[0],
|
|
5176
|
+
setPdfError = _useState[1];
|
|
5177
|
+
|
|
5084
5178
|
return React__default.createElement("div", {
|
|
5085
5179
|
className: "tickets-box"
|
|
5086
|
-
}, React__default.createElement(
|
|
5180
|
+
}, React__default.createElement(SnackbarAlert, {
|
|
5181
|
+
type: "error",
|
|
5182
|
+
isOpen: !!pdfError,
|
|
5183
|
+
message: pdfError || '',
|
|
5184
|
+
onClose: function onClose() {
|
|
5185
|
+
return setPdfError(null);
|
|
5186
|
+
}
|
|
5187
|
+
}), React__default.createElement("h4", {
|
|
5087
5188
|
className: "sub-title"
|
|
5088
5189
|
}, "Your Tickets"), React__default.createElement(TableContainer, {
|
|
5089
5190
|
component: Paper
|
|
@@ -5097,9 +5198,49 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5097
5198
|
}, React__default.createElement(TableRow, null, React__default.createElement(TableCell, null, ticket.hash), React__default.createElement(TableCell, null, ticket.ticket_type), React__default.createElement(TableCell, null, ticket.holder_name), React__default.createElement(TableCell, null, ticket.status), React__default.createElement(TableCell, null, React__default.createElement("span", {
|
|
5098
5199
|
"aria-hidden": true,
|
|
5099
5200
|
className: "download-button",
|
|
5100
|
-
onClick: function
|
|
5101
|
-
|
|
5102
|
-
|
|
5201
|
+
onClick: function () {
|
|
5202
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5203
|
+
var pdfDownloadError;
|
|
5204
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5205
|
+
while (1) {
|
|
5206
|
+
switch (_context.prev = _context.next) {
|
|
5207
|
+
case 0:
|
|
5208
|
+
_context.prev = 0;
|
|
5209
|
+
_context.next = 3;
|
|
5210
|
+
return downloadPDF(ticket.pdf_link);
|
|
5211
|
+
|
|
5212
|
+
case 3:
|
|
5213
|
+
pdfDownloadError = _context.sent;
|
|
5214
|
+
|
|
5215
|
+
if (pdfDownloadError) {
|
|
5216
|
+
setPdfError(pdfDownloadError == null ? void 0 : pdfDownloadError.message);
|
|
5217
|
+
}
|
|
5218
|
+
|
|
5219
|
+
_context.next = 10;
|
|
5220
|
+
break;
|
|
5221
|
+
|
|
5222
|
+
case 7:
|
|
5223
|
+
_context.prev = 7;
|
|
5224
|
+
_context.t0 = _context["catch"](0);
|
|
5225
|
+
|
|
5226
|
+
if (_context.t0 && typeof _context.t0 === 'string') {
|
|
5227
|
+
setPdfError(_context.t0);
|
|
5228
|
+
}
|
|
5229
|
+
|
|
5230
|
+
case 10:
|
|
5231
|
+
case "end":
|
|
5232
|
+
return _context.stop();
|
|
5233
|
+
}
|
|
5234
|
+
}
|
|
5235
|
+
}, _callee, null, [[0, 7]]);
|
|
5236
|
+
}));
|
|
5237
|
+
|
|
5238
|
+
function onClick() {
|
|
5239
|
+
return _onClick.apply(this, arguments);
|
|
5240
|
+
}
|
|
5241
|
+
|
|
5242
|
+
return onClick;
|
|
5243
|
+
}()
|
|
5103
5244
|
}, "Download"))), !!((_ticket$add_ons = ticket.add_ons) != null && _ticket$add_ons.length) && React__default.createElement(TableRow, null, React__default.createElement(TableCell, {
|
|
5104
5245
|
colSpan: 5
|
|
5105
5246
|
}, React__default.createElement(Table, {
|