tf-checkout-react 1.6.6-beta.22 → 1.6.6-beta.24
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/api/common.d.ts +1 -1
- package/dist/components/common/DatePickerField.d.ts +2 -2
- package/dist/components/orderDetailsContainer/index.d.ts +2 -2
- package/dist/components/resetPasswordContainer/index.d.ts +2 -2
- package/dist/components/ticketsContainer/TicketsSection.d.ts +1 -1
- package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +9 -0
- package/dist/tf-checkout-react.cjs.development.js +280 -173
- 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 +280 -173
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/utils/customFields.d.ts +2 -2
- package/package.json +1 -1
- package/src/api/common.ts +32 -1
- package/src/components/addonsContainer/AddonComponent.tsx +11 -5
- package/src/components/addonsContainer/index.tsx +33 -5
- package/src/components/billing-info-container/index.tsx +1 -0
- package/src/components/common/DatePickerField.tsx +12 -11
- package/src/components/forgotPasswordModal/index.tsx +15 -6
- package/src/components/orderDetailsContainer/index.tsx +16 -14
- package/src/components/preRegistration/index.tsx +8 -5
- package/src/components/resetPasswordContainer/index.tsx +12 -13
- package/src/components/ticketsContainer/TicketsSection.tsx +51 -24
- package/src/components/ticketsContainer/TimeSlotsSection.tsx +10 -24
- package/src/components/ticketsContainer/index.tsx +74 -7
- package/src/constants/index.ts +2 -2
- package/src/types/api/orders.d.ts +19 -3
- package/src/utils/customFields.ts +9 -9
- package/src/utils/setConfigs.ts +2 -2
|
@@ -61,6 +61,7 @@ var reactStripeJs = require('@stripe/react-stripe-js');
|
|
|
61
61
|
var stripeJs = require('@stripe/stripe-js');
|
|
62
62
|
var reactShare = require('react-share');
|
|
63
63
|
var _filter = _interopDefault(require('lodash/filter'));
|
|
64
|
+
var _flatten = _interopDefault(require('lodash/flatten'));
|
|
64
65
|
var _some = _interopDefault(require('lodash/some'));
|
|
65
66
|
var moment = _interopDefault(require('moment-timezone'));
|
|
66
67
|
var Button$1 = _interopDefault(require('react-bootstrap/Button'));
|
|
@@ -824,15 +825,15 @@ var getAddOnDataWithCustomFields = function getAddOnDataWithCustomFields(customF
|
|
|
824
825
|
// Custom Fields are not specified case
|
|
825
826
|
if (_isEmpty(customFields)) {
|
|
826
827
|
return {
|
|
827
|
-
addOnDataWithCustomFields:
|
|
828
|
+
addOnDataWithCustomFields: []
|
|
828
829
|
};
|
|
829
830
|
}
|
|
830
831
|
// Add Custom Fields for Order
|
|
831
|
-
var orderWithCustomFields = {
|
|
832
|
+
var orderWithCustomFields = [{
|
|
832
833
|
id: 1,
|
|
833
834
|
groupClassname: 'billing-info-container__customFields',
|
|
834
835
|
groupItems: [].concat(customFields.addOnFields)
|
|
835
|
-
};
|
|
836
|
+
}];
|
|
836
837
|
var addOnDataWithCustomFields = {
|
|
837
838
|
fields: orderWithCustomFields
|
|
838
839
|
};
|
|
@@ -1305,28 +1306,51 @@ var getTickets = /*#__PURE__*/function () {
|
|
|
1305
1306
|
};
|
|
1306
1307
|
}();
|
|
1307
1308
|
var getTimeSlotsByDate = /*#__PURE__*/function () {
|
|
1308
|
-
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventId, date) {
|
|
1309
|
-
var response;
|
|
1309
|
+
var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(eventId, date, promoCode, pk) {
|
|
1310
|
+
var invitationHash, referralId, promoterId, params, headers, response;
|
|
1310
1311
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1311
1312
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1312
1313
|
case 0:
|
|
1313
|
-
|
|
1314
|
+
invitationHash = getQueryVariable('invitation-hash');
|
|
1315
|
+
referralId = getQueryVariable('ttf_r');
|
|
1316
|
+
if (referralId) {
|
|
1317
|
+
window.localStorage.setItem('promoter_id', referralId);
|
|
1318
|
+
}
|
|
1319
|
+
promoterId = window.localStorage.getItem('promoter_id');
|
|
1320
|
+
params = {
|
|
1321
|
+
pk: pk
|
|
1322
|
+
};
|
|
1323
|
+
if (invitationHash) {
|
|
1324
|
+
params['invitation-hash'] = invitationHash;
|
|
1325
|
+
}
|
|
1326
|
+
headers = publicRequest.defaults.headers.common;
|
|
1327
|
+
if (promoterId) {
|
|
1328
|
+
headers['Promotion-Event'] = String(eventId);
|
|
1329
|
+
headers['Referrer-Id'] = isBrowser ? promoterId : '';
|
|
1330
|
+
}
|
|
1331
|
+
if (promoCode) {
|
|
1332
|
+
headers['Promotion-Event'] = String(eventId);
|
|
1333
|
+
headers['Promotion-Code'] = promoCode;
|
|
1334
|
+
window.localStorage.removeItem('promoter_id');
|
|
1335
|
+
}
|
|
1336
|
+
_context3.next = 11;
|
|
1314
1337
|
return publicRequest.get("v1/event/" + eventId + "/timeslots", {
|
|
1315
|
-
params: {
|
|
1338
|
+
params: _extends({
|
|
1316
1339
|
date: date,
|
|
1317
1340
|
remove_past_slots: true
|
|
1318
|
-
}
|
|
1341
|
+
}, params),
|
|
1342
|
+
headers: headers
|
|
1319
1343
|
});
|
|
1320
|
-
case
|
|
1344
|
+
case 11:
|
|
1321
1345
|
response = _context3.sent;
|
|
1322
1346
|
return _context3.abrupt("return", response.data);
|
|
1323
|
-
case
|
|
1347
|
+
case 13:
|
|
1324
1348
|
case "end":
|
|
1325
1349
|
return _context3.stop();
|
|
1326
1350
|
}
|
|
1327
1351
|
}, _callee3);
|
|
1328
1352
|
}));
|
|
1329
|
-
return function getTimeSlotsByDate(_x6, _x7) {
|
|
1353
|
+
return function getTimeSlotsByDate(_x6, _x7, _x8, _x9) {
|
|
1330
1354
|
return _ref3.apply(this, arguments);
|
|
1331
1355
|
};
|
|
1332
1356
|
}();
|
|
@@ -1368,7 +1392,7 @@ var getStates = /*#__PURE__*/function () {
|
|
|
1368
1392
|
}
|
|
1369
1393
|
}, _callee5);
|
|
1370
1394
|
}));
|
|
1371
|
-
return function getStates(
|
|
1395
|
+
return function getStates(_x10) {
|
|
1372
1396
|
return _ref5.apply(this, arguments);
|
|
1373
1397
|
};
|
|
1374
1398
|
}();
|
|
@@ -1389,7 +1413,7 @@ var sendRSVPInfo = /*#__PURE__*/function () {
|
|
|
1389
1413
|
}
|
|
1390
1414
|
}, _callee6);
|
|
1391
1415
|
}));
|
|
1392
|
-
return function sendRSVPInfo(
|
|
1416
|
+
return function sendRSVPInfo(_x11, _x12) {
|
|
1393
1417
|
return _ref6.apply(this, arguments);
|
|
1394
1418
|
};
|
|
1395
1419
|
}();
|
|
@@ -1412,7 +1436,7 @@ var addToWaitingList = /*#__PURE__*/function () {
|
|
|
1412
1436
|
}
|
|
1413
1437
|
}, _callee7);
|
|
1414
1438
|
}));
|
|
1415
|
-
return function addToWaitingList(
|
|
1439
|
+
return function addToWaitingList(_x13, _x14) {
|
|
1416
1440
|
return _ref7.apply(this, arguments);
|
|
1417
1441
|
};
|
|
1418
1442
|
}();
|
|
@@ -1435,7 +1459,7 @@ var postReferralVisits = /*#__PURE__*/function () {
|
|
|
1435
1459
|
}
|
|
1436
1460
|
}, _callee8);
|
|
1437
1461
|
}));
|
|
1438
|
-
return function postReferralVisits(
|
|
1462
|
+
return function postReferralVisits(_x15, _x16) {
|
|
1439
1463
|
return _ref8.apply(this, arguments);
|
|
1440
1464
|
};
|
|
1441
1465
|
}();
|
|
@@ -1456,7 +1480,7 @@ var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
1456
1480
|
}
|
|
1457
1481
|
}, _callee9);
|
|
1458
1482
|
}));
|
|
1459
|
-
return function validatePhoneNumber(
|
|
1483
|
+
return function validatePhoneNumber(_x17) {
|
|
1460
1484
|
return _ref9.apply(this, arguments);
|
|
1461
1485
|
};
|
|
1462
1486
|
}();
|
|
@@ -3436,10 +3460,10 @@ var AddonComponent = function AddonComponent(_ref) {
|
|
|
3436
3460
|
}, _map(groupItems, function (element) {
|
|
3437
3461
|
return React__default.createElement("div", {
|
|
3438
3462
|
className: element.className,
|
|
3439
|
-
key: element.name
|
|
3463
|
+
key: data.id + "-" + id + "-" + element.name
|
|
3440
3464
|
}, React__default.createElement(formik.Field, Object.assign({}, element, {
|
|
3441
3465
|
type: element.type === 'radio' || element.type === 'checkbox' ? undefined : element.type,
|
|
3442
|
-
name: "" + element.name,
|
|
3466
|
+
name: data.id + "-" + id + "-" + element.name,
|
|
3443
3467
|
label: getFieldLabel(element, configs),
|
|
3444
3468
|
component: getFieldComponent(element),
|
|
3445
3469
|
validate: getValidateFunctions(element, [], values, errors)
|
|
@@ -3881,6 +3905,22 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3881
3905
|
var handleClearAddons = function handleClearAddons() {
|
|
3882
3906
|
window.localStorage.removeItem('add_ons');
|
|
3883
3907
|
};
|
|
3908
|
+
var initialValues = React.useMemo(function () {
|
|
3909
|
+
var _addOnDataWithCustomF;
|
|
3910
|
+
var addOnsData = {};
|
|
3911
|
+
if ((addons == null ? void 0 : addons.length) > 0 && (addOnDataWithCustomFields == null ? void 0 : (_addOnDataWithCustomF = addOnDataWithCustomFields.fields) == null ? void 0 : _addOnDataWithCustomF.length) > 0) {
|
|
3912
|
+
_map(addons, function (addon) {
|
|
3913
|
+
_map(addOnDataWithCustomFields.fields, function (field) {
|
|
3914
|
+
var id = field.id,
|
|
3915
|
+
groupItems = field.groupItems;
|
|
3916
|
+
_map(groupItems, function (item) {
|
|
3917
|
+
addOnsData[addon.id + "-" + id + "-" + item.name] = item.value;
|
|
3918
|
+
});
|
|
3919
|
+
});
|
|
3920
|
+
});
|
|
3921
|
+
}
|
|
3922
|
+
return addOnsData;
|
|
3923
|
+
}, [addons, addOnDataWithCustomFields]);
|
|
3884
3924
|
if (loading) {
|
|
3885
3925
|
return React__default.createElement("div", {
|
|
3886
3926
|
className: classNamePrefix + "_loader"
|
|
@@ -3917,7 +3957,7 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3917
3957
|
}, "Skip")), (!(addons != null && addons.length) || isResale && addOnIsIncluded) && samePage ? null : React__default.createElement("div", {
|
|
3918
3958
|
className: classNamePrefix + "_subtitle"
|
|
3919
3959
|
}, "PLEASE SELECT FROM THE OPTIONAL ADD-ONS BELOW"), React__default.createElement(formik.Formik, {
|
|
3920
|
-
initialValues:
|
|
3960
|
+
initialValues: initialValues,
|
|
3921
3961
|
onSubmit: function onSubmit(values) {
|
|
3922
3962
|
handleConfirm(values);
|
|
3923
3963
|
},
|
|
@@ -3928,7 +3968,8 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
3928
3968
|
} : undefined
|
|
3929
3969
|
}, function (_ref4) {
|
|
3930
3970
|
var values = _ref4.values,
|
|
3931
|
-
errors = _ref4.errors
|
|
3971
|
+
errors = _ref4.errors,
|
|
3972
|
+
setFieldTouched = _ref4.setFieldTouched;
|
|
3932
3973
|
var isConfirmDisabled = !isAtLeastOneAddonSelected(values);
|
|
3933
3974
|
return React__default.createElement(formik.Form, {
|
|
3934
3975
|
autoComplete: "off",
|
|
@@ -4013,7 +4054,14 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
4013
4054
|
selectOptions: addonsOptions[addon.id],
|
|
4014
4055
|
classNamePrefix: classNamePrefix,
|
|
4015
4056
|
handleAddonChange: function handleAddonChange(id, value) {
|
|
4016
|
-
|
|
4057
|
+
onFieldChange(id, value, addon);
|
|
4058
|
+
_map(addOnDataWithCustomFields.fields, function (fieldGroup) {
|
|
4059
|
+
var id = fieldGroup.id,
|
|
4060
|
+
groupItems = fieldGroup.groupItems;
|
|
4061
|
+
_map(groupItems, function (field) {
|
|
4062
|
+
setFieldTouched(addon.id + "-" + id + "-" + field.name, true, true);
|
|
4063
|
+
});
|
|
4064
|
+
});
|
|
4017
4065
|
},
|
|
4018
4066
|
addOnDataWithCustomFields: addOnDataWithCustomFields,
|
|
4019
4067
|
configs: configs,
|
|
@@ -5590,7 +5638,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
5590
5638
|
},
|
|
5591
5639
|
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
5592
5640
|
onForgotPasswordError: onForgotPasswordError,
|
|
5593
|
-
showPoweredByImage: showPoweredByImage
|
|
5641
|
+
showPoweredByImage: showPoweredByImage,
|
|
5642
|
+
displaySuccessMessage: true
|
|
5594
5643
|
}), React__default.createElement(VerificationPendingModal, {
|
|
5595
5644
|
message: pendingVerificationMessage,
|
|
5596
5645
|
onClose: function onClose() {
|
|
@@ -7628,8 +7677,9 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
7628
7677
|
return React__default.createElement(React__default.Fragment, null, returnValue, " ");
|
|
7629
7678
|
};
|
|
7630
7679
|
|
|
7680
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7631
7681
|
function decodeHTML(html) {
|
|
7632
|
-
var textArea = document.createElement(
|
|
7682
|
+
var textArea = document.createElement('textarea');
|
|
7633
7683
|
textArea.innerHTML = html;
|
|
7634
7684
|
return textArea.value;
|
|
7635
7685
|
}
|
|
@@ -7678,7 +7728,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7678
7728
|
ticketIsDiscounted = true;
|
|
7679
7729
|
}
|
|
7680
7730
|
var ticketIsFree = +ticket.price === 0;
|
|
7681
|
-
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE
|
|
7731
|
+
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
7682
7732
|
var isNewGroupTicket = (ticket == null ? void 0 : ticket.groupName) !== ((_arr = arr[i - 1]) == null ? void 0 : _arr.groupName);
|
|
7683
7733
|
return React__default.createElement(React__default.Fragment, {
|
|
7684
7734
|
key: ticket.id || ticket.name
|
|
@@ -7691,26 +7741,26 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7691
7741
|
}, ticket.displayName || ticket.name, ticket.descriptionRich && React__default.createElement(React__default.Fragment, null, React__default.createElement("span", {
|
|
7692
7742
|
"aria-hidden": true,
|
|
7693
7743
|
className: "info-icon",
|
|
7694
|
-
onClick: descriptionTrigger ===
|
|
7744
|
+
onClick: descriptionTrigger === 'click' ? function () {
|
|
7695
7745
|
return handleDescriptionToggle(ticket.id);
|
|
7696
7746
|
} : undefined,
|
|
7697
|
-
onMouseEnter: descriptionTrigger ===
|
|
7747
|
+
onMouseEnter: descriptionTrigger === 'hover' ? function () {
|
|
7698
7748
|
return setVisibleDescription(ticket.id);
|
|
7699
7749
|
} : undefined,
|
|
7700
|
-
onMouseLeave: descriptionTrigger ===
|
|
7750
|
+
onMouseLeave: descriptionTrigger === 'hover' ? function () {
|
|
7701
7751
|
return setVisibleDescription(null);
|
|
7702
7752
|
} : undefined,
|
|
7703
7753
|
"data-tooltip-id": "tooltip-" + ticket.id,
|
|
7704
7754
|
"data-tooltip-content": "View ticket info",
|
|
7705
7755
|
style: {
|
|
7706
7756
|
marginLeft: 8,
|
|
7707
|
-
cursor:
|
|
7708
|
-
display:
|
|
7757
|
+
cursor: 'pointer',
|
|
7758
|
+
display: 'flex'
|
|
7709
7759
|
}
|
|
7710
7760
|
}, React__default.createElement(InfoIcon, null)), React__default.createElement(reactTooltip.Tooltip, {
|
|
7711
7761
|
id: "tooltip-" + ticket.id,
|
|
7712
7762
|
place: "top"
|
|
7713
|
-
}, ticket.description ||
|
|
7763
|
+
}, ticket.description || 'No description available'))), React__default.createElement("div", {
|
|
7714
7764
|
className: "event-tickets-container"
|
|
7715
7765
|
}, React__default.createElement("div", {
|
|
7716
7766
|
className: "event-detail__tier-price"
|
|
@@ -7778,14 +7828,14 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7778
7828
|
style: {
|
|
7779
7829
|
marginLeft: 8,
|
|
7780
7830
|
cursor: 'pointer',
|
|
7781
|
-
display:
|
|
7831
|
+
display: 'flex'
|
|
7782
7832
|
},
|
|
7783
7833
|
"data-tooltip-id": "tooltip-" + ticket.id,
|
|
7784
7834
|
"data-tooltip-content": "View ticket info"
|
|
7785
7835
|
}, React__default.createElement(InfoIcon, null)), React__default.createElement(reactTooltip.Tooltip, {
|
|
7786
7836
|
id: "tooltip-" + ticket.id,
|
|
7787
7837
|
place: "top"
|
|
7788
|
-
}, ticket.description ||
|
|
7838
|
+
}, ticket.description || 'No description available'))), React__default.createElement("div", {
|
|
7789
7839
|
className: "event-tickets-container"
|
|
7790
7840
|
}, React__default.createElement("div", {
|
|
7791
7841
|
className: "event-detail__tier-price"
|
|
@@ -7822,8 +7872,11 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7822
7872
|
|
|
7823
7873
|
var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
7824
7874
|
var event = _ref.event,
|
|
7825
|
-
eventId = _ref.eventId,
|
|
7826
7875
|
availableDates = _ref.availableDates,
|
|
7876
|
+
selectedDate = _ref.selectedDate,
|
|
7877
|
+
timeSlotGroups = _ref.timeSlotGroups,
|
|
7878
|
+
setSelectedDate = _ref.setSelectedDate,
|
|
7879
|
+
getTimeSlots = _ref.getTimeSlots,
|
|
7827
7880
|
selectedTickets = _ref.selectedTickets,
|
|
7828
7881
|
handleTicketSelect = _ref.handleTicketSelect,
|
|
7829
7882
|
sortBySoldOut = _ref.sortBySoldOut,
|
|
@@ -7832,59 +7885,39 @@ var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
|
7832
7885
|
showGroupNameBlock = _ref.showGroupNameBlock,
|
|
7833
7886
|
currencySymbol = _ref.currencySymbol,
|
|
7834
7887
|
isSeatMapAllowed = _ref.isSeatMapAllowed;
|
|
7835
|
-
var _useState = React.useState(
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
var _useState2 = React.useState({}),
|
|
7839
|
-
timeSlotGroups = _useState2[0],
|
|
7840
|
-
setTimeSlotGroups = _useState2[1];
|
|
7841
|
-
var _useState3 = React.useState(false),
|
|
7842
|
-
loading = _useState3[0],
|
|
7843
|
-
setLoading = _useState3[1];
|
|
7888
|
+
var _useState = React.useState(false),
|
|
7889
|
+
loading = _useState[0],
|
|
7890
|
+
setLoading = _useState[1];
|
|
7844
7891
|
var handleDateChange = /*#__PURE__*/function () {
|
|
7845
7892
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(date) {
|
|
7846
|
-
var response, groupedTickets;
|
|
7847
7893
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7848
7894
|
while (1) switch (_context.prev = _context.next) {
|
|
7849
7895
|
case 0:
|
|
7850
7896
|
setSelectedDate(date);
|
|
7851
7897
|
if (!date) {
|
|
7852
|
-
_context.next =
|
|
7898
|
+
_context.next = 14;
|
|
7853
7899
|
break;
|
|
7854
7900
|
}
|
|
7855
7901
|
setLoading(true);
|
|
7856
7902
|
_context.prev = 3;
|
|
7857
7903
|
_context.next = 6;
|
|
7858
|
-
return
|
|
7904
|
+
return getTimeSlots(date);
|
|
7859
7905
|
case 6:
|
|
7860
|
-
|
|
7861
|
-
groupedTickets = {};
|
|
7862
|
-
_map(response.data.attributes.timeslots, function (timeslots, date) {
|
|
7863
|
-
var dateKeyChunks = date.split('-');
|
|
7864
|
-
var dateKey = [dateKeyChunks[0], dateKeyChunks[1], dateKeyChunks[2]].join('-');
|
|
7865
|
-
_forEach(timeslots, function (ticketList) {
|
|
7866
|
-
if (!groupedTickets[dateKey]) {
|
|
7867
|
-
groupedTickets[dateKey] = [];
|
|
7868
|
-
}
|
|
7869
|
-
groupedTickets[dateKey] = groupedTickets[dateKey].concat(ticketList);
|
|
7870
|
-
});
|
|
7871
|
-
});
|
|
7872
|
-
setTimeSlotGroups(groupedTickets);
|
|
7873
|
-
_context.next = 15;
|
|
7906
|
+
_context.next = 11;
|
|
7874
7907
|
break;
|
|
7875
|
-
case
|
|
7876
|
-
_context.prev =
|
|
7908
|
+
case 8:
|
|
7909
|
+
_context.prev = 8;
|
|
7877
7910
|
_context.t0 = _context["catch"](3);
|
|
7878
7911
|
console.error('Error fetching time slots:', _context.t0);
|
|
7879
|
-
case
|
|
7880
|
-
_context.prev =
|
|
7912
|
+
case 11:
|
|
7913
|
+
_context.prev = 11;
|
|
7881
7914
|
setLoading(false);
|
|
7882
|
-
return _context.finish(
|
|
7883
|
-
case
|
|
7915
|
+
return _context.finish(11);
|
|
7916
|
+
case 14:
|
|
7884
7917
|
case "end":
|
|
7885
7918
|
return _context.stop();
|
|
7886
7919
|
}
|
|
7887
|
-
}, _callee, null, [[3,
|
|
7920
|
+
}, _callee, null, [[3, 8, 11, 14]]);
|
|
7888
7921
|
}));
|
|
7889
7922
|
return function handleDateChange(_x) {
|
|
7890
7923
|
return _ref2.apply(this, arguments);
|
|
@@ -8111,6 +8144,12 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8111
8144
|
var _useState23 = React.useState([]),
|
|
8112
8145
|
availableDates = _useState23[0],
|
|
8113
8146
|
setAvailableDates = _useState23[1];
|
|
8147
|
+
var _useState24 = React.useState(null),
|
|
8148
|
+
selectedDate = _useState24[0],
|
|
8149
|
+
setSelectedDate = _useState24[1];
|
|
8150
|
+
var _useState25 = React.useState({}),
|
|
8151
|
+
timeSlotGroups = _useState25[0],
|
|
8152
|
+
setTimeSlotGroups = _useState25[1];
|
|
8114
8153
|
useCookieListener(X_TF_ECOMMERCE, function (value) {
|
|
8115
8154
|
return setIsLogged(Boolean(value));
|
|
8116
8155
|
});
|
|
@@ -8198,28 +8237,83 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8198
8237
|
onLoginSuccess();
|
|
8199
8238
|
}
|
|
8200
8239
|
};
|
|
8201
|
-
function
|
|
8240
|
+
var getTimeSlots = /*#__PURE__*/function () {
|
|
8241
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(date, type) {
|
|
8242
|
+
var _timeSlotsResponse$da, timeSlotsResponse, groupedTickets, attributes;
|
|
8243
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8244
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
8245
|
+
case 0:
|
|
8246
|
+
if (date) {
|
|
8247
|
+
_context2.next = 3;
|
|
8248
|
+
break;
|
|
8249
|
+
}
|
|
8250
|
+
setShowPromoCodeSection(false);
|
|
8251
|
+
return _context2.abrupt("return");
|
|
8252
|
+
case 3:
|
|
8253
|
+
_context2.prev = 3;
|
|
8254
|
+
_context2.next = 6;
|
|
8255
|
+
return getTimeSlotsByDate(eventId, moment(date).format('YYYY-MM-DD'), code);
|
|
8256
|
+
case 6:
|
|
8257
|
+
timeSlotsResponse = _context2.sent;
|
|
8258
|
+
groupedTickets = {};
|
|
8259
|
+
_map(timeSlotsResponse.data.attributes.timeslots, function (timeslots, date) {
|
|
8260
|
+
var dateKeyChunks = date.split('-');
|
|
8261
|
+
var dateKey = [dateKeyChunks[0], dateKeyChunks[1], dateKeyChunks[2]].join('-');
|
|
8262
|
+
_forEach(timeslots, function (ticketList) {
|
|
8263
|
+
if (!groupedTickets[dateKey]) {
|
|
8264
|
+
groupedTickets[dateKey] = [];
|
|
8265
|
+
}
|
|
8266
|
+
groupedTickets[dateKey] = groupedTickets[dateKey].concat(ticketList);
|
|
8267
|
+
});
|
|
8268
|
+
});
|
|
8269
|
+
setTimeSlotGroups(groupedTickets);
|
|
8270
|
+
setShowPromoCodeSection(true);
|
|
8271
|
+
attributes = timeSlotsResponse == null ? void 0 : (_timeSlotsResponse$da = timeSlotsResponse.data) == null ? void 0 : _timeSlotsResponse$da.attributes;
|
|
8272
|
+
if (type === 'promo') {
|
|
8273
|
+
setCodeIsApplied(attributes.ValidPromoCode);
|
|
8274
|
+
setCodeIsInvalid(!attributes.ValidPromoCode);
|
|
8275
|
+
setCode('');
|
|
8276
|
+
window.localStorage.setItem('appliedPromoCode', code);
|
|
8277
|
+
setShowAccessCodeSection(attributes.is_access_code);
|
|
8278
|
+
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
8279
|
+
}
|
|
8280
|
+
_context2.next = 17;
|
|
8281
|
+
break;
|
|
8282
|
+
case 15:
|
|
8283
|
+
_context2.prev = 15;
|
|
8284
|
+
_context2.t0 = _context2["catch"](3);
|
|
8285
|
+
case 17:
|
|
8286
|
+
case "end":
|
|
8287
|
+
return _context2.stop();
|
|
8288
|
+
}
|
|
8289
|
+
}, _callee2, null, [[3, 15]]);
|
|
8290
|
+
}));
|
|
8291
|
+
return function getTimeSlots(_x, _x2) {
|
|
8292
|
+
return _ref3.apply(this, arguments);
|
|
8293
|
+
};
|
|
8294
|
+
}();
|
|
8295
|
+
function getTicketsApi(_x3, _x4) {
|
|
8202
8296
|
return _getTicketsApi.apply(this, arguments);
|
|
8203
8297
|
}
|
|
8204
8298
|
function _getTicketsApi() {
|
|
8205
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8299
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(isUpdatingCode, type) {
|
|
8206
8300
|
var previewKey, eventResponse, _event2, _event2$timeslotSetti, _event2$timeslotSetti2, response, _response$data, attributes;
|
|
8207
|
-
return _regeneratorRuntime().wrap(function
|
|
8208
|
-
while (1) switch (
|
|
8301
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
8302
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
8209
8303
|
case 0:
|
|
8210
|
-
|
|
8304
|
+
_context5.prev = 0;
|
|
8211
8305
|
if (isUpdatingCode) {
|
|
8212
8306
|
setCodeIsLoading(true);
|
|
8213
8307
|
} else {
|
|
8214
8308
|
setIsLoading(true);
|
|
8215
8309
|
}
|
|
8216
8310
|
previewKey = getQueryVariable('pk') || undefined;
|
|
8217
|
-
|
|
8311
|
+
_context5.next = 5;
|
|
8218
8312
|
return getEvent(eventId, previewKey);
|
|
8219
8313
|
case 5:
|
|
8220
|
-
eventResponse =
|
|
8314
|
+
eventResponse = _context5.sent;
|
|
8221
8315
|
if (!eventResponse.success) {
|
|
8222
|
-
|
|
8316
|
+
_context5.next = 14;
|
|
8223
8317
|
break;
|
|
8224
8318
|
}
|
|
8225
8319
|
_event2 = eventResponse.data.attributes;
|
|
@@ -8228,17 +8322,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8228
8322
|
window.localStorage.setItem('eventCountry', _event2.country);
|
|
8229
8323
|
}
|
|
8230
8324
|
if (!_event2.isTimeSlotEvent) {
|
|
8231
|
-
|
|
8325
|
+
_context5.next = 14;
|
|
8232
8326
|
break;
|
|
8233
8327
|
}
|
|
8328
|
+
getTimeSlots(selectedDate, code);
|
|
8234
8329
|
// For timeslots we shouldn't fetch all tickets at once
|
|
8235
8330
|
setAvailableDates((_event2$timeslotSetti = _event2 == null ? void 0 : (_event2$timeslotSetti2 = _event2.timeslotSettings) == null ? void 0 : _event2$timeslotSetti2.availableDates) != null ? _event2$timeslotSetti : []);
|
|
8236
|
-
return
|
|
8237
|
-
case
|
|
8238
|
-
|
|
8331
|
+
return _context5.abrupt("return");
|
|
8332
|
+
case 14:
|
|
8333
|
+
_context5.next = 16;
|
|
8239
8334
|
return getTickets(eventId, code, previewKey);
|
|
8240
|
-
case
|
|
8241
|
-
response =
|
|
8335
|
+
case 16:
|
|
8336
|
+
response = _context5.sent;
|
|
8242
8337
|
if (response.success) {
|
|
8243
8338
|
attributes = response == null ? void 0 : (_response$data = response.data) == null ? void 0 : _response$data.attributes;
|
|
8244
8339
|
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
@@ -8257,26 +8352,26 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8257
8352
|
setShowAccessCodeSection(attributes.is_access_code);
|
|
8258
8353
|
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
8259
8354
|
}
|
|
8260
|
-
|
|
8355
|
+
_context5.next = 23;
|
|
8261
8356
|
break;
|
|
8262
|
-
case
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
if (axios.isAxiosError(
|
|
8266
|
-
onGetTicketsError(
|
|
8267
|
-
setError(_get(
|
|
8357
|
+
case 20:
|
|
8358
|
+
_context5.prev = 20;
|
|
8359
|
+
_context5.t0 = _context5["catch"](0);
|
|
8360
|
+
if (axios.isAxiosError(_context5.t0)) {
|
|
8361
|
+
onGetTicketsError(_context5.t0);
|
|
8362
|
+
setError(_get(_context5.t0, 'response.data.message', ''));
|
|
8268
8363
|
window.localStorage.removeItem('appliedPromoCode');
|
|
8269
8364
|
}
|
|
8270
|
-
case
|
|
8271
|
-
|
|
8365
|
+
case 23:
|
|
8366
|
+
_context5.prev = 23;
|
|
8272
8367
|
setIsLoading(false);
|
|
8273
8368
|
setCodeIsLoading(false);
|
|
8274
|
-
return
|
|
8275
|
-
case
|
|
8369
|
+
return _context5.finish(23);
|
|
8370
|
+
case 27:
|
|
8276
8371
|
case "end":
|
|
8277
|
-
return
|
|
8372
|
+
return _context5.stop();
|
|
8278
8373
|
}
|
|
8279
|
-
},
|
|
8374
|
+
}, _callee5, null, [[0, 20, 23, 27]]);
|
|
8280
8375
|
}));
|
|
8281
8376
|
return _getTicketsApi.apply(this, arguments);
|
|
8282
8377
|
}
|
|
@@ -8284,32 +8379,32 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8284
8379
|
return _fetchPreregisteredData.apply(this, arguments);
|
|
8285
8380
|
}
|
|
8286
8381
|
function _fetchPreregisteredData() {
|
|
8287
|
-
_fetchPreregisteredData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8382
|
+
_fetchPreregisteredData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
8288
8383
|
var preregistrationData;
|
|
8289
|
-
return _regeneratorRuntime().wrap(function
|
|
8290
|
-
while (1) switch (
|
|
8384
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
8385
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
8291
8386
|
case 0:
|
|
8292
|
-
|
|
8293
|
-
|
|
8387
|
+
_context6.prev = 0;
|
|
8388
|
+
_context6.next = 3;
|
|
8294
8389
|
return getPreRegistrationInfluencers({
|
|
8295
8390
|
eventId: eventId
|
|
8296
8391
|
});
|
|
8297
8392
|
case 3:
|
|
8298
|
-
preregistrationData =
|
|
8393
|
+
preregistrationData = _context6.sent;
|
|
8299
8394
|
setPreregisteredUsers(preregistrationData.data.attributes.influencers);
|
|
8300
|
-
|
|
8395
|
+
_context6.next = 10;
|
|
8301
8396
|
break;
|
|
8302
8397
|
case 7:
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
if (axios.isAxiosError(
|
|
8306
|
-
setError(_get(
|
|
8398
|
+
_context6.prev = 7;
|
|
8399
|
+
_context6.t0 = _context6["catch"](0);
|
|
8400
|
+
if (axios.isAxiosError(_context6.t0)) {
|
|
8401
|
+
setError(_get(_context6.t0, 'response.data.message', ''));
|
|
8307
8402
|
}
|
|
8308
8403
|
case 10:
|
|
8309
8404
|
case "end":
|
|
8310
|
-
return
|
|
8405
|
+
return _context6.stop();
|
|
8311
8406
|
}
|
|
8312
|
-
},
|
|
8407
|
+
}, _callee6, null, [[0, 7]]);
|
|
8313
8408
|
}));
|
|
8314
8409
|
return _fetchPreregisteredData.apply(this, arguments);
|
|
8315
8410
|
}
|
|
@@ -8319,11 +8414,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8319
8414
|
}
|
|
8320
8415
|
localStorage.setItem('selectedTicketsQuantity', value.toString());
|
|
8321
8416
|
setSelectedTickets(function (prevState) {
|
|
8322
|
-
var
|
|
8417
|
+
var _ref4;
|
|
8323
8418
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
8324
8419
|
return prevState;
|
|
8325
8420
|
}
|
|
8326
|
-
return
|
|
8421
|
+
return _ref4 = {}, _ref4[key] = value, _ref4.isTable = isTable, _ref4;
|
|
8327
8422
|
});
|
|
8328
8423
|
};
|
|
8329
8424
|
var handleOrdersClick = function handleOrdersClick() {
|
|
@@ -8335,14 +8430,19 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8335
8430
|
setError(null);
|
|
8336
8431
|
};
|
|
8337
8432
|
var handleBook = /*#__PURE__*/function () {
|
|
8338
|
-
var
|
|
8433
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
8339
8434
|
var _product_options, _product_options2, _ticket_types;
|
|
8340
|
-
var ticket, optionName, ticketId, isTableType, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse, _errorResponse$data, _errorResponse$data$d, errorResponse, _errorResponse$data2, message, _isInvalidLinkError, _isNotInvitedError;
|
|
8341
|
-
return _regeneratorRuntime().wrap(function
|
|
8342
|
-
while (1) switch (
|
|
8435
|
+
var timeSlotTickets, ticket, optionName, ticketId, isTableType, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse, _errorResponse$data, _errorResponse$data$d, errorResponse, _errorResponse$data2, message, _isInvalidLinkError, _isNotInvitedError;
|
|
8436
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
8437
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
8343
8438
|
case 0:
|
|
8439
|
+
timeSlotTickets = _flatten(_map(timeSlotGroups, function (slots) {
|
|
8440
|
+
return slots;
|
|
8441
|
+
}));
|
|
8344
8442
|
setHandleBookIsLoading(true);
|
|
8345
|
-
ticket = _find(
|
|
8443
|
+
ticket = event != null && event.isTimeSlotEvent ? _find(timeSlotTickets || [], function (item) {
|
|
8444
|
+
return Number(selectedTickets[item.id]) > 0;
|
|
8445
|
+
}) || {} : _find(tickets, function (item) {
|
|
8346
8446
|
return Number(selectedTickets[item.id]) > 0;
|
|
8347
8447
|
}) || {};
|
|
8348
8448
|
optionName = _get(ticket, 'optionName');
|
|
@@ -8362,33 +8462,33 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8362
8462
|
}, _ticket_types)
|
|
8363
8463
|
}
|
|
8364
8464
|
};
|
|
8365
|
-
|
|
8465
|
+
_context3.prev = 9;
|
|
8366
8466
|
onGetTicketsPress();
|
|
8367
|
-
|
|
8467
|
+
_context3.next = 13;
|
|
8368
8468
|
return addToCart(eventId, data);
|
|
8369
|
-
case
|
|
8370
|
-
result =
|
|
8469
|
+
case 13:
|
|
8470
|
+
result = _context3.sent;
|
|
8371
8471
|
if (!enableAddOns) {
|
|
8372
|
-
|
|
8472
|
+
_context3.next = 20;
|
|
8373
8473
|
break;
|
|
8374
8474
|
}
|
|
8375
|
-
|
|
8475
|
+
_context3.next = 17;
|
|
8376
8476
|
return getCheckoutPageConfigs();
|
|
8377
|
-
case
|
|
8378
|
-
|
|
8379
|
-
|
|
8477
|
+
case 17:
|
|
8478
|
+
_context3.t0 = _context3.sent;
|
|
8479
|
+
_context3.next = 21;
|
|
8380
8480
|
break;
|
|
8381
|
-
case
|
|
8382
|
-
|
|
8481
|
+
case 20:
|
|
8482
|
+
_context3.t0 = {
|
|
8383
8483
|
status: 200,
|
|
8384
8484
|
data: {
|
|
8385
8485
|
attributes: _get(result, 'data.attributes')
|
|
8386
8486
|
}
|
|
8387
8487
|
};
|
|
8388
|
-
case
|
|
8389
|
-
pageConfigsDataResponse =
|
|
8488
|
+
case 21:
|
|
8489
|
+
pageConfigsDataResponse = _context3.t0;
|
|
8390
8490
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
8391
|
-
|
|
8491
|
+
_context3.next = 44;
|
|
8392
8492
|
break;
|
|
8393
8493
|
}
|
|
8394
8494
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
@@ -8399,29 +8499,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8399
8499
|
total = '';
|
|
8400
8500
|
isBrowser && window.localStorage.removeItem('add_ons');
|
|
8401
8501
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
8402
|
-
|
|
8502
|
+
_context3.next = 43;
|
|
8403
8503
|
break;
|
|
8404
8504
|
}
|
|
8405
8505
|
// Get user data for checkout data
|
|
8406
8506
|
userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
8407
8507
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
8408
8508
|
if (!enableBillingInfoAutoCreate) {
|
|
8409
|
-
|
|
8509
|
+
_context3.next = 39;
|
|
8410
8510
|
break;
|
|
8411
8511
|
}
|
|
8412
|
-
|
|
8512
|
+
_context3.next = 36;
|
|
8413
8513
|
return postOnCheckout(checkoutBody, freeTicket);
|
|
8414
|
-
case
|
|
8415
|
-
|
|
8416
|
-
|
|
8514
|
+
case 36:
|
|
8515
|
+
_context3.t1 = _context3.sent;
|
|
8516
|
+
_context3.next = 40;
|
|
8417
8517
|
break;
|
|
8418
|
-
case 38:
|
|
8419
|
-
_context2.t1 = null;
|
|
8420
8518
|
case 39:
|
|
8421
|
-
|
|
8519
|
+
_context3.t1 = null;
|
|
8520
|
+
case 40:
|
|
8521
|
+
checkoutResponse = _context3.t1;
|
|
8422
8522
|
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
8423
8523
|
total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
|
|
8424
|
-
case
|
|
8524
|
+
case 43:
|
|
8425
8525
|
onAddToCartSuccess({
|
|
8426
8526
|
skip_billing_page: skipBillingPage,
|
|
8427
8527
|
event_id: String(eventId),
|
|
@@ -8429,18 +8529,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8429
8529
|
total: total,
|
|
8430
8530
|
hasAddOn: hasAddOn
|
|
8431
8531
|
});
|
|
8432
|
-
case
|
|
8433
|
-
|
|
8532
|
+
case 44:
|
|
8533
|
+
_context3.next = 50;
|
|
8434
8534
|
break;
|
|
8435
|
-
case
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
errorResponse = _get(
|
|
8535
|
+
case 46:
|
|
8536
|
+
_context3.prev = 46;
|
|
8537
|
+
_context3.t2 = _context3["catch"](9);
|
|
8538
|
+
errorResponse = _get(_context3.t2, 'response', {});
|
|
8439
8539
|
if (errorResponse != null && (_errorResponse$data = errorResponse.data) != null && (_errorResponse$data$d = _errorResponse$data.data) != null && _errorResponse$data$d.hasUnverifiedOrder) {
|
|
8440
8540
|
setPendingVerificationMessage(errorResponse == null ? void 0 : (_errorResponse$data2 = errorResponse.data) == null ? void 0 : _errorResponse$data2.message);
|
|
8441
|
-
} else if (axios.isAxiosError(
|
|
8442
|
-
onAddToCartError(
|
|
8443
|
-
message = _get(
|
|
8541
|
+
} else if (axios.isAxiosError(_context3.t2)) {
|
|
8542
|
+
onAddToCartError(_context3.t2);
|
|
8543
|
+
message = _get(_context3.t2, 'response.data.message', '');
|
|
8444
8544
|
_isInvalidLinkError = _includes(message, 'No more of this ticket type are available right now');
|
|
8445
8545
|
_isNotInvitedError = _includes(message, 'You must have been invited to this event to attend');
|
|
8446
8546
|
if (_isInvalidLinkError) {
|
|
@@ -8451,47 +8551,47 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8451
8551
|
setError(message);
|
|
8452
8552
|
}
|
|
8453
8553
|
}
|
|
8454
|
-
case
|
|
8455
|
-
|
|
8554
|
+
case 50:
|
|
8555
|
+
_context3.prev = 50;
|
|
8456
8556
|
setHandleBookIsLoading(false);
|
|
8457
|
-
return
|
|
8458
|
-
case
|
|
8557
|
+
return _context3.finish(50);
|
|
8558
|
+
case 53:
|
|
8459
8559
|
case "end":
|
|
8460
|
-
return
|
|
8560
|
+
return _context3.stop();
|
|
8461
8561
|
}
|
|
8462
|
-
},
|
|
8562
|
+
}, _callee3, null, [[9, 46, 50, 53]]);
|
|
8463
8563
|
}));
|
|
8464
8564
|
return function handleBook() {
|
|
8465
|
-
return
|
|
8565
|
+
return _ref5.apply(this, arguments);
|
|
8466
8566
|
};
|
|
8467
8567
|
}();
|
|
8468
8568
|
var updateTickets = function updateTickets(isUpdatingCode, type) {
|
|
8469
8569
|
getTicketsApi(isUpdatingCode, type);
|
|
8470
8570
|
};
|
|
8471
8571
|
var fetchUserData = /*#__PURE__*/function () {
|
|
8472
|
-
var
|
|
8572
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
8473
8573
|
var userDataResponse, profileData, profileDataObj;
|
|
8474
|
-
return _regeneratorRuntime().wrap(function
|
|
8475
|
-
while (1) switch (
|
|
8574
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8575
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
8476
8576
|
case 0:
|
|
8477
|
-
|
|
8577
|
+
_context4.next = 2;
|
|
8478
8578
|
return getProfileData();
|
|
8479
8579
|
case 2:
|
|
8480
|
-
userDataResponse =
|
|
8580
|
+
userDataResponse = _context4.sent;
|
|
8481
8581
|
profileData = _get(userDataResponse, 'data');
|
|
8482
8582
|
profileDataObj = setLoggedUserData(profileData);
|
|
8483
|
-
return
|
|
8583
|
+
return _context4.abrupt("return", profileDataObj);
|
|
8484
8584
|
case 6:
|
|
8485
8585
|
case "end":
|
|
8486
|
-
return
|
|
8586
|
+
return _context4.stop();
|
|
8487
8587
|
}
|
|
8488
|
-
},
|
|
8588
|
+
}, _callee4);
|
|
8489
8589
|
}));
|
|
8490
8590
|
return function fetchUserData() {
|
|
8491
|
-
return
|
|
8591
|
+
return _ref6.apply(this, arguments);
|
|
8492
8592
|
};
|
|
8493
8593
|
}();
|
|
8494
|
-
var isTicketOnSale = _some(tickets, function (item) {
|
|
8594
|
+
var isTicketOnSale = event != null && event.isTimeSlotEvent ? true : _some(tickets, function (item) {
|
|
8495
8595
|
return (item.salesStarted || (event == null ? void 0 : event.presalesStarted)) && !item.salesEnded && !item.soldOut;
|
|
8496
8596
|
});
|
|
8497
8597
|
var eventHasTickets = !_isEmpty(tickets);
|
|
@@ -8611,6 +8711,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8611
8711
|
event: event,
|
|
8612
8712
|
eventId: eventId,
|
|
8613
8713
|
availableDates: availableDates,
|
|
8714
|
+
selectedDate: selectedDate,
|
|
8715
|
+
setSelectedDate: setSelectedDate,
|
|
8716
|
+
timeSlotGroups: timeSlotGroups,
|
|
8717
|
+
setTimeSlotGroups: setTimeSlotGroups,
|
|
8614
8718
|
selectedTickets: selectedTickets,
|
|
8615
8719
|
handleTicketSelect: handleTicketSelect,
|
|
8616
8720
|
sortBySoldOut: sortBySoldOut,
|
|
@@ -8618,7 +8722,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8618
8722
|
hideTicketsHeader: hideTicketsHeader,
|
|
8619
8723
|
showGroupNameBlock: showGroupNameBlock,
|
|
8620
8724
|
currencySymbol: currencySymbol,
|
|
8621
|
-
isSeatMapAllowed: isSeatMapAllowed
|
|
8725
|
+
isSeatMapAllowed: isSeatMapAllowed,
|
|
8726
|
+
getTimeSlots: getTimeSlots
|
|
8622
8727
|
}), !isSalesClosed && !isTimeSlotEvent && React__default.createElement(TicketsSection, {
|
|
8623
8728
|
event: event,
|
|
8624
8729
|
ticketsList: ordinaryTickets,
|
|
@@ -13233,13 +13338,14 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
13233
13338
|
setShowModalLogin(true);
|
|
13234
13339
|
},
|
|
13235
13340
|
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
13236
|
-
onForgotPasswordError: onForgotPasswordError
|
|
13341
|
+
onForgotPasswordError: onForgotPasswordError,
|
|
13342
|
+
displaySuccessMessage: true
|
|
13237
13343
|
}), React__default.createElement("h2", null, "Pre-Registration"), React__default.createElement(formik.Formik, {
|
|
13238
13344
|
initialValues: getFormInitialValues$1(formFields),
|
|
13239
13345
|
enableReinitialize: true,
|
|
13240
13346
|
onSubmit: function () {
|
|
13241
13347
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
|
|
13242
|
-
var updatedValues, holderAgeDate, confirmationData, bodyFormData, res, profileRes,
|
|
13348
|
+
var updatedValues, holderAgeDate, confirmationData, bodyFormData, res, profileRes, _error2$response, _error2$response$data, _error2$response$data2, _error2$response2, _error2$response2$dat, _error2, errorMessage, emailErrors, _error2$response3, _error2$response3$dat;
|
|
13243
13349
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
13244
13350
|
while (1) switch (_context2.prev = _context2.next) {
|
|
13245
13351
|
case 0:
|
|
@@ -13306,15 +13412,16 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
13306
13412
|
setUserData(_get(profileRes, 'data'));
|
|
13307
13413
|
}
|
|
13308
13414
|
case 41:
|
|
13309
|
-
_context2.next =
|
|
13415
|
+
_context2.next = 51;
|
|
13310
13416
|
break;
|
|
13311
13417
|
case 43:
|
|
13312
13418
|
_context2.prev = 43;
|
|
13313
13419
|
_context2.t0 = _context2["catch"](0);
|
|
13314
|
-
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13420
|
+
_error2 = _context2.t0;
|
|
13421
|
+
errorMessage = (_error2 == null ? void 0 : _error2.message) || 'Error';
|
|
13422
|
+
emailErrors = _error2 == null ? void 0 : (_error2$response = _error2.response) == null ? void 0 : (_error2$response$data = _error2$response.data) == null ? void 0 : (_error2$response$data2 = _error2$response$data.message) == null ? void 0 : _error2$response$data2.email;
|
|
13423
|
+
if (typeof (_error2 == null ? void 0 : (_error2$response2 = _error2.response) == null ? void 0 : (_error2$response2$dat = _error2$response2.data) == null ? void 0 : _error2$response2$dat.message) === 'string') {
|
|
13424
|
+
errorMessage = _error2 == null ? void 0 : (_error2$response3 = _error2.response) == null ? void 0 : (_error2$response3$dat = _error2$response3.data) == null ? void 0 : _error2$response3$dat.message;
|
|
13318
13425
|
}
|
|
13319
13426
|
if ((emailErrors == null ? void 0 : emailErrors.length) > 0) {
|
|
13320
13427
|
if (emailErrors[0] === 'The email is already used') {
|
|
@@ -13324,8 +13431,8 @@ var PreRegistration = function PreRegistration(_ref) {
|
|
|
13324
13431
|
} else {
|
|
13325
13432
|
setError(errorMessage);
|
|
13326
13433
|
}
|
|
13327
|
-
onConfirmationError(
|
|
13328
|
-
case
|
|
13434
|
+
onConfirmationError(_error2);
|
|
13435
|
+
case 51:
|
|
13329
13436
|
case "end":
|
|
13330
13437
|
return _context2.stop();
|
|
13331
13438
|
}
|