tf-checkout-react-native 1.0.39 → 1.0.42
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/lib/index.js +609 -101
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +609 -101
- package/lib/index.mjs.map +1 -1
- package/lib/typescript/src/apiv2/index.d.ts +3 -0
- package/lib/typescript/src/apiv2/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/apiv2/index.ts +142 -0
- package/src/index.tsx +1 -1
package/lib/index.mjs
CHANGED
|
@@ -3432,7 +3432,7 @@ var fetchTickets = async ({
|
|
|
3432
3432
|
};
|
|
3433
3433
|
}
|
|
3434
3434
|
const eventId = Config.EVENT_ID.toString();
|
|
3435
|
-
const
|
|
3435
|
+
const headers2 = {
|
|
3436
3436
|
"Promotion-Event": eventId,
|
|
3437
3437
|
"Promotion-Code": promoCode,
|
|
3438
3438
|
"Referrer-Id": referredId
|
|
@@ -3440,21 +3440,21 @@ var fetchTickets = async ({
|
|
|
3440
3440
|
let responseError;
|
|
3441
3441
|
let response;
|
|
3442
3442
|
if (!referredId) {
|
|
3443
|
-
delete
|
|
3443
|
+
delete headers2["Referrer-Id"];
|
|
3444
3444
|
}
|
|
3445
3445
|
if (!promoCode) {
|
|
3446
|
-
delete
|
|
3446
|
+
delete headers2["Promotion-Code"];
|
|
3447
3447
|
}
|
|
3448
3448
|
if (!promoCode && !referredId) {
|
|
3449
|
-
delete
|
|
3449
|
+
delete headers2["Promotion-Event"];
|
|
3450
3450
|
}
|
|
3451
|
-
if (promoCode && referredId &&
|
|
3452
|
-
delete
|
|
3451
|
+
if (promoCode && referredId && headers2["Referrer-Id"]) {
|
|
3452
|
+
delete headers2["Referrer-Id"];
|
|
3453
3453
|
}
|
|
3454
3454
|
try {
|
|
3455
3455
|
response = await Client.get(`v1/event/${eventId}/tickets/`, {
|
|
3456
3456
|
//@ts-ignore
|
|
3457
|
-
headers
|
|
3457
|
+
headers: headers2
|
|
3458
3458
|
});
|
|
3459
3459
|
} catch (error) {
|
|
3460
3460
|
const axiosError = error;
|
|
@@ -5987,8 +5987,8 @@ var WaitingList_default = WaitingList;
|
|
|
5987
5987
|
// src/containers/billingInfo/Billing.tsx
|
|
5988
5988
|
import _every from "lodash/every";
|
|
5989
5989
|
import _find3 from "lodash/find";
|
|
5990
|
-
import
|
|
5991
|
-
import
|
|
5990
|
+
import _forEach4 from "lodash/forEach";
|
|
5991
|
+
import _map4 from "lodash/map";
|
|
5992
5992
|
import React32, {
|
|
5993
5993
|
forwardRef as forwardRef14,
|
|
5994
5994
|
useCallback as useCallback9,
|
|
@@ -9386,43 +9386,512 @@ var countryCodes = [
|
|
|
9386
9386
|
];
|
|
9387
9387
|
|
|
9388
9388
|
// ../tf-checkout-shared/dist/index.mjs
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9389
|
+
import axios from "axios";
|
|
9390
|
+
import _get2 from "lodash/get";
|
|
9391
|
+
import _forEach3 from "lodash/forEach";
|
|
9392
|
+
import _map3 from "lodash/map";
|
|
9393
|
+
|
|
9394
|
+
// ../../node_modules/.pnpm/nanoid@3.3.11/node_modules/nanoid/non-secure/index.js
|
|
9395
|
+
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
9396
|
+
var nanoid = (size = 21) => {
|
|
9397
|
+
let id = "";
|
|
9398
|
+
let i = size | 0;
|
|
9399
|
+
while (i--) {
|
|
9400
|
+
id += urlAlphabet[Math.random() * 64 | 0];
|
|
9401
|
+
}
|
|
9402
|
+
return id;
|
|
9392
9403
|
};
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9404
|
+
|
|
9405
|
+
// ../tf-checkout-shared/dist/index.mjs
|
|
9406
|
+
function getDomain(url, subdomain, publicSuffix) {
|
|
9407
|
+
let updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, "");
|
|
9408
|
+
if (!subdomain) {
|
|
9409
|
+
if (publicSuffix) {
|
|
9410
|
+
const updatedPublicSuffix = publicSuffix.startsWith(".") ? publicSuffix : "." + publicSuffix;
|
|
9411
|
+
updatedUrl = url.replace(updatedPublicSuffix, "").split(".");
|
|
9412
|
+
updatedUrl = updatedUrl.length > 0 ? updatedUrl[updatedUrl.length - 1] : "";
|
|
9413
|
+
updatedUrl += updatedPublicSuffix;
|
|
9414
|
+
} else {
|
|
9415
|
+
updatedUrl = updatedUrl.split(".");
|
|
9416
|
+
updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join(".");
|
|
9417
|
+
}
|
|
9418
|
+
}
|
|
9419
|
+
if (updatedUrl.indexOf("/") !== -1) {
|
|
9420
|
+
return updatedUrl.split("/")[0];
|
|
9421
|
+
}
|
|
9422
|
+
return updatedUrl;
|
|
9423
|
+
}
|
|
9424
|
+
var generalDomain;
|
|
9425
|
+
function setCustomCookie(name, value, days = 5) {
|
|
9426
|
+
let expires = "";
|
|
9427
|
+
if (days) {
|
|
9428
|
+
const date2 = /* @__PURE__ */ new Date();
|
|
9429
|
+
date2.setTime(date2.getTime() + days * 24 * 60 * 60 * 1e3);
|
|
9430
|
+
expires = "; expires=" + date2.toUTCString();
|
|
9431
|
+
}
|
|
9432
|
+
if (typeof window === "undefined") {
|
|
9433
|
+
return;
|
|
9434
|
+
}
|
|
9435
|
+
const { hostname } = window.location;
|
|
9436
|
+
if (generalDomain && generalDomain.endsWith(getDomain(hostname))) {
|
|
9437
|
+
document.cookie = name + "=" + (value || "") + expires + `; path=/;domain=${generalDomain}`;
|
|
9438
|
+
return;
|
|
9439
|
+
}
|
|
9440
|
+
let previousDomain = void 0;
|
|
9441
|
+
let domain = void 0;
|
|
9442
|
+
do {
|
|
9443
|
+
previousDomain = domain;
|
|
9444
|
+
domain = getDomain(hostname, void 0, previousDomain);
|
|
9445
|
+
document.cookie = name + "=" + (value || "") + expires + `; path=/;domain=${domain}`;
|
|
9446
|
+
} while (getCookieByName(name) === "" && hostname !== domain);
|
|
9447
|
+
generalDomain = domain;
|
|
9448
|
+
}
|
|
9449
|
+
function getCookieByName(cname) {
|
|
9450
|
+
if (typeof window === "undefined") return "";
|
|
9451
|
+
const name = cname + "=";
|
|
9452
|
+
const ca = document.cookie.split(";");
|
|
9453
|
+
for (let i = 0; i < ca.length; i++) {
|
|
9454
|
+
let c = ca[i];
|
|
9455
|
+
while (c.charAt(0) === " ") {
|
|
9456
|
+
c = c.substring(1);
|
|
9457
|
+
}
|
|
9458
|
+
if (c.indexOf(name) === 0) {
|
|
9459
|
+
return c.substring(name.length, c.length);
|
|
9460
|
+
}
|
|
9461
|
+
}
|
|
9462
|
+
return "";
|
|
9463
|
+
}
|
|
9464
|
+
function deleteCookieByName(name) {
|
|
9465
|
+
if (getCookieByName(name) === "") {
|
|
9466
|
+
return;
|
|
9467
|
+
}
|
|
9468
|
+
if (typeof window === "undefined") {
|
|
9469
|
+
return;
|
|
9470
|
+
}
|
|
9471
|
+
const { hostname } = window.location;
|
|
9472
|
+
if (generalDomain && generalDomain.endsWith(getDomain(hostname))) {
|
|
9473
|
+
document.cookie = name + `=; Path=/;domain=${generalDomain}; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
|
|
9474
|
+
return;
|
|
9475
|
+
}
|
|
9476
|
+
let previousDomain = void 0;
|
|
9477
|
+
let domain = void 0;
|
|
9478
|
+
do {
|
|
9479
|
+
previousDomain = domain;
|
|
9480
|
+
domain = getDomain(hostname, void 0, previousDomain);
|
|
9481
|
+
document.cookie = name + `=; Path=/;domain=${domain}; Expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
|
|
9482
|
+
} while (getCookieByName(name) !== "" && hostname !== domain);
|
|
9483
|
+
generalDomain = domain;
|
|
9484
|
+
}
|
|
9485
|
+
var headers = {
|
|
9486
|
+
Accept: "application/vnd.api+json",
|
|
9487
|
+
"Content-Type": "application/vnd.api+json"
|
|
9488
|
+
};
|
|
9489
|
+
var isWindowDefined = typeof window !== "undefined";
|
|
9490
|
+
var authGuestToken = isWindowDefined ? localStorage.getItem("auth_guest_token") : "";
|
|
9491
|
+
if (isWindowDefined && authGuestToken) {
|
|
9492
|
+
headers["Authorization-Guest"] = authGuestToken;
|
|
9493
|
+
}
|
|
9494
|
+
var setAxiosHeader = (key, value) => {
|
|
9495
|
+
headers[key] = `${value}`;
|
|
9398
9496
|
};
|
|
9399
|
-
var
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9497
|
+
var publicRequest = axios.create({
|
|
9498
|
+
baseURL: "https://www.ticketfairy.com/api",
|
|
9499
|
+
headers,
|
|
9500
|
+
withCredentials: true
|
|
9501
|
+
});
|
|
9502
|
+
publicRequest.interceptors.request.use((config) => {
|
|
9503
|
+
if (getCookieByName("X-TF-ECOMMERCE")) {
|
|
9504
|
+
config.headers["X-TF-ECOMMERCE"] = getCookieByName("X-TF-ECOMMERCE");
|
|
9505
|
+
}
|
|
9506
|
+
return config;
|
|
9507
|
+
});
|
|
9508
|
+
publicRequest.setBaseUrl = (baseUrl) => publicRequest.defaults.baseURL = baseUrl + "/api";
|
|
9509
|
+
publicRequest.setGuestToken = (guestToken) => publicRequest.defaults.headers.common["Authorization-Guest"] = guestToken;
|
|
9510
|
+
var setBaseUrl = (baseUrl) => {
|
|
9511
|
+
publicRequest.setBaseUrl(baseUrl);
|
|
9512
|
+
};
|
|
9513
|
+
var X_TF_ECOMMERCE = "X-TF-ECOMMERCE";
|
|
9514
|
+
var FEES_STYLES = { TRADITIONAL: "TRADITIONAL", DISPLAY_BOTH: "DISPLAY_BOTH" };
|
|
9515
|
+
var DEFAULT_FEES_STYLE = FEES_STYLES.TRADITIONAL;
|
|
9516
|
+
var CONFIGS = { FEES_STYLE: DEFAULT_FEES_STYLE };
|
|
9517
|
+
var setConfigs = (configs) => {
|
|
9518
|
+
Object.keys(configs).forEach((key) => {
|
|
9519
|
+
const value = configs[key];
|
|
9520
|
+
if (value !== void 0) {
|
|
9521
|
+
CONFIGS[key] = value;
|
|
9522
|
+
}
|
|
9405
9523
|
});
|
|
9406
|
-
|
|
9524
|
+
publicRequest.setBaseUrl(CONFIGS.BASE_URL);
|
|
9407
9525
|
};
|
|
9408
|
-
var
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
X_TF_ECOMMERCE: "X-TF-ECOMMERCE",
|
|
9415
|
-
PROMOTION_EVENT: "Promotion-Event",
|
|
9416
|
-
PROMOTION_CODE: "Promotion-Code",
|
|
9417
|
-
REFERRER_ID: "Referrer-Id"
|
|
9526
|
+
var authorize2 = async (data) => {
|
|
9527
|
+
const response = await publicRequest.post(
|
|
9528
|
+
`/auth?clientId=${CONFIGS.CLIENT_ID || "e9d8f8922797b4621e562255afe90dbf"}`,
|
|
9529
|
+
data
|
|
9530
|
+
);
|
|
9531
|
+
return response.data;
|
|
9418
9532
|
};
|
|
9419
|
-
var
|
|
9420
|
-
|
|
9421
|
-
|
|
9533
|
+
var register = async (data) => {
|
|
9534
|
+
const response = await publicRequest.post("v1/oauth/register-rn", data);
|
|
9535
|
+
return response.data;
|
|
9422
9536
|
};
|
|
9423
|
-
var
|
|
9424
|
-
|
|
9425
|
-
|
|
9537
|
+
var getProfileData = async () => {
|
|
9538
|
+
const response = await publicRequest.get("/customer/profile/");
|
|
9539
|
+
return response.data;
|
|
9540
|
+
};
|
|
9541
|
+
var logout = async () => {
|
|
9542
|
+
const response = await publicRequest.delete("/auth");
|
|
9543
|
+
return response.data;
|
|
9544
|
+
};
|
|
9545
|
+
var checkEmailExists = async (email) => {
|
|
9546
|
+
var _a;
|
|
9547
|
+
try {
|
|
9548
|
+
const formData = new FormData();
|
|
9549
|
+
formData.append("email", email);
|
|
9550
|
+
formData.append("is_checkout_flow", "true");
|
|
9551
|
+
const baseUrl = ((_a = publicRequest.defaults.baseURL) == null ? void 0 : _a.replace("/api", "")) || "";
|
|
9552
|
+
const url = `${baseUrl}/ajax/contact-email`;
|
|
9553
|
+
const response = await publicRequest.post(
|
|
9554
|
+
url,
|
|
9555
|
+
formData,
|
|
9556
|
+
{
|
|
9557
|
+
headers: {
|
|
9558
|
+
"Content-Type": "multipart/form-data"
|
|
9559
|
+
}
|
|
9560
|
+
}
|
|
9561
|
+
);
|
|
9562
|
+
return {
|
|
9563
|
+
exists: response.data.exists === 1,
|
|
9564
|
+
error: response.data.error === 1 ? response.data.message : void 0
|
|
9565
|
+
};
|
|
9566
|
+
} catch (error) {
|
|
9567
|
+
console.error("Error checking email:", error);
|
|
9568
|
+
return {
|
|
9569
|
+
exists: false,
|
|
9570
|
+
error: "Failed to check email"
|
|
9571
|
+
};
|
|
9572
|
+
}
|
|
9573
|
+
};
|
|
9574
|
+
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
9575
|
+
var setLoggedUserData = (data) => ({
|
|
9576
|
+
id: data.id,
|
|
9577
|
+
first_name: data.firstName,
|
|
9578
|
+
last_name: data.lastName,
|
|
9579
|
+
email: data.email,
|
|
9580
|
+
confirmEmail: data.email,
|
|
9581
|
+
city: (data == null ? void 0 : data.city) || "",
|
|
9582
|
+
country: (data == null ? void 0 : data.countryId) || "",
|
|
9583
|
+
phone: (data == null ? void 0 : data.phone) || "",
|
|
9584
|
+
street_address: (data == null ? void 0 : data.streetAddress) || "",
|
|
9585
|
+
state: (data == null ? void 0 : data.stateId) || "",
|
|
9586
|
+
zip: (data == null ? void 0 : data.zipCode) || ""
|
|
9587
|
+
});
|
|
9588
|
+
var logoutUser = async ({
|
|
9589
|
+
onLogoutSuccess,
|
|
9590
|
+
onLogoutError,
|
|
9591
|
+
setIsLogged
|
|
9592
|
+
}) => {
|
|
9593
|
+
try {
|
|
9594
|
+
await logout();
|
|
9595
|
+
onLogoutSuccess && onLogoutSuccess();
|
|
9596
|
+
if (isBrowser) {
|
|
9597
|
+
window.localStorage.removeItem("user_data");
|
|
9598
|
+
setIsLogged && setIsLogged(false);
|
|
9599
|
+
const event = new window.CustomEvent("tf-logout");
|
|
9600
|
+
deleteCookieByName("X-TF-ECOMMERCE");
|
|
9601
|
+
window.document.dispatchEvent(event);
|
|
9602
|
+
}
|
|
9603
|
+
} catch (e) {
|
|
9604
|
+
onLogoutError && onLogoutError(e);
|
|
9605
|
+
}
|
|
9606
|
+
};
|
|
9607
|
+
var getQueryVariable = (variable) => {
|
|
9608
|
+
if (typeof window !== "undefined") {
|
|
9609
|
+
const query = window.location.search.substring(1);
|
|
9610
|
+
const vars = query.split("&");
|
|
9611
|
+
for (let i = 0; i < vars.length; i++) {
|
|
9612
|
+
const pair = vars[i].split("=");
|
|
9613
|
+
if (pair[0] === variable) {
|
|
9614
|
+
return decodeURIComponent(pair[1]);
|
|
9615
|
+
}
|
|
9616
|
+
}
|
|
9617
|
+
}
|
|
9618
|
+
return false;
|
|
9619
|
+
};
|
|
9620
|
+
publicRequest.interceptors.request.use((config) => {
|
|
9621
|
+
var _a;
|
|
9622
|
+
const guestToken = isBrowser ? window.localStorage.getItem("auth_guest_token") : null;
|
|
9623
|
+
if (guestToken) {
|
|
9624
|
+
config.headers["Authorization-Guest"] = guestToken;
|
|
9625
|
+
}
|
|
9626
|
+
const xtfCookie = getCookieByName("X-TF-ECOMMERCE");
|
|
9627
|
+
if (xtfCookie) {
|
|
9628
|
+
config.headers["X-TF-ECOMMERCE"] = xtfCookie;
|
|
9629
|
+
}
|
|
9630
|
+
const additionalCookiesHeaderValue = isBrowser ? (_a = document.cookie) != null ? _a : "" : "";
|
|
9631
|
+
if (additionalCookiesHeaderValue !== "") {
|
|
9632
|
+
config.headers["Additional-Cookies"] = additionalCookiesHeaderValue;
|
|
9633
|
+
}
|
|
9634
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
9635
|
+
config.headers["X-Source-Origin"] = CONFIGS.X_SOURCE_ORIGIN;
|
|
9636
|
+
}
|
|
9637
|
+
if (CONFIGS.BASE_URL) {
|
|
9638
|
+
config.baseURL = CONFIGS.BASE_URL + "/api";
|
|
9639
|
+
}
|
|
9640
|
+
return config;
|
|
9641
|
+
});
|
|
9642
|
+
publicRequest.interceptors.response.use(
|
|
9643
|
+
(response) => {
|
|
9644
|
+
const authGuestToken2 = _get2(
|
|
9645
|
+
response,
|
|
9646
|
+
"headers.authorization-guest",
|
|
9647
|
+
""
|
|
9648
|
+
);
|
|
9649
|
+
if (isBrowser && authGuestToken2) {
|
|
9650
|
+
window.localStorage.setItem("auth_guest_token", authGuestToken2);
|
|
9651
|
+
publicRequest.setGuestToken(authGuestToken2);
|
|
9652
|
+
}
|
|
9653
|
+
const xtfCookie = _get2(response, "headers.x-tf-ecommerce");
|
|
9654
|
+
const url = _get2(response, "config.url");
|
|
9655
|
+
const method = _get2(response, "config.method");
|
|
9656
|
+
if (xtfCookie && !(url === "/auth" && method === "delete")) {
|
|
9657
|
+
setCustomCookie("X-TF-ECOMMERCE", xtfCookie);
|
|
9658
|
+
}
|
|
9659
|
+
return response;
|
|
9660
|
+
},
|
|
9661
|
+
(error) => {
|
|
9662
|
+
var _a;
|
|
9663
|
+
if (((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) === 401) {
|
|
9664
|
+
if (isBrowser) {
|
|
9665
|
+
window.localStorage.removeItem("user_data");
|
|
9666
|
+
const errorType = _get2(error, "response.data.error");
|
|
9667
|
+
if (errorType === "invalid_token") {
|
|
9668
|
+
window.location.href = "/";
|
|
9669
|
+
}
|
|
9670
|
+
}
|
|
9671
|
+
}
|
|
9672
|
+
const authGuestToken2 = _get2(error, "response.headers.authorization-guest");
|
|
9673
|
+
if (isBrowser && authGuestToken2) {
|
|
9674
|
+
window.localStorage.setItem("auth_guest_token", authGuestToken2);
|
|
9675
|
+
publicRequest.setGuestToken(authGuestToken2);
|
|
9676
|
+
}
|
|
9677
|
+
return Promise.reject(error);
|
|
9678
|
+
}
|
|
9679
|
+
);
|
|
9680
|
+
var addToCart2 = async (id, data) => {
|
|
9681
|
+
const response = await publicRequest.post(
|
|
9682
|
+
`v1/event/${id}/add-to-cart/`,
|
|
9683
|
+
{ data },
|
|
9684
|
+
{
|
|
9685
|
+
headers: {
|
|
9686
|
+
...publicRequest.defaults.headers.common,
|
|
9687
|
+
"Referer-Url": isBrowser ? document.referrer : ""
|
|
9688
|
+
}
|
|
9689
|
+
}
|
|
9690
|
+
);
|
|
9691
|
+
return response.data;
|
|
9692
|
+
};
|
|
9693
|
+
var getCart = async () => {
|
|
9694
|
+
const response = await publicRequest.get(`v1/cart`);
|
|
9695
|
+
return response.data;
|
|
9696
|
+
};
|
|
9697
|
+
var postOnCheckout = async (data, freeTicket = false) => {
|
|
9698
|
+
if (freeTicket) {
|
|
9699
|
+
delete data.attributes.city;
|
|
9700
|
+
delete data.attributes.country;
|
|
9701
|
+
delete data.attributes.state;
|
|
9702
|
+
delete data.attributes.street_address;
|
|
9703
|
+
}
|
|
9704
|
+
const response = await publicRequest.post(`v1/on-checkout`, { data });
|
|
9705
|
+
return response.data;
|
|
9706
|
+
};
|
|
9707
|
+
var updateCheckout = async (data) => {
|
|
9708
|
+
const response = await publicRequest.post(`v1/checkout`, { data });
|
|
9709
|
+
return response.data;
|
|
9710
|
+
};
|
|
9711
|
+
var getEvent = async (id, pk) => {
|
|
9712
|
+
let referralValue = "";
|
|
9713
|
+
let invitationHash;
|
|
9714
|
+
if (isBrowser) {
|
|
9715
|
+
const params = new URL(`${window.location}`);
|
|
9716
|
+
const referralId = params.searchParams.get("ttf_r") || "";
|
|
9717
|
+
const referral_key = window.localStorage.getItem("referral_key");
|
|
9718
|
+
const [, referralIdlocal] = (referral_key || "").split(".");
|
|
9719
|
+
referralValue = referralId || (referralIdlocal != null ? referralIdlocal : "");
|
|
9720
|
+
invitationHash = params.searchParams.get("invitation-hash") || null;
|
|
9721
|
+
}
|
|
9722
|
+
const response = await publicRequest.get(`v1/event/${id}`, {
|
|
9723
|
+
params: { pk, invitationHash },
|
|
9724
|
+
headers: {
|
|
9725
|
+
...publicRequest.defaults.headers.common,
|
|
9726
|
+
"Referer-Url": isBrowser ? document.referrer : "",
|
|
9727
|
+
"Referrer-Id": isBrowser ? referralValue : ""
|
|
9728
|
+
}
|
|
9729
|
+
});
|
|
9730
|
+
return response.data;
|
|
9731
|
+
};
|
|
9732
|
+
var getTickets = async (eventId, promoCode, pk) => {
|
|
9733
|
+
const invitationHash = getQueryVariable("invitation-hash");
|
|
9734
|
+
const referralId = getQueryVariable("ttf_r");
|
|
9735
|
+
if (referralId) {
|
|
9736
|
+
window.localStorage.setItem("promoter_id", referralId);
|
|
9737
|
+
}
|
|
9738
|
+
const promoterId = window.localStorage.getItem("promoter_id");
|
|
9739
|
+
const params = { pk };
|
|
9740
|
+
if (invitationHash) {
|
|
9741
|
+
params["invitation-hash"] = invitationHash;
|
|
9742
|
+
}
|
|
9743
|
+
const headers2 = publicRequest.defaults.headers.common;
|
|
9744
|
+
if (promoterId) {
|
|
9745
|
+
headers2["Promotion-Event"] = String(eventId);
|
|
9746
|
+
headers2["Referrer-Id"] = isBrowser ? promoterId : "";
|
|
9747
|
+
}
|
|
9748
|
+
if (promoCode) {
|
|
9749
|
+
headers2["Promotion-Event"] = String(eventId);
|
|
9750
|
+
headers2["Promotion-Code"] = promoCode;
|
|
9751
|
+
window.localStorage.removeItem("promoter_id");
|
|
9752
|
+
}
|
|
9753
|
+
const response = await publicRequest.get(`v1/event/${eventId}/tickets/`, {
|
|
9754
|
+
params,
|
|
9755
|
+
headers: headers2
|
|
9756
|
+
});
|
|
9757
|
+
const { tickets } = response.data.data.attributes;
|
|
9758
|
+
const ticketsArr = [];
|
|
9759
|
+
_forEach3(tickets, (item) => {
|
|
9760
|
+
ticketsArr.push(item);
|
|
9761
|
+
});
|
|
9762
|
+
const adaptedResponse = {
|
|
9763
|
+
...response,
|
|
9764
|
+
data: {
|
|
9765
|
+
...response.data,
|
|
9766
|
+
data: {
|
|
9767
|
+
...response.data.data,
|
|
9768
|
+
attributes: {
|
|
9769
|
+
...response.data.data.attributes,
|
|
9770
|
+
tickets: ticketsArr
|
|
9771
|
+
}
|
|
9772
|
+
}
|
|
9773
|
+
}
|
|
9774
|
+
};
|
|
9775
|
+
return adaptedResponse.data;
|
|
9776
|
+
};
|
|
9777
|
+
var getTimeSlotsByDate = async (eventId, date2, promoCode, pk) => {
|
|
9778
|
+
const invitationHash = getQueryVariable("invitation-hash");
|
|
9779
|
+
const referralId = getQueryVariable("ttf_r");
|
|
9780
|
+
if (referralId) {
|
|
9781
|
+
window.localStorage.setItem("promoter_id", referralId);
|
|
9782
|
+
}
|
|
9783
|
+
const promoterId = window.localStorage.getItem("promoter_id");
|
|
9784
|
+
const params = { pk };
|
|
9785
|
+
if (invitationHash) {
|
|
9786
|
+
params["invitation-hash"] = invitationHash;
|
|
9787
|
+
}
|
|
9788
|
+
const headers2 = publicRequest.defaults.headers.common;
|
|
9789
|
+
if (promoterId) {
|
|
9790
|
+
headers2["Promotion-Event"] = String(eventId);
|
|
9791
|
+
headers2["Referrer-Id"] = isBrowser ? promoterId : "";
|
|
9792
|
+
}
|
|
9793
|
+
if (promoCode) {
|
|
9794
|
+
headers2["Promotion-Event"] = String(eventId);
|
|
9795
|
+
headers2["Promotion-Code"] = promoCode;
|
|
9796
|
+
window.localStorage.removeItem("promoter_id");
|
|
9797
|
+
}
|
|
9798
|
+
const response = await publicRequest.get(`v1/event/${eventId}/timeslots`, {
|
|
9799
|
+
params: {
|
|
9800
|
+
date: date2,
|
|
9801
|
+
remove_past_slots: true,
|
|
9802
|
+
...params
|
|
9803
|
+
},
|
|
9804
|
+
headers: headers2
|
|
9805
|
+
});
|
|
9806
|
+
return response.data;
|
|
9807
|
+
};
|
|
9808
|
+
var getCountries = async () => {
|
|
9809
|
+
const response = await publicRequest.get("/countries/list");
|
|
9810
|
+
return response.data;
|
|
9811
|
+
};
|
|
9812
|
+
var getStates = async (countryId) => {
|
|
9813
|
+
const response = await publicRequest.get(`/countries/${countryId}/states/`);
|
|
9814
|
+
return response.data;
|
|
9815
|
+
};
|
|
9816
|
+
var sendRSVPInfo = async (eventId, data) => {
|
|
9817
|
+
const response = await publicRequest.post(`v1/event/${eventId}/send-rsvp-info`, data);
|
|
9818
|
+
return response.data;
|
|
9819
|
+
};
|
|
9820
|
+
var addToWaitingList2 = async (id, data) => {
|
|
9821
|
+
const response = await publicRequest.post(`v1/event/${id}/add_to_waiting_list`, {
|
|
9822
|
+
data
|
|
9823
|
+
});
|
|
9824
|
+
return response.data;
|
|
9825
|
+
};
|
|
9826
|
+
var postReferralVisits = async (eventId, referralId) => {
|
|
9827
|
+
const response = await publicRequest.post(`v1/event/${eventId}/referrer/`, {
|
|
9828
|
+
referrer: `${referralId}`
|
|
9829
|
+
});
|
|
9830
|
+
return response.data;
|
|
9831
|
+
};
|
|
9832
|
+
var validatePhoneNumber2 = async (phone) => {
|
|
9833
|
+
const response = await publicRequest.get(`/v1/account/validate_phone?phone=${phone}`);
|
|
9834
|
+
return response.data;
|
|
9835
|
+
};
|
|
9836
|
+
var getOrders = async (page, limit, eventSlug) => {
|
|
9837
|
+
const slug = eventSlug || CONFIGS.EVENT_SLUG || "";
|
|
9838
|
+
const response = await publicRequest.get(
|
|
9839
|
+
`v1/account/orders/?page=${page}&limit=${limit}&filter[event]=${slug}&${CONFIGS.BRAND_SLUG ? `filter[brand]=${CONFIGS.BRAND_SLUG}&filter[subbrands]=true` : ""}`
|
|
9840
|
+
);
|
|
9841
|
+
return response.data;
|
|
9842
|
+
};
|
|
9843
|
+
var getOrderDetails = async (orderId) => {
|
|
9844
|
+
const response = await publicRequest.get(`v1/account/order/${orderId}`);
|
|
9845
|
+
return response.data;
|
|
9846
|
+
};
|
|
9847
|
+
var getPaymentData = async (hash) => {
|
|
9848
|
+
const response = await publicRequest.get(`v1/order/${hash}/review`, {
|
|
9849
|
+
headers: { "Referer-Url": isBrowser ? document.referrer : "" }
|
|
9850
|
+
});
|
|
9851
|
+
return response.data;
|
|
9852
|
+
};
|
|
9853
|
+
var handlePaymentSuccess = async (orderHash) => {
|
|
9854
|
+
const response = await publicRequest.post(`v1/order/${orderHash}/success`, void 0, {
|
|
9855
|
+
headers: {
|
|
9856
|
+
...publicRequest.defaults.headers.common,
|
|
9857
|
+
"Referer-Url": isBrowser ? document.referrer : ""
|
|
9858
|
+
}
|
|
9859
|
+
});
|
|
9860
|
+
return response.data;
|
|
9861
|
+
};
|
|
9862
|
+
var handleFreeSuccess = async (orderHash) => {
|
|
9863
|
+
const response = await publicRequest.post(
|
|
9864
|
+
`v1/order/${orderHash}/complete_free_registration`,
|
|
9865
|
+
void 0,
|
|
9866
|
+
{ headers: { "Referer-Url": isBrowser ? document.referrer : "" } }
|
|
9867
|
+
);
|
|
9868
|
+
return response.data;
|
|
9869
|
+
};
|
|
9870
|
+
var getConfirmationData = async (orderHash) => {
|
|
9871
|
+
const response = await publicRequest.get(`v1/order/${orderHash}/payment/complete`);
|
|
9872
|
+
return response.data;
|
|
9873
|
+
};
|
|
9874
|
+
var getConditions = async (eventId) => {
|
|
9875
|
+
const response = await publicRequest.get(`v1/event/${eventId}/conditions`);
|
|
9876
|
+
const adaptedData = _map3(
|
|
9877
|
+
response.data.data.attributes,
|
|
9878
|
+
(item) => ({
|
|
9879
|
+
id: nanoid(),
|
|
9880
|
+
text: item,
|
|
9881
|
+
checked: false
|
|
9882
|
+
})
|
|
9883
|
+
);
|
|
9884
|
+
const returnData = {
|
|
9885
|
+
...response,
|
|
9886
|
+
data: {
|
|
9887
|
+
...response.data,
|
|
9888
|
+
data: {
|
|
9889
|
+
...response.data.data,
|
|
9890
|
+
attributes: adaptedData
|
|
9891
|
+
}
|
|
9892
|
+
}
|
|
9893
|
+
};
|
|
9894
|
+
return returnData.data;
|
|
9426
9895
|
};
|
|
9427
9896
|
|
|
9428
9897
|
// src/helpers/StringsHelper.ts
|
|
@@ -10072,7 +10541,7 @@ var Billing = forwardRef14(
|
|
|
10072
10541
|
errorsRef.current.privacy = isSubToTicketFairy ? "" : requiredText;
|
|
10073
10542
|
if (isNameRequired) {
|
|
10074
10543
|
const ticketHoldersDataCopy = [...data.ticketHolderData];
|
|
10075
|
-
|
|
10544
|
+
_map4(data.ticketHolderData, (th, index) => {
|
|
10076
10545
|
if (isNameRequired) {
|
|
10077
10546
|
ticketHoldersDataCopy[index].firstNameError = validateEmpty(th.firstName);
|
|
10078
10547
|
ticketHoldersDataCopy[index].lastNameError = validateEmpty(th.lastName);
|
|
@@ -10138,7 +10607,7 @@ var Billing = forwardRef14(
|
|
|
10138
10607
|
errorsRef.current.privacy = isSubToTicketFairy ? "" : requiredText;
|
|
10139
10608
|
if (isNameRequired) {
|
|
10140
10609
|
const ticketHoldersDataCopy = [...data.ticketHolderData];
|
|
10141
|
-
|
|
10610
|
+
_map4(data.ticketHolderData, (th, index) => {
|
|
10142
10611
|
if (isNameRequired) {
|
|
10143
10612
|
ticketHoldersDataCopy[index].firstNameError = validateEmpty(th.firstName);
|
|
10144
10613
|
ticketHoldersDataCopy[index].lastNameError = validateEmpty(th.lastName);
|
|
@@ -10197,7 +10666,7 @@ var Billing = forwardRef14(
|
|
|
10197
10666
|
return "";
|
|
10198
10667
|
}
|
|
10199
10668
|
return _every(
|
|
10200
|
-
|
|
10669
|
+
_map4(
|
|
10201
10670
|
ticketHoldersData,
|
|
10202
10671
|
(th) => validateEmpty(th.firstName) || validateEmpty(th.lastName)
|
|
10203
10672
|
),
|
|
@@ -10232,7 +10701,7 @@ var Billing = forwardRef14(
|
|
|
10232
10701
|
};
|
|
10233
10702
|
const getRegisterFormData = (data) => {
|
|
10234
10703
|
const bodyFormData = new FormData();
|
|
10235
|
-
|
|
10704
|
+
_forEach4(data.attributes, (item, key) => {
|
|
10236
10705
|
bodyFormData.append(key, item);
|
|
10237
10706
|
});
|
|
10238
10707
|
return bodyFormData;
|
|
@@ -10487,7 +10956,7 @@ var Billing = forwardRef14(
|
|
|
10487
10956
|
return showAlert(countriesError.message || "Error fetching countries");
|
|
10488
10957
|
}
|
|
10489
10958
|
onFetchCountriesSuccess == null ? void 0 : onFetchCountriesSuccess(countriesData);
|
|
10490
|
-
const parsedCountries =
|
|
10959
|
+
const parsedCountries = _map4(countriesData, (item) => {
|
|
10491
10960
|
return { label: item.name, value: item.id, code: item.code };
|
|
10492
10961
|
});
|
|
10493
10962
|
if (usrTkn) {
|
|
@@ -10632,7 +11101,7 @@ var Billing = forwardRef14(
|
|
|
10632
11101
|
}
|
|
10633
11102
|
}, [countries, countryId]);
|
|
10634
11103
|
useEffect11(() => {
|
|
10635
|
-
const
|
|
11104
|
+
const getStates2 = async () => {
|
|
10636
11105
|
if (!selectedCountry) {
|
|
10637
11106
|
return;
|
|
10638
11107
|
}
|
|
@@ -10647,14 +11116,14 @@ var Billing = forwardRef14(
|
|
|
10647
11116
|
onFetchStatesError == null ? void 0 : onFetchStatesError(statesError);
|
|
10648
11117
|
return showAlert((statesError == null ? void 0 : statesError.message) || "Error fetching states");
|
|
10649
11118
|
}
|
|
10650
|
-
const parsedStates =
|
|
11119
|
+
const parsedStates = _map4(statesData, (item, index) => {
|
|
10651
11120
|
return { label: item, value: index };
|
|
10652
11121
|
});
|
|
10653
11122
|
onFetchStatesSuccess == null ? void 0 : onFetchStatesSuccess();
|
|
10654
11123
|
setStates(parsedStates);
|
|
10655
11124
|
};
|
|
10656
11125
|
if (selectedCountry && selectedCountry.value !== "-1") {
|
|
10657
|
-
|
|
11126
|
+
getStates2();
|
|
10658
11127
|
}
|
|
10659
11128
|
}, [selectedCountry]);
|
|
10660
11129
|
useEffect11(() => {
|
|
@@ -11067,8 +11536,8 @@ import {
|
|
|
11067
11536
|
useConfirmPayment as useConfirmPayment2
|
|
11068
11537
|
} from "@stripe/stripe-react-native";
|
|
11069
11538
|
import _every2 from "lodash/every";
|
|
11070
|
-
import
|
|
11071
|
-
import
|
|
11539
|
+
import _forEach5 from "lodash/forEach";
|
|
11540
|
+
import _map7 from "lodash/map";
|
|
11072
11541
|
import _mapKeys3 from "lodash/mapKeys";
|
|
11073
11542
|
import {
|
|
11074
11543
|
forwardRef as forwardRef15,
|
|
@@ -11111,7 +11580,7 @@ var orderReviewItems = [
|
|
|
11111
11580
|
];
|
|
11112
11581
|
|
|
11113
11582
|
// src/containers/checkout/components/Conditions.tsx
|
|
11114
|
-
import
|
|
11583
|
+
import _map5 from "lodash/map";
|
|
11115
11584
|
import { View as View27 } from "react-native";
|
|
11116
11585
|
|
|
11117
11586
|
// src/containers/checkout/components/styles.ts
|
|
@@ -11154,19 +11623,19 @@ var ConditionItem = ({ id, checkboxProps }) => /* @__PURE__ */ jsx45(
|
|
|
11154
11623
|
id
|
|
11155
11624
|
);
|
|
11156
11625
|
var Conditions = (props) => {
|
|
11157
|
-
return /* @__PURE__ */ jsx45(View27, { style: ConditionsStyles.rootContainer, children:
|
|
11626
|
+
return /* @__PURE__ */ jsx45(View27, { style: ConditionsStyles.rootContainer, children: _map5(props, ConditionItem) });
|
|
11158
11627
|
};
|
|
11159
11628
|
var Conditions_default = Conditions;
|
|
11160
11629
|
|
|
11161
11630
|
// src/containers/checkout/components/OrderReview.tsx
|
|
11162
|
-
import
|
|
11631
|
+
import _map6 from "lodash/map";
|
|
11163
11632
|
import { Text as Text20, View as View28 } from "react-native";
|
|
11164
11633
|
import { jsx as jsx46, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11165
11634
|
var OrderItem = ({ title, value, styles: styles3 }) => /* @__PURE__ */ jsxs22(View28, { style: [OrderReviewStyles.orderItemContainer, styles3 == null ? void 0 : styles3.container], children: [
|
|
11166
11635
|
/* @__PURE__ */ jsx46(Text20, { style: [OrderReviewStyles.orderItemTitle, styles3 == null ? void 0 : styles3.title], children: title }),
|
|
11167
11636
|
/* @__PURE__ */ jsx46(Text20, { style: [OrderReviewStyles.orderItemValue, styles3 == null ? void 0 : styles3.value], allowFontScaling: true, children: value })
|
|
11168
11637
|
] }, `orderReview.${title}`);
|
|
11169
|
-
var OrderReview = ({ orderItems, styles: styles3 }) => /* @__PURE__ */ jsx46(View28, { style: [OrderReviewStyles.rootContainer, styles3 == null ? void 0 : styles3.rootContainer], children:
|
|
11638
|
+
var OrderReview = ({ orderItems, styles: styles3 }) => /* @__PURE__ */ jsx46(View28, { style: [OrderReviewStyles.rootContainer, styles3 == null ? void 0 : styles3.rootContainer], children: _map6(orderItems, (item) => /* @__PURE__ */ jsx46(
|
|
11170
11639
|
OrderItem,
|
|
11171
11640
|
{
|
|
11172
11641
|
id: item.id,
|
|
@@ -11310,7 +11779,7 @@ var Checkout = forwardRef15(
|
|
|
11310
11779
|
onFetchEventConditionsError == null ? void 0 : onFetchEventConditionsError(conditionsError);
|
|
11311
11780
|
return showAlert(conditionsError.message || "Error while fetching conditions");
|
|
11312
11781
|
}
|
|
11313
|
-
setConditionsValues(
|
|
11782
|
+
setConditionsValues(_map7(conditionsData, () => false));
|
|
11314
11783
|
setConditionsTexts(conditionsData);
|
|
11315
11784
|
hideLoading();
|
|
11316
11785
|
onFetchEventConditionsSuccess == null ? void 0 : onFetchEventConditionsSuccess(conditionsData);
|
|
@@ -11336,13 +11805,13 @@ var Checkout = forwardRef15(
|
|
|
11336
11805
|
setSecondsLeft(orderReviewData.expiresAt);
|
|
11337
11806
|
const tOrderInfo = [...orderInfo];
|
|
11338
11807
|
const currency = orderReviewData.reviewData.currency;
|
|
11339
|
-
|
|
11808
|
+
_forEach5(tOrderInfo, (item) => {
|
|
11340
11809
|
_mapKeys3(orderReviewData.reviewData, (value, key) => {
|
|
11341
11810
|
var _a3, _b2;
|
|
11342
11811
|
if (item.id === key) {
|
|
11343
11812
|
item.title = (_b2 = (_a3 = texts == null ? void 0 : texts.orderReviewItems) == null ? void 0 : _a3[key]) != null ? _b2 : item.title;
|
|
11344
11813
|
if (key === "price" || key === "total") {
|
|
11345
|
-
item.value =
|
|
11814
|
+
item.value = priceWithCurrency2(value, currency);
|
|
11346
11815
|
} else {
|
|
11347
11816
|
item.value = value;
|
|
11348
11817
|
}
|
|
@@ -11421,7 +11890,7 @@ var Checkout = forwardRef15(
|
|
|
11421
11890
|
ticketName: orderDetailsData.items[0].name,
|
|
11422
11891
|
ticketCost: orderDetailsData.items[0].price,
|
|
11423
11892
|
numberOfTickets: parseInt(orderDetailsData.items[0].quantity, 10),
|
|
11424
|
-
eventUserTickets:
|
|
11893
|
+
eventUserTickets: _map7(orderDetailsData.tickets, (ticket) => ({
|
|
11425
11894
|
hash: ticket.hash,
|
|
11426
11895
|
ticketType: ticket.ticketType,
|
|
11427
11896
|
holderEmail: ticket.holderEmail,
|
|
@@ -11499,7 +11968,7 @@ var Checkout = forwardRef15(
|
|
|
11499
11968
|
(_a2 = checkoutCoreRef.current) == null ? void 0 : _a2.stopCartTimer();
|
|
11500
11969
|
onPaymentSuccess == null ? void 0 : onPaymentSuccess();
|
|
11501
11970
|
};
|
|
11502
|
-
const
|
|
11971
|
+
const getConditions2 = () => _map7(conditionsTexts, (conditionTxt, index) => {
|
|
11503
11972
|
return {
|
|
11504
11973
|
id: `condition${index}`,
|
|
11505
11974
|
fieldType: "checkbox",
|
|
@@ -11568,7 +12037,7 @@ var Checkout = forwardRef15(
|
|
|
11568
12037
|
}
|
|
11569
12038
|
)
|
|
11570
12039
|
] }),
|
|
11571
|
-
/* @__PURE__ */ jsx47(Conditions_default, { ...
|
|
12040
|
+
/* @__PURE__ */ jsx47(Conditions_default, { ...getConditions2() }),
|
|
11572
12041
|
isPaymentRequired && !isStripeConfigMissing && /* @__PURE__ */ jsx47(
|
|
11573
12042
|
Button_default,
|
|
11574
12043
|
{
|
|
@@ -11613,7 +12082,7 @@ var Checkout_default = Checkout;
|
|
|
11613
12082
|
|
|
11614
12083
|
// src/containers/myOrderDetails/MyOrderDetails.tsx
|
|
11615
12084
|
import _find4 from "lodash/find";
|
|
11616
|
-
import
|
|
12085
|
+
import _forEach6 from "lodash/forEach";
|
|
11617
12086
|
import {
|
|
11618
12087
|
forwardRef as forwardRef16,
|
|
11619
12088
|
useCallback as useCallback11,
|
|
@@ -11631,7 +12100,7 @@ import {
|
|
|
11631
12100
|
|
|
11632
12101
|
// src/containers/myOrderDetails/MyOrderDetailsView.tsx
|
|
11633
12102
|
import Clipboard from "@react-native-clipboard/clipboard";
|
|
11634
|
-
import
|
|
12103
|
+
import _map8 from "lodash/map";
|
|
11635
12104
|
import { Image as Image13, SectionList, Text as Text25, TouchableOpacity as TouchableOpacity14, View as View33 } from "react-native";
|
|
11636
12105
|
|
|
11637
12106
|
// src/containers/myOrderDetails/components/Notification.tsx
|
|
@@ -12003,13 +12472,13 @@ var MyOrderDetailsView = ({
|
|
|
12003
12472
|
] })
|
|
12004
12473
|
] });
|
|
12005
12474
|
};
|
|
12006
|
-
const parsedItems = items ?
|
|
12475
|
+
const parsedItems = items ? _map8(items, (item) => {
|
|
12007
12476
|
return {
|
|
12008
12477
|
id: `${item.name}.${item.price}`,
|
|
12009
12478
|
item
|
|
12010
12479
|
};
|
|
12011
12480
|
}) : void 0;
|
|
12012
|
-
const parsedTickets =
|
|
12481
|
+
const parsedTickets = _map8(tickets, (item) => {
|
|
12013
12482
|
return {
|
|
12014
12483
|
id: `${item.hash}`,
|
|
12015
12484
|
item
|
|
@@ -12214,7 +12683,7 @@ var MyOrderDetails = forwardRef16(
|
|
|
12214
12683
|
return setDownloadStatus("failed");
|
|
12215
12684
|
}
|
|
12216
12685
|
const path = Platform7.OS === "ios" ? `${DocumentDirectoryPath}/${hash}.pdf` : `${DownloadDirectoryPath}/${hash}.pdf`;
|
|
12217
|
-
const
|
|
12686
|
+
const headers2 = {
|
|
12218
12687
|
Accept: "application/pdf",
|
|
12219
12688
|
"Content-Type": "application/pdf",
|
|
12220
12689
|
Authorization: `Bearer ${accessToken}`
|
|
@@ -12222,7 +12691,7 @@ var MyOrderDetails = forwardRef16(
|
|
|
12222
12691
|
const options = {
|
|
12223
12692
|
fromUrl: pdfLink,
|
|
12224
12693
|
toFile: path,
|
|
12225
|
-
headers
|
|
12694
|
+
headers: headers2
|
|
12226
12695
|
};
|
|
12227
12696
|
setDownloadStatus("downloading");
|
|
12228
12697
|
const response = await downloadFile(options).promise;
|
|
@@ -12247,7 +12716,7 @@ var MyOrderDetails = forwardRef16(
|
|
|
12247
12716
|
return Alert6.alert("", removeTicketFromResaleError == null ? void 0 : removeTicketFromResaleError.message);
|
|
12248
12717
|
}
|
|
12249
12718
|
const updatedOrderInfo = { ...orderInfo };
|
|
12250
|
-
|
|
12719
|
+
_forEach6(updatedOrderInfo.tickets, (item) => {
|
|
12251
12720
|
if (item.hash === ticket.hash) {
|
|
12252
12721
|
item.isSellable = true;
|
|
12253
12722
|
item.isOnSale = false;
|
|
@@ -12372,7 +12841,7 @@ var MyOrderDetails = forwardRef16(
|
|
|
12372
12841
|
var MyOrderDetails_default = MyOrderDetails;
|
|
12373
12842
|
|
|
12374
12843
|
// src/containers/myOrders/MyOrders.tsx
|
|
12375
|
-
import
|
|
12844
|
+
import _map9 from "lodash/map";
|
|
12376
12845
|
import _sortBy3 from "lodash/sortBy";
|
|
12377
12846
|
import _uniqBy from "lodash/uniqBy";
|
|
12378
12847
|
import {
|
|
@@ -12816,7 +13285,7 @@ var MyOrders = forwardRef17(
|
|
|
12816
13285
|
}
|
|
12817
13286
|
onFetchMyOrdersSuccess == null ? void 0 : onFetchMyOrdersSuccess(myOrdersData);
|
|
12818
13287
|
const events = _sortBy3(
|
|
12819
|
-
|
|
13288
|
+
_map9(myOrdersData.events, (item) => {
|
|
12820
13289
|
return {
|
|
12821
13290
|
label: item.event_name,
|
|
12822
13291
|
value: item.url_name
|
|
@@ -12827,7 +13296,7 @@ var MyOrders = forwardRef17(
|
|
|
12827
13296
|
setMyEvents(events);
|
|
12828
13297
|
return myOrdersData;
|
|
12829
13298
|
};
|
|
12830
|
-
const
|
|
13299
|
+
const getOrders2 = async () => {
|
|
12831
13300
|
var _a2;
|
|
12832
13301
|
const fetchedOrders = await getOrdersAsync();
|
|
12833
13302
|
setMyOrders((_a2 = fetchedOrders == null ? void 0 : fetchedOrders.orders) != null ? _a2 : []);
|
|
@@ -12863,7 +13332,7 @@ var MyOrders = forwardRef17(
|
|
|
12863
13332
|
logger.debug("MyOrders", "refreshAccessToken", {
|
|
12864
13333
|
message: "Access token refreshed successfully"
|
|
12865
13334
|
});
|
|
12866
|
-
await
|
|
13335
|
+
await getOrders2();
|
|
12867
13336
|
}
|
|
12868
13337
|
return {
|
|
12869
13338
|
accessTokenData,
|
|
@@ -12872,12 +13341,12 @@ var MyOrders = forwardRef17(
|
|
|
12872
13341
|
},
|
|
12873
13342
|
async reloadData() {
|
|
12874
13343
|
logger.debug("MyOrders", "reloadData");
|
|
12875
|
-
await
|
|
13344
|
+
await getOrders2();
|
|
12876
13345
|
}
|
|
12877
13346
|
}));
|
|
12878
13347
|
const handleOnRefresh = async () => {
|
|
12879
13348
|
setIsRefreshing(true);
|
|
12880
|
-
await
|
|
13349
|
+
await getOrders2();
|
|
12881
13350
|
setIsRefreshing(false);
|
|
12882
13351
|
};
|
|
12883
13352
|
const handleOnLoadingChange = useCallback13(
|
|
@@ -12939,13 +13408,13 @@ var MyOrders = forwardRef17(
|
|
|
12939
13408
|
}, [handleOnLoadingChange, isLoading, isGettingEventDetails]);
|
|
12940
13409
|
useEffect14(() => {
|
|
12941
13410
|
const _fetchMyOrders = async () => {
|
|
12942
|
-
await
|
|
13411
|
+
await getOrders2();
|
|
12943
13412
|
};
|
|
12944
13413
|
_fetchMyOrders();
|
|
12945
13414
|
}, []);
|
|
12946
13415
|
useEffect14(() => {
|
|
12947
13416
|
if (selectedEvent.value !== "" || selectedTimeFilter.value !== "") {
|
|
12948
|
-
|
|
13417
|
+
getOrders2();
|
|
12949
13418
|
}
|
|
12950
13419
|
}, [selectedEvent, selectedTimeFilter]);
|
|
12951
13420
|
return /* @__PURE__ */ jsx55(MyOrdersCore_default, { ref: myOrdersCoreRef, children: /* @__PURE__ */ jsx55(SessionHandle_default, { ref: sessionHandleRef, children: /* @__PURE__ */ jsx55(
|
|
@@ -13844,7 +14313,7 @@ var ResetPassword = ({
|
|
|
13844
14313
|
var ResetPassword_default = ResetPassword;
|
|
13845
14314
|
|
|
13846
14315
|
// src/containers/tickets/Tickets.tsx
|
|
13847
|
-
import
|
|
14316
|
+
import _get3 from "lodash/get";
|
|
13848
14317
|
import _isEmpty from "lodash/isEmpty";
|
|
13849
14318
|
import _some from "lodash/some";
|
|
13850
14319
|
import {
|
|
@@ -13965,7 +14434,7 @@ var TicketListItem2 = ({
|
|
|
13965
14434
|
const feesIncluded = ticket.feeIncluded ? feesIncludedText : feesExcludedText;
|
|
13966
14435
|
const showOldPrice = ticket.price !== ticket.oldPrice;
|
|
13967
14436
|
const isTicketFree = +ticket.price === 0;
|
|
13968
|
-
const ticketPrice = isSoldOut ? soldOutText : isTicketFree ? freeText :
|
|
14437
|
+
const ticketPrice = isSoldOut ? soldOutText : isTicketFree ? freeText : priceWithCurrency3(ticket.price.toFixed(2).toString(), ticket.priceSymbol);
|
|
13969
14438
|
const maximumOption = (_a = _maxBy(dropdownOptions, (o) => o.value)) == null ? void 0 : _a.value;
|
|
13970
14439
|
let rightContent = /* @__PURE__ */ jsx63(Fragment18, {});
|
|
13971
14440
|
if (ticket.soldOut || ticket.sold_out || !ticket.displayTicket) {
|
|
@@ -13987,7 +14456,7 @@ var TicketListItem2 = ({
|
|
|
13987
14456
|
/* @__PURE__ */ jsx63(Text32, { style: [CartListItemStyles.ticketNumber, styles3 == null ? void 0 : styles3.ticketName], numberOfLines: 2, children: ticket.displayName.toUpperCase() || `${ticketText} ${ticketNumber}` }),
|
|
13988
14457
|
isSoldOut ? /* @__PURE__ */ jsx63(View40, { style: [CartListItemStyles.soldOutContainer, styles3 == null ? void 0 : styles3.soldOutContainer], children: /* @__PURE__ */ jsx63(Text32, { style: [CartListItemStyles.soldOut, styles3 == null ? void 0 : styles3.soldOutText], children: soldOutMessage }) }) : /* @__PURE__ */ jsxs33(Fragment18, { children: [
|
|
13989
14458
|
/* @__PURE__ */ jsxs33(View40, { style: styles3 == null ? void 0 : styles3.pricesContainer, children: [
|
|
13990
|
-
showOldPrice && /* @__PURE__ */ jsx63(Text32, { style: [CartListItemStyles.oldPrice, styles3 == null ? void 0 : styles3.oldPrice], children:
|
|
14459
|
+
showOldPrice && /* @__PURE__ */ jsx63(Text32, { style: [CartListItemStyles.oldPrice, styles3 == null ? void 0 : styles3.oldPrice], children: priceWithCurrency3((_b = ticket.oldPrice) == null ? void 0 : _b.toString(), ticket.priceSymbol) }),
|
|
13991
14460
|
/* @__PURE__ */ jsx63(Text32, { style: [CartListItemStyles.price, styles3 == null ? void 0 : styles3.price], children: ticketPrice })
|
|
13992
14461
|
] }),
|
|
13993
14462
|
/* @__PURE__ */ jsx63(Text32, { style: [CartListItemStyles.tax, styles3 == null ? void 0 : styles3.fees], children: feesIncluded.toUpperCase() })
|
|
@@ -14293,7 +14762,7 @@ var Tickets = forwardRef20(
|
|
|
14293
14762
|
logger2.error("Error while fetching initial data", error);
|
|
14294
14763
|
}
|
|
14295
14764
|
};
|
|
14296
|
-
const
|
|
14765
|
+
const getTickets2 = async (promoCode = "") => {
|
|
14297
14766
|
setIsGettingTickets(true);
|
|
14298
14767
|
isApiErrorRef.current = false;
|
|
14299
14768
|
const {
|
|
@@ -14398,7 +14867,7 @@ var Tickets = forwardRef20(
|
|
|
14398
14867
|
}
|
|
14399
14868
|
try {
|
|
14400
14869
|
logger2.info("Fetching tickets: getTickets()");
|
|
14401
|
-
await
|
|
14870
|
+
await getTickets2();
|
|
14402
14871
|
} catch (error) {
|
|
14403
14872
|
logger2.info("Fetching tickets: getTickets() Error: " + error);
|
|
14404
14873
|
showAlert(error);
|
|
@@ -14414,8 +14883,8 @@ var Tickets = forwardRef20(
|
|
|
14414
14883
|
const ticketQuantity = typeof selectedTicket.selectedOption.value === "string" ? parseInt(selectedTicket.selectedOption.value, 10) : selectedTicket.selectedOption.value;
|
|
14415
14884
|
const ticketsOptions = {
|
|
14416
14885
|
quantity: ticketQuantity,
|
|
14417
|
-
optionName:
|
|
14418
|
-
ticketId:
|
|
14886
|
+
optionName: _get3(selectedTicket, "optionName"),
|
|
14887
|
+
ticketId: _get3(selectedTicket, "id"),
|
|
14419
14888
|
price: selectedTicket.price
|
|
14420
14889
|
};
|
|
14421
14890
|
setIsBooking(true);
|
|
@@ -14482,7 +14951,7 @@ var Tickets = forwardRef20(
|
|
|
14482
14951
|
performBookTickets();
|
|
14483
14952
|
};
|
|
14484
14953
|
const handleOnPressApplyPromoCode = async (code) => {
|
|
14485
|
-
await
|
|
14954
|
+
await getTickets2(code);
|
|
14486
14955
|
};
|
|
14487
14956
|
const handleOnSelectTicketOption = (ticket) => {
|
|
14488
14957
|
setSelectedTicket(ticket);
|
|
@@ -14522,7 +14991,7 @@ var Tickets = forwardRef20(
|
|
|
14522
14991
|
eventErrorCodeRef.current = 0;
|
|
14523
14992
|
onFetchEventSuccess == null ? void 0 : onFetchEventSuccess(eventData);
|
|
14524
14993
|
setEvent(eventData);
|
|
14525
|
-
|
|
14994
|
+
getTickets2();
|
|
14526
14995
|
};
|
|
14527
14996
|
return /* @__PURE__ */ jsx65(TicketsCore_default, { ref: ticketsCoreRef, children: /* @__PURE__ */ jsx65(SessionHandle_default, { ref: sessionHandleRef, children: /* @__PURE__ */ jsx65(
|
|
14528
14997
|
TicketsView_default,
|
|
@@ -14571,10 +15040,10 @@ import { useCallback as useCallback18, useEffect as useEffect19, useMemo as useM
|
|
|
14571
15040
|
import BackgroundTimer4 from "react-native-background-timer";
|
|
14572
15041
|
|
|
14573
15042
|
// src/utils/handlers.ts
|
|
14574
|
-
import
|
|
15043
|
+
import axios2 from "axios";
|
|
14575
15044
|
function readableError(error) {
|
|
14576
15045
|
var _a, _b;
|
|
14577
|
-
if (
|
|
15046
|
+
if (axios2.isAxiosError(error)) {
|
|
14578
15047
|
return ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message;
|
|
14579
15048
|
} else if (error instanceof Error) {
|
|
14580
15049
|
return error.message;
|
|
@@ -14584,7 +15053,7 @@ function readableError(error) {
|
|
|
14584
15053
|
}
|
|
14585
15054
|
function logError(error, context, options) {
|
|
14586
15055
|
const prefix = context ? `[${context}]` : "[Error]";
|
|
14587
|
-
if (
|
|
15056
|
+
if (axios2.isAxiosError(error)) {
|
|
14588
15057
|
console.error(`${prefix}: ${error.message}`);
|
|
14589
15058
|
if (error.response) {
|
|
14590
15059
|
console.error(`${prefix} Response:`, {
|
|
@@ -15512,11 +15981,11 @@ var useCheckoutFlow = ({
|
|
|
15512
15981
|
updatedOrderItems.push({
|
|
15513
15982
|
id: ticket.ticket_type_id,
|
|
15514
15983
|
title: ticket.ticket_type_name,
|
|
15515
|
-
subtitle: `${ticket.quantity} x ${
|
|
15984
|
+
subtitle: `${ticket.quantity} x ${priceWithCurrency5(
|
|
15516
15985
|
ticket.price_per_ticket,
|
|
15517
15986
|
currency
|
|
15518
15987
|
)}`,
|
|
15519
|
-
value:
|
|
15988
|
+
value: priceWithCurrency5(ticket.total_price.toString(), currency)
|
|
15520
15989
|
});
|
|
15521
15990
|
});
|
|
15522
15991
|
}
|
|
@@ -15525,11 +15994,11 @@ var useCheckoutFlow = ({
|
|
|
15525
15994
|
updatedOrderItems.push({
|
|
15526
15995
|
id: `addon_${addon.add_on_name}`,
|
|
15527
15996
|
title: `${addon.add_on_name} (Add-on)`,
|
|
15528
|
-
subtitle: `${addon.quantity} x ${
|
|
15997
|
+
subtitle: `${addon.quantity} x ${priceWithCurrency5(
|
|
15529
15998
|
addon.price_per_add_on,
|
|
15530
15999
|
currency
|
|
15531
16000
|
)}`,
|
|
15532
|
-
value:
|
|
16001
|
+
value: priceWithCurrency5(addon.total_price.toString(), currency)
|
|
15533
16002
|
});
|
|
15534
16003
|
});
|
|
15535
16004
|
}
|
|
@@ -15537,13 +16006,13 @@ var useCheckoutFlow = ({
|
|
|
15537
16006
|
updatedOrderItems.push({
|
|
15538
16007
|
id: "tax",
|
|
15539
16008
|
title: cartPriceBreakdown.goods_tax_name || "Tax",
|
|
15540
|
-
value:
|
|
16009
|
+
value: priceWithCurrency5(cartPriceBreakdown.goods_tax.toString(), currency)
|
|
15541
16010
|
});
|
|
15542
16011
|
}
|
|
15543
16012
|
updatedOrderItems.push({
|
|
15544
16013
|
id: "total",
|
|
15545
16014
|
title: "Total",
|
|
15546
|
-
value:
|
|
16015
|
+
value: priceWithCurrency5(cartPriceBreakdown.total.toString(), currency)
|
|
15547
16016
|
});
|
|
15548
16017
|
setOrderItems(updatedOrderItems);
|
|
15549
16018
|
},
|
|
@@ -15645,14 +16114,14 @@ var useCheckoutFlow = ({
|
|
|
15645
16114
|
items.push({
|
|
15646
16115
|
id: "price",
|
|
15647
16116
|
title: "Ticket Price",
|
|
15648
|
-
value:
|
|
16117
|
+
value: priceWithCurrency5(cartData.cart[0].price, currency)
|
|
15649
16118
|
});
|
|
15650
16119
|
}
|
|
15651
16120
|
const total = ((_m2 = (_l2 = cartData.cart) == null ? void 0 : _l2[0]) == null ? void 0 : _m2.price) || 0;
|
|
15652
16121
|
items.push({
|
|
15653
16122
|
id: "total",
|
|
15654
16123
|
title: "Total",
|
|
15655
|
-
value:
|
|
16124
|
+
value: priceWithCurrency5(total, currency)
|
|
15656
16125
|
});
|
|
15657
16126
|
setOrderItems(items);
|
|
15658
16127
|
}
|
|
@@ -15929,7 +16398,7 @@ var AddonsContainer = ({
|
|
|
15929
16398
|
const priceWithFees = addonData.price || 0;
|
|
15930
16399
|
const addonCurrency = addonData.currency || currency;
|
|
15931
16400
|
const isAddonFree = Number(priceWithFees) === 0;
|
|
15932
|
-
const basePriceFormatted = isAddonFree ? "FREE" :
|
|
16401
|
+
const basePriceFormatted = isAddonFree ? "FREE" : priceWithCurrency6((priceWithFees / 100).toString(), addonCurrency);
|
|
15933
16402
|
return /* @__PURE__ */ jsxs36(View42, { style: [customStyles == null ? void 0 : customStyles.addonItem], children: [
|
|
15934
16403
|
/* @__PURE__ */ jsxs36(View42, { style: [customStyles == null ? void 0 : customStyles.addonRow], children: [
|
|
15935
16404
|
/* @__PURE__ */ jsxs36(View42, { style: [customStyles == null ? void 0 : customStyles.addonInfo], children: [
|
|
@@ -16089,7 +16558,7 @@ var styles = StyleSheet43.create({
|
|
|
16089
16558
|
var Conditions_default2 = Conditions2;
|
|
16090
16559
|
|
|
16091
16560
|
// src/features/checkout-v2/components/OrderReview.tsx
|
|
16092
|
-
import
|
|
16561
|
+
import _map10 from "lodash/map";
|
|
16093
16562
|
import { StyleSheet as StyleSheet44, Text as Text37, View as View44 } from "react-native";
|
|
16094
16563
|
import { jsx as jsx69, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
16095
16564
|
var styles2 = StyleSheet44.create({
|
|
@@ -16134,7 +16603,7 @@ var OrderItem2 = ({ title, subtitle, value, styles: itemStyles }) => /* @__PURE_
|
|
|
16134
16603
|
`orderReview.${title}`
|
|
16135
16604
|
);
|
|
16136
16605
|
var OrderReview2 = ({ orderItems, styles: customStyles }) => {
|
|
16137
|
-
return /* @__PURE__ */ jsx69(View44, { style: [styles2.rootContainer, customStyles == null ? void 0 : customStyles.rootContainer], children:
|
|
16606
|
+
return /* @__PURE__ */ jsx69(View44, { style: [styles2.rootContainer, customStyles == null ? void 0 : customStyles.rootContainer], children: _map10(orderItems, (item) => {
|
|
16138
16607
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
16139
16608
|
return /* @__PURE__ */ jsx69(
|
|
16140
16609
|
OrderItem2,
|
|
@@ -17599,14 +18068,17 @@ var index_default = NativeModules.TFCheckoutRNModule;
|
|
|
17599
18068
|
export {
|
|
17600
18069
|
BillingCore_default as BillingCore,
|
|
17601
18070
|
Billing_default as BillingInfo,
|
|
18071
|
+
CONFIGS,
|
|
17602
18072
|
CartTimer_default as CartTimer,
|
|
17603
18073
|
Checkout_default as Checkout,
|
|
17604
18074
|
CheckoutCore_default as CheckoutCore,
|
|
17605
18075
|
CheckoutForm,
|
|
17606
18076
|
CheckoutProvider,
|
|
17607
18077
|
CheckoutController as CheckoutV2,
|
|
18078
|
+
DEFAULT_FEES_STYLE,
|
|
17608
18079
|
Dropdown_default as Dropdown,
|
|
17609
18080
|
DropdownMaterial_default as DropdownMaterial,
|
|
18081
|
+
FEES_STYLES,
|
|
17610
18082
|
Loading_default as Loading,
|
|
17611
18083
|
LoggedIn_default as LoggedIn,
|
|
17612
18084
|
Login_default as Login,
|
|
@@ -17626,13 +18098,48 @@ export {
|
|
|
17626
18098
|
TicketsCore_default as TicketsCore,
|
|
17627
18099
|
WaitingList_default as WaitingList,
|
|
17628
18100
|
WaitingListCore_default as WaitingListCore,
|
|
18101
|
+
X_TF_ECOMMERCE,
|
|
18102
|
+
addToCart2 as addToCart,
|
|
18103
|
+
addToWaitingList2 as addToWaitingList,
|
|
18104
|
+
authorize2 as authorize,
|
|
18105
|
+
checkEmailExists,
|
|
17629
18106
|
index_default as default,
|
|
17630
18107
|
deleteAllData,
|
|
18108
|
+
deleteCookieByName,
|
|
17631
18109
|
deleteUserData,
|
|
17632
|
-
|
|
17633
|
-
|
|
18110
|
+
getCart,
|
|
18111
|
+
getConditions,
|
|
18112
|
+
getConfirmationData,
|
|
18113
|
+
getCookieByName,
|
|
18114
|
+
getCountries,
|
|
18115
|
+
getDomain,
|
|
18116
|
+
getEvent,
|
|
18117
|
+
getOrderDetails,
|
|
18118
|
+
getOrders,
|
|
18119
|
+
getPaymentData,
|
|
18120
|
+
getProfileData,
|
|
18121
|
+
getQueryVariable,
|
|
18122
|
+
getStates,
|
|
18123
|
+
getTickets,
|
|
18124
|
+
getTimeSlotsByDate,
|
|
18125
|
+
handleFreeSuccess,
|
|
18126
|
+
handlePaymentSuccess,
|
|
18127
|
+
isBrowser,
|
|
18128
|
+
logout,
|
|
18129
|
+
logoutUser,
|
|
18130
|
+
postOnCheckout,
|
|
18131
|
+
postReferralVisits,
|
|
18132
|
+
publicRequest,
|
|
17634
18133
|
refreshAccessToken,
|
|
18134
|
+
register,
|
|
18135
|
+
sendRSVPInfo,
|
|
18136
|
+
setAxiosHeader,
|
|
18137
|
+
setBaseUrl,
|
|
17635
18138
|
setConfig,
|
|
18139
|
+
setConfigs,
|
|
18140
|
+
setCustomCookie,
|
|
18141
|
+
setLoggedUserData,
|
|
18142
|
+
updateCheckout,
|
|
17636
18143
|
useAddToCart,
|
|
17637
18144
|
useAddons,
|
|
17638
18145
|
useCart,
|
|
@@ -17647,6 +18154,7 @@ export {
|
|
|
17647
18154
|
useStates,
|
|
17648
18155
|
useTickets,
|
|
17649
18156
|
useUpdateCheckout,
|
|
17650
|
-
useUserProfile
|
|
18157
|
+
useUserProfile,
|
|
18158
|
+
validatePhoneNumber2 as validatePhoneNumber
|
|
17651
18159
|
};
|
|
17652
18160
|
//# sourceMappingURL=index.mjs.map
|