@sartech/ai-chat-agent 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +373 -353
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { jsx as a, jsxs as d, Fragment as Be } from "react/jsx-runtime";
|
|
2
|
-
import De, { createContext as
|
|
3
|
-
import { FiLock as
|
|
2
|
+
import De, { createContext as ls, useContext as cs, useState as tt, useEffect as ut, useMemo as Zt, useRef as Mt, useCallback as Ne } from "react";
|
|
3
|
+
import { FiLock as us, FiBriefcase as ki, FiCreditCard as Pr, FiGlobe as ds, FiSmartphone as fs, FiX as ms, FiMicOff as hs, FiMic as ps, FiPlus as bs } from "react-icons/fi";
|
|
4
4
|
import { IoChevronUp as Jn, IoChevronDown as Xn } from "react-icons/io5";
|
|
5
5
|
import { MdStar as Ti } from "react-icons/md";
|
|
6
6
|
import { RxCross2 as We } from "react-icons/rx";
|
|
7
|
-
import { BsArrowRight as Qn, BsCheckCircleFill as
|
|
7
|
+
import { BsArrowRight as Qn, BsCheckCircleFill as gs } from "react-icons/bs";
|
|
8
8
|
import { FaArrowRightLong as xi } from "react-icons/fa6";
|
|
9
|
-
import { FaPlane as
|
|
9
|
+
import { FaPlane as ys, FaUser as Ye } from "react-icons/fa";
|
|
10
10
|
import tr from "react-datepicker";
|
|
11
|
-
import
|
|
11
|
+
import Ns from "react-select";
|
|
12
12
|
import "react-datepicker/dist/react-datepicker.css";
|
|
13
13
|
import { parse as Di, isValid as Li } from "date-fns";
|
|
14
|
-
import { AiOutlineInfoCircle as
|
|
14
|
+
import { AiOutlineInfoCircle as _s } from "react-icons/ai";
|
|
15
15
|
import { HiSparkles as Qe } from "react-icons/hi";
|
|
16
|
-
import { createPortal as
|
|
17
|
-
import { LuSend as
|
|
18
|
-
import
|
|
19
|
-
|
|
16
|
+
import { createPortal as ws } from "react-dom";
|
|
17
|
+
import { LuSend as vs, LuPanelLeft as Ss } from "react-icons/lu";
|
|
18
|
+
import As from "react-secure-storage";
|
|
19
|
+
import { io as Cs } from "socket.io-client";
|
|
20
|
+
const Fi = ls(null);
|
|
20
21
|
function Ei() {
|
|
21
|
-
const t =
|
|
22
|
+
const t = cs(Fi);
|
|
22
23
|
if (t == null)
|
|
23
24
|
throw new Error(
|
|
24
25
|
"[@sartech/ai-chat-agent] Missing socket. Wrap the tree with <AIChatAgent socket={yourSocketIoClient}> (or set SocketContext.Provider)."
|
|
@@ -269,7 +270,7 @@ function Sn(t) {
|
|
|
269
270
|
SGD: "S$"
|
|
270
271
|
}[e] || e;
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
+
function ks(t, e) {
|
|
273
274
|
if (!t || !e || Number(t.payloadIndex) !== Number(e.payloadIndex))
|
|
274
275
|
return null;
|
|
275
276
|
const n = Nn(t == null ? void 0 : t.rmkey), r = Nn(e == null ? void 0 : e.rmkey), i = [...n, ...r].filter(
|
|
@@ -287,13 +288,13 @@ function As(t, e) {
|
|
|
287
288
|
rtapcoup: u
|
|
288
289
|
};
|
|
289
290
|
}
|
|
290
|
-
function
|
|
291
|
+
function Ts() {
|
|
291
292
|
const t = {};
|
|
292
293
|
return vn.forEach((e) => {
|
|
293
294
|
e != null && e.code && (t[String(e.code).toUpperCase()] = e.english);
|
|
294
295
|
}), t;
|
|
295
296
|
}
|
|
296
|
-
function
|
|
297
|
+
function xs(t = {}) {
|
|
297
298
|
const e = [
|
|
298
299
|
t == null ? void 0 : t.code,
|
|
299
300
|
t == null ? void 0 : t.iata,
|
|
@@ -302,7 +303,7 @@ function ks(t = {}) {
|
|
|
302
303
|
].find((n) => String(n || "").trim());
|
|
303
304
|
return String(e || "").trim().toUpperCase();
|
|
304
305
|
}
|
|
305
|
-
function
|
|
306
|
+
function Ds(t = {}) {
|
|
306
307
|
const e = [
|
|
307
308
|
t == null ? void 0 : t.name,
|
|
308
309
|
t == null ? void 0 : t.airportName,
|
|
@@ -318,7 +319,7 @@ function $i(t) {
|
|
|
318
319
|
const e = {};
|
|
319
320
|
return Array.isArray(t) && t.forEach((n) => {
|
|
320
321
|
if (!n || typeof n != "object") return;
|
|
321
|
-
const r =
|
|
322
|
+
const r = xs(n), i = Ds(n);
|
|
322
323
|
r && i && (e[r] = i);
|
|
323
324
|
}), e;
|
|
324
325
|
}
|
|
@@ -326,7 +327,7 @@ function Ii(t = {}, e) {
|
|
|
326
327
|
const n = String(e || "").trim().toUpperCase();
|
|
327
328
|
return n ? String((t == null ? void 0 : t[n]) || "").trim() : "";
|
|
328
329
|
}
|
|
329
|
-
function
|
|
330
|
+
function Ls({
|
|
330
331
|
adt: t = 1,
|
|
331
332
|
chd: e = 0,
|
|
332
333
|
inf: n = 0,
|
|
@@ -389,7 +390,7 @@ function xs({
|
|
|
389
390
|
});
|
|
390
391
|
return i;
|
|
391
392
|
}
|
|
392
|
-
function
|
|
393
|
+
function Fs(t, e) {
|
|
393
394
|
var H, z, L, I, O, k, g, $, K, W, nt, lt;
|
|
394
395
|
const n = (t == null ? void 0 : t.payload) || t || {}, r = (n == null ? void 0 : n.trps) || {}, i = Array.isArray(r) ? r[0] || {} : r, o = (i == null ? void 0 : i.deps) || {}, c = Array.isArray(o) ? o[0] || {} : o, u = Array.isArray(c == null ? void 0 : c.seg) ? c.seg : [], s = (n == null ? void 0 : n.rttrps) || {}, m = Array.isArray(s) ? s[0] || {} : s, N = (m == null ? void 0 : m.deps) || {}, f = Array.isArray(N) ? N[0] || {} : N, y = Array.isArray(f == null ? void 0 : f.seg) ? f.seg : [], C = (i == null ? void 0 : i.arrs) || {}, v = Array.isArray(C) ? C[0] || {} : C, S = Array.isArray(v == null ? void 0 : v.seg) ? v.seg : [], p = y.length ? y : S, _ = (i == null ? void 0 : i.pr) || {}, h = (m == null ? void 0 : m.pr) || {}, x = Array.isArray(_ == null ? void 0 : _.taxs) ? _.taxs.reduce((P, Z) => P + Number((Z == null ? void 0 : Z.pr) || 0), 0) : 0, A = Array.isArray(h == null ? void 0 : h.taxs) ? h.taxs.reduce((P, Z) => P + Number((Z == null ? void 0 : Z.pr) || 0), 0) : 0, j = String((n == null ? void 0 : n.ps) || "").toUpperCase() === "Y" || String((n == null ? void 0 : n.sectyp) || "").toLowerCase() === "int", w = !!String((n == null ? void 0 : n.rukey) || "").trim(), l = p.length > 0, b = Number((n == null ? void 0 : n.tt) || 1) === 2 || w || l, D = b ? "2" : "1";
|
|
395
396
|
return {
|
|
@@ -456,7 +457,7 @@ function Ds(t, e) {
|
|
|
456
457
|
} : null,
|
|
457
458
|
uid: (n == null ? void 0 : n.uid) ?? null,
|
|
458
459
|
agid: (n == null ? void 0 : n.agid) ?? null,
|
|
459
|
-
trvlrs:
|
|
460
|
+
trvlrs: Ls({
|
|
460
461
|
adt: n == null ? void 0 : n.adt,
|
|
461
462
|
chd: n == null ? void 0 : n.chd,
|
|
462
463
|
inf: n == null ? void 0 : n.inf,
|
|
@@ -464,7 +465,7 @@ function Ds(t, e) {
|
|
|
464
465
|
})
|
|
465
466
|
};
|
|
466
467
|
}
|
|
467
|
-
const
|
|
468
|
+
const Es = "Service fee : 300/pax";
|
|
468
469
|
function Ri({
|
|
469
470
|
isNonRefundable: t = !1,
|
|
470
471
|
policyRows: e = null,
|
|
@@ -488,7 +489,7 @@ function Ri({
|
|
|
488
489
|
/* @__PURE__ */ a("div", { className: "val", children: c.penalty })
|
|
489
490
|
] })
|
|
490
491
|
] }, u)),
|
|
491
|
-
n && /* @__PURE__ */ a("div", { className: "frRulespill", children:
|
|
492
|
+
n && /* @__PURE__ */ a("div", { className: "frRulespill", children: Es })
|
|
492
493
|
] }) });
|
|
493
494
|
}
|
|
494
495
|
function cr({
|
|
@@ -1435,7 +1436,7 @@ function cr({
|
|
|
1435
1436
|
/* @__PURE__ */ d("div", { className: "flight-card__details-bottom-chips", children: [
|
|
1436
1437
|
/* @__PURE__ */ d("span", { className: "flight-card__details-chip", children: [
|
|
1437
1438
|
/* @__PURE__ */ a(
|
|
1438
|
-
|
|
1439
|
+
us,
|
|
1439
1440
|
{
|
|
1440
1441
|
className: "flight-card__details-chip-icon",
|
|
1441
1442
|
"aria-hidden": "true"
|
|
@@ -1483,16 +1484,16 @@ function ln(t, e, n) {
|
|
|
1483
1484
|
const o = String(t || "").trim().toUpperCase();
|
|
1484
1485
|
return o ? `${o} Airport` : "Origin Airport";
|
|
1485
1486
|
}
|
|
1486
|
-
function
|
|
1487
|
+
function $s(t) {
|
|
1487
1488
|
return /* @__PURE__ */ a(cr, { ...t, legTagText: null });
|
|
1488
1489
|
}
|
|
1489
|
-
function
|
|
1490
|
+
function Is(t) {
|
|
1490
1491
|
return /* @__PURE__ */ a(cr, { ...t, legTagText: "Onward" });
|
|
1491
1492
|
}
|
|
1492
|
-
function
|
|
1493
|
+
function Rs(t) {
|
|
1493
1494
|
return /* @__PURE__ */ a(cr, { ...t, legTagText: "Return" });
|
|
1494
1495
|
}
|
|
1495
|
-
function
|
|
1496
|
+
function Bs({
|
|
1496
1497
|
card: t,
|
|
1497
1498
|
disableBook: e = !1,
|
|
1498
1499
|
bookingFlightId: n = null,
|
|
@@ -1939,7 +1940,7 @@ function Is({
|
|
|
1939
1940
|
) : null
|
|
1940
1941
|
] });
|
|
1941
1942
|
}
|
|
1942
|
-
function
|
|
1943
|
+
function Ms({
|
|
1943
1944
|
card: t,
|
|
1944
1945
|
cardPositionIndex: e = 0,
|
|
1945
1946
|
isCheapest: n = !1,
|
|
@@ -2141,7 +2142,7 @@ function Rs({
|
|
|
2141
2142
|
/* @__PURE__ */ d("div", { className: "flight-card__combined-leg-header", children: [
|
|
2142
2143
|
/* @__PURE__ */ d("div", { className: "flight-card__combined-leg-title", children: [
|
|
2143
2144
|
/* @__PURE__ */ a(
|
|
2144
|
-
|
|
2145
|
+
ys,
|
|
2145
2146
|
{
|
|
2146
2147
|
className: `flight-card__combined-plane ${I ? "flight-card__combined-plane--return" : ""}`
|
|
2147
2148
|
}
|
|
@@ -2221,7 +2222,7 @@ function Rs({
|
|
|
2221
2222
|
] });
|
|
2222
2223
|
};
|
|
2223
2224
|
return /* @__PURE__ */ a(
|
|
2224
|
-
|
|
2225
|
+
Bs,
|
|
2225
2226
|
{
|
|
2226
2227
|
card: t,
|
|
2227
2228
|
disableBook: i,
|
|
@@ -2391,7 +2392,7 @@ function _n({
|
|
|
2391
2392
|
}, [t, w]), b = Zt(() => {
|
|
2392
2393
|
if (!t.length) return null;
|
|
2393
2394
|
const g = t.find(
|
|
2394
|
-
($) =>
|
|
2395
|
+
($) => zs($, i)
|
|
2395
2396
|
);
|
|
2396
2397
|
return (g == null ? void 0 : g.id) || null;
|
|
2397
2398
|
}, [t, i]);
|
|
@@ -2416,7 +2417,7 @@ function _n({
|
|
|
2416
2417
|
if (n)
|
|
2417
2418
|
return;
|
|
2418
2419
|
v && I();
|
|
2419
|
-
const $ = Nn(g == null ? void 0 : g.rmkey), K = Nn(g == null ? void 0 : g.rtrmkey), W =
|
|
2420
|
+
const $ = Nn(g == null ? void 0 : g.rmkey), K = Nn(g == null ? void 0 : g.rtrmkey), W = Ps({
|
|
2420
2421
|
flight: g,
|
|
2421
2422
|
cardVariant: s,
|
|
2422
2423
|
rmkeyList: $,
|
|
@@ -2442,7 +2443,7 @@ function _n({
|
|
|
2442
2443
|
}
|
|
2443
2444
|
})
|
|
2444
2445
|
);
|
|
2445
|
-
}, z = t.slice(0, 3), L = s === "onward" ?
|
|
2446
|
+
}, z = t.slice(0, 3), L = s === "onward" ? Is : s === "return" ? Rs : s === "combined" ? Ms : $s, I = () => S(!1), O = (g) => {
|
|
2446
2447
|
j(($) => ({
|
|
2447
2448
|
...$,
|
|
2448
2449
|
[g]: !$[g]
|
|
@@ -2518,7 +2519,7 @@ function _n({
|
|
|
2518
2519
|
) }) : null
|
|
2519
2520
|
] });
|
|
2520
2521
|
}
|
|
2521
|
-
function
|
|
2522
|
+
function Ps({
|
|
2522
2523
|
flight: t,
|
|
2523
2524
|
cardVariant: e,
|
|
2524
2525
|
rmkeyList: n,
|
|
@@ -2559,7 +2560,7 @@ function Bs({
|
|
|
2559
2560
|
}
|
|
2560
2561
|
return c;
|
|
2561
2562
|
}
|
|
2562
|
-
function
|
|
2563
|
+
function zs(t, e) {
|
|
2563
2564
|
if (!t || !e || ![
|
|
2564
2565
|
e.airlineCode,
|
|
2565
2566
|
e.departureTime,
|
|
@@ -2588,7 +2589,7 @@ function Or(t) {
|
|
|
2588
2589
|
const n = new Date(e);
|
|
2589
2590
|
return Number.isNaN(n.getTime()) ? "" : n.toISOString().slice(0, 10);
|
|
2590
2591
|
}
|
|
2591
|
-
function
|
|
2592
|
+
function Us({
|
|
2592
2593
|
payload: t = [],
|
|
2593
2594
|
airlinesMap: e = {},
|
|
2594
2595
|
flightImagesBaseUrl: n = "",
|
|
@@ -2767,7 +2768,7 @@ function Hr({
|
|
|
2767
2768
|
payloadIndex: i
|
|
2768
2769
|
};
|
|
2769
2770
|
}
|
|
2770
|
-
function
|
|
2771
|
+
function js({
|
|
2771
2772
|
payload: t = [],
|
|
2772
2773
|
airlinesMap: e = {},
|
|
2773
2774
|
flightImagesBaseUrl: n = "",
|
|
@@ -2807,7 +2808,7 @@ function zs({
|
|
|
2807
2808
|
}, x = () => {
|
|
2808
2809
|
if (c)
|
|
2809
2810
|
return;
|
|
2810
|
-
const z =
|
|
2811
|
+
const z = ks(
|
|
2811
2812
|
u,
|
|
2812
2813
|
m
|
|
2813
2814
|
);
|
|
@@ -2935,7 +2936,7 @@ function zs({
|
|
|
2935
2936
|
] }) : null
|
|
2936
2937
|
] });
|
|
2937
2938
|
}
|
|
2938
|
-
function
|
|
2939
|
+
function Os({
|
|
2939
2940
|
payload: t = [],
|
|
2940
2941
|
airlinesMap: e = {},
|
|
2941
2942
|
flightImagesBaseUrl: n = "",
|
|
@@ -3081,8 +3082,8 @@ const Dn = (t, e = !1) => {
|
|
|
3081
3082
|
layoverDuration: null,
|
|
3082
3083
|
rLayoverDuration: null
|
|
3083
3084
|
};
|
|
3084
|
-
return
|
|
3085
|
-
},
|
|
3085
|
+
return Vs(n, i), i.clearAll || (Gs(n, i), Ws(r, n, i, e), qs(r, n, i), Zs(r, t, n, i, e), Js(r, n, i, e), Hs(n, i, e), Ks(n, i), Ys(t, n, i, e)), i;
|
|
3086
|
+
}, Hs = (t, e, n) => {
|
|
3086
3087
|
const r = n && /\b(return|returning|inbound|back|roundtrip|round trip|rt)\b/i.test(t), i = /\b(onward|outbound|oneway|one-way|one way|outward)\b/i.test(t), o = r && !i ? "rLayover" : "layover", c = r && !i ? "rLayoverDuration" : "layoverDuration", u = /* @__PURE__ */ new Set([
|
|
3087
3088
|
"for",
|
|
3088
3089
|
"and",
|
|
@@ -3194,14 +3195,14 @@ const Dn = (t, e = !1) => {
|
|
|
3194
3195
|
v ? (e.layoverDuration = l, e.rLayoverDuration = l) : e[c] = l;
|
|
3195
3196
|
}
|
|
3196
3197
|
}
|
|
3197
|
-
},
|
|
3198
|
+
}, Ks = (t, e) => {
|
|
3198
3199
|
/\b(refundable only|only refundable|refundable flights?)\b/i.test(t) && (e.refundable = !0), /\b(non refundable|non-refundable)\b/i.test(t) && (e.refundable = !1);
|
|
3199
3200
|
const n = t.match(/\b(?:duration|journey|flight time)\s*(?:under|below|less than|max(?:imum)?)\s*(\d+)\s*(h|hr|hrs|hour|hours|m|min|mins|minute|minutes)\b/i);
|
|
3200
3201
|
if (n) {
|
|
3201
3202
|
const r = Number(n[1]), i = String(n[2] || "").toLowerCase();
|
|
3202
3203
|
Number.isFinite(r) && (e.maxDuration = /h|hr|hour/.test(i) ? Math.round(r * 60) : Math.round(r));
|
|
3203
3204
|
}
|
|
3204
|
-
},
|
|
3205
|
+
}, Ys = (t, e, n, r) => {
|
|
3205
3206
|
if (!r) return;
|
|
3206
3207
|
const i = /\b(return|returning|inbound|back|roundtrip|round trip|rt)\b/i.test(
|
|
3207
3208
|
e
|
|
@@ -3274,7 +3275,7 @@ const Dn = (t, e = !1) => {
|
|
|
3274
3275
|
O.test(h) && I(k);
|
|
3275
3276
|
});
|
|
3276
3277
|
});
|
|
3277
|
-
},
|
|
3278
|
+
}, Vs = (t, e) => {
|
|
3278
3279
|
[
|
|
3279
3280
|
"clear all",
|
|
3280
3281
|
"clear all filters",
|
|
@@ -3291,7 +3292,7 @@ const Dn = (t, e = !1) => {
|
|
|
3291
3292
|
].forEach((r) => {
|
|
3292
3293
|
t.includes(r) && (e.clearAll = !0);
|
|
3293
3294
|
});
|
|
3294
|
-
},
|
|
3295
|
+
}, Gs = (t, e) => {
|
|
3295
3296
|
const n = String(t || "").trim().toLowerCase();
|
|
3296
3297
|
if (!n) return;
|
|
3297
3298
|
const r = /\b(desc|dsc|descending|decending|high(?:est)?\s+to\s+low(?:est)?|reverse|highest first|max(?:imum)? first)\b/.test(
|
|
@@ -3380,7 +3381,7 @@ const Dn = (t, e = !1) => {
|
|
|
3380
3381
|
}).forEach(([f, y]) => {
|
|
3381
3382
|
n.includes(f) && (e.sortBy = y);
|
|
3382
3383
|
});
|
|
3383
|
-
},
|
|
3384
|
+
}, Ws = (t, e, n, r) => {
|
|
3384
3385
|
const i = r && /\b(return|returning|inbound|back|roundtrip|round trip|rt)\b/i.test(e), o = /\b(onward|outbound|oneway|one-way|one way|outward)\b/i.test(e), c = r ? i ? ["rtStops"] : o ? ["stops"] : ["stops", "rtStops"] : ["stops"], u = (y) => {
|
|
3385
3386
|
c.forEach((C) => {
|
|
3386
3387
|
n[C].includes(y) || n[C].push(y);
|
|
@@ -3457,7 +3458,7 @@ const Dn = (t, e = !1) => {
|
|
|
3457
3458
|
v.includes(S) && u(2);
|
|
3458
3459
|
});
|
|
3459
3460
|
});
|
|
3460
|
-
},
|
|
3461
|
+
}, qs = (t, e, n) => {
|
|
3461
3462
|
const r = e.replace(/,/g, ""), i = /\b(layover|stopover|via)\b/i.test(r), o = /\b(h|hr|hrs|hour|hours|m|min|mins|minute|minutes)\b/i.test(
|
|
3462
3463
|
r
|
|
3463
3464
|
), c = /\b(under|below|less than|over|above|more than|min|minimum|max|maximum|between|from)\b/i.test(
|
|
@@ -3513,7 +3514,7 @@ const Dn = (t, e = !1) => {
|
|
|
3513
3514
|
f ? n.price = { max: N } : y ? n.price = { min: N } : n.price = { min: N, max: N };
|
|
3514
3515
|
}
|
|
3515
3516
|
}
|
|
3516
|
-
},
|
|
3517
|
+
}, Zs = (t, e, n, r, i) => {
|
|
3517
3518
|
const o = i && /\b(return|returning|inbound|back|roundtrip|round trip|rt)\b/i.test(n), c = /\b(onward|outbound|oneway|one-way|one way|outward)\b/i.test(n), u = i ? o ? ["rtAirlines"] : c ? ["airlines"] : ["airlines", "rtAirlines"] : ["airlines"], s = (_) => {
|
|
3518
3519
|
u.forEach((h) => {
|
|
3519
3520
|
r[h].includes(_) || r[h].push(_);
|
|
@@ -3549,7 +3550,7 @@ const Dn = (t, e = !1) => {
|
|
|
3549
3550
|
p && p.forEach((_) => {
|
|
3550
3551
|
!u.some((h) => r[h].includes(_)) && !m.has(_) && y.includes(_) && _.length >= 2 && _.length <= 3 && s(_);
|
|
3551
3552
|
});
|
|
3552
|
-
},
|
|
3553
|
+
}, Js = (t, e, n, r) => {
|
|
3553
3554
|
const i = ["0-6", "6-12", "12-18", "18-24"], o = /\b(return|returning|inbound|back|roundtrip|round trip|rt)\b/i.test(
|
|
3554
3555
|
e
|
|
3555
3556
|
), c = /\b(arrival|arrive)\b/i.test(e), u = /\b(departure|depart)\b/i.test(e), s = /\b(onward|outbound|oneway|one-way|one way|outward)\b/i.test(
|
|
@@ -3900,7 +3901,7 @@ const Dn = (t, e = !1) => {
|
|
|
3900
3901
|
return m ? N ? e === "cheapest" ? n(m) - n(N) : e === "expensive" ? n(N) - n(m) : e === "departure" ? r(m).localeCompare(r(N)) : e === "lateDeparture" ? r(N).localeCompare(r(m)) : e === "arrival" ? i(m).localeCompare(i(N)) : e === "lateArrival" ? i(N).localeCompare(i(m)) : e === "quickest" ? o(m) - o(N) : e === "slowest" ? o(N) - o(m) : 0 : -1 : 1;
|
|
3901
3902
|
}), c;
|
|
3902
3903
|
};
|
|
3903
|
-
function
|
|
3904
|
+
function Xs({
|
|
3904
3905
|
results: t = [],
|
|
3905
3906
|
emptyMessage: e = "",
|
|
3906
3907
|
recommendationCriteria: n = null,
|
|
@@ -3920,7 +3921,7 @@ function Zs({
|
|
|
3920
3921
|
const f = Zt(
|
|
3921
3922
|
() => Array.isArray(t) ? t : (t == null ? void 0 : t.payload) || [],
|
|
3922
3923
|
[t]
|
|
3923
|
-
), y = process.env.REACT_APP_FLIGHT_IMAGES || process.env.FLIGHT_IMAGES || "", C = Zt(() =>
|
|
3924
|
+
), y = process.env.REACT_APP_FLIGHT_IMAGES || process.env.FLIGHT_IMAGES || "", C = Zt(() => Ts(), []), [v, S] = tt(c), [p, _] = tt(!1), [h, x] = tt(!1), A = Mt(null);
|
|
3924
3925
|
ut(() => {
|
|
3925
3926
|
S(c);
|
|
3926
3927
|
}, [c]);
|
|
@@ -3948,7 +3949,7 @@ function Zs({
|
|
|
3948
3949
|
m(j.length);
|
|
3949
3950
|
}, [j, m]), ut(() => {
|
|
3950
3951
|
N(
|
|
3951
|
-
|
|
3952
|
+
Qs(j, v, C)
|
|
3952
3953
|
);
|
|
3953
3954
|
}, [j, v, C, N]), ut(() => {
|
|
3954
3955
|
var W;
|
|
@@ -3990,7 +3991,7 @@ function Zs({
|
|
|
3990
3991
|
return /* @__PURE__ */ d("div", { className: "flight-results-container", ref: A, children: [
|
|
3991
3992
|
w.length ? /* @__PURE__ */ a("div", { className: "flight-results__context-bar", children: w.map((I) => /* @__PURE__ */ a("span", { className: "flight-results__context-chip", children: I }, I)) }) : null,
|
|
3992
3993
|
j.length === 0 ? /* @__PURE__ */ a("div", { className: "flight-results__empty", children: "No flights match your filters." }) : /* @__PURE__ */ a(Be, { children: z ? L ? /* @__PURE__ */ a(
|
|
3993
|
-
|
|
3994
|
+
Os,
|
|
3994
3995
|
{
|
|
3995
3996
|
payload: D,
|
|
3996
3997
|
airlinesMap: C,
|
|
@@ -4001,7 +4002,7 @@ function Zs({
|
|
|
4001
4002
|
disableBook: o
|
|
4002
4003
|
}
|
|
4003
4004
|
) : /* @__PURE__ */ a(
|
|
4004
|
-
|
|
4005
|
+
js,
|
|
4005
4006
|
{
|
|
4006
4007
|
payload: H,
|
|
4007
4008
|
airlinesMap: C,
|
|
@@ -4012,7 +4013,7 @@ function Zs({
|
|
|
4012
4013
|
disableBook: o
|
|
4013
4014
|
}
|
|
4014
4015
|
) : /* @__PURE__ */ a(
|
|
4015
|
-
|
|
4016
|
+
Us,
|
|
4016
4017
|
{
|
|
4017
4018
|
payload: j,
|
|
4018
4019
|
airlinesMap: C,
|
|
@@ -4025,9 +4026,9 @@ function Zs({
|
|
|
4025
4026
|
) })
|
|
4026
4027
|
] });
|
|
4027
4028
|
}
|
|
4028
|
-
function
|
|
4029
|
+
function Qs(t = [], e = null, n = {}) {
|
|
4029
4030
|
var v;
|
|
4030
|
-
const r =
|
|
4031
|
+
const r = ta(t, n);
|
|
4031
4032
|
if (!r.length) return "";
|
|
4032
4033
|
const i = r.filter((S) => Number.isFinite(S.price)), o = (i.length ? i : r).reduce(
|
|
4033
4034
|
(S, p) => Number(p.price || Number.MAX_SAFE_INTEGER) < Number(S.price || Number.MAX_SAFE_INTEGER) ? p : S
|
|
@@ -4038,7 +4039,7 @@ function Js(t = [], e = null, n = {}) {
|
|
|
4038
4039
|
}, null) || o, m = `${s.origin} to ${s.destination}`, N = s.departureDate || "selected date", f = s.currency || o.currency || ((v = r[0]) == null ? void 0 : v.currency) || "INR", y = s === o ? `${s.airline} ${s.flightNumber} at ${s.departureTime} is currently the best pick for ${m} on ${N} (lowest fare ${Kr(s.price, f)}).` : `${s.airline} ${s.flightNumber} at ${s.departureTime} is the best convenience option for ${m} on ${N}, while ${o.airline} ${o.flightNumber} is cheapest at ${Kr(o.price, f)}.`, C = [];
|
|
4039
4040
|
return e != null && e.sortBy && C.push(`sorted by ${String(e.sortBy)}`), Array.isArray(e == null ? void 0 : e.depTimes) && e.depTimes.length > 0 && C.push(`departure window ${e.depTimes.join(", ")}`), Array.isArray(e == null ? void 0 : e.stops) && e.stops.length > 0 && C.push(`stops ${e.stops.join(", ")}`), C.length ? `${y} (Applied filters: ${C.join(" | ")}.)` : y;
|
|
4040
4041
|
}
|
|
4041
|
-
function
|
|
4042
|
+
function ta(t = [], e = {}) {
|
|
4042
4043
|
const n = [];
|
|
4043
4044
|
return (Array.isArray(t) ? t : []).forEach((i) => {
|
|
4044
4045
|
(Array.isArray(i == null ? void 0 : i.trps) ? i.trps : []).forEach((c) => {
|
|
@@ -4054,7 +4055,7 @@ function Xs(t = [], e = {}) {
|
|
|
4054
4055
|
airline: C,
|
|
4055
4056
|
flightNumber: String((m == null ? void 0 : m.fn) || "").trim(),
|
|
4056
4057
|
stops: Math.max(s.length - 1, 0),
|
|
4057
|
-
durationMins:
|
|
4058
|
+
durationMins: ea((m == null ? void 0 : m.fdur) || (u == null ? void 0 : u.tdur) || ""),
|
|
4058
4059
|
price: Number(f == null ? void 0 : f.tf),
|
|
4059
4060
|
currency: String(
|
|
4060
4061
|
(i == null ? void 0 : i.cur) || (f == null ? void 0 : f.cur) || (f == null ? void 0 : f.currency) || (c == null ? void 0 : c.cur) || (c == null ? void 0 : c.currency) || ""
|
|
@@ -4063,7 +4064,7 @@ function Xs(t = [], e = {}) {
|
|
|
4063
4064
|
});
|
|
4064
4065
|
}), n;
|
|
4065
4066
|
}
|
|
4066
|
-
function
|
|
4067
|
+
function ea(t) {
|
|
4067
4068
|
const e = String(t || "").toLowerCase();
|
|
4068
4069
|
if (!e) return null;
|
|
4069
4070
|
if (/^\d+$/.test(e)) return Number(e);
|
|
@@ -4078,7 +4079,7 @@ const Yr = {
|
|
|
4078
4079
|
passportRequired: !1,
|
|
4079
4080
|
trvlrs: []
|
|
4080
4081
|
};
|
|
4081
|
-
function
|
|
4082
|
+
function na({
|
|
4082
4083
|
prebookPayload: t,
|
|
4083
4084
|
sessionId: e,
|
|
4084
4085
|
isReadOnly: n = !1,
|
|
@@ -4136,7 +4137,7 @@ function ta({
|
|
|
4136
4137
|
((_r = gt == null ? void 0 : gt.outbound) == null ? void 0 : _r.ptyp) || ((wr = gt == null ? void 0 : gt.onward) == null ? void 0 : wr.ptyp) || ((vr = gt == null ? void 0 : gt.ob) == null ? void 0 : vr.ptyp)
|
|
4137
4138
|
), R = ve(
|
|
4138
4139
|
((Sr = gt == null ? void 0 : gt.inbound) == null ? void 0 : Sr.ptyp) || ((Ar = gt == null ? void 0 : gt.return) == null ? void 0 : Ar.ptyp) || ((Cr = gt == null ? void 0 : gt.ib) == null ? void 0 : Cr.ptyp)
|
|
4139
|
-
), M = !!((kr = gt == null ? void 0 : gt.journey) != null && kr.hasInbound), V =
|
|
4140
|
+
), M = !!((kr = gt == null ? void 0 : gt.journey) != null && kr.hasInbound), V = ra(
|
|
4140
4141
|
(s == null ? void 0 : s.isaprv) ?? (t == null ? void 0 : t.isaprv) ?? ((Tr = A == null ? void 0 : A.payload) == null ? void 0 : Tr.isaprv) ?? (A == null ? void 0 : A.isaprv) ?? (gt == null ? void 0 : gt.isaprv)
|
|
4141
4142
|
), q = Kt && dt === "employee" && V && (M || R.includes("cl") || Se.includes("cl")), J = qr({
|
|
4142
4143
|
charges: O == null ? void 0 : O.charges,
|
|
@@ -4217,7 +4218,7 @@ function ta({
|
|
|
4217
4218
|
wt,
|
|
4218
4219
|
Et
|
|
4219
4220
|
]), ut(() => {
|
|
4220
|
-
const T =
|
|
4221
|
+
const T = pa(O);
|
|
4221
4222
|
T.length && T.forEach((B) => {
|
|
4222
4223
|
const Q = String(B || "").toLowerCase();
|
|
4223
4224
|
if (Q.includes("razor")) {
|
|
@@ -4361,7 +4362,7 @@ function ta({
|
|
|
4361
4362
|
() => Array.isArray(s == null ? void 0 : s.trvlrs) ? s.trvlrs : [],
|
|
4362
4363
|
[s]
|
|
4363
4364
|
), Yt = Zt(
|
|
4364
|
-
() =>
|
|
4365
|
+
() => ia(t == null ? void 0 : t.frequentTravellers),
|
|
4365
4366
|
[t]
|
|
4366
4367
|
), pt = (T, B, Q) => {
|
|
4367
4368
|
m((U) => {
|
|
@@ -4432,7 +4433,7 @@ function ta({
|
|
|
4432
4433
|
if (rt.setHours(0, 0, 0, 0), new Date(Y) > rt)
|
|
4433
4434
|
T[`${G}.dob`] = "Date of birth cannot be in the future.";
|
|
4434
4435
|
else {
|
|
4435
|
-
const At =
|
|
4436
|
+
const At = ua(U == null ? void 0 : U.typ, Y);
|
|
4436
4437
|
At && (T[`${G}.dob`] = At);
|
|
4437
4438
|
}
|
|
4438
4439
|
}
|
|
@@ -4617,7 +4618,7 @@ function ta({
|
|
|
4617
4618
|
return;
|
|
4618
4619
|
}
|
|
4619
4620
|
f(!0), S("");
|
|
4620
|
-
const Q =
|
|
4621
|
+
const Q = aa(s, {
|
|
4621
4622
|
fallbackPayload: t,
|
|
4622
4623
|
confirmedRequestPayload: b
|
|
4623
4624
|
});
|
|
@@ -4776,7 +4777,7 @@ function ta({
|
|
|
4776
4777
|
});
|
|
4777
4778
|
return;
|
|
4778
4779
|
}
|
|
4779
|
-
const se = await
|
|
4780
|
+
const se = await ma({
|
|
4780
4781
|
gateway: P,
|
|
4781
4782
|
paymentMode: st,
|
|
4782
4783
|
apiData: Ft == null ? void 0 : Ft.data,
|
|
@@ -4833,13 +4834,13 @@ function ta({
|
|
|
4833
4834
|
const U = String(Q || "").trim().match(/\b(?:traveller|traveler)\s*(\d+)\b/i), G = Math.min(
|
|
4834
4835
|
U ? Math.max(Number(U[1]) - 1, 0) : 0,
|
|
4835
4836
|
Math.max(ht.length - 1, 0)
|
|
4836
|
-
), Y =
|
|
4837
|
+
), Y = va(Q, {
|
|
4837
4838
|
passportRequired: xe,
|
|
4838
4839
|
defaultTyp: (oe = ht[G]) == null ? void 0 : oe.typ
|
|
4839
4840
|
});
|
|
4840
4841
|
if (Y != null && Y.isFixedFormat && !(Y != null && Y.isValid)) {
|
|
4841
4842
|
(Tt = (Rt = B.detail) == null ? void 0 : Rt.appendUserMessage) == null || Tt.call(Rt, Q), (fe = (X = B.detail) == null ? void 0 : X.markHandled) == null || fe.call(X);
|
|
4842
|
-
const mt = `Invalid traveller format: ${Y.error}. Use: ${
|
|
4843
|
+
const mt = `Invalid traveller format: ${Y.error}. Use: ${Sa(xe)}`;
|
|
4843
4844
|
S(mt), i(mt);
|
|
4844
4845
|
return;
|
|
4845
4846
|
}
|
|
@@ -4864,15 +4865,15 @@ function ta({
|
|
|
4864
4865
|
}, je) : Ue;
|
|
4865
4866
|
}), _((Ue) => {
|
|
4866
4867
|
const je = { ...Ue };
|
|
4867
|
-
return Object.keys(le || {}).forEach((
|
|
4868
|
-
delete je[`${mt}.${
|
|
4868
|
+
return Object.keys(le || {}).forEach((os) => {
|
|
4869
|
+
delete je[`${mt}.${os}`];
|
|
4869
4870
|
}), je;
|
|
4870
4871
|
});
|
|
4871
4872
|
const ze = `Updated Traveler ${mt + 1} from chat format.`;
|
|
4872
4873
|
S(ze), i(ze);
|
|
4873
4874
|
return;
|
|
4874
4875
|
}
|
|
4875
|
-
const rt =
|
|
4876
|
+
const rt = ba(Q, {
|
|
4876
4877
|
passportRequired: xe,
|
|
4877
4878
|
traveller: ot
|
|
4878
4879
|
});
|
|
@@ -4893,10 +4894,10 @@ function ta({
|
|
|
4893
4894
|
return;
|
|
4894
4895
|
}
|
|
4895
4896
|
if (rt.intent === "select_payment_mode") {
|
|
4896
|
-
const mt = String(((Br = rt == null ? void 0 : rt.updates) == null ? void 0 : Br.paymentMode) || "").trim().toUpperCase(), le =
|
|
4897
|
+
const mt = String(((Br = rt == null ? void 0 : rt.updates) == null ? void 0 : Br.paymentMode) || "").trim().toUpperCase(), le = Ca(mt);
|
|
4897
4898
|
if (mt && le) {
|
|
4898
4899
|
Z(le), it(mt);
|
|
4899
|
-
const ze = `Selected payment mode as ${
|
|
4900
|
+
const ze = `Selected payment mode as ${ka(mt)}.`;
|
|
4900
4901
|
S(ze), i(ze);
|
|
4901
4902
|
}
|
|
4902
4903
|
return;
|
|
@@ -4955,7 +4956,7 @@ function ta({
|
|
|
4955
4956
|
S(mt), i(mt);
|
|
4956
4957
|
return;
|
|
4957
4958
|
}
|
|
4958
|
-
const At =
|
|
4959
|
+
const At = ya(Q, ht);
|
|
4959
4960
|
if (At != null && At.error) {
|
|
4960
4961
|
S(At.error), i(At.error);
|
|
4961
4962
|
return;
|
|
@@ -4979,7 +4980,7 @@ function ta({
|
|
|
4979
4980
|
const de = {
|
|
4980
4981
|
...ue || {},
|
|
4981
4982
|
...Nt
|
|
4982
|
-
}, ae =
|
|
4983
|
+
}, ae = ga({
|
|
4983
4984
|
traveller: de,
|
|
4984
4985
|
updates: Nt,
|
|
4985
4986
|
passportRequired: xe
|
|
@@ -5188,7 +5189,7 @@ function ta({
|
|
|
5188
5189
|
] }),
|
|
5189
5190
|
/* @__PURE__ */ a("div", { className: "traveler-form__section-card", children: /* @__PURE__ */ d("div", { className: "traveler-form__grid traveler-form__grid--4", children: [
|
|
5190
5191
|
/* @__PURE__ */ a(
|
|
5191
|
-
|
|
5192
|
+
la,
|
|
5192
5193
|
{
|
|
5193
5194
|
label: "Gender *",
|
|
5194
5195
|
value: (T == null ? void 0 : T.tl) || "",
|
|
@@ -5203,7 +5204,7 @@ function ta({
|
|
|
5203
5204
|
}
|
|
5204
5205
|
),
|
|
5205
5206
|
/* @__PURE__ */ a(
|
|
5206
|
-
|
|
5207
|
+
oa,
|
|
5207
5208
|
{
|
|
5208
5209
|
label: "First Name *",
|
|
5209
5210
|
value: (T == null ? void 0 : T.fn) || "",
|
|
@@ -5331,12 +5332,12 @@ function ta({
|
|
|
5331
5332
|
function ce(t) {
|
|
5332
5333
|
return Array.isArray(t) ? t : t && Array.isArray(t.payload) ? t.payload : t && typeof t == "object" ? [t] : [];
|
|
5333
5334
|
}
|
|
5334
|
-
function
|
|
5335
|
+
function ra(t) {
|
|
5335
5336
|
if (typeof t == "boolean") return t;
|
|
5336
5337
|
const e = String(t || "").trim().toLowerCase();
|
|
5337
5338
|
return e ? ["true", "1", "y", "yes"].includes(e) : !1;
|
|
5338
5339
|
}
|
|
5339
|
-
function
|
|
5340
|
+
function ia(t) {
|
|
5340
5341
|
return Array.isArray(t) ? t.filter((e) => e && typeof e == "object") : [];
|
|
5341
5342
|
}
|
|
5342
5343
|
function Vr(t, e) {
|
|
@@ -5354,7 +5355,7 @@ function Ln(t) {
|
|
|
5354
5355
|
const n = e.getUTCFullYear(), r = String(e.getUTCMonth() + 1).padStart(2, "0"), i = String(e.getUTCDate()).padStart(2, "0");
|
|
5355
5356
|
return `${n}-${r}-${i}`;
|
|
5356
5357
|
}
|
|
5357
|
-
function
|
|
5358
|
+
function sa(t = {}) {
|
|
5358
5359
|
const e = String((t == null ? void 0 : t.typ) || "ADT").trim().toUpperCase(), n = {
|
|
5359
5360
|
sno: Number((t == null ? void 0 : t.sno) || 0),
|
|
5360
5361
|
tl: String((t == null ? void 0 : t.tl) || "").trim(),
|
|
@@ -5372,13 +5373,13 @@ function ra(t = {}) {
|
|
|
5372
5373
|
};
|
|
5373
5374
|
return e !== "INF" && (n.extbag = Array.isArray(t == null ? void 0 : t.extbag) ? t.extbag : [], n.meal = Array.isArray(t == null ? void 0 : t.meal) ? t.meal : [], n.seat = Array.isArray(t == null ? void 0 : t.seat) ? t.seat : []), n;
|
|
5374
5375
|
}
|
|
5375
|
-
function
|
|
5376
|
+
function aa(t = {}, e = {}) {
|
|
5376
5377
|
const n = e != null && e.fallbackPayload && typeof e.fallbackPayload == "object" ? e.fallbackPayload : {}, r = e != null && e.confirmedRequestPayload && typeof e.confirmedRequestPayload == "object" ? e.confirmedRequestPayload : {}, i = String(
|
|
5377
5378
|
(t == null ? void 0 : t.agtyp) || (n == null ? void 0 : n.agtyp) || (r == null ? void 0 : r.agtyp) || ""
|
|
5378
5379
|
).trim(), o = i.trim().toLowerCase(), c = String((t == null ? void 0 : t.chnl) || (t == null ? void 0 : t.cha) || "").trim().toLowerCase(), u = String(
|
|
5379
5380
|
(n == null ? void 0 : n.chnl) || (n == null ? void 0 : n.cha) || (r == null ? void 0 : r.chnl) || (r == null ? void 0 : r.cha) || ""
|
|
5380
5381
|
).trim().toLowerCase(), s = c || u, m = s === "b2b" || s === "corp" || o.includes("b2b") || o.includes("corporate") ? "B2B" : "B2C", f = (Array.isArray(t == null ? void 0 : t.trvlrs) ? t.trvlrs : []).map((x, A) => {
|
|
5381
|
-
const j =
|
|
5382
|
+
const j = sa(x);
|
|
5382
5383
|
return j.sno = j.sno > 0 ? j.sno : A + 1, j;
|
|
5383
5384
|
}), y = [], C = [], v = [];
|
|
5384
5385
|
f.forEach((x) => {
|
|
@@ -5442,7 +5443,7 @@ function Fn({ label: t, error: e, ...n }) {
|
|
|
5442
5443
|
e ? /* @__PURE__ */ a("span", { className: "traveler-form__error-text", children: an(e) }) : null
|
|
5443
5444
|
] });
|
|
5444
5445
|
}
|
|
5445
|
-
function
|
|
5446
|
+
function oa({
|
|
5446
5447
|
label: t,
|
|
5447
5448
|
value: e,
|
|
5448
5449
|
onChange: n,
|
|
@@ -5542,7 +5543,7 @@ function sa({
|
|
|
5542
5543
|
u ? /* @__PURE__ */ a("span", { className: "traveler-form__error-text", children: an(u) }) : null
|
|
5543
5544
|
] });
|
|
5544
5545
|
}
|
|
5545
|
-
function
|
|
5546
|
+
function la({
|
|
5546
5547
|
label: t,
|
|
5547
5548
|
options: e,
|
|
5548
5549
|
error: n,
|
|
@@ -5558,7 +5559,7 @@ function aa({
|
|
|
5558
5559
|
return /* @__PURE__ */ d("label", { className: "traveler-form__label-wrap", children: [
|
|
5559
5560
|
/* @__PURE__ */ a("span", { className: "traveler-form__label", children: t }),
|
|
5560
5561
|
/* @__PURE__ */ a(
|
|
5561
|
-
|
|
5562
|
+
Ns,
|
|
5562
5563
|
{
|
|
5563
5564
|
className: c,
|
|
5564
5565
|
classNamePrefix: "traveler-form__react-select",
|
|
@@ -5592,8 +5593,8 @@ function En({
|
|
|
5592
5593
|
/* @__PURE__ */ a(
|
|
5593
5594
|
tr,
|
|
5594
5595
|
{
|
|
5595
|
-
selected:
|
|
5596
|
-
onChange: (s) => r(
|
|
5596
|
+
selected: da(n),
|
|
5597
|
+
onChange: (s) => r(fa(s)),
|
|
5597
5598
|
dateFormat: "dd-MM-yyyy",
|
|
5598
5599
|
placeholderText: "Please select a date",
|
|
5599
5600
|
disabled: i,
|
|
@@ -5646,7 +5647,7 @@ function Wr(t) {
|
|
|
5646
5647
|
maxDate: en(e, -12)
|
|
5647
5648
|
};
|
|
5648
5649
|
}
|
|
5649
|
-
function
|
|
5650
|
+
function ca(t) {
|
|
5650
5651
|
const e = new Date(t);
|
|
5651
5652
|
if (Number.isNaN(e.getTime())) return null;
|
|
5652
5653
|
const n = /* @__PURE__ */ new Date();
|
|
@@ -5654,21 +5655,21 @@ function oa(t) {
|
|
|
5654
5655
|
const i = n.getMonth() - e.getMonth(), o = n.getDate() - e.getDate();
|
|
5655
5656
|
return (i < 0 || i === 0 && o < 0) && (r -= 1), r;
|
|
5656
5657
|
}
|
|
5657
|
-
function
|
|
5658
|
-
const n =
|
|
5658
|
+
function ua(t, e) {
|
|
5659
|
+
const n = ca(e);
|
|
5659
5660
|
if (n === null) return null;
|
|
5660
5661
|
const r = String(t || "ADT").trim().toUpperCase();
|
|
5661
5662
|
return r === "INF" && n >= 2 ? "Infant age must be below 2 years." : r === "CHD" && (n < 2 || n >= 12) ? "Child age must be between 2 and 11 years." : r === "ADT" && n < 12 ? "Adult age must be 12 years or above." : null;
|
|
5662
5663
|
}
|
|
5663
|
-
function
|
|
5664
|
+
function da(t) {
|
|
5664
5665
|
if (!t) return null;
|
|
5665
5666
|
const e = new Date(t);
|
|
5666
5667
|
return Number.isNaN(e.getTime()) ? null : e;
|
|
5667
5668
|
}
|
|
5668
|
-
function
|
|
5669
|
+
function fa(t) {
|
|
5669
5670
|
return t ? new Date(t).toISOString() : null;
|
|
5670
5671
|
}
|
|
5671
|
-
async function
|
|
5672
|
+
async function ma({
|
|
5672
5673
|
gateway: t,
|
|
5673
5674
|
paymentMode: e,
|
|
5674
5675
|
apiData: n,
|
|
@@ -5719,7 +5720,7 @@ async function da({
|
|
|
5719
5720
|
reason: "Checkout closed by user."
|
|
5720
5721
|
});
|
|
5721
5722
|
}, v.handler = (x) => {
|
|
5722
|
-
_ = !0, typeof i == "function" && i(),
|
|
5723
|
+
_ = !0, typeof i == "function" && i(), ha({
|
|
5723
5724
|
callbackBaseUrl: C,
|
|
5724
5725
|
payload: {
|
|
5725
5726
|
razorpay_payment_id: (x == null ? void 0 : x.razorpay_payment_id) || "",
|
|
@@ -5809,7 +5810,7 @@ async function da({
|
|
|
5809
5810
|
}
|
|
5810
5811
|
return { launched: !1, reason: "Unsupported gateway launch flow" };
|
|
5811
5812
|
}
|
|
5812
|
-
async function
|
|
5813
|
+
async function ha({ callbackBaseUrl: t, payload: e }) {
|
|
5813
5814
|
const n = String(t).replace(/\/$/, "");
|
|
5814
5815
|
if (!n) return;
|
|
5815
5816
|
const r = `${n}/api/v1/razorpay/payment-response`;
|
|
@@ -5826,7 +5827,7 @@ function Re(t, e) {
|
|
|
5826
5827
|
i.id = t, i.src = e, i.async = !0, i.onload = () => r(!0), i.onerror = () => r(!1), document.body.appendChild(i);
|
|
5827
5828
|
}) : Promise.resolve(!1);
|
|
5828
5829
|
}
|
|
5829
|
-
function
|
|
5830
|
+
function pa(t) {
|
|
5830
5831
|
const e = /* @__PURE__ */ new Set();
|
|
5831
5832
|
return ce(t == null ? void 0 : t.gateways).forEach((i) => {
|
|
5832
5833
|
if (typeof i == "string" && i.trim()) {
|
|
@@ -5880,7 +5881,7 @@ function zi(t) {
|
|
|
5880
5881
|
const e = String(t || "ADT").trim().toUpperCase();
|
|
5881
5882
|
return e === "CHD" ? "Child" : e === "INF" ? "Infant" : "Adult";
|
|
5882
5883
|
}
|
|
5883
|
-
function
|
|
5884
|
+
function ba(t, { passportRequired: e = !1, traveller: n = {} } = {}) {
|
|
5884
5885
|
const r = String(t || "").trim(), i = r.toLowerCase();
|
|
5885
5886
|
if (!i) return null;
|
|
5886
5887
|
if (/\b(save details|save traveler details|save traveller details|save)\b/.test(
|
|
@@ -5902,7 +5903,7 @@ function ha(t, { passportRequired: e = !1, traveller: n = {} } = {}) {
|
|
|
5902
5903
|
) || /\b(credit card|debit card|net banking|upi|razor ?pay|crypto)\b/.test(i))
|
|
5903
5904
|
return {
|
|
5904
5905
|
intent: "select_payment_mode",
|
|
5905
|
-
updates: { paymentMode:
|
|
5906
|
+
updates: { paymentMode: Aa(i) }
|
|
5906
5907
|
};
|
|
5907
5908
|
const o = i.match(
|
|
5908
5909
|
/\b(?:apply|use|add)\s+(?:promo|promocode|promocde|coupon|discount)\s+(?:code\s+)?(\w+)\b/
|
|
@@ -6019,9 +6020,9 @@ function ha(t, { passportRequired: e = !1, traveller: n = {} } = {}) {
|
|
|
6019
6020
|
updates: {},
|
|
6020
6021
|
targetIndex: y,
|
|
6021
6022
|
blockedReason: "Traveler type cannot be changed. Please update other traveler details only."
|
|
6022
|
-
} : (Object.keys(C).length === 0 &&
|
|
6023
|
+
} : (Object.keys(C).length === 0 && Na(C, r, v), { intent: "fill_details", updates: C, targetIndex: y });
|
|
6023
6024
|
}
|
|
6024
|
-
function
|
|
6025
|
+
function ga({
|
|
6025
6026
|
traveller: t,
|
|
6026
6027
|
updates: e = {},
|
|
6027
6028
|
passportRequired: n = !1
|
|
@@ -6035,7 +6036,7 @@ function pa({
|
|
|
6035
6036
|
`passport expiry date as ${In(e.expdt)}`
|
|
6036
6037
|
);
|
|
6037
6038
|
const i = er(t, n);
|
|
6038
|
-
return r.length ? `Updated ${
|
|
6039
|
+
return r.length ? `Updated ${Ta(r)}. ${i}` : i;
|
|
6039
6040
|
}
|
|
6040
6041
|
function er(t = {}, e = !1) {
|
|
6041
6042
|
const n = Ui(t, e);
|
|
@@ -6055,7 +6056,7 @@ function Ui(t = {}, e = !1) {
|
|
|
6055
6056
|
}
|
|
6056
6057
|
return null;
|
|
6057
6058
|
}
|
|
6058
|
-
function
|
|
6059
|
+
function ya(t, e = []) {
|
|
6059
6060
|
const n = String(t || "").trim().toLowerCase();
|
|
6060
6061
|
if (!n) return { index: null, error: "" };
|
|
6061
6062
|
const r = n.match(
|
|
@@ -6093,10 +6094,10 @@ function ba(t, e = []) {
|
|
|
6093
6094
|
}
|
|
6094
6095
|
return { index: s, error: "" };
|
|
6095
6096
|
}
|
|
6096
|
-
function
|
|
6097
|
+
function Na(t, e, n) {
|
|
6097
6098
|
if (n) {
|
|
6098
6099
|
if (n === "fn" || n === "ln") {
|
|
6099
|
-
const r =
|
|
6100
|
+
const r = _a(e);
|
|
6100
6101
|
r && (t[n] = r);
|
|
6101
6102
|
return;
|
|
6102
6103
|
}
|
|
@@ -6106,7 +6107,7 @@ function ga(t, e, n) {
|
|
|
6106
6107
|
return;
|
|
6107
6108
|
}
|
|
6108
6109
|
if (n === "nat") {
|
|
6109
|
-
const r =
|
|
6110
|
+
const r = wa(e);
|
|
6110
6111
|
r && (t.nat = r);
|
|
6111
6112
|
return;
|
|
6112
6113
|
}
|
|
@@ -6116,7 +6117,7 @@ function ga(t, e, n) {
|
|
|
6116
6117
|
}
|
|
6117
6118
|
}
|
|
6118
6119
|
}
|
|
6119
|
-
function
|
|
6120
|
+
function _a(t) {
|
|
6120
6121
|
const e = String(t || "").replace(
|
|
6121
6122
|
/\b(my|the|is|it's|it is|this is|name|first|last|given|family|surname)\b/gi,
|
|
6122
6123
|
" "
|
|
@@ -6125,7 +6126,7 @@ function ya(t) {
|
|
|
6125
6126
|
const [n] = e.split(" ");
|
|
6126
6127
|
return Oe(n);
|
|
6127
6128
|
}
|
|
6128
|
-
function
|
|
6129
|
+
function wa(t) {
|
|
6129
6130
|
return String(t || "").replace(/\b(my|the|is|it's|it is|this is)\b/gi, " ").replace(/\s+/g, " ").trim();
|
|
6130
6131
|
}
|
|
6131
6132
|
function Ve(t) {
|
|
@@ -6152,7 +6153,7 @@ function Ve(t) {
|
|
|
6152
6153
|
const r = new Date(e);
|
|
6153
6154
|
return Number.isNaN(r.getTime()) ? null : r.toISOString();
|
|
6154
6155
|
}
|
|
6155
|
-
function
|
|
6156
|
+
function va(t, { passportRequired: e = !1, defaultTyp: n = "" } = {}) {
|
|
6156
6157
|
const r = String(t || "").trim();
|
|
6157
6158
|
if (!r) return { isFixedFormat: !1, isValid: !1 };
|
|
6158
6159
|
const i = r.replace(/\|/g, ";");
|
|
@@ -6259,7 +6260,7 @@ function _a(t, { passportRequired: e = !1, defaultTyp: n = "" } = {}) {
|
|
|
6259
6260
|
error: "Traveller index missing. Start with TRAVELLER 1"
|
|
6260
6261
|
};
|
|
6261
6262
|
}
|
|
6262
|
-
function
|
|
6263
|
+
function Sa(t = !1) {
|
|
6263
6264
|
return t ? "TRAVELLER 1; FN:John; LN:Doe; TL:M; DOB:1992-08-14; TYP:ADT; NAT:IN; NUM:K1234567; ISSDT:2018-01-01; EXPDT:2028-01-01" : "TRAVELLER 1; FN:John; LN:Doe; TL:M; DOB:1992-08-14; TYP:ADT";
|
|
6264
6265
|
}
|
|
6265
6266
|
function $n(t) {
|
|
@@ -6311,19 +6312,19 @@ function Xr(t = {}) {
|
|
|
6311
6312
|
const e = { ...t };
|
|
6312
6313
|
return delete e.typ, e;
|
|
6313
6314
|
}
|
|
6314
|
-
function
|
|
6315
|
+
function Aa(t) {
|
|
6315
6316
|
const e = String(t || "").toLowerCase();
|
|
6316
6317
|
return /\bcredit card\b/.test(e) ? "CC" : /\bdebit card\b/.test(e) ? "DC" : /\bnet banking\b/.test(e) ? "NB" : /\bupi\b/.test(e) ? "UP" : /\brazor ?pay\b/.test(e) ? "RP" : /\bcrypto\b/.test(e) ? "CR" : "";
|
|
6317
6318
|
}
|
|
6318
|
-
function
|
|
6319
|
+
function Ca(t) {
|
|
6319
6320
|
const e = String(t || "").trim().toUpperCase();
|
|
6320
6321
|
return e === "RP" ? "Razorpay" : e === "CR" ? "Crypto" : ["CC", "DC", "NB", "UP"].includes(e) ? "Default" : "";
|
|
6321
6322
|
}
|
|
6322
|
-
function
|
|
6323
|
+
function ka(t) {
|
|
6323
6324
|
const e = String(t || "").trim().toUpperCase();
|
|
6324
6325
|
return e === "CC" ? "Credit Card" : e === "DC" ? "Debit Card" : e === "NB" ? "Net Banking" : e === "UP" ? "UPI" : e === "RP" ? "Pay with Razor Pay" : e === "CR" ? "Pay with Crypto" : e || "payment mode";
|
|
6325
6326
|
}
|
|
6326
|
-
function
|
|
6327
|
+
function Ta(t = []) {
|
|
6327
6328
|
return t.length <= 1 ? t[0] || "" : t.length === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[t.length - 1]}`;
|
|
6328
6329
|
}
|
|
6329
6330
|
function an(t, e = "") {
|
|
@@ -6341,17 +6342,17 @@ function an(t, e = "") {
|
|
|
6341
6342
|
}
|
|
6342
6343
|
return e;
|
|
6343
6344
|
}
|
|
6344
|
-
function
|
|
6345
|
+
function xa({ confirmation: t }) {
|
|
6345
6346
|
if (!t || typeof t != "object")
|
|
6346
6347
|
return /* @__PURE__ */ a("p", { className: "payment-confirmation__muted-text", children: "Confirmation details are unavailable." });
|
|
6347
|
-
const e =
|
|
6348
|
+
const e = Da(t), n = He(e, ["bkid", "bookingid", "bookingId"]), r = He(e, ["bksts", "status", "bookingStatus"]) || "-", i = He(e, ["pnr", "airlinePnr", "gdsPnr"]) || "-", o = He(e, ["trps.pr.tf", "tf", "amount", "amt"]), c = He(e, ["cur", "currency"]) || "INR", u = process.env.REACT_APP_FLIGHT_IMAGES || process.env.FLIGHT_IMAGES || "", s = Ea(e), m = $a(e), N = Ia(e), f = Ba(e), y = Oi(e), C = Ra(e, N), v = Ma(e), S = La(r), p = Ua(r);
|
|
6348
6349
|
return /* @__PURE__ */ d("div", { className: "payment-confirmation", children: [
|
|
6349
6350
|
S ? /* @__PURE__ */ d(
|
|
6350
6351
|
"div",
|
|
6351
6352
|
{
|
|
6352
6353
|
className: `payment-confirmation__banner ${S.bannerClass}`,
|
|
6353
6354
|
children: [
|
|
6354
|
-
/* @__PURE__ */ a("div", { className: "payment-confirmation__banner-icon", children: String(r).toLowerCase().includes("confirm") ? /* @__PURE__ */ a(
|
|
6355
|
+
/* @__PURE__ */ a("div", { className: "payment-confirmation__banner-icon", children: String(r).toLowerCase().includes("confirm") ? /* @__PURE__ */ a(gs, {}) : /* @__PURE__ */ a(_s, {}) }),
|
|
6355
6356
|
/* @__PURE__ */ d("div", { className: "payment-confirmation__banner-content", children: [
|
|
6356
6357
|
/* @__PURE__ */ a("div", { className: "payment-confirmation__banner-title", children: S.title }),
|
|
6357
6358
|
/* @__PURE__ */ a("div", { className: "payment-confirmation__banner-text", children: S.text })
|
|
@@ -6384,7 +6385,7 @@ function ka({ confirmation: t }) {
|
|
|
6384
6385
|
fn,
|
|
6385
6386
|
{
|
|
6386
6387
|
label: "Total",
|
|
6387
|
-
value: o !== "" ? `${c} ${
|
|
6388
|
+
value: o !== "" ? `${c} ${Pa(o).toFixed(2)}` : "-"
|
|
6388
6389
|
}
|
|
6389
6390
|
)
|
|
6390
6391
|
] }),
|
|
@@ -6533,7 +6534,7 @@ function ka({ confirmation: t }) {
|
|
|
6533
6534
|
Ee,
|
|
6534
6535
|
{
|
|
6535
6536
|
label: "Gender",
|
|
6536
|
-
value:
|
|
6537
|
+
value: za(_ == null ? void 0 : _.tl)
|
|
6537
6538
|
}
|
|
6538
6539
|
),
|
|
6539
6540
|
/* @__PURE__ */ a(
|
|
@@ -6580,10 +6581,10 @@ function ka({ confirmation: t }) {
|
|
|
6580
6581
|
] })
|
|
6581
6582
|
] });
|
|
6582
6583
|
}
|
|
6583
|
-
function
|
|
6584
|
+
function Da(t) {
|
|
6584
6585
|
return t != null && t.payload && typeof t.payload == "object" ? t.payload : t;
|
|
6585
6586
|
}
|
|
6586
|
-
function
|
|
6587
|
+
function La(t) {
|
|
6587
6588
|
const e = String(t).trim();
|
|
6588
6589
|
return e ? e === "Partially Confirmed" ? {
|
|
6589
6590
|
bannerClass: "payment-confirmation__banner--warning",
|
|
@@ -6607,7 +6608,7 @@ function He(t, e = []) {
|
|
|
6607
6608
|
if (!t || typeof t != "object" || !Array.isArray(e)) return "";
|
|
6608
6609
|
for (const n of e) {
|
|
6609
6610
|
if (n.includes(".")) {
|
|
6610
|
-
const i =
|
|
6611
|
+
const i = Fa(t, n);
|
|
6611
6612
|
if (pn(i)) return i;
|
|
6612
6613
|
continue;
|
|
6613
6614
|
}
|
|
@@ -6620,7 +6621,7 @@ function He(t, e = []) {
|
|
|
6620
6621
|
}
|
|
6621
6622
|
return "";
|
|
6622
6623
|
}
|
|
6623
|
-
function
|
|
6624
|
+
function Fa(t, e) {
|
|
6624
6625
|
return String(e || "").split(".").reduce((n, r) => {
|
|
6625
6626
|
if (!(!n || typeof n != "object"))
|
|
6626
6627
|
return n == null ? void 0 : n[r];
|
|
@@ -6640,7 +6641,7 @@ function ji(t, e) {
|
|
|
6640
6641
|
function pn(t) {
|
|
6641
6642
|
return t == null ? !1 : typeof t == "string" ? !!t.trim() : !0;
|
|
6642
6643
|
}
|
|
6643
|
-
function
|
|
6644
|
+
function Ea(t) {
|
|
6644
6645
|
var n, r;
|
|
6645
6646
|
const e = [
|
|
6646
6647
|
t == null ? void 0 : t.trvlrs,
|
|
@@ -6655,7 +6656,7 @@ function La(t) {
|
|
|
6655
6656
|
if (Array.isArray(i) && i.length) return i;
|
|
6656
6657
|
return [];
|
|
6657
6658
|
}
|
|
6658
|
-
function
|
|
6659
|
+
function $a(t) {
|
|
6659
6660
|
var r, i;
|
|
6660
6661
|
const e = Array.isArray((r = t == null ? void 0 : t.trps) == null ? void 0 : r.deps) ? t.trps.deps[0] : (i = t == null ? void 0 : t.trps) == null ? void 0 : i.deps, n = e == null ? void 0 : e.seg;
|
|
6661
6662
|
return Array.isArray(n) && n.length ? n.map((o) => ({
|
|
@@ -6672,7 +6673,7 @@ function Fa(t) {
|
|
|
6672
6673
|
stopLabel: Hi(o == null ? void 0 : o.st)
|
|
6673
6674
|
})) : [];
|
|
6674
6675
|
}
|
|
6675
|
-
function
|
|
6676
|
+
function Ia(t) {
|
|
6676
6677
|
var i, o, c, u;
|
|
6677
6678
|
const e = Array.isArray((i = t == null ? void 0 : t.rttrps) == null ? void 0 : i.deps) ? t.rttrps.deps[0] : (o = t == null ? void 0 : t.rttrps) == null ? void 0 : o.deps, n = Array.isArray((c = t == null ? void 0 : t.trps) == null ? void 0 : c.arrs) ? t.trps.arrs[0] : (u = t == null ? void 0 : t.trps) == null ? void 0 : u.arrs, r = (e == null ? void 0 : e.seg) || (n == null ? void 0 : n.seg);
|
|
6678
6679
|
return Array.isArray(r) && r.length ? r.map((s) => ({
|
|
@@ -6689,22 +6690,22 @@ function Ea(t) {
|
|
|
6689
6690
|
stopLabel: Hi(s == null ? void 0 : s.st)
|
|
6690
6691
|
})) : [];
|
|
6691
6692
|
}
|
|
6692
|
-
function
|
|
6693
|
+
function Ra(t, e = []) {
|
|
6693
6694
|
return Oi(t) === 2 ? !0 : Array.isArray(e) && e.length > 0;
|
|
6694
6695
|
}
|
|
6695
6696
|
function Oi(t) {
|
|
6696
6697
|
return Number((t == null ? void 0 : t.tt) || 0);
|
|
6697
6698
|
}
|
|
6698
|
-
function
|
|
6699
|
+
function Ba(t) {
|
|
6699
6700
|
return String((t == null ? void 0 : t.styp) || "").trim().toLowerCase();
|
|
6700
6701
|
}
|
|
6701
|
-
function
|
|
6702
|
+
function Ma(t) {
|
|
6702
6703
|
return {
|
|
6703
6704
|
email: He(t, ["em", "email"]),
|
|
6704
6705
|
phone: He(t, ["ph", "phone", "mobile"])
|
|
6705
6706
|
};
|
|
6706
6707
|
}
|
|
6707
|
-
function
|
|
6708
|
+
function Pa(t) {
|
|
6708
6709
|
const e = Number(t);
|
|
6709
6710
|
return Number.isFinite(e) ? e : 0;
|
|
6710
6711
|
}
|
|
@@ -6738,7 +6739,7 @@ function Rn(t) {
|
|
|
6738
6739
|
const r = String(n.getDate()).padStart(2, "0"), i = String(n.getMonth() + 1).padStart(2, "0"), o = n.getFullYear();
|
|
6739
6740
|
return `${r}/${i}/${o}`;
|
|
6740
6741
|
}
|
|
6741
|
-
function
|
|
6742
|
+
function za(t) {
|
|
6742
6743
|
const e = String(t || "").toUpperCase();
|
|
6743
6744
|
return e === "M" ? "M" : e === "F" ? "F" : "-";
|
|
6744
6745
|
}
|
|
@@ -6746,7 +6747,7 @@ function Qr(t, e) {
|
|
|
6746
6747
|
const n = String(e || "").trim().toUpperCase();
|
|
6747
6748
|
return !t || !n ? "" : `${t.endsWith("/") ? t : `${t}/`}${n}.png`;
|
|
6748
6749
|
}
|
|
6749
|
-
function
|
|
6750
|
+
function Ua(t) {
|
|
6750
6751
|
const e = String(t).trim().toLowerCase();
|
|
6751
6752
|
return e ? e.includes("confirm") ? "payment-confirmation__meta-value--success" : e.includes("request") || e.includes("partial") ? "payment-confirmation__meta-value--warning" : e.includes("cancel") || e.includes("fail") || e.includes("reject") || e.includes("void") ? "payment-confirmation__meta-value--danger" : "payment-confirmation__meta-value--info" : "";
|
|
6752
6753
|
}
|
|
@@ -6769,7 +6770,7 @@ function Ee({ label: t, value: e }) {
|
|
|
6769
6770
|
/* @__PURE__ */ a("div", { className: "payment-confirmation__detail-value", children: e || "-" })
|
|
6770
6771
|
] });
|
|
6771
6772
|
}
|
|
6772
|
-
function
|
|
6773
|
+
function ja({
|
|
6773
6774
|
payload: t,
|
|
6774
6775
|
prebookResponse: e,
|
|
6775
6776
|
convenienceFee: n = 0,
|
|
@@ -6778,12 +6779,12 @@ function za({
|
|
|
6778
6779
|
}) {
|
|
6779
6780
|
var x, A, j, w;
|
|
6780
6781
|
if (!t) return null;
|
|
6781
|
-
const o =
|
|
6782
|
+
const o = Oa(e, t), c = Ha(
|
|
6782
6783
|
e,
|
|
6783
6784
|
t,
|
|
6784
6785
|
n,
|
|
6785
6786
|
i
|
|
6786
|
-
), u =
|
|
6787
|
+
), u = Ka(t), s = Ki(t), m = Va(t, e), N = Yi(t, e), f = Ya(t, e), y = ((x = t == null ? void 0 : t.selectedFlight) == null ? void 0 : x.airlineName) || "Selected Airline", C = ((A = t == null ? void 0 : t.selectedFlight) == null ? void 0 : A.airlineCode) || "", v = ((j = t == null ? void 0 : t.selectedReturnFlight) == null ? void 0 : j.airlineName) || y, S = ((w = t == null ? void 0 : t.selectedReturnFlight) == null ? void 0 : w.airlineCode) || C, p = process.env.REACT_APP_FLIGHT_IMAGES || process.env.FLIGHT_IMAGES || "", _ = ni(p, C), h = ni(
|
|
6787
6788
|
p,
|
|
6788
6789
|
S
|
|
6789
6790
|
);
|
|
@@ -6972,7 +6973,7 @@ function za({
|
|
|
6972
6973
|
$e,
|
|
6973
6974
|
{
|
|
6974
6975
|
label: "Gender",
|
|
6975
|
-
value:
|
|
6976
|
+
value: Ga(l == null ? void 0 : l.tl)
|
|
6976
6977
|
}
|
|
6977
6978
|
),
|
|
6978
6979
|
/* @__PURE__ */ a(
|
|
@@ -7031,7 +7032,7 @@ function $e({ label: t, value: e }) {
|
|
|
7031
7032
|
/* @__PURE__ */ a("div", { className: "flight-summary__detail-value", children: e || "-" })
|
|
7032
7033
|
] });
|
|
7033
7034
|
}
|
|
7034
|
-
function
|
|
7035
|
+
function Oa(t, e) {
|
|
7035
7036
|
var n, r, i, o;
|
|
7036
7037
|
return ((r = (n = e == null ? void 0 : e.selectedFlight) == null ? void 0 : n.fare) == null ? void 0 : r.currency) || ((i = t == null ? void 0 : t.payload) == null ? void 0 : i.cur) || ((o = t == null ? void 0 : t.payload) == null ? void 0 : o.currency) || (e == null ? void 0 : e.cur) || "INR";
|
|
7037
7038
|
}
|
|
@@ -7039,7 +7040,7 @@ function Bt(t) {
|
|
|
7039
7040
|
const e = Number(t);
|
|
7040
7041
|
return Number.isFinite(e) ? e : 0;
|
|
7041
7042
|
}
|
|
7042
|
-
function
|
|
7043
|
+
function Ha(t, e, n = 0, r = null) {
|
|
7043
7044
|
var g, $, K, W, nt, lt, P, Z, st, it;
|
|
7044
7045
|
const i = (t == null ? void 0 : t.payload) || t || {}, o = i == null ? void 0 : i.trps, c = Array.isArray(o) ? o[0] || {} : o || {}, u = (i == null ? void 0 : i.rttrps) || null, s = ((g = e == null ? void 0 : e.selectedFlight) == null ? void 0 : g.fare) || {}, m = (($ = e == null ? void 0 : e.selectedReturnFlight) == null ? void 0 : $.fare) || {}, N = Bt(i == null ? void 0 : i.adt), f = Bt(i == null ? void 0 : i.chd), y = Bt(i == null ? void 0 : i.inf), C = ti(c == null ? void 0 : c.paxpr, { adt: N, chd: f, inf: y }), v = ti(u == null ? void 0 : u.paxpr, { adt: N, chd: f, inf: y }), S = C + v, p = Bt((K = c == null ? void 0 : c.pr) == null ? void 0 : K.bf) + Bt((W = u == null ? void 0 : u.pr) == null ? void 0 : W.bf), _ = Bt(s == null ? void 0 : s.baseFare) + Bt(m == null ? void 0 : m.baseFare), h = S || p || _, x = ei((nt = c == null ? void 0 : c.pr) == null ? void 0 : nt.taxs), A = ei((lt = u == null ? void 0 : u.pr) == null ? void 0 : lt.taxs), j = Bt((P = e == null ? void 0 : e.fareBreakup) == null ? void 0 : P.onwardTax) + Bt((Z = e == null ? void 0 : e.fareBreakup) == null ? void 0 : Z.returnTax), w = Math.max(x + A, j), l = Bt((st = c == null ? void 0 : c.pr) == null ? void 0 : st.tf), b = Bt((it = u == null ? void 0 : u.pr) == null ? void 0 : it.tf), D = l + b, H = Bt(s == null ? void 0 : s.totalFare) + Bt(m == null ? void 0 : m.totalFare), z = Bt(n), L = w, I = D || H, O = r ? Bt(r.ondis) + Bt(r.rtdis) : 0, k = I ? I + z - O : h + L + z - O;
|
|
7045
7046
|
return {
|
|
@@ -7064,7 +7065,7 @@ function Mn(t, e) {
|
|
|
7064
7065
|
function ei(t) {
|
|
7065
7066
|
return Array.isArray(t) ? t.reduce((e, n) => e + Bt(n == null ? void 0 : n.pr), 0) : 0;
|
|
7066
7067
|
}
|
|
7067
|
-
function
|
|
7068
|
+
function Ka(t) {
|
|
7068
7069
|
var e;
|
|
7069
7070
|
return Array.isArray((e = t == null ? void 0 : t.selectedFlight) == null ? void 0 : e.sectors) ? t.selectedFlight.sectors : [];
|
|
7070
7071
|
}
|
|
@@ -7072,14 +7073,14 @@ function Ki(t) {
|
|
|
7072
7073
|
var e;
|
|
7073
7074
|
return Array.isArray((e = t == null ? void 0 : t.selectedReturnFlight) == null ? void 0 : e.sectors) ? t.selectedReturnFlight.sectors : [];
|
|
7074
7075
|
}
|
|
7075
|
-
function
|
|
7076
|
+
function Ya(t, e) {
|
|
7076
7077
|
return Yi(t, e) === 2 ? !0 : Ki(t).length > 0;
|
|
7077
7078
|
}
|
|
7078
7079
|
function Yi(t, e) {
|
|
7079
7080
|
var n;
|
|
7080
7081
|
return Number((t == null ? void 0 : t.tt) || ((n = e == null ? void 0 : e.payload) == null ? void 0 : n.tt) || 0);
|
|
7081
7082
|
}
|
|
7082
|
-
function
|
|
7083
|
+
function Va(t, e) {
|
|
7083
7084
|
var n;
|
|
7084
7085
|
return String((t == null ? void 0 : t.styp) || ((n = e == null ? void 0 : e.payload) == null ? void 0 : n.styp) || "").trim().toLowerCase();
|
|
7085
7086
|
}
|
|
@@ -7110,7 +7111,7 @@ function Pn(t) {
|
|
|
7110
7111
|
const r = String(n.getDate()).padStart(2, "0"), i = String(n.getMonth() + 1).padStart(2, "0"), o = n.getFullYear();
|
|
7111
7112
|
return `${r}-${i}-${o}`;
|
|
7112
7113
|
}
|
|
7113
|
-
function
|
|
7114
|
+
function Ga(t) {
|
|
7114
7115
|
const e = String(t || "").toUpperCase();
|
|
7115
7116
|
return e === "M" ? "M" : e === "F" ? "F" : "-";
|
|
7116
7117
|
}
|
|
@@ -7118,17 +7119,17 @@ function ni(t, e) {
|
|
|
7118
7119
|
const n = String(e || "").trim().toUpperCase();
|
|
7119
7120
|
return !t || !n ? "" : `${t.endsWith("/") ? t : `${t}/`}${n}.png`;
|
|
7120
7121
|
}
|
|
7121
|
-
const
|
|
7122
|
+
const Wa = [
|
|
7122
7123
|
{ pm: "UP", label: "UPI", gatetyp: "Default", _kind: "online" },
|
|
7123
7124
|
{ pm: "NB", label: "Net Banking", gatetyp: "Default", _kind: "online" },
|
|
7124
7125
|
{ pm: "DC", label: "Debit Card", gatetyp: "Default", _kind: "online" },
|
|
7125
7126
|
{ pm: "CC", label: "Credit Card", gatetyp: "Default", _kind: "online" }
|
|
7126
|
-
],
|
|
7127
|
+
], qa = {
|
|
7127
7128
|
pm: "CA",
|
|
7128
7129
|
label: "Card/Net Banking/UPI",
|
|
7129
7130
|
gatetyp: "Default",
|
|
7130
7131
|
_kind: "online"
|
|
7131
|
-
},
|
|
7132
|
+
}, Za = [
|
|
7132
7133
|
{ pm: "BL", label: "Balance", gatetyp: "Balance", _kind: "balance" },
|
|
7133
7134
|
{ pm: "RP", label: "Pay with Razor Pay", gatetyp: "Razorpay", _kind: "online" },
|
|
7134
7135
|
{ pm: "CR", label: "Pay with Crypto", gatetyp: "Crypto", _kind: "online" }
|
|
@@ -7136,11 +7137,11 @@ const Va = [
|
|
|
7136
7137
|
function zn(t) {
|
|
7137
7138
|
return Array.isArray(t) ? t.map((e) => String(e || "").trim().toLowerCase()).filter(Boolean) : typeof t == "string" && t.trim() ? [t.trim().toLowerCase()] : [];
|
|
7138
7139
|
}
|
|
7139
|
-
function
|
|
7140
|
+
function Ja(t) {
|
|
7140
7141
|
const e = String(t || "").trim().toUpperCase();
|
|
7141
|
-
return e === "CC" || e === "DC" || e === "CA" ? /* @__PURE__ */ a(Pr, { size: 18 }) : e === "NB" ? /* @__PURE__ */ a(
|
|
7142
|
+
return e === "CC" || e === "DC" || e === "CA" ? /* @__PURE__ */ a(Pr, { size: 18 }) : e === "NB" ? /* @__PURE__ */ a(ds, { size: 18 }) : e === "UP" || e === "UPI" ? /* @__PURE__ */ a(fs, { size: 18 }) : e === "BL" || e === "WL" ? /* @__PURE__ */ a(ki, { size: 18 }) : /* @__PURE__ */ a(Pr, { size: 18 });
|
|
7142
7143
|
}
|
|
7143
|
-
function
|
|
7144
|
+
function Xa({
|
|
7144
7145
|
paymentSummary: t = {},
|
|
7145
7146
|
selectedGateway: e,
|
|
7146
7147
|
selectedPaymentMode: n,
|
|
@@ -7154,8 +7155,8 @@ function Za({
|
|
|
7154
7155
|
const m = String(o || "INR").toUpperCase().trim(), N = Zt(() => {
|
|
7155
7156
|
var w, l, b, D, H, z, L;
|
|
7156
7157
|
const C = [
|
|
7157
|
-
...u ? [
|
|
7158
|
-
...
|
|
7158
|
+
...u ? [qa] : Wa,
|
|
7159
|
+
...Za.filter((I) => I.pm !== "BL" || c)
|
|
7159
7160
|
].filter((I) => !(m !== "INR" && (I.pm === "UP" || I.pm === "NB"))), v = (t == null ? void 0 : t.corporate) || null, S = zn(v == null ? void 0 : v.ptyp), p = zn(
|
|
7160
7161
|
((w = v == null ? void 0 : v.outbound) == null ? void 0 : w.ptyp) || ((l = v == null ? void 0 : v.onward) == null ? void 0 : l.ptyp) || ((b = v == null ? void 0 : v.ob) == null ? void 0 : b.ptyp) || (v == null ? void 0 : v.ptypOutbound) || (v == null ? void 0 : v.outboundPtyp) || (v == null ? void 0 : v.ptyp_outbound)
|
|
7161
7162
|
), _ = zn(
|
|
@@ -7208,7 +7209,7 @@ function Za({
|
|
|
7208
7209
|
),
|
|
7209
7210
|
/* @__PURE__ */ a("span", { style: { fontWeight: "500", color: "#1f2937", fontSize: "0.875rem" }, children: f.label })
|
|
7210
7211
|
] }),
|
|
7211
|
-
/* @__PURE__ */ a("div", { style: { color: "#6b7280", display: "flex", alignItems: "center" }, children:
|
|
7212
|
+
/* @__PURE__ */ a("div", { style: { color: "#6b7280", display: "flex", alignItems: "center" }, children: Ja(f.pm) })
|
|
7212
7213
|
]
|
|
7213
7214
|
},
|
|
7214
7215
|
f.pm
|
|
@@ -7291,7 +7292,7 @@ function ri({
|
|
|
7291
7292
|
L && window.cancelAnimationFrame(L);
|
|
7292
7293
|
};
|
|
7293
7294
|
}, [t, e]);
|
|
7294
|
-
const p = [...t].map((l, b) => ({ type: l == null ? void 0 : l.type, idx: b })).filter((l) => l.type === "flight_results").map((l) => l.idx).pop(), _ = [...t].map((l, b) => ({ type: l == null ? void 0 : l.type, idx: b })).filter((l) => l.type === "traveler_details_form").map((l) => l.idx).pop(), h = (w = [...t].reverse().find((l) => (l == null ? void 0 : l.type) === "user_message")) == null ? void 0 : w.text, x = String(n || "").trim() ||
|
|
7295
|
+
const p = [...t].map((l, b) => ({ type: l == null ? void 0 : l.type, idx: b })).filter((l) => l.type === "flight_results").map((l) => l.idx).pop(), _ = [...t].map((l, b) => ({ type: l == null ? void 0 : l.type, idx: b })).filter((l) => l.type === "traveler_details_form").map((l) => l.idx).pop(), h = (w = [...t].reverse().find((l) => (l == null ? void 0 : l.type) === "user_message")) == null ? void 0 : w.text, x = String(n || "").trim() || Qa(h), A = Number.isInteger(_) && (!Number.isInteger(p) || _ > p), j = (l, b = "") => {
|
|
7295
7296
|
if (typeof l == "string") return l;
|
|
7296
7297
|
if (typeof l == "number" || typeof l == "boolean")
|
|
7297
7298
|
return String(l);
|
|
@@ -7318,7 +7319,7 @@ function ri({
|
|
|
7318
7319
|
const F = ((H = (D = l == null ? void 0 : l.data) == null ? void 0 : D.results) == null ? void 0 : H.payload) || [], qt = F.reduce(
|
|
7319
7320
|
(bt, at) => bt + (Array.isArray(at == null ? void 0 : at.trps) ? at.trps.length : 0) + (Array.isArray(at == null ? void 0 : at.rttrps) ? at.rttrps.length : 0),
|
|
7320
7321
|
0
|
|
7321
|
-
), jt = qt > 0, kt = jt ? `Found ${qt} flight option${qt > 1 ? "s" : ""}.` : j(l == null ? void 0 : l.text, "No flights found."), Ht = jt ?
|
|
7322
|
+
), jt = qt > 0, kt = jt ? `Found ${qt} flight option${qt > 1 ? "s" : ""}.` : j(l == null ? void 0 : l.text, "No flights found."), Ht = jt ? to(F) : null, zt = jt ? j((l == null ? void 0 : l._dynamicRecommendation) || (l == null ? void 0 : l.text), "") : "";
|
|
7322
7323
|
return /* @__PURE__ */ d(
|
|
7323
7324
|
"div",
|
|
7324
7325
|
{
|
|
@@ -7335,13 +7336,13 @@ function ri({
|
|
|
7335
7336
|
kt
|
|
7336
7337
|
] }),
|
|
7337
7338
|
/* @__PURE__ */ a(
|
|
7338
|
-
|
|
7339
|
+
Xs,
|
|
7339
7340
|
{
|
|
7340
7341
|
results: (z = l == null ? void 0 : l.data) == null ? void 0 : z.results,
|
|
7341
7342
|
extractedFilters: (l == null ? void 0 : l.filters) || null,
|
|
7342
7343
|
latestUserText: h,
|
|
7343
7344
|
isLatestResultsMessage: b === p,
|
|
7344
|
-
recommendationCriteria:
|
|
7345
|
+
recommendationCriteria: no(
|
|
7345
7346
|
zt
|
|
7346
7347
|
),
|
|
7347
7348
|
onAvailabilitySuccess: i,
|
|
@@ -7365,23 +7366,23 @@ function ri({
|
|
|
7365
7366
|
);
|
|
7366
7367
|
}
|
|
7367
7368
|
if (l.type === "user_message")
|
|
7368
|
-
return
|
|
7369
|
+
return ao(
|
|
7369
7370
|
t,
|
|
7370
7371
|
b,
|
|
7371
7372
|
_
|
|
7372
|
-
) ? /* @__PURE__ */ a(De.Fragment, {}, b) :
|
|
7373
|
+
) ? /* @__PURE__ */ a(De.Fragment, {}, b) : co(
|
|
7373
7374
|
t,
|
|
7374
7375
|
b,
|
|
7375
7376
|
_
|
|
7376
|
-
) ? /* @__PURE__ */ a(De.Fragment, {}, b) :
|
|
7377
|
+
) ? /* @__PURE__ */ a(De.Fragment, {}, b) : fo(
|
|
7377
7378
|
t,
|
|
7378
7379
|
b,
|
|
7379
7380
|
_
|
|
7380
|
-
) ? /* @__PURE__ */ a(De.Fragment, {}, b) :
|
|
7381
|
+
) ? /* @__PURE__ */ a(De.Fragment, {}, b) : yo(
|
|
7381
7382
|
t,
|
|
7382
7383
|
b,
|
|
7383
7384
|
_
|
|
7384
|
-
) ? /* @__PURE__ */ a(De.Fragment, {}, b) :
|
|
7385
|
+
) ? /* @__PURE__ */ a(De.Fragment, {}, b) : No(
|
|
7385
7386
|
t,
|
|
7386
7387
|
b,
|
|
7387
7388
|
_
|
|
@@ -7397,7 +7398,7 @@ function ri({
|
|
|
7397
7398
|
b
|
|
7398
7399
|
);
|
|
7399
7400
|
if (l.type === "traveler_details_form") {
|
|
7400
|
-
const F = v[b] || {}, qt = b === _, jt = t.slice(b + 1).some((dt) => (dt == null ? void 0 : dt.type) === "flight_results"), kt = b === _ ?
|
|
7401
|
+
const F = v[b] || {}, qt = b === _, jt = t.slice(b + 1).some((dt) => (dt == null ? void 0 : dt.type) === "flight_results"), kt = b === _ ? so(t, b) : "", Ht = b === _ ? Cn(t, b) : null, zt = b === _ && Ht ? qi(t, Ht) : null, bt = b === _ ? kn(t, b) : null, at = Ht ? /* @__PURE__ */ d(
|
|
7401
7402
|
"div",
|
|
7402
7403
|
{
|
|
7403
7404
|
className: "message-list__traveler-inline-proceed-block",
|
|
@@ -7427,7 +7428,7 @@ function ri({
|
|
|
7427
7428
|
className: "message-list__bubble message-list__bubble--assistant message-list__bubble--traveler",
|
|
7428
7429
|
children: [
|
|
7429
7430
|
/* @__PURE__ */ a(
|
|
7430
|
-
|
|
7431
|
+
na,
|
|
7431
7432
|
{
|
|
7432
7433
|
prebookPayload: l == null ? void 0 : l.prebookPayload,
|
|
7433
7434
|
isReadOnly: !!(l != null && l.readOnly) || !qt || jt,
|
|
@@ -7459,7 +7460,7 @@ function ri({
|
|
|
7459
7460
|
}
|
|
7460
7461
|
) : null,
|
|
7461
7462
|
F != null && F.showSummary ? /* @__PURE__ */ a(
|
|
7462
|
-
|
|
7463
|
+
ja,
|
|
7463
7464
|
{
|
|
7464
7465
|
payload: (I = F == null ? void 0 : F.summary) == null ? void 0 : I.payload,
|
|
7465
7466
|
prebookResponse: (O = F == null ? void 0 : F.summary) == null ? void 0 : O.prebookResponse,
|
|
@@ -7622,7 +7623,7 @@ function ri({
|
|
|
7622
7623
|
]
|
|
7623
7624
|
}
|
|
7624
7625
|
) : /* @__PURE__ */ a(
|
|
7625
|
-
|
|
7626
|
+
Xa,
|
|
7626
7627
|
{
|
|
7627
7628
|
paymentSummary: (Et = F == null ? void 0 : F.payment) == null ? void 0 : Et.paymentSummary,
|
|
7628
7629
|
selectedGateway: (Lt = F == null ? void 0 : F.payment) == null ? void 0 : Lt.selectedGateway,
|
|
@@ -7724,19 +7725,19 @@ function ri({
|
|
|
7724
7725
|
/* @__PURE__ */ a("span", { className: "message-list__text-icon", children: /* @__PURE__ */ a(Qe, {}) }),
|
|
7725
7726
|
j(l == null ? void 0 : l.text, "Payment completed successfully.")
|
|
7726
7727
|
] }),
|
|
7727
|
-
/* @__PURE__ */ a(
|
|
7728
|
+
/* @__PURE__ */ a(xa, { confirmation: l == null ? void 0 : l.confirmation })
|
|
7728
7729
|
]
|
|
7729
7730
|
},
|
|
7730
7731
|
b
|
|
7731
7732
|
);
|
|
7732
7733
|
if (l.type === "assistant_message") {
|
|
7733
|
-
if (
|
|
7734
|
+
if (uo(
|
|
7734
7735
|
t,
|
|
7735
7736
|
b,
|
|
7736
7737
|
_
|
|
7737
7738
|
))
|
|
7738
7739
|
return /* @__PURE__ */ a(De.Fragment, {}, b);
|
|
7739
|
-
if (
|
|
7740
|
+
if (_o(
|
|
7740
7741
|
t,
|
|
7741
7742
|
b,
|
|
7742
7743
|
_
|
|
@@ -7761,7 +7762,7 @@ function ri({
|
|
|
7761
7762
|
}
|
|
7762
7763
|
);
|
|
7763
7764
|
}
|
|
7764
|
-
function
|
|
7765
|
+
function Qa(t) {
|
|
7765
7766
|
const e = String(t || "").trim();
|
|
7766
7767
|
if (!e) return "Processing your request...";
|
|
7767
7768
|
const n = e.match(
|
|
@@ -7771,14 +7772,14 @@ function Ja(t) {
|
|
|
7771
7772
|
), c = String((o == null ? void 0 : o[2]) || "").trim().replace(/\s+(and|return|retrun|retun|rtn)\b.*$/i, "");
|
|
7772
7773
|
return r && i && c ? `Processing your request from ${r} to ${i} on ${c}...` : r && i ? `Processing your request from ${r} to ${i}...` : "Processing your request...";
|
|
7773
7774
|
}
|
|
7774
|
-
function
|
|
7775
|
+
function to(t = []) {
|
|
7775
7776
|
var p;
|
|
7776
7777
|
const e = Array.isArray(t) ? t[0] : null, n = Array.isArray(e == null ? void 0 : e.trps) ? e.trps[0] : null, r = (p = n == null ? void 0 : n.deps) == null ? void 0 : p[0], i = Array.isArray(r == null ? void 0 : r.seg) ? r.seg : [], o = i[0] || {}, c = i[i.length - 1] || o, u = String((o == null ? void 0 : o.da) || "").trim().toUpperCase(), s = String((c == null ? void 0 : c.ar) || "").trim().toUpperCase(), m = `${ii(u)} → ${ii(s)}`, N = Number((e == null ? void 0 : e.adt) ?? 1), f = Number((e == null ? void 0 : e.chd) ?? 0), y = Number((e == null ? void 0 : e.inf) ?? 0), C = Math.max(N + f + y, 1), v = String(
|
|
7777
7778
|
(o == null ? void 0 : o.cc) || (o == null ? void 0 : o.cls) || (e == null ? void 0 : e.cls) || "Economy"
|
|
7778
7779
|
).trim(), S = `${C} traveler${C > 1 ? "s" : ""}, ${v}`;
|
|
7779
7780
|
return {
|
|
7780
7781
|
route: m,
|
|
7781
|
-
date:
|
|
7782
|
+
date: eo(o == null ? void 0 : o.dd),
|
|
7782
7783
|
travelerInfo: S
|
|
7783
7784
|
};
|
|
7784
7785
|
}
|
|
@@ -7796,7 +7797,7 @@ function ii(t) {
|
|
|
7796
7797
|
PNQ: "Pune"
|
|
7797
7798
|
}[t] || t || "Route";
|
|
7798
7799
|
}
|
|
7799
|
-
function
|
|
7800
|
+
function eo(t) {
|
|
7800
7801
|
const e = String(t || "").trim();
|
|
7801
7802
|
if (!e) return "--";
|
|
7802
7803
|
const n = /^\d{2}-\d{2}-\d{4}$/.test(e) ? new Date(e.split("-").reverse().join("-")) : new Date(e);
|
|
@@ -7804,7 +7805,7 @@ function Qa(t) {
|
|
|
7804
7805
|
const r = String(n.getDate()).padStart(2, "0"), i = String(n.getMonth() + 1).padStart(2, "0"), o = n.getFullYear();
|
|
7805
7806
|
return `${r}-${i}-${o}`;
|
|
7806
7807
|
}
|
|
7807
|
-
function
|
|
7808
|
+
function no(t) {
|
|
7808
7809
|
var c, u, s;
|
|
7809
7810
|
const e = String(t || "").trim();
|
|
7810
7811
|
if (!e) return null;
|
|
@@ -7820,11 +7821,11 @@ function to(t) {
|
|
|
7820
7821
|
destination: ((u = n == null ? void 0 : n[2]) == null ? void 0 : u.toUpperCase()) || "",
|
|
7821
7822
|
departureDate: (n == null ? void 0 : n[3]) || "",
|
|
7822
7823
|
airlineCode: ((s = r == null ? void 0 : r[1]) == null ? void 0 : s.toUpperCase()) || "",
|
|
7823
|
-
departureTime:
|
|
7824
|
-
price:
|
|
7824
|
+
departureTime: ro((i == null ? void 0 : i[1]) || ""),
|
|
7825
|
+
price: io(o == null ? void 0 : o[1])
|
|
7825
7826
|
};
|
|
7826
7827
|
}
|
|
7827
|
-
function
|
|
7828
|
+
function ro(t) {
|
|
7828
7829
|
const e = String(t || "").trim();
|
|
7829
7830
|
if (!e) return "";
|
|
7830
7831
|
const [n, r] = e.split(":");
|
|
@@ -7832,7 +7833,7 @@ function eo(t) {
|
|
|
7832
7833
|
const i = Number(n), o = Number(r);
|
|
7833
7834
|
return !Number.isFinite(i) || !Number.isFinite(o) || i < 0 || i > 23 || o < 0 || o > 59 ? "" : `${String(i).padStart(2, "0")}:${String(o).padStart(2, "0")}`;
|
|
7834
7835
|
}
|
|
7835
|
-
function
|
|
7836
|
+
function io(t) {
|
|
7836
7837
|
const e = String(t || "").replace(/,/g, "").trim();
|
|
7837
7838
|
if (!e) return null;
|
|
7838
7839
|
const n = Number(e);
|
|
@@ -7844,11 +7845,11 @@ function An(t) {
|
|
|
7844
7845
|
e
|
|
7845
7846
|
) : !1;
|
|
7846
7847
|
}
|
|
7847
|
-
function
|
|
7848
|
+
function so(t, e) {
|
|
7848
7849
|
const n = t[Number(e) + 1];
|
|
7849
7850
|
return !n || n.type !== "user_message" || n.hiddenFromChat || !An(n.text) ? "" : String(n.text || "").trim();
|
|
7850
7851
|
}
|
|
7851
|
-
function
|
|
7852
|
+
function ao(t, e, n) {
|
|
7852
7853
|
if (!Number.isInteger(n) || e < 1 || e - 1 !== n) return !1;
|
|
7853
7854
|
const r = t[e - 1];
|
|
7854
7855
|
if (!r || r.type !== "traveler_details_form") return !1;
|
|
@@ -7877,7 +7878,7 @@ function Gi(t, e) {
|
|
|
7877
7878
|
userText: i ? String(r.text || "").trim() : ""
|
|
7878
7879
|
};
|
|
7879
7880
|
}
|
|
7880
|
-
function
|
|
7881
|
+
function oo(t, e) {
|
|
7881
7882
|
for (let n = e + 1; n < t.length; n++) {
|
|
7882
7883
|
const r = t[n];
|
|
7883
7884
|
if (r.type === "flight_results" || r.type === "payment_confirmation")
|
|
@@ -7887,7 +7888,7 @@ function so(t, e) {
|
|
|
7887
7888
|
}
|
|
7888
7889
|
return null;
|
|
7889
7890
|
}
|
|
7890
|
-
function
|
|
7891
|
+
function lo(t, e) {
|
|
7891
7892
|
for (let n = e - 1; n >= 0; n--) {
|
|
7892
7893
|
const r = t[n];
|
|
7893
7894
|
if (r.type === "flight_results")
|
|
@@ -7898,14 +7899,14 @@ function ao(t, e) {
|
|
|
7898
7899
|
return null;
|
|
7899
7900
|
}
|
|
7900
7901
|
function Cn(t, e) {
|
|
7901
|
-
return
|
|
7902
|
+
return oo(t, e) || lo(t, e);
|
|
7902
7903
|
}
|
|
7903
|
-
function
|
|
7904
|
+
function co(t, e, n) {
|
|
7904
7905
|
if (!Number.isInteger(n)) return !1;
|
|
7905
7906
|
const r = Cn(t, n);
|
|
7906
7907
|
return !r || r.userIndex < 0 ? !1 : e === r.userIndex;
|
|
7907
7908
|
}
|
|
7908
|
-
function
|
|
7909
|
+
function uo(t, e, n) {
|
|
7909
7910
|
if (!Number.isInteger(n)) return !1;
|
|
7910
7911
|
const r = Cn(t, n);
|
|
7911
7912
|
return r ? e === r.assistantIndex : !1;
|
|
@@ -7927,7 +7928,7 @@ function qi(t, e) {
|
|
|
7927
7928
|
}
|
|
7928
7929
|
return null;
|
|
7929
7930
|
}
|
|
7930
|
-
function
|
|
7931
|
+
function fo(t, e, n) {
|
|
7931
7932
|
if (!Number.isInteger(n)) return !1;
|
|
7932
7933
|
const r = Cn(t, n);
|
|
7933
7934
|
if (!r) return !1;
|
|
@@ -7943,31 +7944,31 @@ function nr(t) {
|
|
|
7943
7944
|
function rr(t) {
|
|
7944
7945
|
return (t == null ? void 0 : t.type) !== "assistant_message" ? !1 : (Array.isArray(t.options) ? t.options : []).some((n) => String((n == null ? void 0 : n.value) || "").startsWith("CONFIRM_PAYMENT:")) ? !0 : String((t == null ? void 0 : t.text) || "").includes("Do you want to proceed with payment");
|
|
7945
7946
|
}
|
|
7946
|
-
function
|
|
7947
|
+
function mo(t, e) {
|
|
7947
7948
|
var n;
|
|
7948
7949
|
for (let r = e - 1; r >= 0; r--)
|
|
7949
7950
|
if (((n = t[r]) == null ? void 0 : n.type) === "traveler_details_form") return r;
|
|
7950
7951
|
return -1;
|
|
7951
7952
|
}
|
|
7952
|
-
function
|
|
7953
|
+
function ho(t, e) {
|
|
7953
7954
|
var r;
|
|
7954
7955
|
let n = -1;
|
|
7955
7956
|
for (let i = 0; i < e; i++)
|
|
7956
7957
|
((r = t[i]) == null ? void 0 : r.type) === "flight_results" && (n = i);
|
|
7957
7958
|
return n;
|
|
7958
7959
|
}
|
|
7959
|
-
function
|
|
7960
|
+
function po(t, e, n) {
|
|
7960
7961
|
var r;
|
|
7961
7962
|
for (let i = e + 1; i < n; i++)
|
|
7962
7963
|
if (((r = t[i]) == null ? void 0 : r.type) === "payment_confirmation")
|
|
7963
7964
|
return !1;
|
|
7964
7965
|
return !0;
|
|
7965
7966
|
}
|
|
7966
|
-
function
|
|
7967
|
+
function bo(t, e) {
|
|
7967
7968
|
let n = -1;
|
|
7968
7969
|
for (let r = 0; r < e; r++) {
|
|
7969
7970
|
const i = t[r];
|
|
7970
|
-
(i == null ? void 0 : i.type) === "assistant_message" && rr(i) &&
|
|
7971
|
+
(i == null ? void 0 : i.type) === "assistant_message" && rr(i) && po(t, r, e) && (n = Math.max(n, r));
|
|
7971
7972
|
}
|
|
7972
7973
|
if (n >= 0)
|
|
7973
7974
|
return n;
|
|
@@ -7982,7 +7983,7 @@ function ho(t, e) {
|
|
|
7982
7983
|
}
|
|
7983
7984
|
return -1;
|
|
7984
7985
|
}
|
|
7985
|
-
function
|
|
7986
|
+
function go(t, e, n) {
|
|
7986
7987
|
const r = [];
|
|
7987
7988
|
let i = "";
|
|
7988
7989
|
const o = (c) => {
|
|
@@ -7990,7 +7991,7 @@ function po(t, e, n) {
|
|
|
7990
7991
|
(u == null ? void 0 : u.type) !== "user_message" || u.hiddenFromChat || nr(u.text) && (r.push(c), i = String(u.text || "").trim());
|
|
7991
7992
|
};
|
|
7992
7993
|
if (n < e) {
|
|
7993
|
-
const c =
|
|
7994
|
+
const c = ho(t, n) + 1, u = Math.max(0, c);
|
|
7994
7995
|
for (let s = u; s < n; s++)
|
|
7995
7996
|
o(s);
|
|
7996
7997
|
} else
|
|
@@ -8000,17 +8001,17 @@ function po(t, e, n) {
|
|
|
8000
8001
|
}
|
|
8001
8002
|
function kn(t, e) {
|
|
8002
8003
|
var m;
|
|
8003
|
-
const n =
|
|
8004
|
+
const n = mo(
|
|
8004
8005
|
t,
|
|
8005
8006
|
e
|
|
8006
8007
|
);
|
|
8007
|
-
let r =
|
|
8008
|
+
let r = bo(
|
|
8008
8009
|
t,
|
|
8009
8010
|
e
|
|
8010
8011
|
), i = [], o = "", c = "";
|
|
8011
8012
|
if (r >= 0) {
|
|
8012
8013
|
c = String(((m = t[r]) == null ? void 0 : m.text) || "").trim();
|
|
8013
|
-
const N =
|
|
8014
|
+
const N = go(
|
|
8014
8015
|
t,
|
|
8015
8016
|
e,
|
|
8016
8017
|
r
|
|
@@ -8081,17 +8082,17 @@ function kn(t, e) {
|
|
|
8081
8082
|
confirmReplyText: s
|
|
8082
8083
|
};
|
|
8083
8084
|
}
|
|
8084
|
-
function
|
|
8085
|
+
function yo(t, e, n) {
|
|
8085
8086
|
if (!Number.isInteger(n)) return !1;
|
|
8086
8087
|
const r = kn(t, n);
|
|
8087
8088
|
return r ? r.payUserIndices.includes(e) : !1;
|
|
8088
8089
|
}
|
|
8089
|
-
function
|
|
8090
|
+
function No(t, e, n) {
|
|
8090
8091
|
if (!Number.isInteger(n)) return !1;
|
|
8091
8092
|
const r = kn(t, n);
|
|
8092
8093
|
return !r || r.confirmReplyIndex < 0 ? !1 : e === r.confirmReplyIndex;
|
|
8093
8094
|
}
|
|
8094
|
-
function
|
|
8095
|
+
function _o(t, e, n) {
|
|
8095
8096
|
if (!Number.isInteger(n)) return !1;
|
|
8096
8097
|
const r = kn(t, n);
|
|
8097
8098
|
return !r || r.assistantIndex < 0 ? !1 : e === r.assistantIndex;
|
|
@@ -8103,7 +8104,7 @@ function bn(t) {
|
|
|
8103
8104
|
const n = String(e.getDate()).padStart(2, "0"), r = String(e.getMonth() + 1).padStart(2, "0"), i = e.getFullYear();
|
|
8104
8105
|
return `${n}/${r}/${i}`;
|
|
8105
8106
|
}
|
|
8106
|
-
function
|
|
8107
|
+
function wo() {
|
|
8107
8108
|
return /* @__PURE__ */ d(
|
|
8108
8109
|
"svg",
|
|
8109
8110
|
{
|
|
@@ -8143,7 +8144,7 @@ function No() {
|
|
|
8143
8144
|
}
|
|
8144
8145
|
);
|
|
8145
8146
|
}
|
|
8146
|
-
function
|
|
8147
|
+
function vo({
|
|
8147
8148
|
onSend: t,
|
|
8148
8149
|
disabled: e = !1,
|
|
8149
8150
|
onOpenVoiceAssistant: n = () => {
|
|
@@ -8182,7 +8183,7 @@ function _o({
|
|
|
8182
8183
|
document.body.style.overflow = k;
|
|
8183
8184
|
};
|
|
8184
8185
|
}, [y]);
|
|
8185
|
-
const H = Array.isArray(o) && o.some((k) =>
|
|
8186
|
+
const H = Array.isArray(o) && o.some((k) => So((k == null ? void 0 : k.label) || (k == null ? void 0 : k.value))), z = Array.isArray(o) ? o.map((k) => String((k == null ? void 0 : k.label) || (k == null ? void 0 : k.value) || "")).join("|") : "";
|
|
8186
8187
|
ut(() => {
|
|
8187
8188
|
if (H) {
|
|
8188
8189
|
if (we(u), we(s), !c) {
|
|
@@ -8214,7 +8215,7 @@ function _o({
|
|
|
8214
8215
|
S(g), _(null);
|
|
8215
8216
|
return;
|
|
8216
8217
|
}
|
|
8217
|
-
if (!
|
|
8218
|
+
if (!Ao(g, $)) {
|
|
8218
8219
|
_(null);
|
|
8219
8220
|
return;
|
|
8220
8221
|
}
|
|
@@ -8249,7 +8250,7 @@ function _o({
|
|
|
8249
8250
|
}
|
|
8250
8251
|
) : null
|
|
8251
8252
|
] }) : null,
|
|
8252
|
-
y && typeof document < "u" ?
|
|
8253
|
+
y && typeof document < "u" ? ws(
|
|
8253
8254
|
/* @__PURE__ */ a(
|
|
8254
8255
|
"div",
|
|
8255
8256
|
{
|
|
@@ -8278,7 +8279,7 @@ function _o({
|
|
|
8278
8279
|
selectsRange: !0,
|
|
8279
8280
|
startDate: v,
|
|
8280
8281
|
endDate: p,
|
|
8281
|
-
minDate: v ?
|
|
8282
|
+
minDate: v ? Co(v, 1) : /* @__PURE__ */ new Date(),
|
|
8282
8283
|
monthsShown: A,
|
|
8283
8284
|
onSelect: I,
|
|
8284
8285
|
calendarClassName: "message-input__calendar"
|
|
@@ -8322,7 +8323,7 @@ function _o({
|
|
|
8322
8323
|
disabled: e,
|
|
8323
8324
|
"aria-label": "Open voice assistant",
|
|
8324
8325
|
title: "Open voice assistant",
|
|
8325
|
-
children: /* @__PURE__ */ a(
|
|
8326
|
+
children: /* @__PURE__ */ a(wo, {})
|
|
8326
8327
|
}
|
|
8327
8328
|
),
|
|
8328
8329
|
/* @__PURE__ */ a(
|
|
@@ -8334,12 +8335,12 @@ function _o({
|
|
|
8334
8335
|
disabled: e,
|
|
8335
8336
|
"aria-label": "Send message",
|
|
8336
8337
|
title: "Send message",
|
|
8337
|
-
children: /* @__PURE__ */ a(
|
|
8338
|
+
children: /* @__PURE__ */ a(vs, { className: "message-input__send-icon", "aria-hidden": "true" })
|
|
8338
8339
|
}
|
|
8339
8340
|
)
|
|
8340
8341
|
] });
|
|
8341
8342
|
}
|
|
8342
|
-
function
|
|
8343
|
+
function So(t) {
|
|
8343
8344
|
const e = String(t || "").trim().toLowerCase();
|
|
8344
8345
|
return ["today", "tomorrow", "next weekend", "next week"].includes(
|
|
8345
8346
|
e
|
|
@@ -8369,7 +8370,7 @@ function we(t) {
|
|
|
8369
8370
|
const i = new Date(e);
|
|
8370
8371
|
return Number.isNaN(i.getTime()) ? null : i;
|
|
8371
8372
|
}
|
|
8372
|
-
function
|
|
8373
|
+
function Ao(t, e) {
|
|
8373
8374
|
const n = we(t), r = we(e);
|
|
8374
8375
|
return !n || !r ? !1 : ir(n).getTime() > ir(r).getTime();
|
|
8375
8376
|
}
|
|
@@ -8377,7 +8378,7 @@ function ir(t) {
|
|
|
8377
8378
|
const e = new Date(t);
|
|
8378
8379
|
return e.setHours(0, 0, 0, 0), e;
|
|
8379
8380
|
}
|
|
8380
|
-
function
|
|
8381
|
+
function Co(t, e) {
|
|
8381
8382
|
const n = ir(t), r = new Date(n);
|
|
8382
8383
|
return r.setDate(n.getDate() + Number(e)), r;
|
|
8383
8384
|
}
|
|
@@ -8387,7 +8388,7 @@ function sr() {
|
|
|
8387
8388
|
function Tn() {
|
|
8388
8389
|
return typeof window > "u" ? !1 : !!(window.speechSynthesis && window.SpeechSynthesisUtterance);
|
|
8389
8390
|
}
|
|
8390
|
-
function
|
|
8391
|
+
function ko(t = {}) {
|
|
8391
8392
|
if (!sr()) return null;
|
|
8392
8393
|
const e = window.SpeechRecognition || window.webkitSpeechRecognition, n = new e();
|
|
8393
8394
|
return n.lang = t.lang || "en-US", n.continuous = t.continuous ?? !0, n.interimResults = t.interimResults ?? !0, n.maxAlternatives = t.maxAlternatives ?? 1, n;
|
|
@@ -8395,17 +8396,17 @@ function Ao(t = {}) {
|
|
|
8395
8396
|
function gn() {
|
|
8396
8397
|
Tn() && (window.speechSynthesis.speaking || window.speechSynthesis.pending) && window.speechSynthesis.cancel();
|
|
8397
8398
|
}
|
|
8398
|
-
function
|
|
8399
|
+
function To(t, e = {}) {
|
|
8399
8400
|
if (!Tn()) return null;
|
|
8400
8401
|
const n = String(t || "").trim();
|
|
8401
8402
|
if (!n) return null;
|
|
8402
8403
|
gn();
|
|
8403
8404
|
const r = new window.SpeechSynthesisUtterance(n);
|
|
8404
8405
|
r.lang = e.lang || "en-US", r.rate = e.rate ?? 1, r.pitch = e.pitch ?? 1.08;
|
|
8405
|
-
const i =
|
|
8406
|
+
const i = xo(r.lang, e.voiceName);
|
|
8406
8407
|
return i && (r.voice = i, r.lang = i.lang || r.lang), typeof e.onstart == "function" && (r.onstart = e.onstart), typeof e.onend == "function" && (r.onend = e.onend), typeof e.onerror == "function" && (r.onerror = e.onerror), window.speechSynthesis.speak(r), r;
|
|
8407
8408
|
}
|
|
8408
|
-
function
|
|
8409
|
+
function xo(t = "en-US", e = "") {
|
|
8409
8410
|
if (!Tn()) return null;
|
|
8410
8411
|
const n = window.speechSynthesis.getVoices();
|
|
8411
8412
|
if (!Array.isArray(n) || n.length === 0) return null;
|
|
@@ -8420,11 +8421,11 @@ function ko(t = "en-US", e = "") {
|
|
|
8420
8421
|
(m) => String((m == null ? void 0 : m.lang) || "").toLowerCase().startsWith(r.split("-")[0])
|
|
8421
8422
|
), c = o.length ? o : n, u = c.find((m) => {
|
|
8422
8423
|
const N = String((m == null ? void 0 : m.name) || "").toLowerCase();
|
|
8423
|
-
return
|
|
8424
|
+
return Do.some((f) => N.includes(f));
|
|
8424
8425
|
});
|
|
8425
8426
|
return u || c.find((m) => m == null ? void 0 : m.default) || c[0] || null;
|
|
8426
8427
|
}
|
|
8427
|
-
const
|
|
8428
|
+
const Do = [
|
|
8428
8429
|
"female",
|
|
8429
8430
|
"woman",
|
|
8430
8431
|
"zira",
|
|
@@ -8441,7 +8442,7 @@ const To = [
|
|
|
8441
8442
|
"neural female",
|
|
8442
8443
|
"google us english"
|
|
8443
8444
|
];
|
|
8444
|
-
function
|
|
8445
|
+
function Lo({
|
|
8445
8446
|
assistantText: t = "",
|
|
8446
8447
|
disabled: e = !1,
|
|
8447
8448
|
isBackendTyping: n = !1,
|
|
@@ -8473,7 +8474,7 @@ function xo({
|
|
|
8473
8474
|
}, 300);
|
|
8474
8475
|
return;
|
|
8475
8476
|
}
|
|
8476
|
-
j.current = g,
|
|
8477
|
+
j.current = g, To(k, {
|
|
8477
8478
|
onstart: () => {
|
|
8478
8479
|
A.current && u(!0);
|
|
8479
8480
|
},
|
|
@@ -8491,7 +8492,7 @@ function xo({
|
|
|
8491
8492
|
}, z = () => {
|
|
8492
8493
|
if (p.current || !sr())
|
|
8493
8494
|
return p.current;
|
|
8494
|
-
const k =
|
|
8495
|
+
const k = ko({
|
|
8495
8496
|
continuous: !0,
|
|
8496
8497
|
interimResults: !0,
|
|
8497
8498
|
lang: "en-US"
|
|
@@ -8511,7 +8512,7 @@ function xo({
|
|
|
8511
8512
|
I();
|
|
8512
8513
|
}, 2400);
|
|
8513
8514
|
}, k.onerror = (g) => {
|
|
8514
|
-
A.current && (b.current = !1, D.current = !1, S(
|
|
8515
|
+
A.current && (b.current = !1, D.current = !1, S(Fo(g == null ? void 0 : g.error)), C("Voice input unavailable right now."), o(!1));
|
|
8515
8516
|
}, k.onend = () => {
|
|
8516
8517
|
if (!A.current) return;
|
|
8517
8518
|
b.current = !1, D.current = !1, o(!1), window.clearTimeout(x.current);
|
|
@@ -8561,7 +8562,7 @@ function xo({
|
|
|
8561
8562
|
stopListening: I
|
|
8562
8563
|
};
|
|
8563
8564
|
}
|
|
8564
|
-
function
|
|
8565
|
+
function Fo(t) {
|
|
8565
8566
|
switch (t) {
|
|
8566
8567
|
case "audio-capture":
|
|
8567
8568
|
return "No microphone was found for voice input.";
|
|
@@ -8574,7 +8575,7 @@ function Do(t) {
|
|
|
8574
8575
|
return "Voice input could not be completed.";
|
|
8575
8576
|
}
|
|
8576
8577
|
}
|
|
8577
|
-
function
|
|
8578
|
+
function Eo({
|
|
8578
8579
|
assistantText: t = "",
|
|
8579
8580
|
disabled: e = !1,
|
|
8580
8581
|
isBackendTyping: n = !1,
|
|
@@ -8593,7 +8594,7 @@ function Lo({
|
|
|
8593
8594
|
resetConversation: y,
|
|
8594
8595
|
startListening: C,
|
|
8595
8596
|
stopListening: v
|
|
8596
|
-
} =
|
|
8597
|
+
} = Lo({
|
|
8597
8598
|
assistantText: t,
|
|
8598
8599
|
disabled: e,
|
|
8599
8600
|
isBackendTyping: n,
|
|
@@ -8648,7 +8649,7 @@ function Lo({
|
|
|
8648
8649
|
},
|
|
8649
8650
|
title: "Close voice assistant",
|
|
8650
8651
|
"aria-label": "Close voice assistant",
|
|
8651
|
-
children: /* @__PURE__ */ a(
|
|
8652
|
+
children: /* @__PURE__ */ a(ms, {})
|
|
8652
8653
|
}
|
|
8653
8654
|
),
|
|
8654
8655
|
/* @__PURE__ */ a(
|
|
@@ -8660,7 +8661,7 @@ function Lo({
|
|
|
8660
8661
|
disabled: e || !m,
|
|
8661
8662
|
title: u ? "Stop listening" : "Start listening",
|
|
8662
8663
|
"aria-label": u ? "Stop listening" : "Start listening",
|
|
8663
|
-
children: u ? /* @__PURE__ */ a(
|
|
8664
|
+
children: u ? /* @__PURE__ */ a(hs, {}) : /* @__PURE__ */ a(ps, {})
|
|
8664
8665
|
}
|
|
8665
8666
|
)
|
|
8666
8667
|
] })
|
|
@@ -8683,8 +8684,19 @@ function ai(t, e = "") {
|
|
|
8683
8684
|
}
|
|
8684
8685
|
return e;
|
|
8685
8686
|
}
|
|
8686
|
-
|
|
8687
|
-
|
|
8687
|
+
function $o() {
|
|
8688
|
+
if (typeof window > "u") return null;
|
|
8689
|
+
const t = window.__TRAVEL_AI_RUNTIME__;
|
|
8690
|
+
return !t || typeof t != "object" ? null : String(t.apiBaseUrl || "").trim() || null;
|
|
8691
|
+
}
|
|
8692
|
+
function Zi() {
|
|
8693
|
+
const t = $o();
|
|
8694
|
+
if (t) return t.replace(/\/$/, "");
|
|
8695
|
+
const e = String(process.env.REACT_APP_API_BASE_URL || "").trim();
|
|
8696
|
+
return e ? e.replace(/\/$/, "") : "http://localhost:5000";
|
|
8697
|
+
}
|
|
8698
|
+
const Io = 15 * 60 * 1e3;
|
|
8699
|
+
function Ro() {
|
|
8688
8700
|
var gt, Se;
|
|
8689
8701
|
const t = Ei(), [e, n] = tt(""), [r, i] = tt([]), [o, c] = tt(!1), [u, s] = tt(""), [m, N] = tt(!1), [f, y] = tt(0), [, C] = tt(""), [v, S] = tt(!1), [p, _] = tt(""), [h, x] = tt(""), [A, j] = tt([]), [w, l] = tt(""), [b, D] = tt(null), [H, z] = tt(null), [
|
|
8690
8702
|
L,
|
|
@@ -8696,7 +8708,7 @@ function Eo() {
|
|
|
8696
8708
|
return M == null ? null : typeof M == "string" ? { type: "assistant_message", text: M } : typeof M != "object" ? null : M;
|
|
8697
8709
|
};
|
|
8698
8710
|
ut(() => {
|
|
8699
|
-
const R =
|
|
8711
|
+
const R = Mo() || localStorage.getItem("travel_session_id");
|
|
8700
8712
|
if (R) {
|
|
8701
8713
|
const q = di(R);
|
|
8702
8714
|
i(q), C(fi(q)), W.current = q.length === 0, K.current = R, _e(R);
|
|
@@ -8708,7 +8720,7 @@ function Eo() {
|
|
|
8708
8720
|
user: M,
|
|
8709
8721
|
userContext: M
|
|
8710
8722
|
}), t.on("chat:joined", (q) => {
|
|
8711
|
-
if (n(q.sessionId), localStorage.setItem("travel_session_id", q.sessionId),
|
|
8723
|
+
if (n(q.sessionId), localStorage.setItem("travel_session_id", q.sessionId), zo(q.sessionId), _e(q.sessionId), K.current !== q.sessionId) {
|
|
8712
8724
|
const J = di(q.sessionId);
|
|
8713
8725
|
i(J), C(fi(J)), W.current = J.length === 0, K.current = q.sessionId;
|
|
8714
8726
|
}
|
|
@@ -8793,10 +8805,10 @@ function Eo() {
|
|
|
8793
8805
|
const V = (M == null ? void 0 : M.detail) || {}, q = (V == null ? void 0 : V.fareAvailabilityPayload) || null;
|
|
8794
8806
|
if (!q || typeof q != "object")
|
|
8795
8807
|
return;
|
|
8796
|
-
const J = (V == null ? void 0 : V.summary) || {}, et =
|
|
8808
|
+
const J = (V == null ? void 0 : V.summary) || {}, et = Al(
|
|
8797
8809
|
J,
|
|
8798
8810
|
q
|
|
8799
|
-
), St = (et == null ? void 0 : et.type) === "split_roundtrip" ?
|
|
8811
|
+
), St = (et == null ? void 0 : et.type) === "split_roundtrip" ? Sl(et) : vl(et);
|
|
8800
8812
|
z({
|
|
8801
8813
|
fareAvailabilityPayload: q
|
|
8802
8814
|
}), i((Wt) => [
|
|
@@ -8869,8 +8881,8 @@ function Eo() {
|
|
|
8869
8881
|
}, []), ut(() => {
|
|
8870
8882
|
if (!e || m) return;
|
|
8871
8883
|
const R = window.setInterval(() => {
|
|
8872
|
-
const M =
|
|
8873
|
-
!Number.isFinite(M) || !(Date.now() - M >
|
|
8884
|
+
const M = Yo(e);
|
|
8885
|
+
!Number.isFinite(M) || !(Date.now() - M > Io) || N(!0);
|
|
8874
8886
|
}, 15e3);
|
|
8875
8887
|
return () => window.clearInterval(R);
|
|
8876
8888
|
}, [e, m]), ut(() => {
|
|
@@ -8882,10 +8894,10 @@ function Eo() {
|
|
|
8882
8894
|
}
|
|
8883
8895
|
]), nt.current = !0);
|
|
8884
8896
|
}, [m]), ut(() => {
|
|
8885
|
-
e &&
|
|
8897
|
+
e && Ho(e, r);
|
|
8886
8898
|
}, [e, r]), ut(() => {
|
|
8887
8899
|
let R = !0;
|
|
8888
|
-
const M =
|
|
8900
|
+
const M = jo();
|
|
8889
8901
|
if (!(M != null && M.bookingId)) return;
|
|
8890
8902
|
const V = M.sessionId || localStorage.getItem("travel_session_id") || "";
|
|
8891
8903
|
if (!V) {
|
|
@@ -8898,7 +8910,7 @@ function Eo() {
|
|
|
8898
8910
|
]);
|
|
8899
8911
|
return;
|
|
8900
8912
|
}
|
|
8901
|
-
const q = (
|
|
8913
|
+
const q = Zi();
|
|
8902
8914
|
return (async () => {
|
|
8903
8915
|
try {
|
|
8904
8916
|
vt(!0, "Loading confirmation details...");
|
|
@@ -8945,7 +8957,7 @@ function Eo() {
|
|
|
8945
8957
|
} finally {
|
|
8946
8958
|
R && vt(!1);
|
|
8947
8959
|
}
|
|
8948
|
-
})(),
|
|
8960
|
+
})(), Oo(), () => {
|
|
8949
8961
|
R = !1;
|
|
8950
8962
|
};
|
|
8951
8963
|
}, []);
|
|
@@ -8966,10 +8978,10 @@ function Eo() {
|
|
|
8966
8978
|
queryOverride: M = "",
|
|
8967
8979
|
suppressUserEcho: V = !1
|
|
8968
8980
|
} = {}) => {
|
|
8969
|
-
const q = String(M || "").trim() || String(w || "").trim() ||
|
|
8981
|
+
const q = String(M || "").trim() || String(w || "").trim() || Nl(r);
|
|
8970
8982
|
i((J) => {
|
|
8971
8983
|
var St, Wt;
|
|
8972
|
-
const et =
|
|
8984
|
+
const et = _l(J);
|
|
8973
8985
|
return !R || !q || V || et.length > 0 && ((St = et[et.length - 1]) == null ? void 0 : St.type) === "user_message" && String(((Wt = et[et.length - 1]) == null ? void 0 : Wt.text) || "").trim() === q ? et : [
|
|
8974
8986
|
...et,
|
|
8975
8987
|
{
|
|
@@ -9102,7 +9114,7 @@ function Eo() {
|
|
|
9102
9114
|
var St;
|
|
9103
9115
|
if (vt(!1), !(J != null && J.ok)) {
|
|
9104
9116
|
wt(
|
|
9105
|
-
|
|
9117
|
+
wl(
|
|
9106
9118
|
J == null ? void 0 : J.error,
|
|
9107
9119
|
"Failed to fetch fare availability."
|
|
9108
9120
|
)
|
|
@@ -9114,7 +9126,7 @@ function Eo() {
|
|
|
9114
9126
|
wt("Selected flight is not available right now.");
|
|
9115
9127
|
return;
|
|
9116
9128
|
}
|
|
9117
|
-
const ct =
|
|
9129
|
+
const ct = Fs(et, {});
|
|
9118
9130
|
ct.frequentTravellers = Array.isArray(
|
|
9119
9131
|
J == null ? void 0 : J.frequentTravellers
|
|
9120
9132
|
) ? J.frequentTravellers : [], ct.initialPaymentSummary = {
|
|
@@ -9156,7 +9168,7 @@ function Eo() {
|
|
|
9156
9168
|
if (!R.trim() || Un(R)) return !1;
|
|
9157
9169
|
const M = [...r].reverse().findIndex((pt) => pt.type === "flight_results");
|
|
9158
9170
|
if (M === -1) return !1;
|
|
9159
|
-
const V = r.length - 1 - M, q = r[V], J = R.toLowerCase(), et = Gn(q), ct = Dn(R, et), St =
|
|
9171
|
+
const V = r.length - 1 - M, q = r[V], J = R.toLowerCase(), et = Gn(q), ct = Dn(R, et), St = Qi(ct), Wt = St && /\b(book|reserve|buy|purchase|confirm booking|proceed to book)\b/.test(
|
|
9160
9172
|
J
|
|
9161
9173
|
);
|
|
9162
9174
|
if ((() => {
|
|
@@ -9175,10 +9187,10 @@ function Eo() {
|
|
|
9175
9187
|
) || /\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|tomorrow|today|next week)\b/i.test(
|
|
9176
9188
|
J
|
|
9177
9189
|
) || !St) return !1;
|
|
9178
|
-
const Te =
|
|
9190
|
+
const Te = ns(q), Le = ct.clearAll ? null : {
|
|
9179
9191
|
...(q == null ? void 0 : q.filters) || {},
|
|
9180
9192
|
...ct
|
|
9181
|
-
}, ot =
|
|
9193
|
+
}, ot = sl(
|
|
9182
9194
|
Te,
|
|
9183
9195
|
Le
|
|
9184
9196
|
);
|
|
@@ -9212,7 +9224,7 @@ function Eo() {
|
|
|
9212
9224
|
...pe,
|
|
9213
9225
|
filters: be
|
|
9214
9226
|
}, xt;
|
|
9215
|
-
}),
|
|
9227
|
+
}), el(R) && nl(), !0);
|
|
9216
9228
|
}, Ut = (R, M = {}) => {
|
|
9217
9229
|
if (m) return;
|
|
9218
9230
|
const V = String(R || "").trim();
|
|
@@ -9271,7 +9283,7 @@ function Eo() {
|
|
|
9271
9283
|
}
|
|
9272
9284
|
it && x(it);
|
|
9273
9285
|
const St = !!Ge();
|
|
9274
|
-
if (St &&
|
|
9286
|
+
if (St && il(V)) {
|
|
9275
9287
|
const ot = M.source === "voice" ? "voice" : "chat";
|
|
9276
9288
|
if (Kn(V, (Yt) => {
|
|
9277
9289
|
M.skipEcho || i((pt) => [
|
|
@@ -9343,7 +9355,7 @@ function Eo() {
|
|
|
9343
9355
|
};
|
|
9344
9356
|
if (yi(V, ot))
|
|
9345
9357
|
return;
|
|
9346
|
-
const ht =
|
|
9358
|
+
const ht = ol(
|
|
9347
9359
|
V,
|
|
9348
9360
|
ot
|
|
9349
9361
|
);
|
|
@@ -9353,7 +9365,7 @@ function Eo() {
|
|
|
9353
9365
|
}
|
|
9354
9366
|
if ((ht == null ? void 0 : ht.status) === "HANDLED" || yn(V, ot))
|
|
9355
9367
|
return;
|
|
9356
|
-
if (
|
|
9368
|
+
if (rl(V) && St) {
|
|
9357
9369
|
$t({
|
|
9358
9370
|
requireConfirmation: !0,
|
|
9359
9371
|
refetchSearch: !0
|
|
@@ -9440,7 +9452,7 @@ function Eo() {
|
|
|
9440
9452
|
Ut(M, { source: "voice" });
|
|
9441
9453
|
}, qt = () => {
|
|
9442
9454
|
const R = String(e || "").trim();
|
|
9443
|
-
R && (
|
|
9455
|
+
R && (Ko(R), Vo(R)), c(!1), s(""), i([]), _(""), x(""), k(!1), g.current = !1, n(""), N(!1), C(""), S(!1), nt.current = !1, K.current = "", W.current = !0, y((V) => V + 1), localStorage.removeItem("travel_session_id"), Uo();
|
|
9444
9456
|
const M = On();
|
|
9445
9457
|
t.emit("chat:join", {
|
|
9446
9458
|
sessionId: null,
|
|
@@ -9504,7 +9516,7 @@ function Eo() {
|
|
|
9504
9516
|
source: v ? "voice" : "chat"
|
|
9505
9517
|
}), x(it), _("");
|
|
9506
9518
|
}
|
|
9507
|
-
}, kt =
|
|
9519
|
+
}, kt = gl(r), Ht = bl(r), zt = yl(r);
|
|
9508
9520
|
if (v)
|
|
9509
9521
|
return /* @__PURE__ */ d("div", { className: "voice-page", children: [
|
|
9510
9522
|
/* @__PURE__ */ a("div", { className: "voice-page__results", children: Ht.length ? /* @__PURE__ */ a(
|
|
@@ -9529,7 +9541,7 @@ function Eo() {
|
|
|
9529
9541
|
/* @__PURE__ */ a("p", { className: "voice-page__placeholder-copy", children: "Search results, traveler details, or payment blocks will appear here while you continue the conversation by voice." })
|
|
9530
9542
|
] }) }),
|
|
9531
9543
|
/* @__PURE__ */ a(
|
|
9532
|
-
|
|
9544
|
+
Eo,
|
|
9533
9545
|
{
|
|
9534
9546
|
assistantText: zt,
|
|
9535
9547
|
disabled: m,
|
|
@@ -9557,10 +9569,10 @@ function Eo() {
|
|
|
9557
9569
|
(R) => String((R == null ? void 0 : R.value) || "").startsWith("CONFIRM_PROCEED_BOOK:")
|
|
9558
9570
|
), Kt = !!O && at.some(
|
|
9559
9571
|
(R) => String((R == null ? void 0 : R.value) || "").startsWith("CONFIRM_PAYMENT:")
|
|
9560
|
-
), re = at.length > 0 && (!dt || yt || Ot || Kt) && it !== h ? at : [], me =
|
|
9572
|
+
), re = at.length > 0 && (!dt || yt || Ot || Kt) && it !== h ? at : [], me = Tl(r), ve = kl(P == null ? void 0 : P.item);
|
|
9561
9573
|
return /* @__PURE__ */ d("div", { className: "chat-window-container", children: [
|
|
9562
9574
|
/* @__PURE__ */ d("header", { className: "topbar", children: [
|
|
9563
|
-
/* @__PURE__ */ a("button", { type: "button", className: "icon-btn", "aria-label": "Open sidebar", children: /* @__PURE__ */ a(
|
|
9575
|
+
/* @__PURE__ */ a("button", { type: "button", className: "icon-btn", "aria-label": "Open sidebar", children: /* @__PURE__ */ a(Ss, {}) }),
|
|
9564
9576
|
/* @__PURE__ */ a("h1", { className: "title", children: "Chat with Zoe" }),
|
|
9565
9577
|
/* @__PURE__ */ a("div", { className: "new-chat-btn-container", children: /* @__PURE__ */ d(
|
|
9566
9578
|
"button",
|
|
@@ -9569,7 +9581,7 @@ function Eo() {
|
|
|
9569
9581
|
onClick: qt,
|
|
9570
9582
|
className: "new-chat-btn",
|
|
9571
9583
|
children: [
|
|
9572
|
-
/* @__PURE__ */ a(
|
|
9584
|
+
/* @__PURE__ */ a(bs, {}),
|
|
9573
9585
|
/* @__PURE__ */ a("span", { children: "New Chat" })
|
|
9574
9586
|
]
|
|
9575
9587
|
}
|
|
@@ -9596,7 +9608,7 @@ function Eo() {
|
|
|
9596
9608
|
}
|
|
9597
9609
|
),
|
|
9598
9610
|
/* @__PURE__ */ a(
|
|
9599
|
-
|
|
9611
|
+
vo,
|
|
9600
9612
|
{
|
|
9601
9613
|
onSend: Ut,
|
|
9602
9614
|
disabled: m,
|
|
@@ -9615,13 +9627,13 @@ function Eo() {
|
|
|
9615
9627
|
] })
|
|
9616
9628
|
] });
|
|
9617
9629
|
}
|
|
9618
|
-
function
|
|
9630
|
+
function Bo(t) {
|
|
9619
9631
|
const e = String(t || "").trim();
|
|
9620
9632
|
return !e || !/\b(?:traveller|traveler)\s*\d+/i.test(e) ? !1 : /\b(?:FN|LN|DOB|TYP|TL|NAT|NUM|ISSDT|EXPDT)\s*:/i.test(e);
|
|
9621
9633
|
}
|
|
9622
9634
|
function Un(t) {
|
|
9623
9635
|
const e = String(t || "").trim(), n = e.toLowerCase();
|
|
9624
|
-
if (!n ||
|
|
9636
|
+
if (!n || Bo(e)) return !1;
|
|
9625
9637
|
const r = /\b(change|chage|chnage|chang|chanage|chnge|updated?|updte|updae|updat|modify|modfy|modifiy|set|replace|repalce|replce|switch|swtich|swich|make\s+it|switch\s+to|fix|correct|corect|corrrect|reschedule|reshedule|rescheduel)\b/.test(
|
|
9626
9638
|
n
|
|
9627
9639
|
), i = /\b(i\s+need|i\s+want|we\s+need|we\s+want|let\s+us|let's|please|pls|plz)\b/.test(
|
|
@@ -9687,14 +9699,14 @@ function jn() {
|
|
|
9687
9699
|
return "UTC";
|
|
9688
9700
|
}
|
|
9689
9701
|
}
|
|
9690
|
-
function
|
|
9702
|
+
function Mo() {
|
|
9691
9703
|
const t = new URLSearchParams(window.location.search || "");
|
|
9692
9704
|
return String(
|
|
9693
9705
|
t.get("sessionId") || t.get("sessionid") || t.get("sid") || ""
|
|
9694
9706
|
).trim() || "";
|
|
9695
9707
|
}
|
|
9696
9708
|
function On() {
|
|
9697
|
-
const t =
|
|
9709
|
+
const t = Po();
|
|
9698
9710
|
Ie((t == null ? void 0 : t.uid) ?? (t == null ? void 0 : t.id)), Ie((t == null ? void 0 : t.agid) ?? (t == null ? void 0 : t.agencyId));
|
|
9699
9711
|
const e = Ie((t == null ? void 0 : t.grpid) ?? (t == null ? void 0 : t.groupId)), n = Ie((t == null ? void 0 : t.dsgid) ?? (t == null ? void 0 : t.designationId)), r = Ie((t == null ? void 0 : t.utyp) ?? (t == null ? void 0 : t.userType)), i = Ie((t == null ? void 0 : t.agtyp) ?? (t == null ? void 0 : t.agencyType)), o = ci((t == null ? void 0 : t.bt) ?? (t == null ? void 0 : t.businessTrip)), c = ci((t == null ? void 0 : t.pt) ?? (t == null ? void 0 : t.personalTrip)), u = Ie((t == null ? void 0 : t.trmd) ?? (t == null ? void 0 : t.tripMode)), s = String(i || "").trim().toLowerCase().includes("corporate") || String(i || "").trim().toLowerCase() === "b2b" ? "B2B" : "B2C";
|
|
9700
9712
|
return Ie(
|
|
@@ -9712,9 +9724,9 @@ function On() {
|
|
|
9712
9724
|
cha: "B2B"
|
|
9713
9725
|
};
|
|
9714
9726
|
}
|
|
9715
|
-
function
|
|
9727
|
+
function Po() {
|
|
9716
9728
|
try {
|
|
9717
|
-
const t =
|
|
9729
|
+
const t = As.getItem("user"), e = li(t);
|
|
9718
9730
|
if (e) return e;
|
|
9719
9731
|
} catch {
|
|
9720
9732
|
}
|
|
@@ -9747,7 +9759,7 @@ function ci(t) {
|
|
|
9747
9759
|
if (["false", "0", "no", "n"].includes(e)) return !1;
|
|
9748
9760
|
}
|
|
9749
9761
|
}
|
|
9750
|
-
function
|
|
9762
|
+
function zo(t) {
|
|
9751
9763
|
var r;
|
|
9752
9764
|
if (!((r = window == null ? void 0 : window.history) != null && r.replaceState)) return;
|
|
9753
9765
|
const e = String(t || "").trim();
|
|
@@ -9759,7 +9771,7 @@ function Bo(t) {
|
|
|
9759
9771
|
`${n.pathname}${n.search}${n.hash}`
|
|
9760
9772
|
);
|
|
9761
9773
|
}
|
|
9762
|
-
function
|
|
9774
|
+
function Uo() {
|
|
9763
9775
|
var e;
|
|
9764
9776
|
if (!((e = window == null ? void 0 : window.history) != null && e.replaceState)) return;
|
|
9765
9777
|
const t = new URL(window.location.href);
|
|
@@ -9778,7 +9790,7 @@ function ui(t, e) {
|
|
|
9778
9790
|
}
|
|
9779
9791
|
return "";
|
|
9780
9792
|
}
|
|
9781
|
-
function
|
|
9793
|
+
function jo() {
|
|
9782
9794
|
const t = new URLSearchParams(window.location.search || ""), e = ui(t, [
|
|
9783
9795
|
"bookingId",
|
|
9784
9796
|
"bookingid",
|
|
@@ -9794,7 +9806,7 @@ function Po() {
|
|
|
9794
9806
|
]);
|
|
9795
9807
|
return { bookingId: e, sessionId: n };
|
|
9796
9808
|
}
|
|
9797
|
-
function
|
|
9809
|
+
function Oo() {
|
|
9798
9810
|
var e;
|
|
9799
9811
|
if (!((e = window == null ? void 0 : window.history) != null && e.replaceState)) return;
|
|
9800
9812
|
const t = new URL(window.location.href);
|
|
@@ -9830,7 +9842,7 @@ function di(t) {
|
|
|
9830
9842
|
return [];
|
|
9831
9843
|
}
|
|
9832
9844
|
}
|
|
9833
|
-
function
|
|
9845
|
+
function Ho(t, e) {
|
|
9834
9846
|
const n = dr(t);
|
|
9835
9847
|
if (!(!n || n.endsWith("_")))
|
|
9836
9848
|
try {
|
|
@@ -9841,7 +9853,7 @@ function Uo(t, e) {
|
|
|
9841
9853
|
} catch {
|
|
9842
9854
|
}
|
|
9843
9855
|
}
|
|
9844
|
-
function
|
|
9856
|
+
function Ko(t) {
|
|
9845
9857
|
const e = dr(t);
|
|
9846
9858
|
!e || e.endsWith("_") || localStorage.removeItem(e);
|
|
9847
9859
|
}
|
|
@@ -9852,13 +9864,13 @@ function _e(t) {
|
|
|
9852
9864
|
const e = String(t || "").trim();
|
|
9853
9865
|
e && localStorage.setItem(fr(e), String(Date.now()));
|
|
9854
9866
|
}
|
|
9855
|
-
function
|
|
9867
|
+
function Yo(t) {
|
|
9856
9868
|
const e = String(t || "").trim();
|
|
9857
9869
|
if (!e) return NaN;
|
|
9858
9870
|
const n = localStorage.getItem(fr(e)), r = Number(n);
|
|
9859
9871
|
return !Number.isFinite(r) || r <= 0 ? NaN : r;
|
|
9860
9872
|
}
|
|
9861
|
-
function
|
|
9873
|
+
function Vo(t) {
|
|
9862
9874
|
const e = String(t || "").trim();
|
|
9863
9875
|
e && localStorage.removeItem(fr(e));
|
|
9864
9876
|
}
|
|
@@ -9870,11 +9882,11 @@ function fi(t = []) {
|
|
|
9870
9882
|
}
|
|
9871
9883
|
function Hn(t, e = () => {
|
|
9872
9884
|
}) {
|
|
9873
|
-
if (
|
|
9885
|
+
if (Xo(t, e))
|
|
9874
9886
|
return !0;
|
|
9875
9887
|
const n = (o) => {
|
|
9876
9888
|
if (!o) return !1;
|
|
9877
|
-
const c =
|
|
9889
|
+
const c = Xi({
|
|
9878
9890
|
...o,
|
|
9879
9891
|
rawText: t
|
|
9880
9892
|
});
|
|
@@ -9903,7 +9915,7 @@ function mi(t) {
|
|
|
9903
9915
|
const e = String(t || "").trim().toLowerCase();
|
|
9904
9916
|
return e === "onward" ? 0 : e === "round-trip" || e === "roundtrip" ? 1 : e === "return" ? 2 : 9;
|
|
9905
9917
|
}
|
|
9906
|
-
function
|
|
9918
|
+
function Ji(t) {
|
|
9907
9919
|
const e = String(t || "").toLowerCase(), n = /\b(return|inbound|back|homeward|reverse\s+leg|second\s+leg|return\s+leg|returning\s+leg|flight\s+back)\b/.test(
|
|
9908
9920
|
e
|
|
9909
9921
|
), r = /\b(onward|outbound|outward|first\s+leg|departure\s+leg|going\s+leg|outbound\s+leg)\b/.test(
|
|
@@ -9911,7 +9923,7 @@ function Zi(t) {
|
|
|
9911
9923
|
);
|
|
9912
9924
|
return n && !r ? "return" : r && !n ? "onward" : "";
|
|
9913
9925
|
}
|
|
9914
|
-
function
|
|
9926
|
+
function Xi(t = {}) {
|
|
9915
9927
|
if (!t || t.intent === "book-split-flight" || !Number.isFinite(t.index) || t.index < 0) return null;
|
|
9916
9928
|
const e = t.index === Number.MAX_SAFE_INTEGER, n = e ? null : Number(t.index + 1), r = hr();
|
|
9917
9929
|
if (!r) return null;
|
|
@@ -9929,7 +9941,7 @@ function Ji(t = {}) {
|
|
|
9929
9941
|
);
|
|
9930
9942
|
let u = ee(t.leg);
|
|
9931
9943
|
u && !c.has(u) && (u = "");
|
|
9932
|
-
const s = u || ee(
|
|
9944
|
+
const s = u || ee(Ji(i)), m = u ? `[data-ui-flight-card="true"][data-flight-leg="${u}"]` : '[data-ui-flight-card="true"]', N = Array.from(r.querySelectorAll(m)).filter((h) => Gt(h)).map((h) => {
|
|
9933
9945
|
var x, A;
|
|
9934
9946
|
return {
|
|
9935
9947
|
card: h,
|
|
@@ -9938,12 +9950,12 @@ function Ji(t = {}) {
|
|
|
9938
9950
|
};
|
|
9939
9951
|
}).filter((h) => Number.isFinite(h.position) && h.position > 0);
|
|
9940
9952
|
if (!N.length) return null;
|
|
9941
|
-
const f =
|
|
9953
|
+
const f = Go(
|
|
9942
9954
|
t.rawText || ""
|
|
9943
9955
|
), y = f ? N.filter(
|
|
9944
9956
|
(h) => {
|
|
9945
9957
|
var x, A;
|
|
9946
|
-
return
|
|
9958
|
+
return as(
|
|
9947
9959
|
Me(((A = (x = h.card) == null ? void 0 : x.dataset) == null ? void 0 : A.flightAirline) || ""),
|
|
9948
9960
|
Me(f)
|
|
9949
9961
|
);
|
|
@@ -9971,7 +9983,7 @@ function Ji(t = {}) {
|
|
|
9971
9983
|
return j;
|
|
9972
9984
|
}
|
|
9973
9985
|
return null;
|
|
9974
|
-
}, S =
|
|
9986
|
+
}, S = pl(
|
|
9975
9987
|
t.rawText || ""
|
|
9976
9988
|
);
|
|
9977
9989
|
if (S) {
|
|
@@ -10026,7 +10038,7 @@ function Ji(t = {}) {
|
|
|
10026
10038
|
})();
|
|
10027
10039
|
return _ != null && _.card ? v(_.card) : null;
|
|
10028
10040
|
}
|
|
10029
|
-
function
|
|
10041
|
+
function Go(t) {
|
|
10030
10042
|
const e = Me(t);
|
|
10031
10043
|
if (!e) return "";
|
|
10032
10044
|
const n = e.split(" ").filter(Boolean);
|
|
@@ -10077,16 +10089,16 @@ function mr(t) {
|
|
|
10077
10089
|
e
|
|
10078
10090
|
)) : !1;
|
|
10079
10091
|
}
|
|
10080
|
-
function
|
|
10092
|
+
function Qi(t = {}) {
|
|
10081
10093
|
return !t || typeof t != "object" ? !1 : !!(t.clearAll || t.sortBy || Array.isArray(t.stops) && t.stops.length > 0 || Array.isArray(t.rtStops) && t.rtStops.length > 0 || t.price || Array.isArray(t.airlines) && t.airlines.length > 0 || Array.isArray(t.rtAirlines) && t.rtAirlines.length > 0 || Array.isArray(t.depTimes) && t.depTimes.length > 0 || Array.isArray(t.arrTimes) && t.arrTimes.length > 0 || Array.isArray(t.rDepTimes) && t.rDepTimes.length > 0 || Array.isArray(t.rArrTimes) && t.rArrTimes.length > 0 || Array.isArray(t.layover) && t.layover.length > 0 || Array.isArray(t.rLayover) && t.rLayover.length > 0 || t.layoverDuration || t.rLayoverDuration || t.refundable !== null || t.maxDuration);
|
|
10082
10094
|
}
|
|
10083
|
-
function
|
|
10095
|
+
function Wo(t) {
|
|
10084
10096
|
const e = String(t || "").trim().toLowerCase();
|
|
10085
10097
|
return e ? /\b(\d+|1st|2nd|3rd|4th|5th|first|second|third|fourth|fifth|option|this|that|it)\b/.test(
|
|
10086
10098
|
e
|
|
10087
10099
|
) : !1;
|
|
10088
10100
|
}
|
|
10089
|
-
function
|
|
10101
|
+
function qo(t) {
|
|
10090
10102
|
const e = String(t || "").trim().toLowerCase();
|
|
10091
10103
|
return e ? !!(/\b(search|find|show|get|look|need|want)\b.{0,30}\b(flight|flights|ticket|tickets)\b/.test(
|
|
10092
10104
|
e
|
|
@@ -10098,7 +10110,7 @@ function hi(t) {
|
|
|
10098
10110
|
e
|
|
10099
10111
|
) || /\b(fastest|quickest|shortest|slowest|longest)\b/.test(e) || /\b(earliest|latest)\b.{0,20}\b(departure|arrival)\b/.test(e)) : !1;
|
|
10100
10112
|
}
|
|
10101
|
-
function
|
|
10113
|
+
function Zo(t) {
|
|
10102
10114
|
const e = String(t || "").trim().toLowerCase();
|
|
10103
10115
|
return e ? !!(/\b(non[\s-]?stop|one[\s-]?stop|two[\s-]?stop|direct)\b/.test(e) || /\b(under|below|less than|within|max|minimum|between)\b.{0,20}\b(\d+|k|rs|inr)\b/.test(
|
|
10104
10116
|
e
|
|
@@ -10113,10 +10125,10 @@ function pi({
|
|
|
10113
10125
|
isSlotUpdateFollowup: r
|
|
10114
10126
|
}) {
|
|
10115
10127
|
if (r) return "backend";
|
|
10116
|
-
const i = xn(t) || mr(t) ||
|
|
10128
|
+
const i = xn(t) || mr(t) || qo(t), o = Qi(e) || hi(t) || Zo(t), c = !!(e != null && e.sortBy) || hi(t), u = Wo(t), s = n && (Jo(t) || /\b(book|select|choose|pick|reserve|take)\b/i.test(String(t || "")) && u);
|
|
10117
10129
|
return i ? "search" : o && !u ? c ? "sort" : "filter" : s ? "selection" : o ? c ? "sort" : "filter" : "backend";
|
|
10118
10130
|
}
|
|
10119
|
-
function
|
|
10131
|
+
function Jo(t) {
|
|
10120
10132
|
const e = String(t || "").trim().toLowerCase();
|
|
10121
10133
|
return !e || mr(t) ? !1 : /\b(book|select|choose|pick|reserve|take)\b/.test(e) && /\b(\d+|1st|2nd|3rd|4th|first|second|third|fourth|flight|option)\b/.test(
|
|
10122
10134
|
e
|
|
@@ -10134,7 +10146,7 @@ function bi(t) {
|
|
|
10134
10146
|
var h, x;
|
|
10135
10147
|
const p = String(((h = S == null ? void 0 : S.dataset) == null ? void 0 : h.flightPosition) || "").trim(), _ = ee(((x = S == null ? void 0 : S.dataset) == null ? void 0 : x.flightLeg) || "");
|
|
10136
10148
|
return _ ? `${p}:${_}` : p;
|
|
10137
|
-
}) : [], u =
|
|
10149
|
+
}) : [], u = Xi(e), s = (y = u == null ? void 0 : u.closest) == null ? void 0 : y.call(
|
|
10138
10150
|
u,
|
|
10139
10151
|
'[data-ui-flight-card="true"]'
|
|
10140
10152
|
), m = String(
|
|
@@ -10142,9 +10154,9 @@ function bi(t) {
|
|
|
10142
10154
|
).trim(), N = ee(((v = s == null ? void 0 : s.dataset) == null ? void 0 : v.flightLeg) || ""), f = m ? `${m}${N ? `:${N}` : ""}` : "none";
|
|
10143
10155
|
return `[debug: text="${String(t || "").trim()}" intent="${e.intent}" index=${e.index} desired=${n}${r ? ` leg=${r}` : ""} available=[${c.join(", ")}] resolved=${f}]`;
|
|
10144
10156
|
}
|
|
10145
|
-
function
|
|
10157
|
+
function Xo(t, e = () => {
|
|
10146
10158
|
}) {
|
|
10147
|
-
const n =
|
|
10159
|
+
const n = Qo(t);
|
|
10148
10160
|
if (!n) return !1;
|
|
10149
10161
|
const r = n.onwardIndex + 1, i = n.returnIndex + 1, o = gi("onward", r) || wn("select-flight", "onward")[n.onwardIndex] || null;
|
|
10150
10162
|
if (!o || o.disabled) return !1;
|
|
@@ -10224,18 +10236,18 @@ function ar(t) {
|
|
|
10224
10236
|
e
|
|
10225
10237
|
), o = /\b\d+\b/.test(e);
|
|
10226
10238
|
if (!r || !i && !o) return null;
|
|
10227
|
-
let c =
|
|
10239
|
+
let c = es(e);
|
|
10228
10240
|
if (!c) {
|
|
10229
|
-
const s =
|
|
10241
|
+
const s = Ji(e);
|
|
10230
10242
|
s && (c = s);
|
|
10231
10243
|
}
|
|
10232
|
-
const u = c ?
|
|
10244
|
+
const u = c ? ts(
|
|
10233
10245
|
e,
|
|
10234
10246
|
c === "onward" ? "(?:onward|outbound|outward|departure)" : "(?:return|inbound|back|homeward)"
|
|
10235
10247
|
) ?? rn(e) : rn(e);
|
|
10236
10248
|
return c ? { intent: "select-flight", index: u, leg: c } : { intent: "book-or-select-flight", index: u, leg: c };
|
|
10237
10249
|
}
|
|
10238
|
-
function
|
|
10250
|
+
function Qo(t) {
|
|
10239
10251
|
const e = String(t || "").trim().toLowerCase();
|
|
10240
10252
|
if (!e || !/\b(select|choose|pick|take|book)\b/.test(e)) return null;
|
|
10241
10253
|
const r = Ni(
|
|
@@ -10263,9 +10275,9 @@ function Ni(t, e) {
|
|
|
10263
10275
|
if (y !== 0 || /\b(first|1st|1)\b/.test(f))
|
|
10264
10276
|
return y;
|
|
10265
10277
|
}
|
|
10266
|
-
return
|
|
10278
|
+
return ts(t, e);
|
|
10267
10279
|
}
|
|
10268
|
-
function
|
|
10280
|
+
function ts(t, e) {
|
|
10269
10281
|
const n = "(?:\\d+|1st|2nd|3rd|4th|5th|first|second|third|fourth|fifth|best|recommended|last)", r = t.match(
|
|
10270
10282
|
new RegExp(
|
|
10271
10283
|
`\\b${e}\\b[^.\\n]{0,80}?\\b(${n})\\b`,
|
|
@@ -10293,7 +10305,7 @@ function _i(t) {
|
|
|
10293
10305
|
const r = Number(n);
|
|
10294
10306
|
return Number.isFinite(r) ? r : null;
|
|
10295
10307
|
}
|
|
10296
|
-
function
|
|
10308
|
+
function tl(t) {
|
|
10297
10309
|
return String(t || "").replace(/\b[a-z]{1,3}\s*-?\s*\d{2,5}\b/gi, " ");
|
|
10298
10310
|
}
|
|
10299
10311
|
function rn(t) {
|
|
@@ -10311,7 +10323,7 @@ function rn(t) {
|
|
|
10311
10323
|
({ pattern: c }) => c.test(e)
|
|
10312
10324
|
);
|
|
10313
10325
|
if (r) return r.index;
|
|
10314
|
-
const o =
|
|
10326
|
+
const o = tl(e).match(/\b(\d+)\b/);
|
|
10315
10327
|
if (o) {
|
|
10316
10328
|
const c = Number(o[1]);
|
|
10317
10329
|
if (Number.isFinite(c) && c > 0) return c - 1;
|
|
@@ -10372,7 +10384,7 @@ function Yn() {
|
|
|
10372
10384
|
document.querySelectorAll(".message-list__bubble--flight-results")
|
|
10373
10385
|
).some((t) => Gt(t));
|
|
10374
10386
|
}
|
|
10375
|
-
function
|
|
10387
|
+
function es(t) {
|
|
10376
10388
|
const e = String(t || "").toLowerCase();
|
|
10377
10389
|
return /\b(onward|outbound|outward|departure)(\s+leg|\s+flight|\s+side|\s+slice|\s+sector)?\b/.test(
|
|
10378
10390
|
e
|
|
@@ -10387,13 +10399,13 @@ function Gt(t) {
|
|
|
10387
10399
|
const n = t.getBoundingClientRect();
|
|
10388
10400
|
return n.width > 0 && n.height > 0;
|
|
10389
10401
|
}
|
|
10390
|
-
function
|
|
10402
|
+
function el(t) {
|
|
10391
10403
|
const e = String(t || "").trim().toLowerCase();
|
|
10392
10404
|
return e ? /\b(book|reserve|buy|purchase|confirm booking|proceed to book)\b/.test(
|
|
10393
10405
|
e
|
|
10394
10406
|
) : !1;
|
|
10395
10407
|
}
|
|
10396
|
-
function
|
|
10408
|
+
function nl() {
|
|
10397
10409
|
let e = 0;
|
|
10398
10410
|
const n = () => {
|
|
10399
10411
|
e += 1;
|
|
@@ -10406,7 +10418,7 @@ function Qo() {
|
|
|
10406
10418
|
};
|
|
10407
10419
|
window.setTimeout(n, 120);
|
|
10408
10420
|
}
|
|
10409
|
-
function
|
|
10421
|
+
function rl(t) {
|
|
10410
10422
|
const e = String(t || "").trim().toLowerCase();
|
|
10411
10423
|
return /^\s*back\s*$/.test(e) || /\b(go back|back to results|show previous results|previous results)\b/.test(
|
|
10412
10424
|
e
|
|
@@ -10418,7 +10430,7 @@ function wi(t) {
|
|
|
10418
10430
|
e
|
|
10419
10431
|
) : !1;
|
|
10420
10432
|
}
|
|
10421
|
-
function
|
|
10433
|
+
function il(t) {
|
|
10422
10434
|
const e = String(t || "").trim().toLowerCase();
|
|
10423
10435
|
return e ? /\b(proceed to book|continue to book|continue booking)\b/.test(e) : !1;
|
|
10424
10436
|
}
|
|
@@ -10434,12 +10446,12 @@ function vi(t) {
|
|
|
10434
10446
|
e
|
|
10435
10447
|
) : !1;
|
|
10436
10448
|
}
|
|
10437
|
-
function
|
|
10449
|
+
function ns(t) {
|
|
10438
10450
|
var n;
|
|
10439
10451
|
const e = (n = t == null ? void 0 : t.data) == null ? void 0 : n.results;
|
|
10440
10452
|
return Array.isArray(e) ? e : Array.isArray(e == null ? void 0 : e.payload) ? e.payload : [];
|
|
10441
10453
|
}
|
|
10442
|
-
function
|
|
10454
|
+
function sl(t, e) {
|
|
10443
10455
|
const n = Array.isArray(t) ? t : [];
|
|
10444
10456
|
if (!e || e.clearAll) return n;
|
|
10445
10457
|
let r = Bi(n, e);
|
|
@@ -10448,23 +10460,23 @@ function nl(t, e) {
|
|
|
10448
10460
|
function Gn(t) {
|
|
10449
10461
|
var r, i;
|
|
10450
10462
|
if (Number(((i = (r = t == null ? void 0 : t.data) == null ? void 0 : r.params) == null ? void 0 : i.tt) || 0) === 2) return !0;
|
|
10451
|
-
const n =
|
|
10463
|
+
const n = ns(t);
|
|
10452
10464
|
return n.length ? n.some((o) => !!(Number((o == null ? void 0 : o.tt) || 0) === 2 || Array.isArray(o == null ? void 0 : o.rttrps) && o.rttrps.length > 0 || Array.isArray(o == null ? void 0 : o.trps) && o.trps.some((c) => {
|
|
10453
10465
|
var u;
|
|
10454
10466
|
return (u = c == null ? void 0 : c.pr) == null ? void 0 : u.rtrmkey;
|
|
10455
10467
|
}))) : !1;
|
|
10456
10468
|
}
|
|
10457
|
-
function
|
|
10469
|
+
function al(t) {
|
|
10458
10470
|
const e = String(t || "").trim().toLowerCase();
|
|
10459
10471
|
return e ? /\b(view all|view all flights|show all|show more|more options|expand results)\b/i.test(
|
|
10460
10472
|
e
|
|
10461
10473
|
) : !1;
|
|
10462
10474
|
}
|
|
10463
|
-
function
|
|
10475
|
+
function ol(t, e = () => {
|
|
10464
10476
|
}) {
|
|
10465
|
-
const n =
|
|
10477
|
+
const n = ul(t);
|
|
10466
10478
|
if (!n) return !1;
|
|
10467
|
-
const r =
|
|
10479
|
+
const r = rs(t), i = ml(r), o = (() => {
|
|
10468
10480
|
const y = Array.from(
|
|
10469
10481
|
document.querySelectorAll(".message-list__bubble--flight-results")
|
|
10470
10482
|
).filter((C) => Gt(C));
|
|
@@ -10478,7 +10490,7 @@ function il(t, e = () => {
|
|
|
10478
10490
|
preferredAction: n,
|
|
10479
10491
|
actionHints: r
|
|
10480
10492
|
}) ? { status: "HANDLED" } : !1;
|
|
10481
|
-
const { matchedCards: u, hasExplicitConstraint: s } =
|
|
10493
|
+
const { matchedCards: u, hasExplicitConstraint: s } = is(c, r);
|
|
10482
10494
|
if (s && u.length === 0)
|
|
10483
10495
|
return yn(t, e, {
|
|
10484
10496
|
force: !0,
|
|
@@ -10500,13 +10512,13 @@ function il(t, e = () => {
|
|
|
10500
10512
|
message: n.unavailableMessage
|
|
10501
10513
|
} : !1 : (e(t), f.click(), { status: "HANDLED" });
|
|
10502
10514
|
}
|
|
10503
|
-
function
|
|
10515
|
+
function ll(t) {
|
|
10504
10516
|
const e = String(t || "").trim().toLowerCase();
|
|
10505
10517
|
if (!e) return !1;
|
|
10506
10518
|
const n = /\b(open|show|click|select|choose)\b/.test(e), r = /\b(more\s*fares?|morefares)\b/.test(e), i = /\bfare\s+options?\b/.test(e);
|
|
10507
10519
|
return r || n && i || !n && i;
|
|
10508
10520
|
}
|
|
10509
|
-
function
|
|
10521
|
+
function cl(t) {
|
|
10510
10522
|
const e = String(t || "").trim().toLowerCase();
|
|
10511
10523
|
if (!e) return !1;
|
|
10512
10524
|
const n = /\b(open|show|click|select|choose)\b/.test(e), r = /\bfare\b/.test(e), i = /\b(details?|deatails?|deatils?|detials?|detailes?)\b/.test(e);
|
|
@@ -10514,12 +10526,12 @@ function al(t) {
|
|
|
10514
10526
|
e
|
|
10515
10527
|
) || r && i || n && i;
|
|
10516
10528
|
}
|
|
10517
|
-
function
|
|
10518
|
-
return
|
|
10529
|
+
function ul(t) {
|
|
10530
|
+
return ll(t) ? {
|
|
10519
10531
|
key: "more-fares",
|
|
10520
10532
|
buttonSelector: '[data-ui-action="more-fares"]',
|
|
10521
10533
|
unavailableMessage: "No filter data available for the selected flight."
|
|
10522
|
-
} :
|
|
10534
|
+
} : cl(t) ? {
|
|
10523
10535
|
key: "fare-details",
|
|
10524
10536
|
buttonSelector: '[data-ui-action="open-fare-details"]',
|
|
10525
10537
|
unavailableMessage: "No fare details available for the selected flight."
|
|
@@ -10527,9 +10539,9 @@ function ol(t) {
|
|
|
10527
10539
|
}
|
|
10528
10540
|
function yn(t, e = () => {
|
|
10529
10541
|
}, n = {}) {
|
|
10530
|
-
const r = !!(n != null && n.force), i = n != null && n.preferredAction && typeof n.preferredAction == "object" ? n.preferredAction : null, o = n != null && n.actionHints && typeof n.actionHints == "object" ? n.actionHints :
|
|
10531
|
-
if (!r && !
|
|
10532
|
-
const c =
|
|
10542
|
+
const r = !!(n != null && n.force), i = n != null && n.preferredAction && typeof n.preferredAction == "object" ? n.preferredAction : null, o = n != null && n.actionHints && typeof n.actionHints == "object" ? n.actionHints : rs(t);
|
|
10543
|
+
if (!r && !al(t)) return !1;
|
|
10544
|
+
const c = hl(t), u = (() => {
|
|
10533
10545
|
const f = Array.from(
|
|
10534
10546
|
document.querySelectorAll(".message-list__bubble--flight-results")
|
|
10535
10547
|
).filter((y) => Gt(y));
|
|
@@ -10544,16 +10556,16 @@ function yn(t, e = () => {
|
|
|
10544
10556
|
return ee((y = f == null ? void 0 : f.dataset) == null ? void 0 : y.flightLeg) === ee(c);
|
|
10545
10557
|
}
|
|
10546
10558
|
) : null) || s[0];
|
|
10547
|
-
return N ? (e(t), N.click(), i &&
|
|
10559
|
+
return N ? (e(t), N.click(), i && dl(i, o), !0) : !1;
|
|
10548
10560
|
}
|
|
10549
|
-
function
|
|
10561
|
+
function dl(t, e) {
|
|
10550
10562
|
let n = 0;
|
|
10551
10563
|
const r = 12, i = () => {
|
|
10552
|
-
n += 1, !(
|
|
10564
|
+
n += 1, !(fl(t, e) || n >= r) && window.setTimeout(i, 120);
|
|
10553
10565
|
};
|
|
10554
10566
|
window.setTimeout(i, 80);
|
|
10555
10567
|
}
|
|
10556
|
-
function
|
|
10568
|
+
function fl(t, e) {
|
|
10557
10569
|
const n = (() => {
|
|
10558
10570
|
const m = Array.from(
|
|
10559
10571
|
document.querySelectorAll(".message-list__bubble--flight-results")
|
|
@@ -10565,7 +10577,7 @@ function cl(t, e) {
|
|
|
10565
10577
|
)
|
|
10566
10578
|
).filter((m) => Gt(m));
|
|
10567
10579
|
if (!r.length) return !1;
|
|
10568
|
-
const { matchedCards: i, hasExplicitConstraint: o } =
|
|
10580
|
+
const { matchedCards: i, hasExplicitConstraint: o } = is(
|
|
10569
10581
|
r,
|
|
10570
10582
|
e || {}
|
|
10571
10583
|
);
|
|
@@ -10586,7 +10598,7 @@ function cl(t, e) {
|
|
|
10586
10598
|
})
|
|
10587
10599
|
), !0) : !1 : (s.click(), !0);
|
|
10588
10600
|
}
|
|
10589
|
-
function
|
|
10601
|
+
function rs(t) {
|
|
10590
10602
|
const e = String(t || "").trim(), n = e.toLowerCase(), r = n.match(/\b([a-z]{1,3}\s*-?\s*\d{2,5})\b/i), i = n.match(
|
|
10591
10603
|
/\b(?:airline|airlines|operator)\s+([a-z][a-z0-9 &.-]{1,40})\b/i
|
|
10592
10604
|
), o = n.match(
|
|
@@ -10615,18 +10627,18 @@ function ns(t) {
|
|
|
10615
10627
|
/(?:inr|usd|eur|aed|sar|rs|₹|\$)\s*([0-9][0-9,]*(?:\.\d{1,2})?)/i
|
|
10616
10628
|
), S = n.match(/\b([0-2]?\d:[0-5]\d)\b/g) || [];
|
|
10617
10629
|
return {
|
|
10618
|
-
leg:
|
|
10630
|
+
leg: es(n) || "",
|
|
10619
10631
|
position: /\b(last|bottom|final)\b/.test(n) ? "last" : "first",
|
|
10620
10632
|
flightNumber: (r == null ? void 0 : r[1]) || "",
|
|
10621
10633
|
airline: (i == null ? void 0 : i[1]) || (o == null ? void 0 : o[1]) || (f ? N : "") || "",
|
|
10622
10634
|
date: (y == null ? void 0 : y[1]) || "",
|
|
10623
|
-
price:
|
|
10635
|
+
price: ss(
|
|
10624
10636
|
(C == null ? void 0 : C[1]) || (v == null ? void 0 : v[1]) || ""
|
|
10625
10637
|
),
|
|
10626
10638
|
times: S.map((p) => or(p)).filter(Boolean)
|
|
10627
10639
|
};
|
|
10628
10640
|
}
|
|
10629
|
-
function
|
|
10641
|
+
function is(t = [], e = {}) {
|
|
10630
10642
|
let n = Array.isArray(t) ? t : [], r = !1;
|
|
10631
10643
|
if (e.leg && (r = !0, n = n.filter(
|
|
10632
10644
|
(i) => {
|
|
@@ -10649,7 +10661,7 @@ function rs(t = [], e = {}) {
|
|
|
10649
10661
|
n = n.filter(
|
|
10650
10662
|
(o) => {
|
|
10651
10663
|
var c;
|
|
10652
|
-
return
|
|
10664
|
+
return as(
|
|
10653
10665
|
Me((c = o == null ? void 0 : o.dataset) == null ? void 0 : c.flightAirline),
|
|
10654
10666
|
i
|
|
10655
10667
|
);
|
|
@@ -10658,7 +10670,7 @@ function rs(t = [], e = {}) {
|
|
|
10658
10670
|
}
|
|
10659
10671
|
if (e.price != null && (r = !0, n = n.filter((i) => {
|
|
10660
10672
|
var c;
|
|
10661
|
-
const o =
|
|
10673
|
+
const o = ss((c = i == null ? void 0 : i.dataset) == null ? void 0 : c.flightPrice);
|
|
10662
10674
|
return o != null && Math.abs(o - e.price) < 1;
|
|
10663
10675
|
})), e.date) {
|
|
10664
10676
|
r = !0;
|
|
@@ -10677,18 +10689,18 @@ function rs(t = [], e = {}) {
|
|
|
10677
10689
|
);
|
|
10678
10690
|
})), { matchedCards: n, hasExplicitConstraint: r };
|
|
10679
10691
|
}
|
|
10680
|
-
function
|
|
10692
|
+
function ml(t = {}) {
|
|
10681
10693
|
return !!(t != null && t.leg || t != null && t.flightNumber || t != null && t.airline || t != null && t.date || (t == null ? void 0 : t.price) != null || Array.isArray(t == null ? void 0 : t.times) && t.times.length > 0);
|
|
10682
10694
|
}
|
|
10683
10695
|
function ee(t) {
|
|
10684
10696
|
const e = String(t || "").trim().toLowerCase();
|
|
10685
10697
|
return e === "onward" || e === "return" ? e : "";
|
|
10686
10698
|
}
|
|
10687
|
-
function
|
|
10699
|
+
function hl(t) {
|
|
10688
10700
|
const e = String(t || "").trim().toLowerCase();
|
|
10689
10701
|
return e ? /\b(return|inbound|back)\b/.test(e) ? "return" : /\b(onward|outbound|departure)\b/.test(e) ? "onward" : "" : "";
|
|
10690
10702
|
}
|
|
10691
|
-
function
|
|
10703
|
+
function ss(t) {
|
|
10692
10704
|
const e = String(t || "").replace(/,/g, "").trim();
|
|
10693
10705
|
if (!e) return null;
|
|
10694
10706
|
const n = Number(e);
|
|
@@ -10697,7 +10709,7 @@ function is(t) {
|
|
|
10697
10709
|
function sn(t) {
|
|
10698
10710
|
return String(t || "").toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
10699
10711
|
}
|
|
10700
|
-
function
|
|
10712
|
+
function pl(t) {
|
|
10701
10713
|
const e = String(t || ""), n = /\b([a-z]{1,3})\s*-?\s*(\d{2,5})\b/gi;
|
|
10702
10714
|
let r = "", i = -1, o = -1, c = n.exec(e);
|
|
10703
10715
|
for (; c !== null; ) {
|
|
@@ -10730,7 +10742,7 @@ function or(t) {
|
|
|
10730
10742
|
function Me(t) {
|
|
10731
10743
|
return String(t || "").toLowerCase().replace(/[^a-z0-9 ]/g, " ").replace(/\s+/g, " ").trim();
|
|
10732
10744
|
}
|
|
10733
|
-
function
|
|
10745
|
+
function as(t, e) {
|
|
10734
10746
|
const n = Me(t), r = Me(e);
|
|
10735
10747
|
if (!n || !r) return !1;
|
|
10736
10748
|
if (n.includes(r) || r.includes(n))
|
|
@@ -10753,7 +10765,7 @@ function xn(t) {
|
|
|
10753
10765
|
const r = /\bfrom\s+[a-z][a-z .'-]+\s+to\s+[a-z][a-z .'-]+\b/i, i = /\b[a-z][a-z .'-]+\s+to\s+[a-z][a-z .'-]+\b/i, o = /\b[a-z]{3}\s*(?:to|-)\s*[a-z]{3}\b/i, c = /\bon\s+[a-z0-9,\-/ ]+\b/i, u = /\b\d{1,2}(?:st|nd|rd|th)?\b.*\b(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\b/i, s = r.test(e) || i.test(e) || o.test(e), m = c.test(e) || u.test(e);
|
|
10754
10766
|
return s && m || /\b(search|find|show|get)\b.*\bflight/.test(n);
|
|
10755
10767
|
}
|
|
10756
|
-
function
|
|
10768
|
+
function bl(t = []) {
|
|
10757
10769
|
const e = t.filter((c) => c == null ? void 0 : c.hiddenFromChat), n = [...t].reverse().find((c) => (c == null ? void 0 : c.type) === "payment_confirmation");
|
|
10758
10770
|
if (n)
|
|
10759
10771
|
return [n];
|
|
@@ -10769,16 +10781,16 @@ function ml(t = []) {
|
|
|
10769
10781
|
);
|
|
10770
10782
|
return o ? [o] : [];
|
|
10771
10783
|
}
|
|
10772
|
-
function
|
|
10784
|
+
function gl(t = []) {
|
|
10773
10785
|
return t.filter((e) => !(e != null && e.hiddenFromChat));
|
|
10774
10786
|
}
|
|
10775
|
-
function
|
|
10787
|
+
function yl(t = []) {
|
|
10776
10788
|
const e = [...t].reverse().find(
|
|
10777
10789
|
(n) => (n == null ? void 0 : n.hiddenFromChat) && (n == null ? void 0 : n.type) !== "user_message" && typeof (n == null ? void 0 : n.text) == "string" && n.text.trim()
|
|
10778
10790
|
);
|
|
10779
10791
|
return String((e == null ? void 0 : e.text) || "").trim();
|
|
10780
10792
|
}
|
|
10781
|
-
function
|
|
10793
|
+
function Nl(t = []) {
|
|
10782
10794
|
var f;
|
|
10783
10795
|
const e = [...t].reverse().find(
|
|
10784
10796
|
(y) => (y == null ? void 0 : y.type) === "user_message" && xn(String((y == null ? void 0 : y.text) || ""))
|
|
@@ -10791,12 +10803,12 @@ function bl(t = []) {
|
|
|
10791
10803
|
}
|
|
10792
10804
|
return "";
|
|
10793
10805
|
}
|
|
10794
|
-
function
|
|
10806
|
+
function _l(t = []) {
|
|
10795
10807
|
return t.filter((e) => !(!e || e.type === "traveler_details_form" || e.type === "payment_confirmation" || (Array.isArray(e == null ? void 0 : e.options) ? e.options.some(
|
|
10796
10808
|
(r) => String((r == null ? void 0 : r.value) || "").startsWith("CONFIRM_REDIRECT:")
|
|
10797
10809
|
) : !1)));
|
|
10798
10810
|
}
|
|
10799
|
-
function
|
|
10811
|
+
function wl(t, e) {
|
|
10800
10812
|
if (typeof t == "string") return t;
|
|
10801
10813
|
if (typeof t == "number" || typeof t == "boolean")
|
|
10802
10814
|
return String(t);
|
|
@@ -10815,15 +10827,15 @@ function lr(t) {
|
|
|
10815
10827
|
const e = Number(t || 0);
|
|
10816
10828
|
return e <= 0 ? "Non-stop" : e === 1 ? "1 stop" : `${e} stops`;
|
|
10817
10829
|
}
|
|
10818
|
-
function
|
|
10830
|
+
function vl(t = {}) {
|
|
10819
10831
|
const e = lr(t == null ? void 0 : t.stops);
|
|
10820
10832
|
return `You have selected this flight: ${(t == null ? void 0 : t.airline) || "Unknown airline"}, ${(t == null ? void 0 : t.flightNumber) || "N/A"}, ${(t == null ? void 0 : t.departureTime) || "--:--"}-${(t == null ? void 0 : t.arrivalTime) || "--:--"}, ${e}. Do you want to proceed to availability?`;
|
|
10821
10833
|
}
|
|
10822
|
-
function
|
|
10834
|
+
function Sl(t = {}) {
|
|
10823
10835
|
const e = (t == null ? void 0 : t.onward) || {}, n = (t == null ? void 0 : t.return) || {}, r = `Onward: ${(e == null ? void 0 : e.airline) || "Unknown airline"} ${(e == null ? void 0 : e.flightNumber) || "N/A"}, ${(e == null ? void 0 : e.departureTime) || "--:--"}-${(e == null ? void 0 : e.arrivalTime) || "--:--"}, ${lr(e == null ? void 0 : e.stops)}.`, i = `Return: ${(n == null ? void 0 : n.airline) || "Unknown airline"} ${(n == null ? void 0 : n.flightNumber) || "N/A"}, ${(n == null ? void 0 : n.departureTime) || "--:--"}-${(n == null ? void 0 : n.arrivalTime) || "--:--"}, ${lr(n == null ? void 0 : n.stops)}.`;
|
|
10824
10836
|
return `You have selected these flights. ${r} ${i} Do you want to proceed to availability?`;
|
|
10825
10837
|
}
|
|
10826
|
-
function
|
|
10838
|
+
function Al(t = {}, e = null) {
|
|
10827
10839
|
const n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (n == null ? void 0 : n.type) === "split_roundtrip" || !!(n != null && n.onward) || !!(n != null && n.return), i = !!String((e == null ? void 0 : e.rukey) || "").trim() || Array.isArray(e == null ? void 0 : e.rtrmkey) && e.rtrmkey.length > 0 || Number((e == null ? void 0 : e.tt) || 0) === 2 || /split|combined/i.test(String((e == null ? void 0 : e.styp) || ""));
|
|
10828
10840
|
if (!r && !i)
|
|
10829
10841
|
return n;
|
|
@@ -10867,10 +10879,10 @@ function Ci(t) {
|
|
|
10867
10879
|
((c = r == null ? void 0 : r.dataset) == null ? void 0 : c.flightDepartureTime) || ""
|
|
10868
10880
|
).trim(),
|
|
10869
10881
|
arrivalTime: String(((u = r == null ? void 0 : r.dataset) == null ? void 0 : u.flightArrivalTime) || "").trim(),
|
|
10870
|
-
stops:
|
|
10882
|
+
stops: Cl(r)
|
|
10871
10883
|
} : null;
|
|
10872
10884
|
}
|
|
10873
|
-
function
|
|
10885
|
+
function Cl(t) {
|
|
10874
10886
|
if (!t) return 0;
|
|
10875
10887
|
const e = t.querySelector(".flight-card__stop-count"), n = String((e == null ? void 0 : e.textContent) || "").toLowerCase();
|
|
10876
10888
|
if (!n || n.includes("non-stop")) return 0;
|
|
@@ -10881,14 +10893,14 @@ function vl(t) {
|
|
|
10881
10893
|
}
|
|
10882
10894
|
return 0;
|
|
10883
10895
|
}
|
|
10884
|
-
function
|
|
10896
|
+
function kl(t) {
|
|
10885
10897
|
var r;
|
|
10886
10898
|
if ((Array.isArray((r = t == null ? void 0 : t.meta) == null ? void 0 : r.missingFields) ? t.meta.missingFields : []).includes("ad")) return !0;
|
|
10887
10899
|
const n = String((t == null ? void 0 : t.text) || "").toLowerCase();
|
|
10888
10900
|
return /\breturn date\b|\breturning\b|\bcoming back\b/.test(n);
|
|
10889
10901
|
}
|
|
10890
|
-
function
|
|
10891
|
-
const e =
|
|
10902
|
+
function Tl(t = []) {
|
|
10903
|
+
const e = xl(t), n = e >= 0 ? t.slice(e) : t, r = {
|
|
10892
10904
|
onwardDate: null,
|
|
10893
10905
|
returnDate: null,
|
|
10894
10906
|
awaitingField: ""
|
|
@@ -10929,7 +10941,7 @@ function Al(t = []) {
|
|
|
10929
10941
|
returnDate: r.returnDate
|
|
10930
10942
|
};
|
|
10931
10943
|
}
|
|
10932
|
-
function
|
|
10944
|
+
function xl(t = []) {
|
|
10933
10945
|
for (let e = t.length - 1; e >= 0; e -= 1) {
|
|
10934
10946
|
const n = t[e];
|
|
10935
10947
|
if ((n == null ? void 0 : n.type) !== "user_message") continue;
|
|
@@ -10972,10 +10984,10 @@ function Zn(t) {
|
|
|
10972
10984
|
return t;
|
|
10973
10985
|
}
|
|
10974
10986
|
}
|
|
10975
|
-
function
|
|
10976
|
-
return /* @__PURE__ */ a(Fi.Provider, { value: t, children: /* @__PURE__ */ a(
|
|
10987
|
+
function ql({ socket: t }) {
|
|
10988
|
+
return /* @__PURE__ */ a(Fi.Provider, { value: t, children: /* @__PURE__ */ a(Ro, {}) });
|
|
10977
10989
|
}
|
|
10978
|
-
function
|
|
10990
|
+
function Dl({
|
|
10979
10991
|
adt: t = 1,
|
|
10980
10992
|
chd: e = 0,
|
|
10981
10993
|
inf: n = 0,
|
|
@@ -11038,7 +11050,7 @@ function kl({
|
|
|
11038
11050
|
});
|
|
11039
11051
|
return i;
|
|
11040
11052
|
}
|
|
11041
|
-
function
|
|
11053
|
+
function Zl(t) {
|
|
11042
11054
|
const e = (t == null ? void 0 : t.payload) || t || {}, n = (e == null ? void 0 : e.trps) || {}, r = (n == null ? void 0 : n.pr) || {}, i = String((e == null ? void 0 : e.ps) || "").toUpperCase() === "Y" || String((e == null ? void 0 : e.sectyp) || "").toLowerCase() === "int";
|
|
11043
11055
|
return {
|
|
11044
11056
|
ukey: (e == null ? void 0 : e.ukey) || "",
|
|
@@ -11054,7 +11066,7 @@ function Vl(t) {
|
|
|
11054
11066
|
rmkey: (r == null ? void 0 : r.rmkey) || "",
|
|
11055
11067
|
chnl: "B2C",
|
|
11056
11068
|
passportRequired: i,
|
|
11057
|
-
trvlrs:
|
|
11069
|
+
trvlrs: Dl({
|
|
11058
11070
|
adt: e == null ? void 0 : e.adt,
|
|
11059
11071
|
chd: e == null ? void 0 : e.chd,
|
|
11060
11072
|
inf: e == null ? void 0 : e.inf,
|
|
@@ -11062,13 +11074,21 @@ function Vl(t) {
|
|
|
11062
11074
|
})
|
|
11063
11075
|
};
|
|
11064
11076
|
}
|
|
11077
|
+
function Jl(t = {}) {
|
|
11078
|
+
return Cs(Zi(), {
|
|
11079
|
+
transports: ["websocket"],
|
|
11080
|
+
...t
|
|
11081
|
+
});
|
|
11082
|
+
}
|
|
11065
11083
|
export {
|
|
11066
|
-
|
|
11067
|
-
|
|
11084
|
+
ql as AIChatAgent,
|
|
11085
|
+
Ro as ChatWindow,
|
|
11068
11086
|
Fi as SocketContext,
|
|
11069
|
-
|
|
11087
|
+
Zl as buildPrebookPayloadFromAvailability,
|
|
11070
11088
|
bn as convertDateToDDMMYYYY,
|
|
11071
|
-
|
|
11089
|
+
Jl as createDefaultSocket,
|
|
11090
|
+
ql as default,
|
|
11091
|
+
Zi as getApiBaseUrl,
|
|
11072
11092
|
Ei as useSocket
|
|
11073
11093
|
};
|
|
11074
11094
|
//# sourceMappingURL=index.js.map
|