summit-registration-lite 2.0.24 → 2.0.27
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/README.md +2 -0
- package/package.json +2 -1
- package/dist/index.css +0 -26
- package/dist/index.js +0 -2767
package/dist/index.js
DELETED
|
@@ -1,2767 +0,0 @@
|
|
|
1
|
-
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory();
|
|
4
|
-
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define("summit-registration-lite", [], factory);
|
|
6
|
-
else if(typeof exports === 'object')
|
|
7
|
-
exports["summit-registration-lite"] = factory();
|
|
8
|
-
else
|
|
9
|
-
root["summit-registration-lite"] = factory();
|
|
10
|
-
})(this, function() {
|
|
11
|
-
return /******/ (() => { // webpackBootstrap
|
|
12
|
-
/******/ "use strict";
|
|
13
|
-
/******/ // The require scope
|
|
14
|
-
/******/ var __webpack_require__ = {};
|
|
15
|
-
/******/
|
|
16
|
-
/************************************************************************/
|
|
17
|
-
/******/ /* webpack/runtime/compat get default export */
|
|
18
|
-
/******/ (() => {
|
|
19
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
20
|
-
/******/ __webpack_require__.n = (module) => {
|
|
21
|
-
/******/ var getter = module && module.__esModule ?
|
|
22
|
-
/******/ () => (module['default']) :
|
|
23
|
-
/******/ () => (module);
|
|
24
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
|
25
|
-
/******/ return getter;
|
|
26
|
-
/******/ };
|
|
27
|
-
/******/ })();
|
|
28
|
-
/******/
|
|
29
|
-
/******/ /* webpack/runtime/define property getters */
|
|
30
|
-
/******/ (() => {
|
|
31
|
-
/******/ // define getter functions for harmony exports
|
|
32
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
33
|
-
/******/ for(var key in definition) {
|
|
34
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
35
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
36
|
-
/******/ }
|
|
37
|
-
/******/ }
|
|
38
|
-
/******/ };
|
|
39
|
-
/******/ })();
|
|
40
|
-
/******/
|
|
41
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
42
|
-
/******/ (() => {
|
|
43
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
44
|
-
/******/ })();
|
|
45
|
-
/******/
|
|
46
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
47
|
-
/******/ (() => {
|
|
48
|
-
/******/ // define __esModule on exports
|
|
49
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
50
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
51
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
52
|
-
/******/ }
|
|
53
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
54
|
-
/******/ };
|
|
55
|
-
/******/ })();
|
|
56
|
-
/******/
|
|
57
|
-
/************************************************************************/
|
|
58
|
-
var __webpack_exports__ = {};
|
|
59
|
-
// ESM COMPAT FLAG
|
|
60
|
-
__webpack_require__.r(__webpack_exports__);
|
|
61
|
-
|
|
62
|
-
// EXPORTS
|
|
63
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
64
|
-
"default": () => (/* binding */ summit_registration_lite)
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
;// CONCATENATED MODULE: external "react"
|
|
68
|
-
const external_react_namespaceObject = require("react");
|
|
69
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_namespaceObject);
|
|
70
|
-
;// CONCATENATED MODULE: external "react-redux"
|
|
71
|
-
const external_react_redux_namespaceObject = require("react-redux");
|
|
72
|
-
;// CONCATENATED MODULE: external "redux"
|
|
73
|
-
const external_redux_namespaceObject = require("redux");
|
|
74
|
-
;// CONCATENATED MODULE: external "redux-thunk"
|
|
75
|
-
const external_redux_thunk_namespaceObject = require("redux-thunk");
|
|
76
|
-
var external_redux_thunk_default = /*#__PURE__*/__webpack_require__.n(external_redux_thunk_namespaceObject);
|
|
77
|
-
;// CONCATENATED MODULE: external "redux-persist"
|
|
78
|
-
const external_redux_persist_namespaceObject = require("redux-persist");
|
|
79
|
-
;// CONCATENATED MODULE: external "redux-persist/es/storage"
|
|
80
|
-
const storage_namespaceObject = require("redux-persist/es/storage");
|
|
81
|
-
var storage_default = /*#__PURE__*/__webpack_require__.n(storage_namespaceObject);
|
|
82
|
-
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/utils/actions"
|
|
83
|
-
const actions_namespaceObject = require("openstack-uicore-foundation/lib/utils/actions");
|
|
84
|
-
;// CONCATENATED MODULE: external "sweetalert2"
|
|
85
|
-
const external_sweetalert2_namespaceObject = require("sweetalert2");
|
|
86
|
-
var external_sweetalert2_default = /*#__PURE__*/__webpack_require__.n(external_sweetalert2_namespaceObject);
|
|
87
|
-
;// CONCATENATED MODULE: ./src/utils/payment-providers/lawpay-provider.js
|
|
88
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class LawPayProvider {
|
|
94
|
-
constructor({
|
|
95
|
-
reservation,
|
|
96
|
-
summitId,
|
|
97
|
-
userProfile,
|
|
98
|
-
access_token,
|
|
99
|
-
apiBaseUrl,
|
|
100
|
-
dispatch: _dispatch
|
|
101
|
-
}) {
|
|
102
|
-
_defineProperty(this, "payTicket", ({
|
|
103
|
-
token = null
|
|
104
|
-
}) => async dispatch => {
|
|
105
|
-
var _this$userProfile, _this$userProfile2, _this$userProfile3, _this$userProfile4, _this$userProfile5, _this$userProfile6;
|
|
106
|
-
|
|
107
|
-
// Pay using affinity lawpay
|
|
108
|
-
const errorHandler = (err, res) => (dispatch, state) => {
|
|
109
|
-
let code = err.status;
|
|
110
|
-
|
|
111
|
-
switch (code) {
|
|
112
|
-
case 404:
|
|
113
|
-
{
|
|
114
|
-
let msg = res.body.message;
|
|
115
|
-
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
116
|
-
}
|
|
117
|
-
break;
|
|
118
|
-
|
|
119
|
-
case 500:
|
|
120
|
-
{
|
|
121
|
-
let msg = res.body.message;
|
|
122
|
-
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
123
|
-
}
|
|
124
|
-
break;
|
|
125
|
-
|
|
126
|
-
default:
|
|
127
|
-
(0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
let params = {
|
|
133
|
-
access_token: this.access_token,
|
|
134
|
-
expand: 'tickets,' + 'tickets.owner,' + 'tickets.owner.extra_questions,' + 'tickets.badge,' + 'tickets.badge.type,' + 'tickets.badge.type.access_levels,' + 'tickets.badge.type.features,' + 'tickets.ticket_type,' + 'tickets.ticket_type.taxes'
|
|
135
|
-
};
|
|
136
|
-
let normalizedEntity = {
|
|
137
|
-
billing_address_1: token ? token.address1 : ((_this$userProfile = this.userProfile) === null || _this$userProfile === void 0 ? void 0 : _this$userProfile.address1) || '',
|
|
138
|
-
billing_address_2: ((_this$userProfile2 = this.userProfile) === null || _this$userProfile2 === void 0 ? void 0 : _this$userProfile2.address2) || '',
|
|
139
|
-
billing_address_zip_code: token ? token.postal_code : ((_this$userProfile3 = this.userProfile) === null || _this$userProfile3 === void 0 ? void 0 : _this$userProfile3.postal_code) || '',
|
|
140
|
-
billing_address_city: ((_this$userProfile4 = this.userProfile) === null || _this$userProfile4 === void 0 ? void 0 : _this$userProfile4.locality) || '',
|
|
141
|
-
billing_address_state: ((_this$userProfile5 = this.userProfile) === null || _this$userProfile5 === void 0 ? void 0 : _this$userProfile5.region) || '',
|
|
142
|
-
billing_address_country: ((_this$userProfile6 = this.userProfile) === null || _this$userProfile6 === void 0 ? void 0 : _this$userProfile6.country) || ''
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
if (token) {
|
|
146
|
-
normalizedEntity['payment_method_id'] = token.id;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
this.dispatch(startWidgetLoading());
|
|
150
|
-
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
151
|
-
)(params)(this.dispatch).then(payload => {
|
|
152
|
-
this.dispatch(stopWidgetLoading());
|
|
153
|
-
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
154
|
-
this.dispatch(changeStep(3));
|
|
155
|
-
return payload;
|
|
156
|
-
}).catch(e => {
|
|
157
|
-
this.dispatch(removeReservedTicket());
|
|
158
|
-
this.dispatch(changeStep(1));
|
|
159
|
-
this.dispatch(stopWidgetLoading());
|
|
160
|
-
return e;
|
|
161
|
-
}); // The payment has succeeded. Display a success message.
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
this.reservation = reservation;
|
|
165
|
-
this.summitId = summitId;
|
|
166
|
-
this.userProfile = userProfile;
|
|
167
|
-
this.access_token = access_token;
|
|
168
|
-
this.apiBaseUrl = apiBaseUrl;
|
|
169
|
-
this.dispatch = _dispatch;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
;// CONCATENATED MODULE: ./src/utils/payment-providers/stripe-provider.js
|
|
174
|
-
function stripe_provider_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
class StripeProvider {
|
|
181
|
-
constructor({
|
|
182
|
-
reservation,
|
|
183
|
-
summitId,
|
|
184
|
-
userProfile,
|
|
185
|
-
access_token,
|
|
186
|
-
apiBaseUrl,
|
|
187
|
-
dispatch: _dispatch
|
|
188
|
-
}) {
|
|
189
|
-
stripe_provider_defineProperty(this, "payTicket", ({
|
|
190
|
-
token = null,
|
|
191
|
-
stripe = null,
|
|
192
|
-
zipCode = null
|
|
193
|
-
}) => async dispatch => {
|
|
194
|
-
var _this$userProfile, _this$userProfile2, _this$userProfile3, _this$userProfile4, _this$userProfile5;
|
|
195
|
-
|
|
196
|
-
const errorHandler = (err, res) => (dispatch, state) => {
|
|
197
|
-
let code = err.status;
|
|
198
|
-
|
|
199
|
-
switch (code) {
|
|
200
|
-
case 404:
|
|
201
|
-
{
|
|
202
|
-
let msg = res.body.message;
|
|
203
|
-
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
204
|
-
}
|
|
205
|
-
break;
|
|
206
|
-
|
|
207
|
-
case 500:
|
|
208
|
-
{
|
|
209
|
-
let msg = res.body.message;
|
|
210
|
-
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
211
|
-
}
|
|
212
|
-
break;
|
|
213
|
-
|
|
214
|
-
default:
|
|
215
|
-
(0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
216
|
-
break;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
let params = {
|
|
221
|
-
access_token: this.access_token,
|
|
222
|
-
expand: 'tickets,' + 'tickets.owner,' + 'tickets.owner.extra_questions,' + 'tickets.badge,' + 'tickets.badge.type,' + 'tickets.badge.type.access_levels,' + 'tickets.badge.type.features,' + 'tickets.ticket_type,' + 'tickets.ticket_type.taxes'
|
|
223
|
-
};
|
|
224
|
-
let normalizedEntity = {
|
|
225
|
-
billing_address_1: ((_this$userProfile = this.userProfile) === null || _this$userProfile === void 0 ? void 0 : _this$userProfile.address1) || '',
|
|
226
|
-
billing_address_2: ((_this$userProfile2 = this.userProfile) === null || _this$userProfile2 === void 0 ? void 0 : _this$userProfile2.address2) || '',
|
|
227
|
-
billing_address_zip_code: zipCode,
|
|
228
|
-
billing_address_city: ((_this$userProfile3 = this.userProfile) === null || _this$userProfile3 === void 0 ? void 0 : _this$userProfile3.locality) || '',
|
|
229
|
-
billing_address_state: ((_this$userProfile4 = this.userProfile) === null || _this$userProfile4 === void 0 ? void 0 : _this$userProfile4.region) || '',
|
|
230
|
-
billing_address_country: ((_this$userProfile5 = this.userProfile) === null || _this$userProfile5 === void 0 ? void 0 : _this$userProfile5.country) || ''
|
|
231
|
-
};
|
|
232
|
-
dispatch(startWidgetLoading());
|
|
233
|
-
|
|
234
|
-
if (this.reservation.amount > 0) {
|
|
235
|
-
const {
|
|
236
|
-
id
|
|
237
|
-
} = token;
|
|
238
|
-
stripe.confirmCardPayment(this.reservation.payment_gateway_client_token, {
|
|
239
|
-
payment_method: {
|
|
240
|
-
card: {
|
|
241
|
-
token: id
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}).then(result => {
|
|
245
|
-
if (result.error) {
|
|
246
|
-
// Reserve error.message in your UI.
|
|
247
|
-
external_sweetalert2_default().fire(result.error.message, "Please retry purchase.", "warning");
|
|
248
|
-
this.dispatch(changeStep(1));
|
|
249
|
-
this.dispatch(removeReservedTicket());
|
|
250
|
-
this.dispatch(stopWidgetLoading());
|
|
251
|
-
} else {
|
|
252
|
-
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
253
|
-
)(params)(this.dispatch).then(payload => {
|
|
254
|
-
this.dispatch(stopWidgetLoading());
|
|
255
|
-
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
256
|
-
this.dispatch(changeStep(3));
|
|
257
|
-
return payload;
|
|
258
|
-
}).catch(e => {
|
|
259
|
-
this.dispatch(stopWidgetLoading());
|
|
260
|
-
return e;
|
|
261
|
-
}); // The payment has succeeded. Display a success message.
|
|
262
|
-
}
|
|
263
|
-
}).catch(e => {
|
|
264
|
-
this.dispatch(removeReservedTicket());
|
|
265
|
-
this.dispatch(changeStep(1));
|
|
266
|
-
this.dispatch(stopWidgetLoading());
|
|
267
|
-
return e;
|
|
268
|
-
});
|
|
269
|
-
} else {
|
|
270
|
-
// FREE TICKET
|
|
271
|
-
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
272
|
-
)(params)(this.dispatch).then(payload => {
|
|
273
|
-
this.dispatch(stopWidgetLoading());
|
|
274
|
-
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
275
|
-
this.dispatch(changeStep(3));
|
|
276
|
-
return payload;
|
|
277
|
-
}).catch(e => {
|
|
278
|
-
this.dispatch(removeReservedTicket());
|
|
279
|
-
this.dispatch(changeStep(1));
|
|
280
|
-
this.dispatch(stopWidgetLoading());
|
|
281
|
-
return e;
|
|
282
|
-
}); // The payment has succeeded. Display a success message.
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
this.reservation = reservation;
|
|
287
|
-
this.summitId = summitId;
|
|
288
|
-
this.userProfile = userProfile;
|
|
289
|
-
this.access_token = access_token;
|
|
290
|
-
this.apiBaseUrl = apiBaseUrl;
|
|
291
|
-
this.dispatch = _dispatch;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
;// CONCATENATED MODULE: ./src/utils/payment-providers/payment-provider-factory.js
|
|
296
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
297
|
-
|
|
298
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { payment_provider_factory_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
299
|
-
|
|
300
|
-
function payment_provider_factory_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
class PaymentProviderFactory {}
|
|
305
|
-
|
|
306
|
-
payment_provider_factory_defineProperty(PaymentProviderFactory, "build", (provider, params = {}) => {
|
|
307
|
-
let currentProvider = null;
|
|
308
|
-
|
|
309
|
-
switch (provider) {
|
|
310
|
-
case 'LawPay':
|
|
311
|
-
{
|
|
312
|
-
currentProvider = new LawPayProvider(_objectSpread({}, params));
|
|
313
|
-
break;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
case 'Stripe':
|
|
317
|
-
{
|
|
318
|
-
currentProvider = new StripeProvider(_objectSpread({}, params));
|
|
319
|
-
break;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
return currentProvider;
|
|
324
|
-
});
|
|
325
|
-
;// CONCATENATED MODULE: ./src/actions.js
|
|
326
|
-
function actions_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
327
|
-
|
|
328
|
-
function actions_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? actions_ownKeys(Object(source), !0).forEach(function (key) { actions_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : actions_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
329
|
-
|
|
330
|
-
function actions_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Copyright 2020 OpenStack Foundation
|
|
334
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
335
|
-
* you may not use this file except in compliance with the License.
|
|
336
|
-
* You may obtain a copy of the License at
|
|
337
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
338
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
339
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
340
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
341
|
-
* See the License for the specific language governing permissions and
|
|
342
|
-
* limitations under the License.
|
|
343
|
-
**/
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
const START_WIDGET_LOADING = 'START_WIDGET_LOADING';
|
|
349
|
-
const STOP_WIDGET_LOADING = 'STOP_WIDGET_LOADING';
|
|
350
|
-
const LOAD_INITIAL_VARS = 'LOAD_INITIAL_VARS';
|
|
351
|
-
const CHANGE_STEP = 'CHANGE_STEP';
|
|
352
|
-
const GET_TICKET_TYPES = 'GET_TICKET_TYPES';
|
|
353
|
-
const GET_TAX_TYPES = 'GET_TAX_TYPES';
|
|
354
|
-
const CREATE_RESERVATION = 'CREATE_RESERVATION';
|
|
355
|
-
const CREATE_RESERVATION_SUCCESS = 'CREATE_RESERVATION_SUCCESS';
|
|
356
|
-
const CREATE_RESERVATION_ERROR = 'CREATE_RESERVATION_ERROR';
|
|
357
|
-
const DELETE_RESERVATION = 'DELETE_RESERVATION';
|
|
358
|
-
const DELETE_RESERVATION_SUCCESS = 'DELETE_RESERVATION_SUCCESS';
|
|
359
|
-
const DELETE_RESERVATION_ERROR = 'DELETE_RESERVATION_ERROR';
|
|
360
|
-
const PAY_RESERVATION = 'PAY_RESERVATION';
|
|
361
|
-
const CLEAR_RESERVATION = 'CLEAR_RESERVATION';
|
|
362
|
-
const SET_PASSWORDLESS_LOGIN = 'SET_PASSWORDLESS_LOGIN';
|
|
363
|
-
const SET_PASSWORDLESS_LENGTH = 'SET_PASSWORDLESS_LENGTH';
|
|
364
|
-
const SET_PASSWORDLESS_ERROR = 'SET_PASSWORDLESS_ERROR';
|
|
365
|
-
const GO_TO_LOGIN = 'GO_TO_LOGIN';
|
|
366
|
-
const startWidgetLoading = (0,actions_namespaceObject.createAction)(START_WIDGET_LOADING);
|
|
367
|
-
const stopWidgetLoading = (0,actions_namespaceObject.createAction)(STOP_WIDGET_LOADING);
|
|
368
|
-
const loadSession = settings => dispatch => {
|
|
369
|
-
dispatch((0,actions_namespaceObject.createAction)(LOAD_INITIAL_VARS)(settings));
|
|
370
|
-
};
|
|
371
|
-
/*********************************************************************************/
|
|
372
|
-
|
|
373
|
-
/* TICKETS */
|
|
374
|
-
|
|
375
|
-
/*********************************************************************************/
|
|
376
|
-
// api/v1/summits/{id}/ticket-types
|
|
377
|
-
// api/v1/summits/{id}/tax-types
|
|
378
|
-
|
|
379
|
-
const getTicketTypes = summitId => async (dispatch, getState, {
|
|
380
|
-
apiBaseUrl,
|
|
381
|
-
getAccessToken
|
|
382
|
-
}) => {
|
|
383
|
-
try {
|
|
384
|
-
const accessToken = await getAccessToken();
|
|
385
|
-
let params = {
|
|
386
|
-
expand: 'badge_type,badge_type.access_levels,badge_type.badge_features',
|
|
387
|
-
access_token: accessToken
|
|
388
|
-
};
|
|
389
|
-
dispatch(startWidgetLoading());
|
|
390
|
-
return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types`, actions_namespaceObject.authErrorHandler)(params)(dispatch).then(() => {
|
|
391
|
-
dispatch(stopWidgetLoading());
|
|
392
|
-
});
|
|
393
|
-
} catch (e) {
|
|
394
|
-
return Promise.reject();
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
const getTaxesTypes = summitId => async (dispatch, getState, {
|
|
398
|
-
apiBaseUrl,
|
|
399
|
-
getAccessToken
|
|
400
|
-
}) => {
|
|
401
|
-
try {
|
|
402
|
-
const accessToken = await getAccessToken();
|
|
403
|
-
let params = {
|
|
404
|
-
access_token: accessToken
|
|
405
|
-
};
|
|
406
|
-
dispatch(startWidgetLoading());
|
|
407
|
-
return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TAX_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/tax-types`, actions_namespaceObject.authErrorHandler)(params)(dispatch).then(() => {
|
|
408
|
-
dispatch(stopWidgetLoading());
|
|
409
|
-
});
|
|
410
|
-
} catch (e) {
|
|
411
|
-
return Promise.reject();
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
const reserveTicket = ({
|
|
415
|
-
provider,
|
|
416
|
-
personalInformation,
|
|
417
|
-
ticket,
|
|
418
|
-
ticketQuantity
|
|
419
|
-
}, {
|
|
420
|
-
onError
|
|
421
|
-
}) => async (dispatch, getState, {
|
|
422
|
-
apiBaseUrl,
|
|
423
|
-
getAccessToken
|
|
424
|
-
}) => {
|
|
425
|
-
const {
|
|
426
|
-
registrationLiteState: {
|
|
427
|
-
settings: {
|
|
428
|
-
summitId
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
} = getState();
|
|
432
|
-
let {
|
|
433
|
-
firstName,
|
|
434
|
-
lastName,
|
|
435
|
-
email,
|
|
436
|
-
company,
|
|
437
|
-
promoCode
|
|
438
|
-
} = personalInformation;
|
|
439
|
-
dispatch(startWidgetLoading());
|
|
440
|
-
const access_token = await getAccessToken();
|
|
441
|
-
const tickets = [...Array(ticketQuantity)].map(() => ({
|
|
442
|
-
type_id: ticket.id,
|
|
443
|
-
promo_code: promoCode || null
|
|
444
|
-
})); // Only set the attendee for the first ticket.
|
|
445
|
-
|
|
446
|
-
tickets[0].attendee_first_name = firstName;
|
|
447
|
-
tickets[0].attendee_last_name = lastName;
|
|
448
|
-
tickets[0].attendee_email = email;
|
|
449
|
-
let params = {
|
|
450
|
-
access_token,
|
|
451
|
-
expand: 'tickets,tickets.owner,tickets.ticket_type,tickets.ticket_type.taxes'
|
|
452
|
-
};
|
|
453
|
-
const normalizedEntity = normalizeReservation({
|
|
454
|
-
owner_email: email,
|
|
455
|
-
owner_first_name: firstName,
|
|
456
|
-
owner_last_name: lastName,
|
|
457
|
-
owner_company: company,
|
|
458
|
-
tickets
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
const errorHandler = (err, res) => (dispatch, state) => {
|
|
462
|
-
if (res && res.statusCode === 412 && onError) return onError(err, res);
|
|
463
|
-
|
|
464
|
-
if (res && res.statusCode === 404) {
|
|
465
|
-
const msg = res.body.message;
|
|
466
|
-
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
if (res && res.statusCode === 500) {
|
|
471
|
-
const msg = res.body.message;
|
|
472
|
-
external_sweetalert2_default().fire("Server Error", msg, "error");
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
return (0,actions_namespaceObject.postRequest)((0,actions_namespaceObject.createAction)(CREATE_RESERVATION), (0,actions_namespaceObject.createAction)(CREATE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/reserve`, normalizedEntity, errorHandler // entity
|
|
480
|
-
)(params)(dispatch).then(payload => {
|
|
481
|
-
dispatch(stopWidgetLoading());
|
|
482
|
-
payload.response.promo_code = promoCode || null;
|
|
483
|
-
|
|
484
|
-
if (!payload.response.amount) {
|
|
485
|
-
dispatch(payTicketWithProvider(provider));
|
|
486
|
-
return payload;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
dispatch(changeStep(2));
|
|
490
|
-
return payload;
|
|
491
|
-
}).catch(e => {
|
|
492
|
-
dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
|
|
493
|
-
dispatch(stopWidgetLoading());
|
|
494
|
-
return e;
|
|
495
|
-
});
|
|
496
|
-
};
|
|
497
|
-
const removeReservedTicket = () => async (dispatch, getState, {
|
|
498
|
-
apiBaseUrl,
|
|
499
|
-
getAccessToken
|
|
500
|
-
}) => {
|
|
501
|
-
let {
|
|
502
|
-
registrationLiteState: {
|
|
503
|
-
settings: {
|
|
504
|
-
summitId
|
|
505
|
-
},
|
|
506
|
-
reservation: {
|
|
507
|
-
hash
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
} = getState();
|
|
511
|
-
const access_token = await getAccessToken();
|
|
512
|
-
let params = {
|
|
513
|
-
access_token,
|
|
514
|
-
expand: 'tickets,tickets.owner'
|
|
515
|
-
};
|
|
516
|
-
dispatch(startWidgetLoading());
|
|
517
|
-
return (0,actions_namespaceObject.deleteRequest)((0,actions_namespaceObject.createAction)(DELETE_RESERVATION), (0,actions_namespaceObject.createAction)(DELETE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/${hash}`, {}, actions_namespaceObject.authErrorHandler // entity
|
|
518
|
-
)(params)(dispatch).then(payload => {
|
|
519
|
-
dispatch(stopWidgetLoading());
|
|
520
|
-
dispatch(changeStep(1));
|
|
521
|
-
return payload;
|
|
522
|
-
}).catch(e => {
|
|
523
|
-
dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
|
|
524
|
-
dispatch(changeStep(1));
|
|
525
|
-
dispatch(stopWidgetLoading());
|
|
526
|
-
return e;
|
|
527
|
-
});
|
|
528
|
-
};
|
|
529
|
-
const payTicketWithProvider = (provider, params = {}) => async (dispatch, getState, {
|
|
530
|
-
apiBaseUrl,
|
|
531
|
-
getAccessToken
|
|
532
|
-
}) => {
|
|
533
|
-
let {
|
|
534
|
-
registrationLiteState: {
|
|
535
|
-
settings: {
|
|
536
|
-
summitId,
|
|
537
|
-
userProfile
|
|
538
|
-
},
|
|
539
|
-
reservation
|
|
540
|
-
}
|
|
541
|
-
} = getState();
|
|
542
|
-
const access_token = await getAccessToken();
|
|
543
|
-
dispatch(startWidgetLoading());
|
|
544
|
-
const currentProvider = PaymentProviderFactory.build(provider, {
|
|
545
|
-
reservation,
|
|
546
|
-
summitId,
|
|
547
|
-
userProfile,
|
|
548
|
-
access_token,
|
|
549
|
-
apiBaseUrl,
|
|
550
|
-
dispatch
|
|
551
|
-
});
|
|
552
|
-
return dispatch(currentProvider.payTicket(actions_objectSpread({}, params)));
|
|
553
|
-
};
|
|
554
|
-
const changeStep = step => (dispatch, getState) => {
|
|
555
|
-
dispatch(startWidgetLoading());
|
|
556
|
-
dispatch((0,actions_namespaceObject.createAction)(CHANGE_STEP)(step));
|
|
557
|
-
dispatch(stopWidgetLoading());
|
|
558
|
-
};
|
|
559
|
-
const goToLogin = () => (dispatch, getState) => {
|
|
560
|
-
dispatch((0,actions_namespaceObject.createAction)(GO_TO_LOGIN)());
|
|
561
|
-
};
|
|
562
|
-
const getLoginCode = (email, getPasswordlessCode) => async (dispatch, getState) => {
|
|
563
|
-
dispatch((0,actions_namespaceObject.createAction)(SET_PASSWORDLESS_LOGIN)(email));
|
|
564
|
-
return new Promise((resolve, reject) => {
|
|
565
|
-
getPasswordlessCode(email).then(res => {
|
|
566
|
-
dispatch((0,actions_namespaceObject.createAction)(SET_PASSWORDLESS_LENGTH)(res.response));
|
|
567
|
-
resolve(res);
|
|
568
|
-
}, err => {
|
|
569
|
-
reject(err);
|
|
570
|
-
});
|
|
571
|
-
});
|
|
572
|
-
};
|
|
573
|
-
const passwordlessLogin = (code, loginWithCode) => async (dispatch, getState) => {
|
|
574
|
-
const {
|
|
575
|
-
registrationLiteState: {
|
|
576
|
-
passwordless: {
|
|
577
|
-
email
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
} = getState();
|
|
581
|
-
return new Promise((resolve, reject) => {
|
|
582
|
-
loginWithCode(code, email).then(res => {
|
|
583
|
-
if (res) {
|
|
584
|
-
dispatch((0,actions_namespaceObject.createAction)(SET_PASSWORDLESS_ERROR)());
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
resolve(res);
|
|
588
|
-
}, err => {
|
|
589
|
-
reject(err);
|
|
590
|
-
});
|
|
591
|
-
});
|
|
592
|
-
};
|
|
593
|
-
const isInPersonTicketType = ticketType => {
|
|
594
|
-
/** check is the current order has or not IN_PERSON tickets types **/
|
|
595
|
-
if (ticketType.hasOwnProperty("badge_type")) {
|
|
596
|
-
let badgeType = ticketType.badge_type;
|
|
597
|
-
return badgeType.access_levels.some(al => {
|
|
598
|
-
return al.name == 'IN_PERSON';
|
|
599
|
-
});
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
return false;
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
const normalizeReservation = entity => {
|
|
606
|
-
const normalizedEntity = actions_objectSpread({}, entity);
|
|
607
|
-
|
|
608
|
-
if (!entity.owner_company.id) {
|
|
609
|
-
normalizedEntity['owner_company'] = entity.owner_company.name;
|
|
610
|
-
} else {
|
|
611
|
-
delete normalizedEntity['owner_company'];
|
|
612
|
-
normalizedEntity['owner_company_id'] = entity.owner_company.id;
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
return normalizedEntity;
|
|
616
|
-
};
|
|
617
|
-
;// CONCATENATED MODULE: ./src/reducer.js
|
|
618
|
-
function reducer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
619
|
-
|
|
620
|
-
function reducer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? reducer_ownKeys(Object(source), !0).forEach(function (key) { reducer_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : reducer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
621
|
-
|
|
622
|
-
function reducer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* Copyright 2020 OpenStack Foundation
|
|
626
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
627
|
-
* you may not use this file except in compliance with the License.
|
|
628
|
-
* You may obtain a copy of the License at
|
|
629
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
630
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
631
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
632
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
633
|
-
* See the License for the specific language governing permissions and
|
|
634
|
-
* limitations under the License.
|
|
635
|
-
**/
|
|
636
|
-
|
|
637
|
-
const DEFAULT_STATE = {
|
|
638
|
-
reservation: null,
|
|
639
|
-
checkout: null,
|
|
640
|
-
step: 0,
|
|
641
|
-
widgetLoading: false,
|
|
642
|
-
passwordless: {
|
|
643
|
-
email: null,
|
|
644
|
-
otp_length: 0,
|
|
645
|
-
code_sent: false,
|
|
646
|
-
error: false
|
|
647
|
-
},
|
|
648
|
-
ticketTypes: [],
|
|
649
|
-
taxTypes: [],
|
|
650
|
-
settings: {
|
|
651
|
-
apiBaseUrl: null,
|
|
652
|
-
summitId: null,
|
|
653
|
-
marketingData: null,
|
|
654
|
-
userProfile: null
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
659
|
-
const {
|
|
660
|
-
type,
|
|
661
|
-
payload
|
|
662
|
-
} = action;
|
|
663
|
-
|
|
664
|
-
switch (type) {
|
|
665
|
-
case START_WIDGET_LOADING:
|
|
666
|
-
{
|
|
667
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
668
|
-
widgetLoading: true
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
case STOP_WIDGET_LOADING:
|
|
673
|
-
{
|
|
674
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
675
|
-
widgetLoading: false
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
case LOAD_INITIAL_VARS:
|
|
680
|
-
const {
|
|
681
|
-
marketingData,
|
|
682
|
-
summitData,
|
|
683
|
-
apiBaseUrl,
|
|
684
|
-
profileData
|
|
685
|
-
} = payload;
|
|
686
|
-
Object.keys(marketingData).forEach(setting => {
|
|
687
|
-
if (getComputedStyle(document.documentElement).getPropertyValue(`--${setting}`)) {
|
|
688
|
-
document.documentElement.style.setProperty(`--${setting}`, marketingData[setting]);
|
|
689
|
-
document.documentElement.style.setProperty(`--${setting}50`, `${marketingData[setting]}50`);
|
|
690
|
-
}
|
|
691
|
-
});
|
|
692
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
693
|
-
reservation: null,
|
|
694
|
-
checkout: null,
|
|
695
|
-
passwordless: reducer_objectSpread({}, DEFAULT_STATE.passwordless),
|
|
696
|
-
settings: reducer_objectSpread(reducer_objectSpread({}, DEFAULT_STATE.settings), {}, {
|
|
697
|
-
marketingData: marketingData,
|
|
698
|
-
summitId: summitData.id,
|
|
699
|
-
userProfile: profileData,
|
|
700
|
-
apiBaseUrl: apiBaseUrl
|
|
701
|
-
})
|
|
702
|
-
});
|
|
703
|
-
|
|
704
|
-
case CHANGE_STEP:
|
|
705
|
-
{
|
|
706
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
707
|
-
step: payload
|
|
708
|
-
});
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
case GET_TICKET_TYPES:
|
|
712
|
-
{
|
|
713
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
714
|
-
ticketTypes: payload.response.data
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
case GET_TAX_TYPES:
|
|
719
|
-
{
|
|
720
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
721
|
-
taxTypes: payload.response.data
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
case GO_TO_LOGIN:
|
|
726
|
-
{
|
|
727
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
728
|
-
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
729
|
-
code_sent: false,
|
|
730
|
-
error: false
|
|
731
|
-
})
|
|
732
|
-
});
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
case SET_PASSWORDLESS_LOGIN:
|
|
736
|
-
{
|
|
737
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
738
|
-
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
739
|
-
email: payload,
|
|
740
|
-
error: false
|
|
741
|
-
})
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
case SET_PASSWORDLESS_LENGTH:
|
|
746
|
-
{
|
|
747
|
-
const {
|
|
748
|
-
otp_length
|
|
749
|
-
} = payload;
|
|
750
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
751
|
-
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
752
|
-
otp_length,
|
|
753
|
-
code_sent: true,
|
|
754
|
-
error: false
|
|
755
|
-
})
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
case SET_PASSWORDLESS_ERROR:
|
|
760
|
-
{
|
|
761
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
762
|
-
passwordless: reducer_objectSpread(reducer_objectSpread({}, state.passwordless), {}, {
|
|
763
|
-
error: true
|
|
764
|
-
})
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
case CREATE_RESERVATION_SUCCESS:
|
|
769
|
-
{
|
|
770
|
-
const reservation = payload.response;
|
|
771
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
772
|
-
reservation
|
|
773
|
-
});
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
case DELETE_RESERVATION_SUCCESS:
|
|
777
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
778
|
-
reservation: null
|
|
779
|
-
});
|
|
780
|
-
|
|
781
|
-
case CLEAR_RESERVATION:
|
|
782
|
-
{
|
|
783
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
784
|
-
reservation: null
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
case PAY_RESERVATION:
|
|
789
|
-
{
|
|
790
|
-
return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
|
|
791
|
-
checkout: payload.response,
|
|
792
|
-
reservation: null,
|
|
793
|
-
userProfile: null
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
default:
|
|
798
|
-
{
|
|
799
|
-
return state;
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
|
|
804
|
-
/* harmony default export */ const reducer = (RegistrationLiteReducer);
|
|
805
|
-
;// CONCATENATED MODULE: ./src/store.js
|
|
806
|
-
/**
|
|
807
|
-
* Copyright 2019
|
|
808
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
809
|
-
* you may not use this file except in compliance with the License.
|
|
810
|
-
* You may obtain a copy of the License at
|
|
811
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
812
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
813
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
814
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
815
|
-
* See the License for the specific language governing permissions and
|
|
816
|
-
* limitations under the License.
|
|
817
|
-
**/
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
// default: localStorage if web, AsyncStorage if react-native
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
let store, persistor;
|
|
825
|
-
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || external_redux_namespaceObject.compose;
|
|
826
|
-
const getStore = (clientId, apiBaseUrl, getAccessToken) => {
|
|
827
|
-
if (store) return store;
|
|
828
|
-
const config = {
|
|
829
|
-
key: `root_registration_lite_${clientId}`,
|
|
830
|
-
storage: (storage_default()),
|
|
831
|
-
blacklist: ['ticketTypes', 'taxTypes'] // do not persist these keys
|
|
832
|
-
|
|
833
|
-
};
|
|
834
|
-
const reducers = (0,external_redux_persist_namespaceObject.persistCombineReducers)(config, {
|
|
835
|
-
registrationLiteState: reducer
|
|
836
|
-
});
|
|
837
|
-
store = (0,external_redux_namespaceObject.createStore)(reducers, composeEnhancers((0,external_redux_namespaceObject.applyMiddleware)(external_redux_thunk_default().withExtraArgument({
|
|
838
|
-
apiBaseUrl: apiBaseUrl,
|
|
839
|
-
getAccessToken: getAccessToken
|
|
840
|
-
}))));
|
|
841
|
-
return store;
|
|
842
|
-
};
|
|
843
|
-
const getPersistor = () => {
|
|
844
|
-
if (persistor) return persistor;
|
|
845
|
-
|
|
846
|
-
const onRehydrateComplete = () => {};
|
|
847
|
-
|
|
848
|
-
persistor = (0,external_redux_persist_namespaceObject.persistStore)(store, null, onRehydrateComplete);
|
|
849
|
-
return persistor;
|
|
850
|
-
};
|
|
851
|
-
;// CONCATENATED MODULE: external "redux-persist/integration/react"
|
|
852
|
-
const react_namespaceObject = require("redux-persist/integration/react");
|
|
853
|
-
;// CONCATENATED MODULE: external "react-spring"
|
|
854
|
-
const external_react_spring_namespaceObject = require("react-spring");
|
|
855
|
-
;// CONCATENATED MODULE: external "react-use"
|
|
856
|
-
const external_react_use_namespaceObject = require("react-use");
|
|
857
|
-
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/ajaxloader"
|
|
858
|
-
const ajaxloader_namespaceObject = require("openstack-uicore-foundation/lib/components/ajaxloader");
|
|
859
|
-
var ajaxloader_default = /*#__PURE__*/__webpack_require__.n(ajaxloader_namespaceObject);
|
|
860
|
-
;// CONCATENATED MODULE: ./src/styles/general.module.scss
|
|
861
|
-
// extracted by mini-css-extract-plugin
|
|
862
|
-
/* harmony default export */ const general_module = ({"modal":"modal___G3Cmq","modalContent":"modalContent___lIaqw","outerWrapper":"outerWrapper___OWXyi","innerWrapper":"innerWrapper___mIrBF","title":"title___Tbvkl"});
|
|
863
|
-
;// CONCATENATED MODULE: ./src/components/login/index.module.scss
|
|
864
|
-
// extracted by mini-css-extract-plugin
|
|
865
|
-
/* harmony default export */ const index_module = ({"loginWrapper":"loginWrapper___sxUEn","innerWrapper":"innerWrapper___GQRkq","button":"button___QMZPu","loginCode":"loginCode___dDBup","input":"input___QR9sA"});
|
|
866
|
-
;// CONCATENATED MODULE: ./src/components/login/index.js
|
|
867
|
-
/**
|
|
868
|
-
* Copyright 2020 OpenStack Foundation
|
|
869
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
870
|
-
* you may not use this file except in compliance with the License.
|
|
871
|
-
* You may obtain a copy of the License at
|
|
872
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
873
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
874
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
875
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
876
|
-
* See the License for the specific language governing permissions and
|
|
877
|
-
* limitations under the License.
|
|
878
|
-
**/
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
const LoginComponent = ({
|
|
883
|
-
options,
|
|
884
|
-
login,
|
|
885
|
-
allowsNativeAuth,
|
|
886
|
-
allowsOtpAuthlogin,
|
|
887
|
-
getLoginCode,
|
|
888
|
-
getPasswordlessCode
|
|
889
|
-
}) => {
|
|
890
|
-
const [email, setEmail] = (0,external_react_namespaceObject.useState)('');
|
|
891
|
-
const [emailError, setEmailError] = (0,external_react_namespaceObject.useState)();
|
|
892
|
-
|
|
893
|
-
const isValidEmail = email => {
|
|
894
|
-
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
895
|
-
return re.test(String(email).toLowerCase());
|
|
896
|
-
};
|
|
897
|
-
|
|
898
|
-
const loginCode = () => {
|
|
899
|
-
let isValid = isValidEmail(email);
|
|
900
|
-
setEmailError(!isValid);
|
|
901
|
-
|
|
902
|
-
if (isValid) {
|
|
903
|
-
getLoginCode(email, getPasswordlessCode);
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
|
|
907
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
908
|
-
className: `${index_module.loginWrapper} step-wrapper`
|
|
909
|
-
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
910
|
-
className: `${index_module.innerWrapper}`
|
|
911
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
912
|
-
className: index_module.loginCode
|
|
913
|
-
}, "Enter your email to begin registration:", /*#__PURE__*/external_react_default().createElement("div", {
|
|
914
|
-
className: index_module.input
|
|
915
|
-
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
916
|
-
placeholder: "youremail@example.com",
|
|
917
|
-
value: email,
|
|
918
|
-
onChange: e => setEmail(e.target.value),
|
|
919
|
-
onKeyPress: ev => ev.key === 'Enter' ? loginCode() : null,
|
|
920
|
-
"data-testid": "email-input"
|
|
921
|
-
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
922
|
-
onClick: () => loginCode(),
|
|
923
|
-
"data-testid": "email-button"
|
|
924
|
-
}, ">"), /*#__PURE__*/external_react_default().createElement("br", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
925
|
-
"data-testid": "email-error"
|
|
926
|
-
}, "Please enter a valid email address")), /*#__PURE__*/external_react_default().createElement("span", null, "Or you may login with one of the following:"), options.map((o, index) => {
|
|
927
|
-
return o.provider_param ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
928
|
-
className: `${index_module.button}`,
|
|
929
|
-
key: `provider-${o.provider_param}`,
|
|
930
|
-
"data-testid": "login-button",
|
|
931
|
-
style: {
|
|
932
|
-
color: o.button_border_color ? o.button_border_color : '#ffffff',
|
|
933
|
-
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
934
|
-
backgroundColor: o.button_color,
|
|
935
|
-
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
936
|
-
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
937
|
-
},
|
|
938
|
-
onClick: () => login(o.provider_param)
|
|
939
|
-
}, o.provider_label) : allowsNativeAuth ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
940
|
-
className: `${index_module.button}`,
|
|
941
|
-
key: `provider-fnid`,
|
|
942
|
-
"data-testid": "login-button",
|
|
943
|
-
style: {
|
|
944
|
-
color: o.button_border_color ? o.button_border_color : '#ffffff',
|
|
945
|
-
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
946
|
-
backgroundColor: o.button_color,
|
|
947
|
-
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
948
|
-
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
949
|
-
},
|
|
950
|
-
onClick: () => login(o.provider_param)
|
|
951
|
-
}, o.provider_label) : null;
|
|
952
|
-
}), allowsOtpAuthlogin && /*#__PURE__*/external_react_default().createElement("div", {
|
|
953
|
-
className: index_module.loginCode
|
|
954
|
-
}, "or get a login code emailed to you", /*#__PURE__*/external_react_default().createElement("div", {
|
|
955
|
-
className: index_module.input
|
|
956
|
-
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
957
|
-
placeholder: "youremail@example.com",
|
|
958
|
-
value: email,
|
|
959
|
-
onChange: e => setEmail(e.target.value),
|
|
960
|
-
onKeyPress: ev => ev.key === 'Enter' ? loginCode() : null,
|
|
961
|
-
"data-testid": "email-input"
|
|
962
|
-
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
963
|
-
onClick: () => loginCode(),
|
|
964
|
-
"data-testid": "email-button"
|
|
965
|
-
}, ">"), /*#__PURE__*/external_react_default().createElement("br", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
966
|
-
"data-testid": "email-error"
|
|
967
|
-
}, "Please enter a valid email adress")))));
|
|
968
|
-
};
|
|
969
|
-
|
|
970
|
-
/* harmony default export */ const login = (LoginComponent);
|
|
971
|
-
;// CONCATENATED MODULE: external "prop-types"
|
|
972
|
-
const external_prop_types_namespaceObject = require("prop-types");
|
|
973
|
-
;// CONCATENATED MODULE: ./src/components/payment/index.module.scss
|
|
974
|
-
// extracted by mini-css-extract-plugin
|
|
975
|
-
/* harmony default export */ const payment_index_module = ({"title":"title___LksVm","form":"form___v5GIx","fieldWrapper":"fieldWrapper___Eoe61"});
|
|
976
|
-
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components"
|
|
977
|
-
const components_namespaceObject = require("openstack-uicore-foundation/lib/components");
|
|
978
|
-
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/utils/methods"
|
|
979
|
-
const methods_namespaceObject = require("openstack-uicore-foundation/lib/utils/methods");
|
|
980
|
-
;// CONCATENATED MODULE: ./src/components/lawpay-form/index.module.scss
|
|
981
|
-
// extracted by mini-css-extract-plugin
|
|
982
|
-
/* harmony default export */ const lawpay_form_index_module = ({"form":"form___zXb7s","fieldWrapper":"fieldWrapper___G4Wqw","inputWrapper":"inputWrapper___Yz5zB","fieldRow":"fieldRow___NfZdJ","addressField":"addressField___vmAQh","lawpayWrapper":"lawpayWrapper___hpUBf","dateWrapper":"dateWrapper___XDfqs","dropdown":"dropdown___l3_bk","fieldError":"fieldError___Igq3U"});
|
|
983
|
-
;// CONCATENATED MODULE: ./src/components/lawpay-form/index.js
|
|
984
|
-
function lawpay_form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
985
|
-
|
|
986
|
-
function lawpay_form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? lawpay_form_ownKeys(Object(source), !0).forEach(function (key) { lawpay_form_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : lawpay_form_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
987
|
-
|
|
988
|
-
function lawpay_form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
989
|
-
|
|
990
|
-
/**
|
|
991
|
-
* Copyright 2022 OpenStack Foundation
|
|
992
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
993
|
-
* you may not use this file except in compliance with the License.
|
|
994
|
-
* You may obtain a copy of the License at
|
|
995
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
996
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
997
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
998
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
999
|
-
* See the License for the specific language governing permissions and
|
|
1000
|
-
* limitations under the License.
|
|
1001
|
-
**/
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
const LawPayForm = ({
|
|
1010
|
-
reservation,
|
|
1011
|
-
payTicket,
|
|
1012
|
-
userProfile,
|
|
1013
|
-
marketingData,
|
|
1014
|
-
providerKey,
|
|
1015
|
-
provider,
|
|
1016
|
-
timestamp
|
|
1017
|
-
}) => {
|
|
1018
|
-
const [hostedFields, setHostedFields] = (0,external_react_namespaceObject.useState)(null);
|
|
1019
|
-
const [lawPayFields, setLawPayFields] = (0,external_react_namespaceObject.useState)({
|
|
1020
|
-
exp_month: '',
|
|
1021
|
-
exp_year: '',
|
|
1022
|
-
postal_code: userProfile.postal_code || '',
|
|
1023
|
-
address1: userProfile.address1 || ''
|
|
1024
|
-
});
|
|
1025
|
-
const [lawPayErrors, setLawPayErrors] = (0,external_react_namespaceObject.useState)({
|
|
1026
|
-
exp_month: '',
|
|
1027
|
-
exp_year: '',
|
|
1028
|
-
postal_code: '',
|
|
1029
|
-
credit_card_number: '',
|
|
1030
|
-
cvv: '',
|
|
1031
|
-
address1: ''
|
|
1032
|
-
});
|
|
1033
|
-
const style = {
|
|
1034
|
-
color: marketingData.color_text_dark,
|
|
1035
|
-
"font-size": '16px',
|
|
1036
|
-
"font-weight": 'inherit',
|
|
1037
|
-
'::placeholder': {
|
|
1038
|
-
color: marketingData.color_text_input_hints
|
|
1039
|
-
}
|
|
1040
|
-
};
|
|
1041
|
-
const hostedFieldsConfiguration = {
|
|
1042
|
-
publicKey: `${providerKey}`,
|
|
1043
|
-
fields: [{
|
|
1044
|
-
selector: "#my_credit_card_field_id",
|
|
1045
|
-
input: {
|
|
1046
|
-
type: "credit_card_number",
|
|
1047
|
-
placeholder: "Credit Card Number",
|
|
1048
|
-
css: style
|
|
1049
|
-
}
|
|
1050
|
-
}, {
|
|
1051
|
-
selector: "#my_cvv_field_id",
|
|
1052
|
-
input: {
|
|
1053
|
-
type: "cvv",
|
|
1054
|
-
placeholder: "CCV",
|
|
1055
|
-
css: style
|
|
1056
|
-
}
|
|
1057
|
-
}]
|
|
1058
|
-
};
|
|
1059
|
-
|
|
1060
|
-
const hostedFieldsCallBack = state => {
|
|
1061
|
-
let fieldErrors = {};
|
|
1062
|
-
state.fields.map(f => {
|
|
1063
|
-
if (f.focus && f.error !== 'Input field is empty') fieldErrors = lawpay_form_objectSpread(lawpay_form_objectSpread({}, fieldErrors), {}, {
|
|
1064
|
-
[f.type]: f.error
|
|
1065
|
-
});
|
|
1066
|
-
});
|
|
1067
|
-
setLawPayErrors(lawpay_form_objectSpread(lawpay_form_objectSpread({}, lawPayErrors), fieldErrors));
|
|
1068
|
-
};
|
|
1069
|
-
|
|
1070
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
1071
|
-
if (window.AffiniPay && !hostedFields) {
|
|
1072
|
-
setHostedFields(window.AffiniPay.HostedFields.initializeFields(hostedFieldsConfiguration, hostedFieldsCallBack));
|
|
1073
|
-
}
|
|
1074
|
-
}, [reservation]);
|
|
1075
|
-
|
|
1076
|
-
const onExpireChange = ev => {
|
|
1077
|
-
setLawPayFields(lawpay_form_objectSpread(lawpay_form_objectSpread({}, lawPayFields), {}, {
|
|
1078
|
-
[ev.target.id]: ev.target.value
|
|
1079
|
-
}));
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
|
-
const formHasErrors = () => {
|
|
1083
|
-
let errors = {};
|
|
1084
|
-
Object.keys(lawPayFields).map(key => {
|
|
1085
|
-
if (!lawPayFields[key] || lawPayFields[key] === '') {
|
|
1086
|
-
errors = lawpay_form_objectSpread(lawpay_form_objectSpread({}, errors), {}, {
|
|
1087
|
-
[key]: 'This field is required.'
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
setLawPayErrors(lawpay_form_objectSpread(lawpay_form_objectSpread({}, lawPayErrors), errors));
|
|
1092
|
-
return Object.keys(errors).length > 0;
|
|
1093
|
-
};
|
|
1094
|
-
|
|
1095
|
-
const onSubmit = async event => {
|
|
1096
|
-
event.preventDefault();
|
|
1097
|
-
|
|
1098
|
-
if (!hostedFields) {
|
|
1099
|
-
// Affinity Pay has not loaded yet. Make sure to disable
|
|
1100
|
-
// form submission until Affinity Pay has loaded.
|
|
1101
|
-
return;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
if (!formHasErrors()) {
|
|
1105
|
-
try {
|
|
1106
|
-
const token = await hostedFields.getPaymentToken({
|
|
1107
|
-
"postal_code": lawPayFields.postal_code,
|
|
1108
|
-
"address1": lawPayFields.address1,
|
|
1109
|
-
"exp_year": lawPayFields.exp_year,
|
|
1110
|
-
"exp_month": lawPayFields.exp_month,
|
|
1111
|
-
"email": userProfile.email,
|
|
1112
|
-
"name": `${reservation.owner_first_name} ${reservation.owner_last_name}`,
|
|
1113
|
-
"reference": `summit_${reservation.summit_id}_order_${reservation.id}`
|
|
1114
|
-
});
|
|
1115
|
-
payTicket(provider, {
|
|
1116
|
-
token
|
|
1117
|
-
});
|
|
1118
|
-
} catch (error) {
|
|
1119
|
-
external_sweetalert2_default().fire("Payment error", error.message, "warning");
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
};
|
|
1123
|
-
|
|
1124
|
-
const ddl_month = [{
|
|
1125
|
-
label: '1 - January',
|
|
1126
|
-
value: '01'
|
|
1127
|
-
}, {
|
|
1128
|
-
label: '2 - February',
|
|
1129
|
-
value: '02'
|
|
1130
|
-
}, {
|
|
1131
|
-
label: '3 - March',
|
|
1132
|
-
value: '03'
|
|
1133
|
-
}, {
|
|
1134
|
-
label: '4 - April',
|
|
1135
|
-
value: '04'
|
|
1136
|
-
}, {
|
|
1137
|
-
label: '5 - May',
|
|
1138
|
-
value: '05'
|
|
1139
|
-
}, {
|
|
1140
|
-
label: '6 - June',
|
|
1141
|
-
value: '06'
|
|
1142
|
-
}, {
|
|
1143
|
-
label: '7 - July',
|
|
1144
|
-
value: '07'
|
|
1145
|
-
}, {
|
|
1146
|
-
label: '8 - August',
|
|
1147
|
-
value: '08'
|
|
1148
|
-
}, {
|
|
1149
|
-
label: '9 - September',
|
|
1150
|
-
value: '09'
|
|
1151
|
-
}, {
|
|
1152
|
-
label: '10 - October',
|
|
1153
|
-
value: '10'
|
|
1154
|
-
}, {
|
|
1155
|
-
label: '11 - November',
|
|
1156
|
-
value: '11'
|
|
1157
|
-
}, {
|
|
1158
|
-
label: '12 - December',
|
|
1159
|
-
value: '12'
|
|
1160
|
-
}];
|
|
1161
|
-
const current_year = (0,methods_namespaceObject.epochToMomentTimeZone)(timestamp, 'utc').year();
|
|
1162
|
-
const year_ddl = Array.from({
|
|
1163
|
-
length: 15
|
|
1164
|
-
}, (_, i) => {
|
|
1165
|
-
return {
|
|
1166
|
-
label: `${current_year + i}`,
|
|
1167
|
-
value: `${current_year + i}`
|
|
1168
|
-
};
|
|
1169
|
-
});
|
|
1170
|
-
const customStyles = {
|
|
1171
|
-
option: (provided, {
|
|
1172
|
-
isFocused,
|
|
1173
|
-
isSelected
|
|
1174
|
-
}) => {
|
|
1175
|
-
return lawpay_form_objectSpread(lawpay_form_objectSpread({}, provided), {}, {
|
|
1176
|
-
backgroundColor: isFocused ? 'var(--color-primary)' : isSelected ? 'var(--color-primary)' : undefined,
|
|
1177
|
-
color: 'var(--color_text_dark)',
|
|
1178
|
-
':active': lawpay_form_objectSpread(lawpay_form_objectSpread({}, provided[':active']), {}, {
|
|
1179
|
-
backgroundColor: isSelected ? 'var(--color-primary)' : undefined
|
|
1180
|
-
})
|
|
1181
|
-
});
|
|
1182
|
-
},
|
|
1183
|
-
placeholder: (provided, state) => lawpay_form_objectSpread(lawpay_form_objectSpread({}, provided), {}, {
|
|
1184
|
-
color: 'var(--color_text_input_hints)'
|
|
1185
|
-
}),
|
|
1186
|
-
menu: (provided, state) => lawpay_form_objectSpread(lawpay_form_objectSpread({}, provided), {}, {
|
|
1187
|
-
color: 'var(--color_text_dark)',
|
|
1188
|
-
zIndex: '100'
|
|
1189
|
-
}),
|
|
1190
|
-
menuList: provided => lawpay_form_objectSpread(lawpay_form_objectSpread({}, provided), {}, {
|
|
1191
|
-
maxHeight: 160
|
|
1192
|
-
}),
|
|
1193
|
-
singleValue: (provided, state) => {
|
|
1194
|
-
const opacity = state.isDisabled ? 0.5 : 1;
|
|
1195
|
-
const transition = 'opacity 300ms';
|
|
1196
|
-
const color = 'var(--color_text_dark)';
|
|
1197
|
-
return lawpay_form_objectSpread(lawpay_form_objectSpread({}, provided), {}, {
|
|
1198
|
-
opacity,
|
|
1199
|
-
transition,
|
|
1200
|
-
color
|
|
1201
|
-
});
|
|
1202
|
-
}
|
|
1203
|
-
};
|
|
1204
|
-
return /*#__PURE__*/external_react_default().createElement("form", {
|
|
1205
|
-
className: lawpay_form_index_module.form,
|
|
1206
|
-
id: "payment-form",
|
|
1207
|
-
onSubmit: onSubmit
|
|
1208
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1209
|
-
className: lawpay_form_index_module.fieldWrapper
|
|
1210
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1211
|
-
className: lawpay_form_index_module.inputWrapper
|
|
1212
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1213
|
-
id: "my_credit_card_field_id",
|
|
1214
|
-
className: lawpay_form_index_module.lawpayWrapper
|
|
1215
|
-
}), /*#__PURE__*/external_react_default().createElement("i", {
|
|
1216
|
-
className: "fa fa-credit-card"
|
|
1217
|
-
})), lawPayErrors.credit_card_number && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1218
|
-
className: lawpay_form_index_module.fieldError
|
|
1219
|
-
}, lawPayErrors.credit_card_number)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1220
|
-
className: lawpay_form_index_module.fieldWrapper
|
|
1221
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1222
|
-
className: lawpay_form_index_module.dateWrapper
|
|
1223
|
-
}, /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement(components_namespaceObject.Dropdown, {
|
|
1224
|
-
styles: customStyles,
|
|
1225
|
-
className: lawpay_form_index_module.dropdown,
|
|
1226
|
-
placeholder: "Month",
|
|
1227
|
-
onChange: onExpireChange,
|
|
1228
|
-
id: "exp_month",
|
|
1229
|
-
options: ddl_month
|
|
1230
|
-
}), lawPayErrors.exp_month && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1231
|
-
className: lawpay_form_index_module.fieldError
|
|
1232
|
-
}, lawPayErrors.exp_month)), /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement(components_namespaceObject.Dropdown, {
|
|
1233
|
-
styles: customStyles,
|
|
1234
|
-
className: lawpay_form_index_module.dropdown,
|
|
1235
|
-
placeholder: "Year",
|
|
1236
|
-
onChange: onExpireChange,
|
|
1237
|
-
id: "exp_year",
|
|
1238
|
-
options: year_ddl
|
|
1239
|
-
}), lawPayErrors.exp_year && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1240
|
-
className: lawpay_form_index_module.fieldError
|
|
1241
|
-
}, lawPayErrors.exp_year)))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1242
|
-
className: lawpay_form_index_module.fieldWrapper
|
|
1243
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1244
|
-
className: lawpay_form_index_module.fieldRow
|
|
1245
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1246
|
-
className: lawpay_form_index_module.inputWrapper
|
|
1247
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1248
|
-
id: "my_cvv_field_id",
|
|
1249
|
-
className: lawpay_form_index_module.lawpayWrapper
|
|
1250
|
-
})), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1251
|
-
className: lawpay_form_index_module.inputWrapper
|
|
1252
|
-
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
1253
|
-
type: "text",
|
|
1254
|
-
name: "postal_code",
|
|
1255
|
-
placeholder: "ZIP Code *",
|
|
1256
|
-
value: lawPayFields.postal_code,
|
|
1257
|
-
onChange: e => setLawPayFields(lawpay_form_objectSpread(lawpay_form_objectSpread({}, lawPayFields), {}, {
|
|
1258
|
-
postal_code: e.target.value
|
|
1259
|
-
}))
|
|
1260
|
-
}))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1261
|
-
className: lawpay_form_index_module.fieldRow
|
|
1262
|
-
}, lawPayErrors.cvv && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1263
|
-
className: lawpay_form_index_module.fieldError
|
|
1264
|
-
}, lawPayErrors.cvv), lawPayErrors.postal_code && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1265
|
-
className: lawpay_form_index_module.fieldError
|
|
1266
|
-
}, lawPayErrors.postal_code))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1267
|
-
className: lawpay_form_index_module.fieldWrapper
|
|
1268
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1269
|
-
className: `${lawpay_form_index_module.inputWrapper} ${lawpay_form_index_module.addressField}`
|
|
1270
|
-
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
1271
|
-
type: "text",
|
|
1272
|
-
name: "address1",
|
|
1273
|
-
placeholder: "Address *",
|
|
1274
|
-
value: lawPayFields.address1,
|
|
1275
|
-
onChange: e => setLawPayFields(lawpay_form_objectSpread(lawpay_form_objectSpread({}, lawPayFields), {}, {
|
|
1276
|
-
address1: e.target.value
|
|
1277
|
-
}))
|
|
1278
|
-
})), lawPayErrors.address1 && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1279
|
-
className: lawpay_form_index_module.fieldError
|
|
1280
|
-
}, lawPayErrors.address1)));
|
|
1281
|
-
};
|
|
1282
|
-
|
|
1283
|
-
const mapStateToProps = ({
|
|
1284
|
-
registrationLiteState
|
|
1285
|
-
}) => ({
|
|
1286
|
-
marketingData: registrationLiteState.settings.marketingData
|
|
1287
|
-
});
|
|
1288
|
-
|
|
1289
|
-
/* harmony default export */ const lawpay_form = ((0,external_react_redux_namespaceObject.connect)(mapStateToProps, null)(LawPayForm));
|
|
1290
|
-
;// CONCATENATED MODULE: external "@stripe/stripe-js"
|
|
1291
|
-
const stripe_js_namespaceObject = require("@stripe/stripe-js");
|
|
1292
|
-
;// CONCATENATED MODULE: external "@stripe/react-stripe-js"
|
|
1293
|
-
const react_stripe_js_namespaceObject = require("@stripe/react-stripe-js");
|
|
1294
|
-
;// CONCATENATED MODULE: external "react-hook-form"
|
|
1295
|
-
const external_react_hook_form_namespaceObject = require("react-hook-form");
|
|
1296
|
-
;// CONCATENATED MODULE: external "lodash/merge"
|
|
1297
|
-
const merge_namespaceObject = require("lodash/merge");
|
|
1298
|
-
var merge_default = /*#__PURE__*/__webpack_require__.n(merge_namespaceObject);
|
|
1299
|
-
;// CONCATENATED MODULE: ./src/components/stripe-form/index.module.scss
|
|
1300
|
-
// extracted by mini-css-extract-plugin
|
|
1301
|
-
/* harmony default export */ const stripe_form_index_module = ({"form":"form___DoT3x","fieldWrapper":"fieldWrapper___wa1Ks","inputWrapper":"inputWrapper___CbXhF","fieldError":"fieldError___QrMYW"});
|
|
1302
|
-
;// CONCATENATED MODULE: ./src/components/stripe-form/index.js
|
|
1303
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1304
|
-
|
|
1305
|
-
/**
|
|
1306
|
-
* Copyright 2020 OpenStack Foundation
|
|
1307
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1308
|
-
* you may not use this file except in compliance with the License.
|
|
1309
|
-
* You may obtain a copy of the License at
|
|
1310
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1311
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1312
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1313
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1314
|
-
* See the License for the specific language governing permissions and
|
|
1315
|
-
* limitations under the License.
|
|
1316
|
-
**/
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
const stripeErrorCodeMap = {
|
|
1325
|
-
'incomplete_number': {
|
|
1326
|
-
field: 'cardNumber',
|
|
1327
|
-
message: 'This field is required.'
|
|
1328
|
-
},
|
|
1329
|
-
'incorrect_number': {
|
|
1330
|
-
field: 'cardNumber'
|
|
1331
|
-
},
|
|
1332
|
-
'invalid_number': {
|
|
1333
|
-
field: 'cardNumber'
|
|
1334
|
-
},
|
|
1335
|
-
'card_declined': {
|
|
1336
|
-
field: 'cardNumber'
|
|
1337
|
-
},
|
|
1338
|
-
'incomplete_cvc': {
|
|
1339
|
-
field: 'cardCvc',
|
|
1340
|
-
message: 'This field is required.'
|
|
1341
|
-
},
|
|
1342
|
-
'incorrect_cvc': {
|
|
1343
|
-
field: 'cardCvc'
|
|
1344
|
-
},
|
|
1345
|
-
'invalid_cvc': {
|
|
1346
|
-
field: 'cardCvc'
|
|
1347
|
-
},
|
|
1348
|
-
'incomplete_expiry': {
|
|
1349
|
-
field: 'cardExpiry',
|
|
1350
|
-
message: 'This field is required.'
|
|
1351
|
-
},
|
|
1352
|
-
'invalid_expiry_month': {
|
|
1353
|
-
field: 'cardExpiry'
|
|
1354
|
-
},
|
|
1355
|
-
'invalid_expiry_year': {
|
|
1356
|
-
field: 'cardExpiry'
|
|
1357
|
-
},
|
|
1358
|
-
'expired_card': {
|
|
1359
|
-
field: 'cardExpiry'
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
|
|
1363
|
-
const StripeForm = ({
|
|
1364
|
-
reservation,
|
|
1365
|
-
payTicket,
|
|
1366
|
-
userProfile,
|
|
1367
|
-
marketingData,
|
|
1368
|
-
stripeOptions,
|
|
1369
|
-
provider
|
|
1370
|
-
}) => {
|
|
1371
|
-
const stripe = (0,react_stripe_js_namespaceObject.useStripe)();
|
|
1372
|
-
const elements = (0,react_stripe_js_namespaceObject.useElements)();
|
|
1373
|
-
const [stripeErrors, setStripeErrors] = (0,external_react_namespaceObject.useState)({});
|
|
1374
|
-
const {
|
|
1375
|
-
register,
|
|
1376
|
-
handleSubmit,
|
|
1377
|
-
formState: {
|
|
1378
|
-
errors
|
|
1379
|
-
}
|
|
1380
|
-
} = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
1381
|
-
const stripeStyle = merge_default()({}, {
|
|
1382
|
-
base: {
|
|
1383
|
-
// Add your base input styles here. For example: #d4e5f4
|
|
1384
|
-
color: marketingData.color_text_dark,
|
|
1385
|
-
fontSize: '16px',
|
|
1386
|
-
//fontFamily: 'inherit',
|
|
1387
|
-
backgroundColor: '#ffffff',
|
|
1388
|
-
'::placeholder': {
|
|
1389
|
-
color: marketingData.color_text_input_hints
|
|
1390
|
-
}
|
|
1391
|
-
},
|
|
1392
|
-
invalid: {
|
|
1393
|
-
color: '#e5424d',
|
|
1394
|
-
':focus': {
|
|
1395
|
-
color: '#3486cd'
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
}, stripeOptions === null || stripeOptions === void 0 ? void 0 : stripeOptions.style);
|
|
1399
|
-
|
|
1400
|
-
const onSubmit = async data => {
|
|
1401
|
-
setStripeErrors({});
|
|
1402
|
-
|
|
1403
|
-
if (!stripe) {
|
|
1404
|
-
// Stripe.js has not loaded yet. Make sure to disable
|
|
1405
|
-
// form submission until Stripe.js has loaded.
|
|
1406
|
-
return;
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
const cardElement = elements.getElement(react_stripe_js_namespaceObject.CardNumberElement); // @see https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement
|
|
1410
|
-
|
|
1411
|
-
const {
|
|
1412
|
-
error,
|
|
1413
|
-
token
|
|
1414
|
-
} = await stripe.createToken(cardElement, {
|
|
1415
|
-
name: `${reservation.owner_first_name} ${reservation.owner_last_name}`,
|
|
1416
|
-
address_line1: userProfile.address1 || '',
|
|
1417
|
-
address_line2: userProfile.address2 || '',
|
|
1418
|
-
address_city: userProfile.locality || '',
|
|
1419
|
-
address_state: userProfile.region || '',
|
|
1420
|
-
address_zip: data.zipCode,
|
|
1421
|
-
address_country: userProfile.country || '',
|
|
1422
|
-
email: userProfile.email
|
|
1423
|
-
});
|
|
1424
|
-
|
|
1425
|
-
if (token) {
|
|
1426
|
-
payTicket(provider, {
|
|
1427
|
-
token,
|
|
1428
|
-
stripe,
|
|
1429
|
-
zipCode: data.zipCode
|
|
1430
|
-
});
|
|
1431
|
-
} else if (error) {
|
|
1432
|
-
if (stripeErrorCodeMap[error.code]) {
|
|
1433
|
-
setStripeErrors({
|
|
1434
|
-
[stripeErrorCodeMap[error.code].field]: stripeErrorCodeMap[error.code].message || error.message
|
|
1435
|
-
});
|
|
1436
|
-
} else {
|
|
1437
|
-
external_sweetalert2_default().fire("Payment error", error.message, "warning");
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
};
|
|
1441
|
-
|
|
1442
|
-
return /*#__PURE__*/external_react_default().createElement("form", {
|
|
1443
|
-
className: stripe_form_index_module.form,
|
|
1444
|
-
id: "payment-form",
|
|
1445
|
-
onSubmit: handleSubmit(onSubmit)
|
|
1446
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1447
|
-
className: stripe_form_index_module.fieldWrapper
|
|
1448
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1449
|
-
className: stripe_form_index_module.inputWrapper
|
|
1450
|
-
}, /*#__PURE__*/external_react_default().createElement(react_stripe_js_namespaceObject.CardNumberElement, {
|
|
1451
|
-
options: {
|
|
1452
|
-
style: stripeStyle,
|
|
1453
|
-
placeholder: '1234 1234 1234 1234 *'
|
|
1454
|
-
}
|
|
1455
|
-
}), /*#__PURE__*/external_react_default().createElement("i", {
|
|
1456
|
-
className: "fa fa-credit-card"
|
|
1457
|
-
})), stripeErrors.cardNumber && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1458
|
-
className: stripe_form_index_module.fieldError
|
|
1459
|
-
}, stripeErrors.cardNumber)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1460
|
-
className: stripe_form_index_module.fieldWrapper
|
|
1461
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1462
|
-
className: stripe_form_index_module.inputWrapper
|
|
1463
|
-
}, /*#__PURE__*/external_react_default().createElement(react_stripe_js_namespaceObject.CardExpiryElement, {
|
|
1464
|
-
options: {
|
|
1465
|
-
style: stripeStyle,
|
|
1466
|
-
placeholder: 'MM / YY *'
|
|
1467
|
-
}
|
|
1468
|
-
})), stripeErrors.cardExpiry && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1469
|
-
className: stripe_form_index_module.fieldError
|
|
1470
|
-
}, stripeErrors.cardExpiry)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1471
|
-
className: stripe_form_index_module.fieldWrapper
|
|
1472
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1473
|
-
className: stripe_form_index_module.inputWrapper
|
|
1474
|
-
}, /*#__PURE__*/external_react_default().createElement(react_stripe_js_namespaceObject.CardCvcElement, {
|
|
1475
|
-
options: {
|
|
1476
|
-
style: stripeStyle,
|
|
1477
|
-
placeholder: 'CVC *'
|
|
1478
|
-
}
|
|
1479
|
-
})), stripeErrors.cardCvc && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1480
|
-
className: stripe_form_index_module.fieldError
|
|
1481
|
-
}, stripeErrors.cardCvc)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1482
|
-
className: stripe_form_index_module.fieldWrapper
|
|
1483
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1484
|
-
className: stripe_form_index_module.inputWrapper
|
|
1485
|
-
}, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
1486
|
-
type: "text",
|
|
1487
|
-
placeholder: "ZIP Code *",
|
|
1488
|
-
onChange: e => setZipCode(e.target.value)
|
|
1489
|
-
}, register("zipCode", {
|
|
1490
|
-
required: true
|
|
1491
|
-
})))), errors.zipCode && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1492
|
-
className: stripe_form_index_module.fieldError
|
|
1493
|
-
}, "This field is required.")));
|
|
1494
|
-
};
|
|
1495
|
-
|
|
1496
|
-
const stripe_form_mapStateToProps = ({
|
|
1497
|
-
registrationLiteState
|
|
1498
|
-
}) => ({
|
|
1499
|
-
marketingData: registrationLiteState.settings.marketingData
|
|
1500
|
-
});
|
|
1501
|
-
|
|
1502
|
-
/* harmony default export */ const stripe_form = ((0,external_react_redux_namespaceObject.connect)(stripe_form_mapStateToProps, null)(StripeForm));
|
|
1503
|
-
;// CONCATENATED MODULE: ./src/components/stripe-component/index.js
|
|
1504
|
-
/**
|
|
1505
|
-
* Copyright 2020 OpenStack Foundation
|
|
1506
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1507
|
-
* you may not use this file except in compliance with the License.
|
|
1508
|
-
* You may obtain a copy of the License at
|
|
1509
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1510
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1511
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1512
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1513
|
-
* See the License for the specific language governing permissions and
|
|
1514
|
-
* limitations under the License.
|
|
1515
|
-
**/
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
const stripe_component_StripeProvider = ({
|
|
1523
|
-
userProfile,
|
|
1524
|
-
reservation,
|
|
1525
|
-
payTicket,
|
|
1526
|
-
providerKey,
|
|
1527
|
-
provider,
|
|
1528
|
-
stripeOptions
|
|
1529
|
-
}) => {
|
|
1530
|
-
const stripePromise = (0,external_react_namespaceObject.useMemo)(() => (0,stripe_js_namespaceObject.loadStripe)(providerKey), [providerKey]);
|
|
1531
|
-
const options = {
|
|
1532
|
-
fonts: stripeOptions === null || stripeOptions === void 0 ? void 0 : stripeOptions.fonts
|
|
1533
|
-
};
|
|
1534
|
-
return /*#__PURE__*/external_react_default().createElement(react_stripe_js_namespaceObject.Elements, {
|
|
1535
|
-
options: options,
|
|
1536
|
-
stripe: stripePromise
|
|
1537
|
-
}, /*#__PURE__*/external_react_default().createElement(stripe_form, {
|
|
1538
|
-
reservation: reservation,
|
|
1539
|
-
payTicket: payTicket,
|
|
1540
|
-
userProfile: userProfile,
|
|
1541
|
-
stripeOptions: stripeOptions,
|
|
1542
|
-
provider: provider
|
|
1543
|
-
}));
|
|
1544
|
-
};
|
|
1545
|
-
|
|
1546
|
-
/* harmony default export */ const stripe_component = (stripe_component_StripeProvider);
|
|
1547
|
-
;// CONCATENATED MODULE: external "react-helmet"
|
|
1548
|
-
const external_react_helmet_namespaceObject = require("react-helmet");
|
|
1549
|
-
;// CONCATENATED MODULE: ./src/components/payment/index.js
|
|
1550
|
-
function payment_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1551
|
-
|
|
1552
|
-
function payment_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? payment_ownKeys(Object(source), !0).forEach(function (key) { payment_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : payment_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1553
|
-
|
|
1554
|
-
function payment_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1555
|
-
|
|
1556
|
-
/**
|
|
1557
|
-
* Copyright 2020 OpenStack Foundation
|
|
1558
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1559
|
-
* you may not use this file except in compliance with the License.
|
|
1560
|
-
* You may obtain a copy of the License at
|
|
1561
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1562
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1563
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1564
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1565
|
-
* See the License for the specific language governing permissions and
|
|
1566
|
-
* limitations under the License.
|
|
1567
|
-
**/
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
const PaymentComponent = ({
|
|
1578
|
-
isActive,
|
|
1579
|
-
userProfile,
|
|
1580
|
-
reservation,
|
|
1581
|
-
payTicket,
|
|
1582
|
-
providerKey,
|
|
1583
|
-
provider,
|
|
1584
|
-
stripeOptions,
|
|
1585
|
-
timestamp
|
|
1586
|
-
}) => {
|
|
1587
|
-
const [ref, {
|
|
1588
|
-
height
|
|
1589
|
-
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
1590
|
-
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
1591
|
-
config: payment_objectSpread({
|
|
1592
|
-
bounce: 0
|
|
1593
|
-
}, external_react_spring_namespaceObject.config.stiff),
|
|
1594
|
-
from: {
|
|
1595
|
-
opacity: 0,
|
|
1596
|
-
height: 0
|
|
1597
|
-
},
|
|
1598
|
-
to: {
|
|
1599
|
-
opacity: 1,
|
|
1600
|
-
height: isActive ? height + 10 : 0,
|
|
1601
|
-
marginBottom: isActive ? 5 : 0
|
|
1602
|
-
}
|
|
1603
|
-
});
|
|
1604
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
1605
|
-
className: `${payment_index_module.outerWrapper} step-wrapper`
|
|
1606
|
-
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1607
|
-
className: `${payment_index_module.innerWrapper}`
|
|
1608
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1609
|
-
className: payment_index_module.title
|
|
1610
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, "Payment")), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
1611
|
-
style: payment_objectSpread({
|
|
1612
|
-
overflow: `${isActive ? '' : 'hidden'}`
|
|
1613
|
-
}, toggleAnimation)
|
|
1614
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1615
|
-
ref: ref
|
|
1616
|
-
}, provider === 'Stripe' && /*#__PURE__*/external_react_default().createElement(stripe_component, {
|
|
1617
|
-
provider: provider,
|
|
1618
|
-
providerKey: providerKey,
|
|
1619
|
-
reservation: reservation,
|
|
1620
|
-
payTicket: payTicket,
|
|
1621
|
-
userProfile: userProfile,
|
|
1622
|
-
stripeOptions: stripeOptions
|
|
1623
|
-
}), provider === 'LawPay' && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement(external_react_helmet_namespaceObject.Helmet, null, /*#__PURE__*/external_react_default().createElement("script", {
|
|
1624
|
-
src: "https://cdn.affinipay.com/hostedfields/1.1.1/fieldGen_1.1.1.js"
|
|
1625
|
-
})), /*#__PURE__*/external_react_default().createElement(lawpay_form, {
|
|
1626
|
-
provider: provider,
|
|
1627
|
-
reservation: reservation,
|
|
1628
|
-
payTicket: payTicket,
|
|
1629
|
-
userProfile: userProfile,
|
|
1630
|
-
providerKey: providerKey,
|
|
1631
|
-
timestamp: timestamp
|
|
1632
|
-
})))))));
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
|
-
/* harmony default export */ const payment = (PaymentComponent);
|
|
1636
|
-
;// CONCATENATED MODULE: external "react-tooltip"
|
|
1637
|
-
const external_react_tooltip_namespaceObject = require("react-tooltip");
|
|
1638
|
-
var external_react_tooltip_default = /*#__PURE__*/__webpack_require__.n(external_react_tooltip_namespaceObject);
|
|
1639
|
-
;// CONCATENATED MODULE: ./src/helpers/capitalizeFirstLetter.js
|
|
1640
|
-
const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
1641
|
-
;// CONCATENATED MODULE: ./src/helpers/formatErrorMessage.js
|
|
1642
|
-
|
|
1643
|
-
const formatErrorMessage = string => {
|
|
1644
|
-
const errorMessage = capitalizeFirstLetter(string);
|
|
1645
|
-
return `${errorMessage}${errorMessage.endsWith('.') ? '' : '.'}`;
|
|
1646
|
-
};
|
|
1647
|
-
;// CONCATENATED MODULE: ./src/components/personal-information/index.module.scss
|
|
1648
|
-
// extracted by mini-css-extract-plugin
|
|
1649
|
-
/* harmony default export */ const personal_information_index_module = ({"title":"title___ECoNz","form":"form___lDFka","fieldWrapper":"fieldWrapper___Mi_nL","inputWrapper":"inputWrapper___PEQFR","readOnly":"readOnly___WRazF","fieldError":"fieldError___ksJVe","companies":"companies___kmGFB","moreInfo":"moreInfo___cQYdZ","moreInfoTooltip":"moreInfoTooltip___lslgT","ticketQuantityNotice":"ticketQuantityNotice___L6gis","formErrors":"formErrors___dQQMe"});
|
|
1650
|
-
;// CONCATENATED MODULE: ./src/components/personal-information/index.js
|
|
1651
|
-
function personal_information_extends() { personal_information_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return personal_information_extends.apply(this, arguments); }
|
|
1652
|
-
|
|
1653
|
-
function personal_information_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1654
|
-
|
|
1655
|
-
function personal_information_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? personal_information_ownKeys(Object(source), !0).forEach(function (key) { personal_information_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : personal_information_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1656
|
-
|
|
1657
|
-
function personal_information_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1658
|
-
|
|
1659
|
-
/**
|
|
1660
|
-
* Copyright 2020 OpenStack Foundation
|
|
1661
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1662
|
-
* you may not use this file except in compliance with the License.
|
|
1663
|
-
* You may obtain a copy of the License at
|
|
1664
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1665
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1666
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1667
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1668
|
-
* See the License for the specific language governing permissions and
|
|
1669
|
-
* limitations under the License.
|
|
1670
|
-
**/
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
const PersonalInfoComponent = ({
|
|
1681
|
-
isActive,
|
|
1682
|
-
changeForm,
|
|
1683
|
-
reservation,
|
|
1684
|
-
userProfile,
|
|
1685
|
-
summitId,
|
|
1686
|
-
handleCompanyError,
|
|
1687
|
-
formValues,
|
|
1688
|
-
formErrors
|
|
1689
|
-
}) => {
|
|
1690
|
-
var _errors$email, _errors$email2;
|
|
1691
|
-
|
|
1692
|
-
const [personalInfo, setPersonalInfo] = (0,external_react_namespaceObject.useState)({
|
|
1693
|
-
firstName: userProfile.given_name || '',
|
|
1694
|
-
lastName: userProfile.family_name || '',
|
|
1695
|
-
email: userProfile.email || '',
|
|
1696
|
-
company: {
|
|
1697
|
-
id: null,
|
|
1698
|
-
name: ''
|
|
1699
|
-
},
|
|
1700
|
-
promoCode: ''
|
|
1701
|
-
});
|
|
1702
|
-
const [companyError, setCompanyError] = (0,external_react_namespaceObject.useState)(false);
|
|
1703
|
-
const {
|
|
1704
|
-
register,
|
|
1705
|
-
handleSubmit,
|
|
1706
|
-
formState: {
|
|
1707
|
-
errors
|
|
1708
|
-
}
|
|
1709
|
-
} = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
1710
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
1711
|
-
if (reservation) {
|
|
1712
|
-
setPersonalInfo({
|
|
1713
|
-
firstName: reservation.owner_first_name ? reservation.owner_first_name : personalInfo.firstName,
|
|
1714
|
-
lastName: reservation.owner_last_name ? reservation.owner_last_name : personalInfo.lastName,
|
|
1715
|
-
email: reservation.owner_email ? reservation.owner_email : personalInfo.email,
|
|
1716
|
-
company: {
|
|
1717
|
-
id: null,
|
|
1718
|
-
name: reservation.owner_company ? reservation.owner_company : personalInfo.company
|
|
1719
|
-
}
|
|
1720
|
-
});
|
|
1721
|
-
}
|
|
1722
|
-
}, []);
|
|
1723
|
-
|
|
1724
|
-
const onCompanyChange = ev => {
|
|
1725
|
-
const newCompany = ev.target.value;
|
|
1726
|
-
setCompanyError(false);
|
|
1727
|
-
setPersonalInfo(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), {}, {
|
|
1728
|
-
company: newCompany
|
|
1729
|
-
}));
|
|
1730
|
-
};
|
|
1731
|
-
|
|
1732
|
-
const onSubmit = data => {
|
|
1733
|
-
if (!personalInfo.company.name) {
|
|
1734
|
-
setCompanyError(true);
|
|
1735
|
-
return;
|
|
1736
|
-
}
|
|
1737
|
-
|
|
1738
|
-
setPersonalInfo(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), data));
|
|
1739
|
-
changeForm(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), data));
|
|
1740
|
-
};
|
|
1741
|
-
|
|
1742
|
-
const [ref, {
|
|
1743
|
-
height
|
|
1744
|
-
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
1745
|
-
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
1746
|
-
config: personal_information_objectSpread({
|
|
1747
|
-
bounce: 0
|
|
1748
|
-
}, external_react_spring_namespaceObject.config.stiff),
|
|
1749
|
-
from: {
|
|
1750
|
-
opacity: 0,
|
|
1751
|
-
height: 0
|
|
1752
|
-
},
|
|
1753
|
-
to: {
|
|
1754
|
-
opacity: 1,
|
|
1755
|
-
height: isActive ? height + 10 : 0
|
|
1756
|
-
}
|
|
1757
|
-
});
|
|
1758
|
-
const customStyles = {
|
|
1759
|
-
menuList: provided => personal_information_objectSpread(personal_information_objectSpread({}, provided), {}, {
|
|
1760
|
-
maxHeight: 120
|
|
1761
|
-
})
|
|
1762
|
-
};
|
|
1763
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
1764
|
-
className: `${personal_information_index_module.outerWrapper} step-wrapper`
|
|
1765
|
-
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1766
|
-
className: `${personal_information_index_module.innerWrapper}`
|
|
1767
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1768
|
-
className: personal_information_index_module.title
|
|
1769
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, "Personal Information"), !isActive && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1770
|
-
"data-testid": "personal-info"
|
|
1771
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, `${personalInfo.firstName} ${personalInfo.lastName} ${personalInfo.company.name ? `- ${personalInfo.company.name}` : ''}`), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", null, personalInfo.email))), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
1772
|
-
style: personal_information_objectSpread({
|
|
1773
|
-
overflow: `${isActive ? '' : 'hidden'}`
|
|
1774
|
-
}, toggleAnimation)
|
|
1775
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1776
|
-
ref: ref
|
|
1777
|
-
}, formValues.ticketQuantity > 1 && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1778
|
-
className: `${personal_information_index_module.ticketQuantityNotice} alert alert-info`
|
|
1779
|
-
}, "Please note that 1 ticket from this order will be automatically assigned to you; the rest will remain unassigned, with the option to re-assign all tickets after purchase."), /*#__PURE__*/external_react_default().createElement("form", {
|
|
1780
|
-
id: "personal-info-form",
|
|
1781
|
-
onSubmit: handleSubmit(onSubmit),
|
|
1782
|
-
className: personal_information_index_module.form,
|
|
1783
|
-
"data-testid": "personal-form"
|
|
1784
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1785
|
-
className: personal_information_index_module.fieldWrapper
|
|
1786
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1787
|
-
className: personal_information_index_module.inputWrapper
|
|
1788
|
-
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
1789
|
-
type: "text",
|
|
1790
|
-
placeholder: "First name *",
|
|
1791
|
-
defaultValue: personalInfo.firstName || ''
|
|
1792
|
-
}, register("firstName", {
|
|
1793
|
-
required: true,
|
|
1794
|
-
maxLength: 80
|
|
1795
|
-
}), {
|
|
1796
|
-
"data-testid": "first-name"
|
|
1797
|
-
}))), errors.firstName && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1798
|
-
className: personal_information_index_module.fieldError,
|
|
1799
|
-
"data-testid": "first-name-error"
|
|
1800
|
-
}, "This field is required.")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1801
|
-
className: personal_information_index_module.fieldWrapper
|
|
1802
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1803
|
-
className: personal_information_index_module.inputWrapper
|
|
1804
|
-
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
1805
|
-
type: "text",
|
|
1806
|
-
placeholder: "Last name *",
|
|
1807
|
-
defaultValue: personalInfo.lastName || ''
|
|
1808
|
-
}, register("lastName", {
|
|
1809
|
-
required: true,
|
|
1810
|
-
maxLength: 100
|
|
1811
|
-
}), {
|
|
1812
|
-
"data-testid": "last-name"
|
|
1813
|
-
}))), errors.lastName && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1814
|
-
className: personal_information_index_module.fieldError,
|
|
1815
|
-
"data-testid": "last-name-error"
|
|
1816
|
-
}, "This field is required.")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1817
|
-
className: personal_information_index_module.fieldWrapper
|
|
1818
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1819
|
-
className: personal_information_index_module.inputWrapper
|
|
1820
|
-
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
1821
|
-
type: "text",
|
|
1822
|
-
placeholder: "Email *",
|
|
1823
|
-
className: personal_information_index_module.readOnly,
|
|
1824
|
-
readOnly: true,
|
|
1825
|
-
defaultValue: personalInfo.email || ''
|
|
1826
|
-
}, register("email", {
|
|
1827
|
-
required: true,
|
|
1828
|
-
pattern: /^\S+@\S+$/i
|
|
1829
|
-
}), {
|
|
1830
|
-
"data-testid": "email"
|
|
1831
|
-
}))), ((_errors$email = errors.email) === null || _errors$email === void 0 ? void 0 : _errors$email.type) === 'required' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1832
|
-
className: personal_information_index_module.fieldError,
|
|
1833
|
-
"data-testid": "email-error-required"
|
|
1834
|
-
}, "This field is required."), ((_errors$email2 = errors.email) === null || _errors$email2 === void 0 ? void 0 : _errors$email2.type) === 'pattern' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1835
|
-
className: personal_information_index_module.fieldError,
|
|
1836
|
-
"data-testid": "email-error-invalid"
|
|
1837
|
-
}, "The email is invalid.")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1838
|
-
className: personal_information_index_module.fieldWrapper
|
|
1839
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1840
|
-
className: personal_information_index_module.companies
|
|
1841
|
-
}, /*#__PURE__*/external_react_default().createElement(components_namespaceObject.RegistrationCompanyInput, {
|
|
1842
|
-
id: "company",
|
|
1843
|
-
styles: customStyles,
|
|
1844
|
-
summitId: summitId,
|
|
1845
|
-
onChange: onCompanyChange,
|
|
1846
|
-
onError: handleCompanyError,
|
|
1847
|
-
value: personalInfo.company
|
|
1848
|
-
}), companyError && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1849
|
-
className: personal_information_index_module.fieldError,
|
|
1850
|
-
"data-testid": "company-error"
|
|
1851
|
-
}, "This field is required."))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1852
|
-
className: personal_information_index_module.fieldWrapper
|
|
1853
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1854
|
-
className: personal_information_index_module.inputWrapper
|
|
1855
|
-
}, /*#__PURE__*/external_react_default().createElement("input", personal_information_extends({
|
|
1856
|
-
type: "text",
|
|
1857
|
-
placeholder: "Promo Code"
|
|
1858
|
-
}, register("promoCode")))))), /*#__PURE__*/external_react_default().createElement("a", {
|
|
1859
|
-
className: personal_information_index_module.moreInfo,
|
|
1860
|
-
"data-tip": true,
|
|
1861
|
-
"data-for": "promo-code-info"
|
|
1862
|
-
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
1863
|
-
className: "glyphicon glyphicon-info-sign",
|
|
1864
|
-
"aria-hidden": "true"
|
|
1865
|
-
}), ` `, "Have multiple promo codes?"), /*#__PURE__*/external_react_default().createElement((external_react_tooltip_default()), {
|
|
1866
|
-
id: "promo-code-info"
|
|
1867
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1868
|
-
className: personal_information_index_module.moreInfoTooltip
|
|
1869
|
-
}, "Promo code will be applied to all tickets in this order. If you wish to utilize more than one promo code, simply place another order after you complete this registration order. Only one promo code can be applied per order.")), formErrors.length > 0 && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1870
|
-
className: `${personal_information_index_module.formErrors} alert alert-danger`
|
|
1871
|
-
}, formErrors.map((error, index) => /*#__PURE__*/external_react_default().createElement("div", {
|
|
1872
|
-
key: index
|
|
1873
|
-
}, formatErrorMessage(error)))))))));
|
|
1874
|
-
};
|
|
1875
|
-
|
|
1876
|
-
/* harmony default export */ const personal_information = (PersonalInfoComponent);
|
|
1877
|
-
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/raw-html"
|
|
1878
|
-
const raw_html_namespaceObject = require("openstack-uicore-foundation/lib/components/raw-html");
|
|
1879
|
-
var raw_html_default = /*#__PURE__*/__webpack_require__.n(raw_html_namespaceObject);
|
|
1880
|
-
;// CONCATENATED MODULE: ./src/components/ticket-type/index.module.scss
|
|
1881
|
-
// extracted by mini-css-extract-plugin
|
|
1882
|
-
/* harmony default export */ const ticket_type_index_module = ({"title":"title___DNZyl","summary":"summary___quWdZ","crossOut":"crossOut___QZ7dy","discount":"discount___sEK_Q","promo":"promo___F8lPO","form":"form___aoo7w","dropdown":"dropdown____HWg0","quantity":"quantity___SIEQZ","soldOut":"soldOut___Hatfr","moreInfo":"moreInfo___LmwOe","moreInfoTooltip":"moreInfoTooltip___nOBf1","inPersonDisclaimer":"inPersonDisclaimer___PXGTz"});
|
|
1883
|
-
;// CONCATENATED MODULE: ./src/helpers/getTicketMaxQuantity.js
|
|
1884
|
-
const getTicketMaxQuantity = ticket => ticket ? Math.min((ticket.quantity_2_sell || Number.MAX_SAFE_INTEGER) - ticket.quantity_sold, ticket.max_quantity_per_order || Number.MAX_SAFE_INTEGER) : 0;
|
|
1885
|
-
;// CONCATENATED MODULE: ./src/components/ticket-dropdown/index.module.scss
|
|
1886
|
-
// extracted by mini-css-extract-plugin
|
|
1887
|
-
/* harmony default export */ const ticket_dropdown_index_module = ({"placeholder":"placeholder___pcdCn","selectedTicket":"selectedTicket___qkbpH","inPersonDisclaimer":"inPersonDisclaimer___z_DzO","dropdown":"dropdown___mfbPG","soldOut":"soldOut___rBLC0"});
|
|
1888
|
-
;// CONCATENATED MODULE: ./src/components/ticket-dropdown/index.js
|
|
1889
|
-
/**
|
|
1890
|
-
* Copyright 2020 OpenStack Foundation
|
|
1891
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1892
|
-
* you may not use this file except in compliance with the License.
|
|
1893
|
-
* You may obtain a copy of the License at
|
|
1894
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1895
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1896
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1897
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1898
|
-
* See the License for the specific language governing permissions and
|
|
1899
|
-
* limitations under the License.
|
|
1900
|
-
**/
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
const TicketDropdownComponent = ({
|
|
1907
|
-
selectedTicket,
|
|
1908
|
-
ticketTypes,
|
|
1909
|
-
onTicketSelect
|
|
1910
|
-
}) => {
|
|
1911
|
-
const [active, setActive] = (0,external_react_namespaceObject.useState)(false);
|
|
1912
|
-
|
|
1913
|
-
const ticketSelect = ticket => {
|
|
1914
|
-
onTicketSelect(ticket);
|
|
1915
|
-
setActive(!active);
|
|
1916
|
-
};
|
|
1917
|
-
|
|
1918
|
-
const date = new Date();
|
|
1919
|
-
let now_utc = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()) / 1000;
|
|
1920
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
1921
|
-
className: `${ticket_dropdown_index_module.outerWrapper}`
|
|
1922
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1923
|
-
className: ticket_dropdown_index_module.placeholder,
|
|
1924
|
-
onClick: () => setActive(!active),
|
|
1925
|
-
"data-testid": "ticket-dropdown"
|
|
1926
|
-
}, selectedTicket ? /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", {
|
|
1927
|
-
className: ticket_dropdown_index_module.selectedTicket,
|
|
1928
|
-
"data-testid": "selected-ticket"
|
|
1929
|
-
}, `${selectedTicket.name} - $${selectedTicket.cost} ${selectedTicket.currency}`), /*#__PURE__*/external_react_default().createElement("i", {
|
|
1930
|
-
className: "fa fa-chevron-down"
|
|
1931
|
-
})) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", {
|
|
1932
|
-
"data-testid": "no-ticket"
|
|
1933
|
-
}, "Select a ticket"), /*#__PURE__*/external_react_default().createElement("i", {
|
|
1934
|
-
className: "fa fa-chevron-down"
|
|
1935
|
-
}))), active && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1936
|
-
className: ticket_dropdown_index_module.dropdown,
|
|
1937
|
-
"data-testid": "ticket-list"
|
|
1938
|
-
}, ticketTypes.map(t => {
|
|
1939
|
-
const maxQuantity = getTicketMaxQuantity(t);
|
|
1940
|
-
const isTicketSoldOut = maxQuantity < 1;
|
|
1941
|
-
|
|
1942
|
-
if (t.sales_start_date === null && t.sales_end_date === null || now_utc >= t.sales_start_date && now_utc <= t.sales_end_date) {
|
|
1943
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
1944
|
-
key: t.id,
|
|
1945
|
-
className: isTicketSoldOut ? ticket_dropdown_index_module.soldOut : '',
|
|
1946
|
-
onClick: () => {
|
|
1947
|
-
if (isTicketSoldOut) return;
|
|
1948
|
-
ticketSelect(t);
|
|
1949
|
-
}
|
|
1950
|
-
}, t.name, " -", ` `, !isTicketSoldOut && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, "$", t.cost, " ", t.currency), isTicketSoldOut && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, "Sold Out"));
|
|
1951
|
-
}
|
|
1952
|
-
})));
|
|
1953
|
-
};
|
|
1954
|
-
|
|
1955
|
-
/* harmony default export */ const ticket_dropdown = (TicketDropdownComponent);
|
|
1956
|
-
;// CONCATENATED MODULE: ./src/helpers/formatCurrency.js
|
|
1957
|
-
const _excluded = ["locale"];
|
|
1958
|
-
|
|
1959
|
-
function formatCurrency_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1960
|
-
|
|
1961
|
-
function formatCurrency_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? formatCurrency_ownKeys(Object(source), !0).forEach(function (key) { formatCurrency_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : formatCurrency_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1962
|
-
|
|
1963
|
-
function formatCurrency_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1964
|
-
|
|
1965
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
1966
|
-
|
|
1967
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
1968
|
-
|
|
1969
|
-
const formatCurrency = (value, _ref) => {
|
|
1970
|
-
let {
|
|
1971
|
-
locale = 'en-US'
|
|
1972
|
-
} = _ref,
|
|
1973
|
-
options = _objectWithoutProperties(_ref, _excluded);
|
|
1974
|
-
|
|
1975
|
-
const defaultOptions = {
|
|
1976
|
-
currency: 'USD',
|
|
1977
|
-
minimumFractionDigits: 0,
|
|
1978
|
-
maximumFractionDigits: 0
|
|
1979
|
-
};
|
|
1980
|
-
const formatter = new Intl.NumberFormat(locale, formatCurrency_objectSpread(formatCurrency_objectSpread({
|
|
1981
|
-
style: 'currency'
|
|
1982
|
-
}, defaultOptions), options));
|
|
1983
|
-
return formatter.format(value);
|
|
1984
|
-
};
|
|
1985
|
-
;// CONCATENATED MODULE: ./src/components/ticket-type/index.js
|
|
1986
|
-
function ticket_type_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1987
|
-
|
|
1988
|
-
function ticket_type_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ticket_type_ownKeys(Object(source), !0).forEach(function (key) { ticket_type_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ticket_type_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1989
|
-
|
|
1990
|
-
function ticket_type_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1991
|
-
|
|
1992
|
-
/**
|
|
1993
|
-
* Copyright 2020 OpenStack Foundation
|
|
1994
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1995
|
-
* you may not use this file except in compliance with the License.
|
|
1996
|
-
* You may obtain a copy of the License at
|
|
1997
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1998
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1999
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2000
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2001
|
-
* See the License for the specific language governing permissions and
|
|
2002
|
-
* limitations under the License.
|
|
2003
|
-
**/
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
const TicketTypeComponent = ({
|
|
2016
|
-
ticketTypes,
|
|
2017
|
-
isActive,
|
|
2018
|
-
changeForm,
|
|
2019
|
-
reservation,
|
|
2020
|
-
inPersonDisclaimer
|
|
2021
|
-
}) => {
|
|
2022
|
-
const [ticket, setTicket] = (0,external_react_namespaceObject.useState)(null);
|
|
2023
|
-
const [quantity, setQuantity] = (0,external_react_namespaceObject.useState)(1);
|
|
2024
|
-
const minQuantity = 1;
|
|
2025
|
-
const maxQuantity = getTicketMaxQuantity(ticket);
|
|
2026
|
-
const [ref, {
|
|
2027
|
-
height
|
|
2028
|
-
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
2029
|
-
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
2030
|
-
config: ticket_type_objectSpread({
|
|
2031
|
-
bounce: 0
|
|
2032
|
-
}, external_react_spring_namespaceObject.config.stiff),
|
|
2033
|
-
from: {
|
|
2034
|
-
opacity: 0,
|
|
2035
|
-
height: 0
|
|
2036
|
-
},
|
|
2037
|
-
to: {
|
|
2038
|
-
opacity: 1,
|
|
2039
|
-
height: isActive ? height + 10 : 0
|
|
2040
|
-
}
|
|
2041
|
-
});
|
|
2042
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2043
|
-
var _reservation$tickets;
|
|
2044
|
-
|
|
2045
|
-
if (reservation && ((_reservation$tickets = reservation.tickets) === null || _reservation$tickets === void 0 ? void 0 : _reservation$tickets.length) > 0) {
|
|
2046
|
-
setTicket(ticketTypes.find(t => t.id === reservation.tickets[0].ticket_type_id));
|
|
2047
|
-
}
|
|
2048
|
-
}, []);
|
|
2049
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2050
|
-
changeForm({
|
|
2051
|
-
ticketType: ticket,
|
|
2052
|
-
ticketQuantity: quantity
|
|
2053
|
-
});
|
|
2054
|
-
}, [ticket, quantity]);
|
|
2055
|
-
|
|
2056
|
-
const handleTicketChange = t => {
|
|
2057
|
-
setTicket(t);
|
|
2058
|
-
setQuantity(minQuantity);
|
|
2059
|
-
};
|
|
2060
|
-
|
|
2061
|
-
const incrementQuantity = () => setQuantity(quantity + 1);
|
|
2062
|
-
|
|
2063
|
-
const decrementQuantity = () => setQuantity(quantity - 1);
|
|
2064
|
-
|
|
2065
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2066
|
-
className: `${ticket_type_index_module.outerWrapper} step-wrapper`
|
|
2067
|
-
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2068
|
-
className: ticket_type_index_module.innerWrapper
|
|
2069
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2070
|
-
className: ticket_type_index_module.title
|
|
2071
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, "Ticket"), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2072
|
-
className: ticket_type_index_module.summary
|
|
2073
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, ticket.name, ` `, "(", quantity, "):", ` `, !isActive && (reservation === null || reservation === void 0 ? void 0 : reservation.discount_amount) > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", {
|
|
2074
|
-
className: ticket_type_index_module.crossOut
|
|
2075
|
-
}, formatCurrency(ticket.cost * quantity, {
|
|
2076
|
-
currency: ticket.currency
|
|
2077
|
-
})), ` `, /*#__PURE__*/external_react_default().createElement("span", {
|
|
2078
|
-
className: ticket_type_index_module.discount
|
|
2079
|
-
}, formatCurrency(reservation.raw_amount - reservation.discount_amount, {
|
|
2080
|
-
currency: ticket.currency
|
|
2081
|
-
})), ` `), !(reservation !== null && reservation !== void 0 && reservation.discount_amount) && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, formatCurrency(ticket.cost * quantity, {
|
|
2082
|
-
currency: ticket.currency
|
|
2083
|
-
}), ` `), ticket.currency, !isActive && (reservation === null || reservation === void 0 ? void 0 : reservation.discount_amount) > 0 && /*#__PURE__*/external_react_default().createElement("span", {
|
|
2084
|
-
className: ticket_type_index_module.promo
|
|
2085
|
-
}, "Promo code applied"), !isActive && (reservation === null || reservation === void 0 ? void 0 : reservation.taxes_amount) > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), "Taxes: $", reservation === null || reservation === void 0 ? void 0 : reservation.taxes_amount, " ", ticket === null || ticket === void 0 ? void 0 : ticket.currency)), !ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, "No ticket selected")))), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
2086
|
-
style: ticket_type_objectSpread({
|
|
2087
|
-
overflow: 'hidden'
|
|
2088
|
-
}, toggleAnimation)
|
|
2089
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2090
|
-
ref: ref
|
|
2091
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2092
|
-
className: ticket_type_index_module.form
|
|
2093
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2094
|
-
className: ticket_type_index_module.dropdown
|
|
2095
|
-
}, /*#__PURE__*/external_react_default().createElement(ticket_dropdown, {
|
|
2096
|
-
selectedTicket: ticket,
|
|
2097
|
-
ticketTypes: ticketTypes,
|
|
2098
|
-
onTicketSelect: handleTicketChange
|
|
2099
|
-
})), ticket && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2100
|
-
className: ticket_type_index_module.quantity
|
|
2101
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2102
|
-
className: "input-group"
|
|
2103
|
-
}, /*#__PURE__*/external_react_default().createElement("span", {
|
|
2104
|
-
className: "input-group-btn"
|
|
2105
|
-
}, /*#__PURE__*/external_react_default().createElement("button", {
|
|
2106
|
-
"aria-label": "remove a ticket",
|
|
2107
|
-
className: "btn btn-default",
|
|
2108
|
-
onClick: decrementQuantity,
|
|
2109
|
-
disabled: maxQuantity === 0 || quantity === minQuantity
|
|
2110
|
-
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
2111
|
-
className: "fa fa-minus"
|
|
2112
|
-
}))), /*#__PURE__*/external_react_default().createElement("input", {
|
|
2113
|
-
className: "form-control",
|
|
2114
|
-
"aria-label": "ticket quanity",
|
|
2115
|
-
name: "ticket_quantity",
|
|
2116
|
-
type: "text",
|
|
2117
|
-
value: quantity,
|
|
2118
|
-
readOnly: true,
|
|
2119
|
-
disabled: maxQuantity === 0
|
|
2120
|
-
}), /*#__PURE__*/external_react_default().createElement("span", {
|
|
2121
|
-
className: "input-group-btn"
|
|
2122
|
-
}, /*#__PURE__*/external_react_default().createElement("button", {
|
|
2123
|
-
"aria-label": "add a ticket",
|
|
2124
|
-
className: "btn btn-default",
|
|
2125
|
-
onClick: incrementQuantity,
|
|
2126
|
-
disabled: maxQuantity === 0 || quantity >= maxQuantity
|
|
2127
|
-
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
2128
|
-
className: "glyphicon glyphicon-plus"
|
|
2129
|
-
})))))), /*#__PURE__*/external_react_default().createElement("a", {
|
|
2130
|
-
className: ticket_type_index_module.moreInfo,
|
|
2131
|
-
"data-tip": true,
|
|
2132
|
-
"data-for": "ticket-quantity-info"
|
|
2133
|
-
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
2134
|
-
className: "glyphicon glyphicon-info-sign",
|
|
2135
|
-
"aria-hidden": "true"
|
|
2136
|
-
}), ` `, "Need multiple ticket types?"), /*#__PURE__*/external_react_default().createElement((external_react_tooltip_default()), {
|
|
2137
|
-
id: "ticket-quantity-info"
|
|
2138
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2139
|
-
className: ticket_type_index_module.moreInfoTooltip
|
|
2140
|
-
}, "To purchase more than one ticket type, simply place another order after this registration order is complete. Only one ticket type can be chosen per order.")))), inPersonDisclaimer && ticket && isInPersonTicketType(ticket) && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2141
|
-
className: ticket_type_index_module.inPersonDisclaimer
|
|
2142
|
-
}, /*#__PURE__*/external_react_default().createElement((raw_html_default()), null, inPersonDisclaimer)))));
|
|
2143
|
-
};
|
|
2144
|
-
|
|
2145
|
-
/* harmony default export */ const ticket_type = (TicketTypeComponent);
|
|
2146
|
-
;// CONCATENATED MODULE: ./src/components/button-bar/index.module.scss
|
|
2147
|
-
// extracted by mini-css-extract-plugin
|
|
2148
|
-
/* harmony default export */ const button_bar_index_module = ({"button":"button___MZBIY","outerWrapper":"outerWrapper___XRnaq","innerWrapper":"innerWrapper___LFsOH","registration":"registration___jdf6T","actions":"actions___Gsf0y"});
|
|
2149
|
-
;// CONCATENATED MODULE: ./src/components/button-bar/index.js
|
|
2150
|
-
/**
|
|
2151
|
-
* Copyright 2020 OpenStack Foundation
|
|
2152
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2153
|
-
* you may not use this file except in compliance with the License.
|
|
2154
|
-
* You may obtain a copy of the License at
|
|
2155
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2156
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2157
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2158
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2159
|
-
* See the License for the specific language governing permissions and
|
|
2160
|
-
* limitations under the License.
|
|
2161
|
-
**/
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
const ButtonBarComponent = ({
|
|
2167
|
-
step,
|
|
2168
|
-
changeStep,
|
|
2169
|
-
formValues,
|
|
2170
|
-
removeReservedTicket,
|
|
2171
|
-
inPersonDisclaimer
|
|
2172
|
-
}) => {
|
|
2173
|
-
const {
|
|
2174
|
-
ticketType
|
|
2175
|
-
} = formValues || {};
|
|
2176
|
-
const nextButtonText = inPersonDisclaimer && ticketType && isInPersonTicketType(ticketType) ? 'Accept' : 'Next';
|
|
2177
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2178
|
-
className: `${button_bar_index_module.outerWrapper}`
|
|
2179
|
-
}, step !== 3 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2180
|
-
className: `${button_bar_index_module.innerWrapper}`
|
|
2181
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2182
|
-
className: button_bar_index_module.required
|
|
2183
|
-
}, step !== 0 && /*#__PURE__*/external_react_default().createElement("span", null, "* Required fields ", /*#__PURE__*/external_react_default().createElement("br", null), " ")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2184
|
-
className: button_bar_index_module.actions
|
|
2185
|
-
}, step !== 0 && step !== 2 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2186
|
-
className: `${button_bar_index_module.button} button`,
|
|
2187
|
-
onClick: () => changeStep(step - 1)
|
|
2188
|
-
}, "< Back"), step !== 0 && step === 2 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2189
|
-
className: `${button_bar_index_module.button} button`,
|
|
2190
|
-
onClick: () => removeReservedTicket()
|
|
2191
|
-
}, "< Back"), step === 0 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2192
|
-
disabled: !ticketType,
|
|
2193
|
-
className: `${button_bar_index_module.button} button`,
|
|
2194
|
-
onClick: () => changeStep(step + 1)
|
|
2195
|
-
}, nextButtonText), step === 1 && (ticketType === null || ticketType === void 0 ? void 0 : ticketType.cost) === 0 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2196
|
-
className: `${button_bar_index_module.button} button`,
|
|
2197
|
-
type: "submit",
|
|
2198
|
-
form: "personal-info-form"
|
|
2199
|
-
}, "Get Ticket"), step === 1 && (ticketType === null || ticketType === void 0 ? void 0 : ticketType.cost) > 0 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2200
|
-
className: `${button_bar_index_module.button} button`,
|
|
2201
|
-
type: "submit",
|
|
2202
|
-
form: "personal-info-form"
|
|
2203
|
-
}, "Next"), step === 2 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
2204
|
-
className: `${button_bar_index_module.button} button`,
|
|
2205
|
-
type: "submit",
|
|
2206
|
-
form: "payment-form"
|
|
2207
|
-
}, "Pay Now")))));
|
|
2208
|
-
};
|
|
2209
|
-
|
|
2210
|
-
/* harmony default export */ const button_bar = (ButtonBarComponent);
|
|
2211
|
-
;// CONCATENATED MODULE: ./src/components/purchase-complete/index.module.scss
|
|
2212
|
-
// extracted by mini-css-extract-plugin
|
|
2213
|
-
/* harmony default export */ const purchase_complete_index_module = ({"button":"button___XMN8a","wrapper":"wrapper___Jd5Xg","circle":"circle___lcN86","complete":"complete___HAHzl","actions":"actions___jJdPX","footer":"footer___FL9TW"});
|
|
2214
|
-
;// CONCATENATED MODULE: ./src/components/purchase-complete/index.js
|
|
2215
|
-
/**
|
|
2216
|
-
* Copyright 2020 OpenStack Foundation
|
|
2217
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2218
|
-
* you may not use this file except in compliance with the License.
|
|
2219
|
-
* You may obtain a copy of the License at
|
|
2220
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2221
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2222
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2223
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2224
|
-
* See the License for the specific language governing permissions and
|
|
2225
|
-
* limitations under the License.
|
|
2226
|
-
**/
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
const PurchaseComplete = ({
|
|
2232
|
-
checkout,
|
|
2233
|
-
onPurchaseComplete,
|
|
2234
|
-
goToExtraQuestions,
|
|
2235
|
-
goToEvent,
|
|
2236
|
-
summit,
|
|
2237
|
-
supportEmail = "support@fntech.com"
|
|
2238
|
-
}) => {
|
|
2239
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2240
|
-
onPurchaseComplete(checkout);
|
|
2241
|
-
}, []);
|
|
2242
|
-
const date = new Date();
|
|
2243
|
-
let now_utc = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()) / 1000;
|
|
2244
|
-
const isActive = summit.start_date < now_utc && summit.end_date > now_utc;
|
|
2245
|
-
const startDateFormatted = {
|
|
2246
|
-
date: (0,methods_namespaceObject.epochToMomentTimeZone)(summit.start_date, summit.time_zone_id).format('MMMM D'),
|
|
2247
|
-
time: (0,methods_namespaceObject.epochToMomentTimeZone)(summit.start_date, summit.time_zone_id).format('hh:mm A')
|
|
2248
|
-
};
|
|
2249
|
-
|
|
2250
|
-
const needExtraQuestions = () => {
|
|
2251
|
-
return summit.order_extra_questions.some(q => q.mandatory === true) ? true : false;
|
|
2252
|
-
};
|
|
2253
|
-
|
|
2254
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2255
|
-
className: purchase_complete_index_module.wrapper
|
|
2256
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2257
|
-
className: purchase_complete_index_module.circle
|
|
2258
|
-
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
2259
|
-
className: "fa fa-ticket"
|
|
2260
|
-
})), /*#__PURE__*/external_react_default().createElement("span", {
|
|
2261
|
-
className: purchase_complete_index_module.complete
|
|
2262
|
-
}, "Your order is complete"), isActive ? needExtraQuestions() ? /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", null, "This ticket requires additional details. ", /*#__PURE__*/external_react_default().createElement("br", null)), /*#__PURE__*/external_react_default().createElement("button", {
|
|
2263
|
-
className: `${purchase_complete_index_module.button} button`,
|
|
2264
|
-
onClick: () => goToExtraQuestions()
|
|
2265
|
-
}, "Finish now")) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("button", {
|
|
2266
|
-
className: `${purchase_complete_index_module.button} button`,
|
|
2267
|
-
onClick: () => goToEvent()
|
|
2268
|
-
}, "Access event now")) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", null, "The event will start on ", startDateFormatted.date, " at ", startDateFormatted.time, " ", summit.time_zone_label, " ", /*#__PURE__*/external_react_default().createElement("br", null), "This ticket requires additional details."), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2269
|
-
className: purchase_complete_index_module.actions
|
|
2270
|
-
}, /*#__PURE__*/external_react_default().createElement("button", {
|
|
2271
|
-
className: `${purchase_complete_index_module.button} button`,
|
|
2272
|
-
onClick: () => goToExtraQuestions()
|
|
2273
|
-
}, "Finish Now"))), /*#__PURE__*/external_react_default().createElement("span", {
|
|
2274
|
-
className: purchase_complete_index_module.footer
|
|
2275
|
-
}, "For further assistance, please email ", /*#__PURE__*/external_react_default().createElement("a", {
|
|
2276
|
-
href: `mailto:${supportEmail}`
|
|
2277
|
-
}, supportEmail)));
|
|
2278
|
-
};
|
|
2279
|
-
|
|
2280
|
-
/* harmony default export */ const purchase_complete = (PurchaseComplete);
|
|
2281
|
-
;// CONCATENATED MODULE: external "react-otp-input"
|
|
2282
|
-
const external_react_otp_input_namespaceObject = require("react-otp-input");
|
|
2283
|
-
var external_react_otp_input_default = /*#__PURE__*/__webpack_require__.n(external_react_otp_input_namespaceObject);
|
|
2284
|
-
;// CONCATENATED MODULE: ./src/components/login-passwordless/index.module.scss
|
|
2285
|
-
// extracted by mini-css-extract-plugin
|
|
2286
|
-
/* harmony default export */ const login_passwordless_index_module = ({"passwordlessWrapper":"passwordlessWrapper___BRQ_s","innerWrapper":"innerWrapper___nRLDi","digits":"digits___Vu5iy","codeInput":"codeInput___LnTZe","error":"error___wZflZ","verify":"verify___IBgMl","button":"button___nBhtQ","link":"link___f6fDT","resend":"resend___Nma1U"});
|
|
2287
|
-
;// CONCATENATED MODULE: ./src/components/login-passwordless/index.js
|
|
2288
|
-
/**
|
|
2289
|
-
* Copyright 2020 OpenStack Foundation
|
|
2290
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2291
|
-
* you may not use this file except in compliance with the License.
|
|
2292
|
-
* You may obtain a copy of the License at
|
|
2293
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2294
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2295
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2296
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2297
|
-
* See the License for the specific language governing permissions and
|
|
2298
|
-
* limitations under the License.
|
|
2299
|
-
**/
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
const PasswordlessLoginComponent = ({
|
|
2306
|
-
email,
|
|
2307
|
-
codeLength,
|
|
2308
|
-
passwordlessLogin,
|
|
2309
|
-
loginWithCode,
|
|
2310
|
-
codeError,
|
|
2311
|
-
goToLogin,
|
|
2312
|
-
getLoginCode,
|
|
2313
|
-
getPasswordlessCode
|
|
2314
|
-
}) => {
|
|
2315
|
-
const [otpCode, setOtpCode] = (0,external_react_namespaceObject.useState)('');
|
|
2316
|
-
const [otpError, setOtpError] = (0,external_react_namespaceObject.useState)(false);
|
|
2317
|
-
|
|
2318
|
-
const tryPasswordlessLogin = code => {
|
|
2319
|
-
if (code.length === codeLength) {
|
|
2320
|
-
setOtpError(false);
|
|
2321
|
-
passwordlessLogin(otpCode, loginWithCode);
|
|
2322
|
-
} else {
|
|
2323
|
-
setOtpError(true);
|
|
2324
|
-
}
|
|
2325
|
-
};
|
|
2326
|
-
|
|
2327
|
-
const resendCode = () => {
|
|
2328
|
-
getLoginCode(email, getPasswordlessCode);
|
|
2329
|
-
};
|
|
2330
|
-
|
|
2331
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2332
|
-
className: `${login_passwordless_index_module.passwordlessWrapper} step-wrapper`
|
|
2333
|
-
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2334
|
-
className: `${login_passwordless_index_module.innerWrapper}`
|
|
2335
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, "We sent your single-use login code to ", /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
2336
|
-
"data-testid": "email"
|
|
2337
|
-
}, email), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
2338
|
-
className: login_passwordless_index_module.digits,
|
|
2339
|
-
"data-testid": "code-digits"
|
|
2340
|
-
}, "Add the ", codeLength, " digit code below")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2341
|
-
className: login_passwordless_index_module.codeInput
|
|
2342
|
-
}, /*#__PURE__*/external_react_default().createElement((external_react_otp_input_default()), {
|
|
2343
|
-
value: otpCode,
|
|
2344
|
-
onChange: code => setOtpCode(code),
|
|
2345
|
-
numInputs: codeLength,
|
|
2346
|
-
shouldAutoFocus: true,
|
|
2347
|
-
hasErrored: otpError || codeError,
|
|
2348
|
-
errorStyle: {
|
|
2349
|
-
border: '1px solid #e5424d'
|
|
2350
|
-
},
|
|
2351
|
-
"data-testid": "otp-input"
|
|
2352
|
-
})), codeError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
2353
|
-
className: login_passwordless_index_module.error,
|
|
2354
|
-
"data-testid": "error"
|
|
2355
|
-
}, "The code you entered it's incorrect. ", /*#__PURE__*/external_react_default().createElement("br", null), " Please try again."), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2356
|
-
className: login_passwordless_index_module.verify
|
|
2357
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2358
|
-
className: `${login_passwordless_index_module.button} button`,
|
|
2359
|
-
onClick: () => tryPasswordlessLogin(otpCode),
|
|
2360
|
-
"data-testid": "verify"
|
|
2361
|
-
}, "Verify Email"), /*#__PURE__*/external_react_default().createElement("b", null, "or go back and ", /*#__PURE__*/external_react_default().createElement("span", {
|
|
2362
|
-
className: login_passwordless_index_module.link,
|
|
2363
|
-
onClick: () => goToLogin(),
|
|
2364
|
-
"data-testid": "go-back"
|
|
2365
|
-
}, "try another way")))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2366
|
-
className: login_passwordless_index_module.resend
|
|
2367
|
-
}, "Didn\u2019t receive it? Check your spam/junk folder, or ", /*#__PURE__*/external_react_default().createElement("span", {
|
|
2368
|
-
className: login_passwordless_index_module.link,
|
|
2369
|
-
onClick: () => resendCode(),
|
|
2370
|
-
"data-testid": "resend"
|
|
2371
|
-
}, "resend email"), " now.")));
|
|
2372
|
-
};
|
|
2373
|
-
|
|
2374
|
-
/* harmony default export */ const login_passwordless = (PasswordlessLoginComponent);
|
|
2375
|
-
;// CONCATENATED MODULE: ./src/components/ticket-owned/index.module.scss
|
|
2376
|
-
// extracted by mini-css-extract-plugin
|
|
2377
|
-
/* harmony default export */ const ticket_owned_index_module = ({"ticketOwnedWrapper":"ticketOwnedWrapper___nhkDY","alert":"alert___c49oP"});
|
|
2378
|
-
;// CONCATENATED MODULE: ./src/components/ticket-owned/index.js
|
|
2379
|
-
/**
|
|
2380
|
-
* Copyright 2020 OpenStack Foundation
|
|
2381
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2382
|
-
* you may not use this file except in compliance with the License.
|
|
2383
|
-
* You may obtain a copy of the License at
|
|
2384
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2385
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2386
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2387
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2388
|
-
* See the License for the specific language governing permissions and
|
|
2389
|
-
* limitations under the License.
|
|
2390
|
-
**/
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
const TicketOwnedComponent = ({
|
|
2395
|
-
ownedTickets,
|
|
2396
|
-
ticketTypes
|
|
2397
|
-
}) => {
|
|
2398
|
-
const ownedTicketsString = (0,external_react_namespaceObject.useMemo)(() => ownedTickets.reduce((acc, ownedTicket) => {
|
|
2399
|
-
const ticketType = ticketTypes.find(type => type.id === ownedTicket.type_id);
|
|
2400
|
-
if (!ticketType) return acc;
|
|
2401
|
-
return `${acc}${acc ? ', ' : ''}${ownedTicket.qty} ${ticketType.name}${!ticketType.name.toLowerCase().endsWith('ticket') ? ' ticket' : ''}${ownedTicket.qty > 1 ? 's' : ''}`;
|
|
2402
|
-
}, ''), [ownedTickets, ticketTypes]);
|
|
2403
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2404
|
-
className: ticket_owned_index_module.ticketOwnedWrapper
|
|
2405
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2406
|
-
className: `${ticket_owned_index_module.alert} alert alert-warning`,
|
|
2407
|
-
role: "alert"
|
|
2408
|
-
}, "You have already ordered ", ownedTicketsString, ". If you would like to order more tickets, please do so below."));
|
|
2409
|
-
};
|
|
2410
|
-
|
|
2411
|
-
/* harmony default export */ const ticket_owned = (TicketOwnedComponent);
|
|
2412
|
-
;// CONCATENATED MODULE: ./src/utils/utils.js
|
|
2413
|
-
/**
|
|
2414
|
-
* Copyright 2022 OpenStack Foundation
|
|
2415
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2416
|
-
* you may not use this file except in compliance with the License.
|
|
2417
|
-
* You may obtain a copy of the License at
|
|
2418
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2419
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2420
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2421
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2422
|
-
* See the License for the specific language governing permissions and
|
|
2423
|
-
* limitations under the License.
|
|
2424
|
-
**/
|
|
2425
|
-
const getCurrentProvider = summit => {
|
|
2426
|
-
for (let profile of summit.payment_profiles) {
|
|
2427
|
-
if (profile.application_type === 'Registration') {
|
|
2428
|
-
return {
|
|
2429
|
-
publicKey: profile.test_mode_enabled ? profile.test_publishable_key : profile.live_publishable_key,
|
|
2430
|
-
provider: profile.provider
|
|
2431
|
-
};
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
|
|
2435
|
-
return {
|
|
2436
|
-
publicKey: null,
|
|
2437
|
-
provider: ''
|
|
2438
|
-
};
|
|
2439
|
-
};
|
|
2440
|
-
;// CONCATENATED MODULE: ./src/components/registration-lite.js
|
|
2441
|
-
const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypes", "getTaxesTypes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToEvent", "goToRegistration", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions"];
|
|
2442
|
-
|
|
2443
|
-
function registration_lite_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2444
|
-
|
|
2445
|
-
function registration_lite_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? registration_lite_ownKeys(Object(source), !0).forEach(function (key) { registration_lite_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : registration_lite_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2446
|
-
|
|
2447
|
-
function registration_lite_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2448
|
-
|
|
2449
|
-
function registration_lite_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = registration_lite_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2450
|
-
|
|
2451
|
-
function registration_lite_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2452
|
-
|
|
2453
|
-
/**
|
|
2454
|
-
* Copyright 2020 OpenStack Foundation
|
|
2455
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2456
|
-
* you may not use this file except in compliance with the License.
|
|
2457
|
-
* You may obtain a copy of the License at
|
|
2458
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2459
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2460
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2461
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2462
|
-
* See the License for the specific language governing permissions and
|
|
2463
|
-
* limitations under the License.
|
|
2464
|
-
**/
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
const RegistrationLite = _ref => {
|
|
2484
|
-
var _formValues$ticketTyp, _formValues$ticketTyp2;
|
|
2485
|
-
|
|
2486
|
-
let {
|
|
2487
|
-
loadSession,
|
|
2488
|
-
setMarketingSettings,
|
|
2489
|
-
changeStep,
|
|
2490
|
-
removeReservedTicket,
|
|
2491
|
-
reserveTicket,
|
|
2492
|
-
payTicketWithProvider,
|
|
2493
|
-
onPurchaseComplete,
|
|
2494
|
-
getTicketTypes,
|
|
2495
|
-
getTaxesTypes,
|
|
2496
|
-
getLoginCode,
|
|
2497
|
-
passwordlessLogin,
|
|
2498
|
-
goToLogin,
|
|
2499
|
-
loginOptions,
|
|
2500
|
-
allowsNativeAuth,
|
|
2501
|
-
allowsOtpAuth,
|
|
2502
|
-
reservation,
|
|
2503
|
-
checkout,
|
|
2504
|
-
ticketTypes,
|
|
2505
|
-
taxTypes,
|
|
2506
|
-
step,
|
|
2507
|
-
passwordlessCodeSent,
|
|
2508
|
-
passwordlessEmail,
|
|
2509
|
-
passwordlessCode,
|
|
2510
|
-
getPasswordlessCode,
|
|
2511
|
-
passwordlessCodeError,
|
|
2512
|
-
loginWithCode,
|
|
2513
|
-
goToExtraQuestions,
|
|
2514
|
-
goToEvent,
|
|
2515
|
-
goToRegistration,
|
|
2516
|
-
profileData,
|
|
2517
|
-
summitData,
|
|
2518
|
-
supportEmail,
|
|
2519
|
-
ticketOwned,
|
|
2520
|
-
ownedTickets,
|
|
2521
|
-
widgetLoading,
|
|
2522
|
-
loading,
|
|
2523
|
-
inPersonDisclaimer,
|
|
2524
|
-
userProfile,
|
|
2525
|
-
handleCompanyError,
|
|
2526
|
-
stripeOptions
|
|
2527
|
-
} = _ref,
|
|
2528
|
-
rest = registration_lite_objectWithoutProperties(_ref, registration_lite_excluded);
|
|
2529
|
-
|
|
2530
|
-
const [registrationForm, setRegistrationForm] = (0,external_react_namespaceObject.useState)({
|
|
2531
|
-
values: {
|
|
2532
|
-
ticketType: null,
|
|
2533
|
-
ticketQuantity: 1,
|
|
2534
|
-
personalInformation: null,
|
|
2535
|
-
paymentInformation: null
|
|
2536
|
-
},
|
|
2537
|
-
errors: []
|
|
2538
|
-
});
|
|
2539
|
-
const {
|
|
2540
|
-
values: formValues,
|
|
2541
|
-
errors: formErrors
|
|
2542
|
-
} = registrationForm;
|
|
2543
|
-
|
|
2544
|
-
const setFormValues = values => setRegistrationForm(registration_lite_objectSpread(registration_lite_objectSpread({}, registrationForm), {}, {
|
|
2545
|
-
values
|
|
2546
|
-
}));
|
|
2547
|
-
|
|
2548
|
-
const setFormErrors = errors => setRegistrationForm(registration_lite_objectSpread(registration_lite_objectSpread({}, registrationForm), {}, {
|
|
2549
|
-
errors
|
|
2550
|
-
}));
|
|
2551
|
-
|
|
2552
|
-
const {
|
|
2553
|
-
publicKey,
|
|
2554
|
-
provider
|
|
2555
|
-
} = getCurrentProvider(summitData);
|
|
2556
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2557
|
-
loadSession(registration_lite_objectSpread(registration_lite_objectSpread({}, rest), {}, {
|
|
2558
|
-
summitData,
|
|
2559
|
-
profileData
|
|
2560
|
-
}));
|
|
2561
|
-
|
|
2562
|
-
if (!profileData) {
|
|
2563
|
-
changeStep(0);
|
|
2564
|
-
}
|
|
2565
|
-
}, [profileData]);
|
|
2566
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2567
|
-
if (summitData && profileData) {
|
|
2568
|
-
getTicketTypes(summitData.id).then(() => getTaxesTypes(summitData.id));
|
|
2569
|
-
}
|
|
2570
|
-
}, [summitData, profileData]);
|
|
2571
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2572
|
-
if (step === 1 && formValues !== null && formValues !== void 0 && formValues.ticketType && formValues !== null && formValues !== void 0 && formValues.personalInformation) {
|
|
2573
|
-
reserveTicket({
|
|
2574
|
-
provider,
|
|
2575
|
-
personalInformation: formValues === null || formValues === void 0 ? void 0 : formValues.personalInformation,
|
|
2576
|
-
ticket: formValues === null || formValues === void 0 ? void 0 : formValues.ticketType,
|
|
2577
|
-
ticketQuantity: formValues === null || formValues === void 0 ? void 0 : formValues.ticketQuantity
|
|
2578
|
-
}, {
|
|
2579
|
-
onError: (err, res) => setFormErrors(res.body.errors)
|
|
2580
|
-
});
|
|
2581
|
-
}
|
|
2582
|
-
|
|
2583
|
-
if (step > 0 && !(formValues !== null && formValues !== void 0 && formValues.ticketType)) {
|
|
2584
|
-
changeStep(0);
|
|
2585
|
-
}
|
|
2586
|
-
}, [formValues]);
|
|
2587
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
2588
|
-
setFormErrors([]);
|
|
2589
|
-
}, [step]);
|
|
2590
|
-
const [ref, {
|
|
2591
|
-
height
|
|
2592
|
-
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
2593
|
-
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
2594
|
-
config: registration_lite_objectSpread({
|
|
2595
|
-
bounce: 0
|
|
2596
|
-
}, external_react_spring_namespaceObject.config.stiff),
|
|
2597
|
-
to: {
|
|
2598
|
-
opacity: (formValues === null || formValues === void 0 ? void 0 : (_formValues$ticketTyp = formValues.ticketType) === null || _formValues$ticketTyp === void 0 ? void 0 : _formValues$ticketTyp.cost) === 0 ? 0 : 1,
|
|
2599
|
-
height: (formValues === null || formValues === void 0 ? void 0 : (_formValues$ticketTyp2 = formValues.ticketType) === null || _formValues$ticketTyp2 === void 0 ? void 0 : _formValues$ticketTyp2.cost) === 0 ? 0 : height
|
|
2600
|
-
}
|
|
2601
|
-
});
|
|
2602
|
-
|
|
2603
|
-
const handleCloseClick = () => {
|
|
2604
|
-
// Reset the step when closed to avoid unexpected behavior from `useEffect`s w/in other steps.
|
|
2605
|
-
// (i.e., recalling `onPurchaseComplete` after a user completes one order, closes the window, and then reopens the registration widget)
|
|
2606
|
-
changeStep(0);
|
|
2607
|
-
rest.closeWidget();
|
|
2608
|
-
};
|
|
2609
|
-
|
|
2610
|
-
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2611
|
-
id: `${general_module.modal}`,
|
|
2612
|
-
className: "modal is-active"
|
|
2613
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2614
|
-
className: "modal-background"
|
|
2615
|
-
}), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2616
|
-
className: `${general_module.modalContent} modal-content`
|
|
2617
|
-
}, /*#__PURE__*/external_react_default().createElement((ajaxloader_default()), {
|
|
2618
|
-
relative: true,
|
|
2619
|
-
color: '#ffffff',
|
|
2620
|
-
show: widgetLoading || loading,
|
|
2621
|
-
size: 80
|
|
2622
|
-
}), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2623
|
-
className: `${general_module.outerWrapper} summit-registration-lite`
|
|
2624
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2625
|
-
className: general_module.innerWrapper
|
|
2626
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2627
|
-
className: general_module.title
|
|
2628
|
-
}, /*#__PURE__*/external_react_default().createElement("span", null, summitData.name), /*#__PURE__*/external_react_default().createElement("i", {
|
|
2629
|
-
className: "fa fa-close",
|
|
2630
|
-
"aria-label": "close",
|
|
2631
|
-
onClick: handleCloseClick
|
|
2632
|
-
})), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2633
|
-
className: general_module.stepsWrapper
|
|
2634
|
-
}, !profileData && !passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(login, {
|
|
2635
|
-
options: loginOptions,
|
|
2636
|
-
allowsNativeAuth: allowsNativeAuth,
|
|
2637
|
-
allowsOtpAuth: allowsOtpAuth,
|
|
2638
|
-
login: provider => rest.authUser(provider),
|
|
2639
|
-
getLoginCode: getLoginCode,
|
|
2640
|
-
getPasswordlessCode: getPasswordlessCode
|
|
2641
|
-
}), !profileData && passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(login_passwordless, {
|
|
2642
|
-
codeLength: passwordlessCode,
|
|
2643
|
-
email: passwordlessEmail,
|
|
2644
|
-
passwordlessLogin: passwordlessLogin,
|
|
2645
|
-
loginWithCode: loginWithCode,
|
|
2646
|
-
codeError: passwordlessCodeError,
|
|
2647
|
-
goToLogin: goToLogin,
|
|
2648
|
-
getLoginCode: getLoginCode,
|
|
2649
|
-
getPasswordlessCode: getPasswordlessCode
|
|
2650
|
-
}), profileData && step !== 3 && ticketTypes.length > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, ticketOwned && /*#__PURE__*/external_react_default().createElement(ticket_owned, {
|
|
2651
|
-
ownedTickets: ownedTickets,
|
|
2652
|
-
ticketTypes: ticketTypes
|
|
2653
|
-
}), /*#__PURE__*/external_react_default().createElement(ticket_type, {
|
|
2654
|
-
ticketTypes: ticketTypes,
|
|
2655
|
-
inPersonDisclaimer: inPersonDisclaimer,
|
|
2656
|
-
taxTypes: taxTypes,
|
|
2657
|
-
reservation: reservation,
|
|
2658
|
-
isActive: step === 0,
|
|
2659
|
-
changeForm: ticketForm => setFormValues(registration_lite_objectSpread(registration_lite_objectSpread({}, formValues), ticketForm))
|
|
2660
|
-
}), /*#__PURE__*/external_react_default().createElement(personal_information, {
|
|
2661
|
-
isActive: step === 1,
|
|
2662
|
-
reservation: reservation,
|
|
2663
|
-
userProfile: profileData,
|
|
2664
|
-
summitId: summitData.id,
|
|
2665
|
-
changeForm: personalInformation => setFormValues(registration_lite_objectSpread(registration_lite_objectSpread({}, formValues), {}, {
|
|
2666
|
-
personalInformation
|
|
2667
|
-
})),
|
|
2668
|
-
handleCompanyError: handleCompanyError,
|
|
2669
|
-
formValues: formValues,
|
|
2670
|
-
formErrors: formErrors
|
|
2671
|
-
}), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
2672
|
-
style: registration_lite_objectSpread({}, toggleAnimation)
|
|
2673
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2674
|
-
ref: ref
|
|
2675
|
-
}, /*#__PURE__*/external_react_default().createElement(payment, {
|
|
2676
|
-
isActive: step === 2,
|
|
2677
|
-
reservation: reservation,
|
|
2678
|
-
payTicket: payTicketWithProvider,
|
|
2679
|
-
userProfile: profileData,
|
|
2680
|
-
timestamp: summitData.timestamp,
|
|
2681
|
-
provider: provider,
|
|
2682
|
-
providerKey: publicKey,
|
|
2683
|
-
stripeOptions: stripeOptions
|
|
2684
|
-
})))), profileData && step === 3 && /*#__PURE__*/external_react_default().createElement(purchase_complete, {
|
|
2685
|
-
checkout: checkout,
|
|
2686
|
-
summit: summitData,
|
|
2687
|
-
onPurchaseComplete: onPurchaseComplete,
|
|
2688
|
-
supportEmail: supportEmail,
|
|
2689
|
-
goToEvent: goToEvent,
|
|
2690
|
-
goToExtraQuestions: goToExtraQuestions
|
|
2691
|
-
})), profileData && step !== 3 && /*#__PURE__*/external_react_default().createElement(button_bar, {
|
|
2692
|
-
step: step,
|
|
2693
|
-
inPersonDisclaimer: inPersonDisclaimer,
|
|
2694
|
-
formValues: formValues,
|
|
2695
|
-
removeReservedTicket: removeReservedTicket,
|
|
2696
|
-
changeStep: changeStep
|
|
2697
|
-
})))));
|
|
2698
|
-
};
|
|
2699
|
-
|
|
2700
|
-
const registration_lite_mapStateToProps = ({
|
|
2701
|
-
registrationLiteState
|
|
2702
|
-
}) => ({
|
|
2703
|
-
widgetLoading: registrationLiteState.widgetLoading,
|
|
2704
|
-
reservation: registrationLiteState.reservation,
|
|
2705
|
-
userProfile: registrationLiteState.settings.userProfile,
|
|
2706
|
-
checkout: registrationLiteState.checkout,
|
|
2707
|
-
ticketTypes: registrationLiteState.ticketTypes,
|
|
2708
|
-
taxTypes: registrationLiteState.taxTypes,
|
|
2709
|
-
step: registrationLiteState.step,
|
|
2710
|
-
passwordlessEmail: registrationLiteState.passwordless.email,
|
|
2711
|
-
passwordlessCode: registrationLiteState.passwordless.otp_length,
|
|
2712
|
-
passwordlessCodeSent: registrationLiteState.passwordless.code_sent,
|
|
2713
|
-
passwordlessCodeError: registrationLiteState.passwordless.error
|
|
2714
|
-
});
|
|
2715
|
-
|
|
2716
|
-
/* harmony default export */ const registration_lite = ((0,external_react_redux_namespaceObject.connect)(registration_lite_mapStateToProps, {
|
|
2717
|
-
loadSession: loadSession,
|
|
2718
|
-
changeStep: changeStep,
|
|
2719
|
-
reserveTicket: reserveTicket,
|
|
2720
|
-
removeReservedTicket: removeReservedTicket,
|
|
2721
|
-
payTicketWithProvider: payTicketWithProvider,
|
|
2722
|
-
getTicketTypes: getTicketTypes,
|
|
2723
|
-
getTaxesTypes: getTaxesTypes,
|
|
2724
|
-
getLoginCode: getLoginCode,
|
|
2725
|
-
passwordlessLogin: passwordlessLogin,
|
|
2726
|
-
goToLogin: goToLogin
|
|
2727
|
-
})(RegistrationLite));
|
|
2728
|
-
;// CONCATENATED MODULE: ./src/summit-registration-lite.js
|
|
2729
|
-
/**
|
|
2730
|
-
* Copyright 2017 OpenStack Foundation
|
|
2731
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2732
|
-
* you may not use this file except in compliance with the License.
|
|
2733
|
-
* You may obtain a copy of the License at
|
|
2734
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2735
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
2736
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2737
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2738
|
-
* See the License for the specific language governing permissions and
|
|
2739
|
-
* limitations under the License.
|
|
2740
|
-
**/
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
class RegistrationLiteWidget extends (external_react_default()).PureComponent {
|
|
2748
|
-
constructor(props) {
|
|
2749
|
-
super(props);
|
|
2750
|
-
this.store = getStore(props.clientId, props.apiBaseUrl, props.getAccessToken);
|
|
2751
|
-
}
|
|
2752
|
-
|
|
2753
|
-
render() {
|
|
2754
|
-
return /*#__PURE__*/external_react_default().createElement(external_react_redux_namespaceObject.Provider, {
|
|
2755
|
-
store: this.store
|
|
2756
|
-
}, /*#__PURE__*/external_react_default().createElement(react_namespaceObject.PersistGate, {
|
|
2757
|
-
persistor: getPersistor()
|
|
2758
|
-
}, /*#__PURE__*/external_react_default().createElement(registration_lite, this.props)));
|
|
2759
|
-
}
|
|
2760
|
-
|
|
2761
|
-
}
|
|
2762
|
-
|
|
2763
|
-
/* harmony default export */ const summit_registration_lite = (RegistrationLiteWidget);
|
|
2764
|
-
/******/ return __webpack_exports__;
|
|
2765
|
-
/******/ })()
|
|
2766
|
-
;
|
|
2767
|
-
});
|