tf-checkout-react 1.6.6-beta.22 → 1.6.6-beta.23
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/ticketsContainer/TicketsSection.d.ts +1 -1
- package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +9 -0
- package/dist/tf-checkout-react.cjs.development.js +238 -158
- 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 +238 -158
- 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 +6 -3
- package/src/components/common/DatePickerField.tsx +12 -11
- 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/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
|
}();
|
|
@@ -7628,8 +7652,9 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
7628
7652
|
return React__default.createElement(React__default.Fragment, null, returnValue, " ");
|
|
7629
7653
|
};
|
|
7630
7654
|
|
|
7655
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7631
7656
|
function decodeHTML(html) {
|
|
7632
|
-
var textArea = document.createElement(
|
|
7657
|
+
var textArea = document.createElement('textarea');
|
|
7633
7658
|
textArea.innerHTML = html;
|
|
7634
7659
|
return textArea.value;
|
|
7635
7660
|
}
|
|
@@ -7678,7 +7703,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7678
7703
|
ticketIsDiscounted = true;
|
|
7679
7704
|
}
|
|
7680
7705
|
var ticketIsFree = +ticket.price === 0;
|
|
7681
|
-
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE
|
|
7706
|
+
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
7682
7707
|
var isNewGroupTicket = (ticket == null ? void 0 : ticket.groupName) !== ((_arr = arr[i - 1]) == null ? void 0 : _arr.groupName);
|
|
7683
7708
|
return React__default.createElement(React__default.Fragment, {
|
|
7684
7709
|
key: ticket.id || ticket.name
|
|
@@ -7691,26 +7716,26 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7691
7716
|
}, ticket.displayName || ticket.name, ticket.descriptionRich && React__default.createElement(React__default.Fragment, null, React__default.createElement("span", {
|
|
7692
7717
|
"aria-hidden": true,
|
|
7693
7718
|
className: "info-icon",
|
|
7694
|
-
onClick: descriptionTrigger ===
|
|
7719
|
+
onClick: descriptionTrigger === 'click' ? function () {
|
|
7695
7720
|
return handleDescriptionToggle(ticket.id);
|
|
7696
7721
|
} : undefined,
|
|
7697
|
-
onMouseEnter: descriptionTrigger ===
|
|
7722
|
+
onMouseEnter: descriptionTrigger === 'hover' ? function () {
|
|
7698
7723
|
return setVisibleDescription(ticket.id);
|
|
7699
7724
|
} : undefined,
|
|
7700
|
-
onMouseLeave: descriptionTrigger ===
|
|
7725
|
+
onMouseLeave: descriptionTrigger === 'hover' ? function () {
|
|
7701
7726
|
return setVisibleDescription(null);
|
|
7702
7727
|
} : undefined,
|
|
7703
7728
|
"data-tooltip-id": "tooltip-" + ticket.id,
|
|
7704
7729
|
"data-tooltip-content": "View ticket info",
|
|
7705
7730
|
style: {
|
|
7706
7731
|
marginLeft: 8,
|
|
7707
|
-
cursor:
|
|
7708
|
-
display:
|
|
7732
|
+
cursor: 'pointer',
|
|
7733
|
+
display: 'flex'
|
|
7709
7734
|
}
|
|
7710
7735
|
}, React__default.createElement(InfoIcon, null)), React__default.createElement(reactTooltip.Tooltip, {
|
|
7711
7736
|
id: "tooltip-" + ticket.id,
|
|
7712
7737
|
place: "top"
|
|
7713
|
-
}, ticket.description ||
|
|
7738
|
+
}, ticket.description || 'No description available'))), React__default.createElement("div", {
|
|
7714
7739
|
className: "event-tickets-container"
|
|
7715
7740
|
}, React__default.createElement("div", {
|
|
7716
7741
|
className: "event-detail__tier-price"
|
|
@@ -7778,14 +7803,14 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7778
7803
|
style: {
|
|
7779
7804
|
marginLeft: 8,
|
|
7780
7805
|
cursor: 'pointer',
|
|
7781
|
-
display:
|
|
7806
|
+
display: 'flex'
|
|
7782
7807
|
},
|
|
7783
7808
|
"data-tooltip-id": "tooltip-" + ticket.id,
|
|
7784
7809
|
"data-tooltip-content": "View ticket info"
|
|
7785
7810
|
}, React__default.createElement(InfoIcon, null)), React__default.createElement(reactTooltip.Tooltip, {
|
|
7786
7811
|
id: "tooltip-" + ticket.id,
|
|
7787
7812
|
place: "top"
|
|
7788
|
-
}, ticket.description ||
|
|
7813
|
+
}, ticket.description || 'No description available'))), React__default.createElement("div", {
|
|
7789
7814
|
className: "event-tickets-container"
|
|
7790
7815
|
}, React__default.createElement("div", {
|
|
7791
7816
|
className: "event-detail__tier-price"
|
|
@@ -7822,8 +7847,11 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
7822
7847
|
|
|
7823
7848
|
var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
7824
7849
|
var event = _ref.event,
|
|
7825
|
-
eventId = _ref.eventId,
|
|
7826
7850
|
availableDates = _ref.availableDates,
|
|
7851
|
+
selectedDate = _ref.selectedDate,
|
|
7852
|
+
timeSlotGroups = _ref.timeSlotGroups,
|
|
7853
|
+
setSelectedDate = _ref.setSelectedDate,
|
|
7854
|
+
getTimeSlots = _ref.getTimeSlots,
|
|
7827
7855
|
selectedTickets = _ref.selectedTickets,
|
|
7828
7856
|
handleTicketSelect = _ref.handleTicketSelect,
|
|
7829
7857
|
sortBySoldOut = _ref.sortBySoldOut,
|
|
@@ -7832,59 +7860,39 @@ var TimeSlotsSection = function TimeSlotsSection(_ref) {
|
|
|
7832
7860
|
showGroupNameBlock = _ref.showGroupNameBlock,
|
|
7833
7861
|
currencySymbol = _ref.currencySymbol,
|
|
7834
7862
|
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];
|
|
7863
|
+
var _useState = React.useState(false),
|
|
7864
|
+
loading = _useState[0],
|
|
7865
|
+
setLoading = _useState[1];
|
|
7844
7866
|
var handleDateChange = /*#__PURE__*/function () {
|
|
7845
7867
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(date) {
|
|
7846
|
-
var response, groupedTickets;
|
|
7847
7868
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7848
7869
|
while (1) switch (_context.prev = _context.next) {
|
|
7849
7870
|
case 0:
|
|
7850
7871
|
setSelectedDate(date);
|
|
7851
7872
|
if (!date) {
|
|
7852
|
-
_context.next =
|
|
7873
|
+
_context.next = 14;
|
|
7853
7874
|
break;
|
|
7854
7875
|
}
|
|
7855
7876
|
setLoading(true);
|
|
7856
7877
|
_context.prev = 3;
|
|
7857
7878
|
_context.next = 6;
|
|
7858
|
-
return
|
|
7879
|
+
return getTimeSlots(date);
|
|
7859
7880
|
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;
|
|
7881
|
+
_context.next = 11;
|
|
7874
7882
|
break;
|
|
7875
|
-
case
|
|
7876
|
-
_context.prev =
|
|
7883
|
+
case 8:
|
|
7884
|
+
_context.prev = 8;
|
|
7877
7885
|
_context.t0 = _context["catch"](3);
|
|
7878
7886
|
console.error('Error fetching time slots:', _context.t0);
|
|
7879
|
-
case
|
|
7880
|
-
_context.prev =
|
|
7887
|
+
case 11:
|
|
7888
|
+
_context.prev = 11;
|
|
7881
7889
|
setLoading(false);
|
|
7882
|
-
return _context.finish(
|
|
7883
|
-
case
|
|
7890
|
+
return _context.finish(11);
|
|
7891
|
+
case 14:
|
|
7884
7892
|
case "end":
|
|
7885
7893
|
return _context.stop();
|
|
7886
7894
|
}
|
|
7887
|
-
}, _callee, null, [[3,
|
|
7895
|
+
}, _callee, null, [[3, 8, 11, 14]]);
|
|
7888
7896
|
}));
|
|
7889
7897
|
return function handleDateChange(_x) {
|
|
7890
7898
|
return _ref2.apply(this, arguments);
|
|
@@ -8111,6 +8119,12 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8111
8119
|
var _useState23 = React.useState([]),
|
|
8112
8120
|
availableDates = _useState23[0],
|
|
8113
8121
|
setAvailableDates = _useState23[1];
|
|
8122
|
+
var _useState24 = React.useState(null),
|
|
8123
|
+
selectedDate = _useState24[0],
|
|
8124
|
+
setSelectedDate = _useState24[1];
|
|
8125
|
+
var _useState25 = React.useState({}),
|
|
8126
|
+
timeSlotGroups = _useState25[0],
|
|
8127
|
+
setTimeSlotGroups = _useState25[1];
|
|
8114
8128
|
useCookieListener(X_TF_ECOMMERCE, function (value) {
|
|
8115
8129
|
return setIsLogged(Boolean(value));
|
|
8116
8130
|
});
|
|
@@ -8198,28 +8212,83 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8198
8212
|
onLoginSuccess();
|
|
8199
8213
|
}
|
|
8200
8214
|
};
|
|
8201
|
-
function
|
|
8215
|
+
var getTimeSlots = /*#__PURE__*/function () {
|
|
8216
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(date, type) {
|
|
8217
|
+
var _timeSlotsResponse$da, timeSlotsResponse, groupedTickets, attributes;
|
|
8218
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8219
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
8220
|
+
case 0:
|
|
8221
|
+
if (date) {
|
|
8222
|
+
_context2.next = 3;
|
|
8223
|
+
break;
|
|
8224
|
+
}
|
|
8225
|
+
setShowPromoCodeSection(false);
|
|
8226
|
+
return _context2.abrupt("return");
|
|
8227
|
+
case 3:
|
|
8228
|
+
_context2.prev = 3;
|
|
8229
|
+
_context2.next = 6;
|
|
8230
|
+
return getTimeSlotsByDate(eventId, moment(date).format('YYYY-MM-DD'), code);
|
|
8231
|
+
case 6:
|
|
8232
|
+
timeSlotsResponse = _context2.sent;
|
|
8233
|
+
groupedTickets = {};
|
|
8234
|
+
_map(timeSlotsResponse.data.attributes.timeslots, function (timeslots, date) {
|
|
8235
|
+
var dateKeyChunks = date.split('-');
|
|
8236
|
+
var dateKey = [dateKeyChunks[0], dateKeyChunks[1], dateKeyChunks[2]].join('-');
|
|
8237
|
+
_forEach(timeslots, function (ticketList) {
|
|
8238
|
+
if (!groupedTickets[dateKey]) {
|
|
8239
|
+
groupedTickets[dateKey] = [];
|
|
8240
|
+
}
|
|
8241
|
+
groupedTickets[dateKey] = groupedTickets[dateKey].concat(ticketList);
|
|
8242
|
+
});
|
|
8243
|
+
});
|
|
8244
|
+
setTimeSlotGroups(groupedTickets);
|
|
8245
|
+
setShowPromoCodeSection(true);
|
|
8246
|
+
attributes = timeSlotsResponse == null ? void 0 : (_timeSlotsResponse$da = timeSlotsResponse.data) == null ? void 0 : _timeSlotsResponse$da.attributes;
|
|
8247
|
+
if (type === 'promo') {
|
|
8248
|
+
setCodeIsApplied(attributes.ValidPromoCode);
|
|
8249
|
+
setCodeIsInvalid(!attributes.ValidPromoCode);
|
|
8250
|
+
setCode('');
|
|
8251
|
+
window.localStorage.setItem('appliedPromoCode', code);
|
|
8252
|
+
setShowAccessCodeSection(attributes.is_access_code);
|
|
8253
|
+
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
8254
|
+
}
|
|
8255
|
+
_context2.next = 17;
|
|
8256
|
+
break;
|
|
8257
|
+
case 15:
|
|
8258
|
+
_context2.prev = 15;
|
|
8259
|
+
_context2.t0 = _context2["catch"](3);
|
|
8260
|
+
case 17:
|
|
8261
|
+
case "end":
|
|
8262
|
+
return _context2.stop();
|
|
8263
|
+
}
|
|
8264
|
+
}, _callee2, null, [[3, 15]]);
|
|
8265
|
+
}));
|
|
8266
|
+
return function getTimeSlots(_x, _x2) {
|
|
8267
|
+
return _ref3.apply(this, arguments);
|
|
8268
|
+
};
|
|
8269
|
+
}();
|
|
8270
|
+
function getTicketsApi(_x3, _x4) {
|
|
8202
8271
|
return _getTicketsApi.apply(this, arguments);
|
|
8203
8272
|
}
|
|
8204
8273
|
function _getTicketsApi() {
|
|
8205
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8274
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(isUpdatingCode, type) {
|
|
8206
8275
|
var previewKey, eventResponse, _event2, _event2$timeslotSetti, _event2$timeslotSetti2, response, _response$data, attributes;
|
|
8207
|
-
return _regeneratorRuntime().wrap(function
|
|
8208
|
-
while (1) switch (
|
|
8276
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
8277
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
8209
8278
|
case 0:
|
|
8210
|
-
|
|
8279
|
+
_context5.prev = 0;
|
|
8211
8280
|
if (isUpdatingCode) {
|
|
8212
8281
|
setCodeIsLoading(true);
|
|
8213
8282
|
} else {
|
|
8214
8283
|
setIsLoading(true);
|
|
8215
8284
|
}
|
|
8216
8285
|
previewKey = getQueryVariable('pk') || undefined;
|
|
8217
|
-
|
|
8286
|
+
_context5.next = 5;
|
|
8218
8287
|
return getEvent(eventId, previewKey);
|
|
8219
8288
|
case 5:
|
|
8220
|
-
eventResponse =
|
|
8289
|
+
eventResponse = _context5.sent;
|
|
8221
8290
|
if (!eventResponse.success) {
|
|
8222
|
-
|
|
8291
|
+
_context5.next = 14;
|
|
8223
8292
|
break;
|
|
8224
8293
|
}
|
|
8225
8294
|
_event2 = eventResponse.data.attributes;
|
|
@@ -8228,17 +8297,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8228
8297
|
window.localStorage.setItem('eventCountry', _event2.country);
|
|
8229
8298
|
}
|
|
8230
8299
|
if (!_event2.isTimeSlotEvent) {
|
|
8231
|
-
|
|
8300
|
+
_context5.next = 14;
|
|
8232
8301
|
break;
|
|
8233
8302
|
}
|
|
8303
|
+
getTimeSlots(selectedDate, code);
|
|
8234
8304
|
// For timeslots we shouldn't fetch all tickets at once
|
|
8235
8305
|
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
|
-
|
|
8306
|
+
return _context5.abrupt("return");
|
|
8307
|
+
case 14:
|
|
8308
|
+
_context5.next = 16;
|
|
8239
8309
|
return getTickets(eventId, code, previewKey);
|
|
8240
|
-
case
|
|
8241
|
-
response =
|
|
8310
|
+
case 16:
|
|
8311
|
+
response = _context5.sent;
|
|
8242
8312
|
if (response.success) {
|
|
8243
8313
|
attributes = response == null ? void 0 : (_response$data = response.data) == null ? void 0 : _response$data.attributes;
|
|
8244
8314
|
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
@@ -8257,26 +8327,26 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8257
8327
|
setShowAccessCodeSection(attributes.is_access_code);
|
|
8258
8328
|
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
8259
8329
|
}
|
|
8260
|
-
|
|
8330
|
+
_context5.next = 23;
|
|
8261
8331
|
break;
|
|
8262
|
-
case
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
if (axios.isAxiosError(
|
|
8266
|
-
onGetTicketsError(
|
|
8267
|
-
setError(_get(
|
|
8332
|
+
case 20:
|
|
8333
|
+
_context5.prev = 20;
|
|
8334
|
+
_context5.t0 = _context5["catch"](0);
|
|
8335
|
+
if (axios.isAxiosError(_context5.t0)) {
|
|
8336
|
+
onGetTicketsError(_context5.t0);
|
|
8337
|
+
setError(_get(_context5.t0, 'response.data.message', ''));
|
|
8268
8338
|
window.localStorage.removeItem('appliedPromoCode');
|
|
8269
8339
|
}
|
|
8270
|
-
case
|
|
8271
|
-
|
|
8340
|
+
case 23:
|
|
8341
|
+
_context5.prev = 23;
|
|
8272
8342
|
setIsLoading(false);
|
|
8273
8343
|
setCodeIsLoading(false);
|
|
8274
|
-
return
|
|
8275
|
-
case
|
|
8344
|
+
return _context5.finish(23);
|
|
8345
|
+
case 27:
|
|
8276
8346
|
case "end":
|
|
8277
|
-
return
|
|
8347
|
+
return _context5.stop();
|
|
8278
8348
|
}
|
|
8279
|
-
},
|
|
8349
|
+
}, _callee5, null, [[0, 20, 23, 27]]);
|
|
8280
8350
|
}));
|
|
8281
8351
|
return _getTicketsApi.apply(this, arguments);
|
|
8282
8352
|
}
|
|
@@ -8284,32 +8354,32 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8284
8354
|
return _fetchPreregisteredData.apply(this, arguments);
|
|
8285
8355
|
}
|
|
8286
8356
|
function _fetchPreregisteredData() {
|
|
8287
|
-
_fetchPreregisteredData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8357
|
+
_fetchPreregisteredData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
8288
8358
|
var preregistrationData;
|
|
8289
|
-
return _regeneratorRuntime().wrap(function
|
|
8290
|
-
while (1) switch (
|
|
8359
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
8360
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
8291
8361
|
case 0:
|
|
8292
|
-
|
|
8293
|
-
|
|
8362
|
+
_context6.prev = 0;
|
|
8363
|
+
_context6.next = 3;
|
|
8294
8364
|
return getPreRegistrationInfluencers({
|
|
8295
8365
|
eventId: eventId
|
|
8296
8366
|
});
|
|
8297
8367
|
case 3:
|
|
8298
|
-
preregistrationData =
|
|
8368
|
+
preregistrationData = _context6.sent;
|
|
8299
8369
|
setPreregisteredUsers(preregistrationData.data.attributes.influencers);
|
|
8300
|
-
|
|
8370
|
+
_context6.next = 10;
|
|
8301
8371
|
break;
|
|
8302
8372
|
case 7:
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
if (axios.isAxiosError(
|
|
8306
|
-
setError(_get(
|
|
8373
|
+
_context6.prev = 7;
|
|
8374
|
+
_context6.t0 = _context6["catch"](0);
|
|
8375
|
+
if (axios.isAxiosError(_context6.t0)) {
|
|
8376
|
+
setError(_get(_context6.t0, 'response.data.message', ''));
|
|
8307
8377
|
}
|
|
8308
8378
|
case 10:
|
|
8309
8379
|
case "end":
|
|
8310
|
-
return
|
|
8380
|
+
return _context6.stop();
|
|
8311
8381
|
}
|
|
8312
|
-
},
|
|
8382
|
+
}, _callee6, null, [[0, 7]]);
|
|
8313
8383
|
}));
|
|
8314
8384
|
return _fetchPreregisteredData.apply(this, arguments);
|
|
8315
8385
|
}
|
|
@@ -8319,11 +8389,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8319
8389
|
}
|
|
8320
8390
|
localStorage.setItem('selectedTicketsQuantity', value.toString());
|
|
8321
8391
|
setSelectedTickets(function (prevState) {
|
|
8322
|
-
var
|
|
8392
|
+
var _ref4;
|
|
8323
8393
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
8324
8394
|
return prevState;
|
|
8325
8395
|
}
|
|
8326
|
-
return
|
|
8396
|
+
return _ref4 = {}, _ref4[key] = value, _ref4.isTable = isTable, _ref4;
|
|
8327
8397
|
});
|
|
8328
8398
|
};
|
|
8329
8399
|
var handleOrdersClick = function handleOrdersClick() {
|
|
@@ -8335,14 +8405,19 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8335
8405
|
setError(null);
|
|
8336
8406
|
};
|
|
8337
8407
|
var handleBook = /*#__PURE__*/function () {
|
|
8338
|
-
var
|
|
8408
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
8339
8409
|
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 (
|
|
8410
|
+
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;
|
|
8411
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
8412
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
8343
8413
|
case 0:
|
|
8414
|
+
timeSlotTickets = _flatten(_map(timeSlotGroups, function (slots) {
|
|
8415
|
+
return slots;
|
|
8416
|
+
}));
|
|
8344
8417
|
setHandleBookIsLoading(true);
|
|
8345
|
-
ticket = _find(
|
|
8418
|
+
ticket = event != null && event.isTimeSlotEvent ? _find(timeSlotTickets || [], function (item) {
|
|
8419
|
+
return Number(selectedTickets[item.id]) > 0;
|
|
8420
|
+
}) || {} : _find(tickets, function (item) {
|
|
8346
8421
|
return Number(selectedTickets[item.id]) > 0;
|
|
8347
8422
|
}) || {};
|
|
8348
8423
|
optionName = _get(ticket, 'optionName');
|
|
@@ -8362,33 +8437,33 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8362
8437
|
}, _ticket_types)
|
|
8363
8438
|
}
|
|
8364
8439
|
};
|
|
8365
|
-
|
|
8440
|
+
_context3.prev = 9;
|
|
8366
8441
|
onGetTicketsPress();
|
|
8367
|
-
|
|
8442
|
+
_context3.next = 13;
|
|
8368
8443
|
return addToCart(eventId, data);
|
|
8369
|
-
case
|
|
8370
|
-
result =
|
|
8444
|
+
case 13:
|
|
8445
|
+
result = _context3.sent;
|
|
8371
8446
|
if (!enableAddOns) {
|
|
8372
|
-
|
|
8447
|
+
_context3.next = 20;
|
|
8373
8448
|
break;
|
|
8374
8449
|
}
|
|
8375
|
-
|
|
8450
|
+
_context3.next = 17;
|
|
8376
8451
|
return getCheckoutPageConfigs();
|
|
8377
|
-
case
|
|
8378
|
-
|
|
8379
|
-
|
|
8452
|
+
case 17:
|
|
8453
|
+
_context3.t0 = _context3.sent;
|
|
8454
|
+
_context3.next = 21;
|
|
8380
8455
|
break;
|
|
8381
|
-
case
|
|
8382
|
-
|
|
8456
|
+
case 20:
|
|
8457
|
+
_context3.t0 = {
|
|
8383
8458
|
status: 200,
|
|
8384
8459
|
data: {
|
|
8385
8460
|
attributes: _get(result, 'data.attributes')
|
|
8386
8461
|
}
|
|
8387
8462
|
};
|
|
8388
|
-
case
|
|
8389
|
-
pageConfigsDataResponse =
|
|
8463
|
+
case 21:
|
|
8464
|
+
pageConfigsDataResponse = _context3.t0;
|
|
8390
8465
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
8391
|
-
|
|
8466
|
+
_context3.next = 44;
|
|
8392
8467
|
break;
|
|
8393
8468
|
}
|
|
8394
8469
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
@@ -8399,29 +8474,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8399
8474
|
total = '';
|
|
8400
8475
|
isBrowser && window.localStorage.removeItem('add_ons');
|
|
8401
8476
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
8402
|
-
|
|
8477
|
+
_context3.next = 43;
|
|
8403
8478
|
break;
|
|
8404
8479
|
}
|
|
8405
8480
|
// Get user data for checkout data
|
|
8406
8481
|
userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
8407
8482
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
8408
8483
|
if (!enableBillingInfoAutoCreate) {
|
|
8409
|
-
|
|
8484
|
+
_context3.next = 39;
|
|
8410
8485
|
break;
|
|
8411
8486
|
}
|
|
8412
|
-
|
|
8487
|
+
_context3.next = 36;
|
|
8413
8488
|
return postOnCheckout(checkoutBody, freeTicket);
|
|
8414
|
-
case
|
|
8415
|
-
|
|
8416
|
-
|
|
8489
|
+
case 36:
|
|
8490
|
+
_context3.t1 = _context3.sent;
|
|
8491
|
+
_context3.next = 40;
|
|
8417
8492
|
break;
|
|
8418
|
-
case 38:
|
|
8419
|
-
_context2.t1 = null;
|
|
8420
8493
|
case 39:
|
|
8421
|
-
|
|
8494
|
+
_context3.t1 = null;
|
|
8495
|
+
case 40:
|
|
8496
|
+
checkoutResponse = _context3.t1;
|
|
8422
8497
|
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
8423
8498
|
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
|
|
8499
|
+
case 43:
|
|
8425
8500
|
onAddToCartSuccess({
|
|
8426
8501
|
skip_billing_page: skipBillingPage,
|
|
8427
8502
|
event_id: String(eventId),
|
|
@@ -8429,18 +8504,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8429
8504
|
total: total,
|
|
8430
8505
|
hasAddOn: hasAddOn
|
|
8431
8506
|
});
|
|
8432
|
-
case
|
|
8433
|
-
|
|
8507
|
+
case 44:
|
|
8508
|
+
_context3.next = 50;
|
|
8434
8509
|
break;
|
|
8435
|
-
case
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
errorResponse = _get(
|
|
8510
|
+
case 46:
|
|
8511
|
+
_context3.prev = 46;
|
|
8512
|
+
_context3.t2 = _context3["catch"](9);
|
|
8513
|
+
errorResponse = _get(_context3.t2, 'response', {});
|
|
8439
8514
|
if (errorResponse != null && (_errorResponse$data = errorResponse.data) != null && (_errorResponse$data$d = _errorResponse$data.data) != null && _errorResponse$data$d.hasUnverifiedOrder) {
|
|
8440
8515
|
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(
|
|
8516
|
+
} else if (axios.isAxiosError(_context3.t2)) {
|
|
8517
|
+
onAddToCartError(_context3.t2);
|
|
8518
|
+
message = _get(_context3.t2, 'response.data.message', '');
|
|
8444
8519
|
_isInvalidLinkError = _includes(message, 'No more of this ticket type are available right now');
|
|
8445
8520
|
_isNotInvitedError = _includes(message, 'You must have been invited to this event to attend');
|
|
8446
8521
|
if (_isInvalidLinkError) {
|
|
@@ -8451,47 +8526,47 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8451
8526
|
setError(message);
|
|
8452
8527
|
}
|
|
8453
8528
|
}
|
|
8454
|
-
case
|
|
8455
|
-
|
|
8529
|
+
case 50:
|
|
8530
|
+
_context3.prev = 50;
|
|
8456
8531
|
setHandleBookIsLoading(false);
|
|
8457
|
-
return
|
|
8458
|
-
case
|
|
8532
|
+
return _context3.finish(50);
|
|
8533
|
+
case 53:
|
|
8459
8534
|
case "end":
|
|
8460
|
-
return
|
|
8535
|
+
return _context3.stop();
|
|
8461
8536
|
}
|
|
8462
|
-
},
|
|
8537
|
+
}, _callee3, null, [[9, 46, 50, 53]]);
|
|
8463
8538
|
}));
|
|
8464
8539
|
return function handleBook() {
|
|
8465
|
-
return
|
|
8540
|
+
return _ref5.apply(this, arguments);
|
|
8466
8541
|
};
|
|
8467
8542
|
}();
|
|
8468
8543
|
var updateTickets = function updateTickets(isUpdatingCode, type) {
|
|
8469
8544
|
getTicketsApi(isUpdatingCode, type);
|
|
8470
8545
|
};
|
|
8471
8546
|
var fetchUserData = /*#__PURE__*/function () {
|
|
8472
|
-
var
|
|
8547
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
8473
8548
|
var userDataResponse, profileData, profileDataObj;
|
|
8474
|
-
return _regeneratorRuntime().wrap(function
|
|
8475
|
-
while (1) switch (
|
|
8549
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8550
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
8476
8551
|
case 0:
|
|
8477
|
-
|
|
8552
|
+
_context4.next = 2;
|
|
8478
8553
|
return getProfileData();
|
|
8479
8554
|
case 2:
|
|
8480
|
-
userDataResponse =
|
|
8555
|
+
userDataResponse = _context4.sent;
|
|
8481
8556
|
profileData = _get(userDataResponse, 'data');
|
|
8482
8557
|
profileDataObj = setLoggedUserData(profileData);
|
|
8483
|
-
return
|
|
8558
|
+
return _context4.abrupt("return", profileDataObj);
|
|
8484
8559
|
case 6:
|
|
8485
8560
|
case "end":
|
|
8486
|
-
return
|
|
8561
|
+
return _context4.stop();
|
|
8487
8562
|
}
|
|
8488
|
-
},
|
|
8563
|
+
}, _callee4);
|
|
8489
8564
|
}));
|
|
8490
8565
|
return function fetchUserData() {
|
|
8491
|
-
return
|
|
8566
|
+
return _ref6.apply(this, arguments);
|
|
8492
8567
|
};
|
|
8493
8568
|
}();
|
|
8494
|
-
var isTicketOnSale = _some(tickets, function (item) {
|
|
8569
|
+
var isTicketOnSale = event != null && event.isTimeSlotEvent ? true : _some(tickets, function (item) {
|
|
8495
8570
|
return (item.salesStarted || (event == null ? void 0 : event.presalesStarted)) && !item.salesEnded && !item.soldOut;
|
|
8496
8571
|
});
|
|
8497
8572
|
var eventHasTickets = !_isEmpty(tickets);
|
|
@@ -8611,6 +8686,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8611
8686
|
event: event,
|
|
8612
8687
|
eventId: eventId,
|
|
8613
8688
|
availableDates: availableDates,
|
|
8689
|
+
selectedDate: selectedDate,
|
|
8690
|
+
setSelectedDate: setSelectedDate,
|
|
8691
|
+
timeSlotGroups: timeSlotGroups,
|
|
8692
|
+
setTimeSlotGroups: setTimeSlotGroups,
|
|
8614
8693
|
selectedTickets: selectedTickets,
|
|
8615
8694
|
handleTicketSelect: handleTicketSelect,
|
|
8616
8695
|
sortBySoldOut: sortBySoldOut,
|
|
@@ -8618,7 +8697,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8618
8697
|
hideTicketsHeader: hideTicketsHeader,
|
|
8619
8698
|
showGroupNameBlock: showGroupNameBlock,
|
|
8620
8699
|
currencySymbol: currencySymbol,
|
|
8621
|
-
isSeatMapAllowed: isSeatMapAllowed
|
|
8700
|
+
isSeatMapAllowed: isSeatMapAllowed,
|
|
8701
|
+
getTimeSlots: getTimeSlots
|
|
8622
8702
|
}), !isSalesClosed && !isTimeSlotEvent && React__default.createElement(TicketsSection, {
|
|
8623
8703
|
event: event,
|
|
8624
8704
|
ticketsList: ordinaryTickets,
|