@odynn/awayz-core 0.5.0 → 0.5.2

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.
@@ -1,237 +1,97 @@
1
- import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
- import { h as b } from "../../../arrayExtensions-DlcBOj5a.js";
3
- import { E as I } from "../../../DateFormats-DZD30Nea.js";
4
- import { a as x } from "../../../keys-DcSEucOc.js";
5
- import { createContext as B, useContext as G, useCallback as W, useState as Y, useRef as A, useEffect as F } from "react";
6
- import { a as $ } from "../../../index-agnspg2e.js";
7
- import q from "../../Menu/Menu.js";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { h as t } from "../../../arrayExtensions-DlcBOj5a.js";
3
+ import { E as o } from "../../../DateFormats-DZD30Nea.js";
4
+ import { a as r } from "../../../keys-DcSEucOc.js";
5
+ import "react";
6
+ import { useTranslation as D } from "react-i18next";
7
+ import { F as E } from "../../../index-CDh8vAM_.js";
8
+ import M from "../../Menu/Menu.js";
8
9
  import '../../../assets/_styles4.css';/* empty css */
9
- const K = (e, t, s, i) => {
10
- var n, d, p, N;
11
- const r = [s, {
12
- code: t,
13
- ...i || {}
14
- }];
15
- if ((d = (n = e == null ? void 0 : e.services) == null ? void 0 : n.logger) != null && d.forward)
16
- return e.services.logger.forward(r, "warn", "react-i18next::", !0);
17
- E(r[0]) && (r[0] = `react-i18next:: ${r[0]}`), (N = (p = e == null ? void 0 : e.services) == null ? void 0 : p.logger) != null && N.warn ? e.services.logger.warn(...r) : console != null && console.warn && console.warn(...r);
18
- }, U = {}, M = (e, t, s, i) => {
19
- E(s) && U[s] || (E(s) && (U[s] = /* @__PURE__ */ new Date()), K(e, t, s, i));
20
- }, j = (e, t) => () => {
21
- if (e.isInitialized)
22
- t();
23
- else {
24
- const s = () => {
25
- setTimeout(() => {
26
- e.off("initialized", s);
27
- }, 0), t();
28
- };
29
- e.on("initialized", s);
30
- }
31
- }, D = (e, t, s) => {
32
- e.loadNamespaces(t, j(e, s));
33
- }, z = (e, t, s, i) => {
34
- if (E(s) && (s = [s]), e.options.preload && e.options.preload.indexOf(t) > -1) return D(e, s, i);
35
- s.forEach((r) => {
36
- e.options.ns.indexOf(r) < 0 && e.options.ns.push(r);
37
- }), e.loadLanguages(t, j(e, i));
38
- }, J = (e, t, s = {}) => !t.languages || !t.languages.length ? (M(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
39
- languages: t.languages
40
- }), !0) : t.hasLoadedNamespace(e, {
41
- lng: s.lng,
42
- precheck: (i, r) => {
43
- if (s.bindI18n && s.bindI18n.indexOf("languageChanging") > -1 && i.services.backendConnector.backend && i.isLanguageChangingTo && !r(i.isLanguageChangingTo, e)) return !1;
44
- }
45
- }), E = (e) => typeof e == "string", X = (e) => typeof e == "object" && e !== null, Q = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Z = {
46
- "&amp;": "&",
47
- "&#38;": "&",
48
- "&lt;": "<",
49
- "&#60;": "<",
50
- "&gt;": ">",
51
- "&#62;": ">",
52
- "&apos;": "'",
53
- "&#39;": "'",
54
- "&quot;": '"',
55
- "&#34;": '"',
56
- "&nbsp;": " ",
57
- "&#160;": " ",
58
- "&copy;": "©",
59
- "&#169;": "©",
60
- "&reg;": "®",
61
- "&#174;": "®",
62
- "&hellip;": "…",
63
- "&#8230;": "…",
64
- "&#x2F;": "/",
65
- "&#47;": "/"
66
- }, V = (e) => Z[e], ee = (e) => e.replace(Q, V);
67
- let te = {
68
- bindI18n: "languageChanged",
69
- bindI18nStore: "",
70
- transEmptyNodeValue: "",
71
- transSupportBasicHtmlNodes: !0,
72
- transWrapTextNodes: "",
73
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
74
- useSuspense: !0,
75
- unescape: ee
76
- };
77
- const se = () => te;
78
- let ne;
79
- const ae = () => ne, ie = B();
80
- class oe {
81
- constructor() {
82
- this.usedNamespaces = {};
83
- }
84
- addUsedNamespaces(t) {
85
- t.forEach((s) => {
86
- this.usedNamespaces[s] || (this.usedNamespaces[s] = !0);
87
- });
88
- }
89
- getUsedNamespaces() {
90
- return Object.keys(this.usedNamespaces);
91
- }
92
- }
93
- const re = (e, t) => {
94
- const s = A();
95
- return F(() => {
96
- s.current = e;
97
- }, [e, t]), s.current;
98
- }, H = (e, t, s, i) => e.getFixedT(t, s, i), ce = (e, t, s, i) => W(H(e, t, s, i), [e, t, s, i]), le = (e, t = {}) => {
99
- var R, k, L, O;
100
- const {
101
- i18n: s
102
- } = t, {
103
- i18n: i,
104
- defaultNS: r
105
- } = G(ie) || {}, n = s || i || ae();
106
- if (n && !n.reportNamespaces && (n.reportNamespaces = new oe()), !n) {
107
- M(n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
108
- const l = (g, h) => E(h) ? h : X(h) && E(h.defaultValue) ? h.defaultValue : Array.isArray(g) ? g[g.length - 1] : g, f = [l, {}, !1];
109
- return f.t = l, f.i18n = {}, f.ready = !1, f;
110
- }
111
- (R = n.options.react) != null && R.wait && M(n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
112
- const d = {
113
- ...se(),
114
- ...n.options.react,
115
- ...t
116
- }, {
117
- useSuspense: p,
118
- keyPrefix: N
119
- } = d;
120
- let o = r || ((k = n.options) == null ? void 0 : k.defaultNS);
121
- o = E(o) ? [o] : o || ["translation"], (O = (L = n.reportNamespaces).addUsedNamespaces) == null || O.call(L, o);
122
- const m = (n.isInitialized || n.initializedStoreOnce) && o.every((l) => J(l, n, d)), S = ce(n, t.lng || null, d.nsMode === "fallback" ? o : o[0], N), u = () => S, C = () => H(n, t.lng || null, d.nsMode === "fallback" ? o : o[0], N), [_, T] = Y(u);
123
- let y = o.join();
124
- t.lng && (y = `${t.lng}${y}`);
125
- const P = re(y), v = A(!0);
126
- F(() => {
127
- const {
128
- bindI18n: l,
129
- bindI18nStore: f
130
- } = d;
131
- v.current = !0, !m && !p && (t.lng ? z(n, t.lng, o, () => {
132
- v.current && T(C);
133
- }) : D(n, o, () => {
134
- v.current && T(C);
135
- })), m && P && P !== y && v.current && T(C);
136
- const g = () => {
137
- v.current && T(C);
138
- };
139
- return l && (n == null || n.on(l, g)), f && (n == null || n.store.on(f, g)), () => {
140
- v.current = !1, n && l && (l == null || l.split(" ").forEach((h) => n.off(h, g))), f && n && f.split(" ").forEach((h) => n.store.off(h, g));
141
- };
142
- }, [n, y]), F(() => {
143
- v.current && m && T(u);
144
- }, [n, N, m]);
145
- const w = [_, n, m];
146
- if (w.t = _, w.i18n = n, w.ready = m, m || !m && !p) return w;
147
- throw new Promise((l) => {
148
- t.lng ? z(n, t.lng, o, () => l()) : D(n, o, () => l());
149
- });
150
- }, ve = ({
151
- airlines: e,
152
- departure: t,
153
- arrival: s,
154
- bookingRef: i,
155
- flightClass: r,
156
- numberOfPassengers: n,
10
+ const b = ({
11
+ airlines: s,
12
+ departure: c,
13
+ arrival: l,
14
+ bookingRef: v,
15
+ flightClass: N,
16
+ numberOfPassengers: g,
157
17
  cancelledAt: d,
158
- hasAirlineChanges: p,
159
- onClick: N,
160
- contextOptions: o = []
18
+ hasAirlineChanges: m,
19
+ onClick: f,
20
+ contextOptions: h = []
161
21
  }) => {
162
- var S;
163
- const { t: m } = le();
164
- return /* @__PURE__ */ a("div", { className: "selected-flight-card", onClick: N, children: /* @__PURE__ */ c("div", { className: "content", children: [
165
- /* @__PURE__ */ c("div", { className: "top-section", children: [
166
- /* @__PURE__ */ c("div", { className: "header", children: [
167
- /* @__PURE__ */ a("div", { children: e == null ? void 0 : e.map((u) => /* @__PURE__ */ c("div", { className: "airline-logo tip", children: [
168
- /* @__PURE__ */ a("img", { src: u.logo, alt: u.name }),
169
- /* @__PURE__ */ a("span", { className: "right", children: u.name })
170
- ] }, u.name)) }),
171
- o.length > 0 && /* @__PURE__ */ a(
22
+ var p;
23
+ const { t: n } = D();
24
+ return /* @__PURE__ */ e("div", { className: "selected-flight-card", onClick: f, children: /* @__PURE__ */ i("div", { className: "content", children: [
25
+ /* @__PURE__ */ i("div", { className: "top-section", children: [
26
+ /* @__PURE__ */ i("div", { className: "header", children: [
27
+ /* @__PURE__ */ e("div", { children: s == null ? void 0 : s.map((a) => /* @__PURE__ */ i("div", { className: "airline-logo tip", children: [
28
+ /* @__PURE__ */ e("img", { src: a.logo, alt: a.name }),
29
+ /* @__PURE__ */ e("span", { className: "right", children: a.name })
30
+ ] }, a.name)) }),
31
+ h.length > 0 && /* @__PURE__ */ e(
172
32
  "div",
173
33
  {
174
- onClick: (u) => {
175
- u.stopPropagation();
34
+ onClick: (a) => {
35
+ a.stopPropagation();
176
36
  },
177
- children: /* @__PURE__ */ a(q, { options: o })
37
+ children: /* @__PURE__ */ e(M, { options: h })
178
38
  }
179
39
  )
180
40
  ] }),
181
- /* @__PURE__ */ c("div", { className: "flight", children: [
182
- /* @__PURE__ */ a("p", { className: "departure-title", children: t.airportCode }),
183
- /* @__PURE__ */ a($, {}),
184
- /* @__PURE__ */ a("p", { className: "arrival-title", children: s.airportCode }),
185
- /* @__PURE__ */ a("span", { className: "flight-trail" })
41
+ /* @__PURE__ */ i("div", { className: "flight", children: [
42
+ /* @__PURE__ */ e("p", { className: "departure-title", children: c.airportCode }),
43
+ /* @__PURE__ */ e(E, {}),
44
+ /* @__PURE__ */ e("p", { className: "arrival-title", children: l.airportCode }),
45
+ /* @__PURE__ */ e("span", { className: "flight-trail" })
186
46
  ] }),
187
- /* @__PURE__ */ c("div", { className: "flight-details", children: [
188
- /* @__PURE__ */ c("div", { className: "destination", children: [
189
- /* @__PURE__ */ a("span", { children: t.location }),
190
- /* @__PURE__ */ a("span", { children: s.location })
47
+ /* @__PURE__ */ i("div", { className: "flight-details", children: [
48
+ /* @__PURE__ */ i("div", { className: "destination", children: [
49
+ /* @__PURE__ */ e("span", { children: c.location }),
50
+ /* @__PURE__ */ e("span", { children: l.location })
191
51
  ] }),
192
- /* @__PURE__ */ c("div", { className: "time", children: [
193
- /* @__PURE__ */ a("p", { children: b(t.dateTime).format(
194
- m(x.DATE_TIME_MEDIUM, I.FlightShortDate)
52
+ /* @__PURE__ */ i("div", { className: "time", children: [
53
+ /* @__PURE__ */ e("p", { children: t(c.dateTime).format(
54
+ n(r.DATE_TIME_MEDIUM, o.FlightShortDate)
195
55
  ) }),
196
- /* @__PURE__ */ a("p", { children: b(s.dateTime).format(
197
- m(x.DATE_TIME_MEDIUM, I.FlightShortDate)
56
+ /* @__PURE__ */ e("p", { children: t(l.dateTime).format(
57
+ n(r.DATE_TIME_MEDIUM, o.FlightShortDate)
198
58
  ) })
199
59
  ] })
200
60
  ] })
201
61
  ] }),
202
- /* @__PURE__ */ a("div", { className: "mid-section", children: /* @__PURE__ */ a("div", { className: "dashes" }) }),
203
- /* @__PURE__ */ c("div", { className: "bottom-section", children: [
204
- (d || p) && /* @__PURE__ */ c("div", { className: "notices", children: [
205
- d && /* @__PURE__ */ a("div", { className: "cancelled-notice", children: /* @__PURE__ */ c("p", { children: [
62
+ /* @__PURE__ */ e("div", { className: "mid-section", children: /* @__PURE__ */ e("div", { className: "dashes" }) }),
63
+ /* @__PURE__ */ i("div", { className: "bottom-section", children: [
64
+ (d || m) && /* @__PURE__ */ i("div", { className: "notices", children: [
65
+ d && /* @__PURE__ */ e("div", { className: "cancelled-notice", children: /* @__PURE__ */ i("p", { children: [
206
66
  "Cancelled:",
207
67
  " ",
208
- (S = b(d)) == null ? void 0 : S.format(
209
- m(
210
- x.DISPLAY_MEDIUM_WITH_YEAR,
211
- I.USStringDateFormat
68
+ (p = t(d)) == null ? void 0 : p.format(
69
+ n(
70
+ r.DISPLAY_MEDIUM_WITH_YEAR,
71
+ o.USStringDateFormat
212
72
  )
213
73
  )
214
74
  ] }) }),
215
- p && /* @__PURE__ */ a("div", { className: "cancelled-notice", children: /* @__PURE__ */ a("p", { children: "Changes Pending Review" }) })
75
+ m && /* @__PURE__ */ e("div", { className: "cancelled-notice", children: /* @__PURE__ */ e("p", { children: "Changes Pending Review" }) })
216
76
  ] }),
217
- /* @__PURE__ */ c("div", { className: "bottom-header", children: [
218
- /* @__PURE__ */ a("p", { children: "Booking Confirmation" }),
77
+ /* @__PURE__ */ i("div", { className: "bottom-header", children: [
78
+ /* @__PURE__ */ e("p", { children: "Booking Confirmation" }),
219
79
  " ",
220
- /* @__PURE__ */ a("div", { className: "id-and-icon", children: /* @__PURE__ */ a("span", { children: i }) })
80
+ /* @__PURE__ */ e("div", { className: "id-and-icon", children: /* @__PURE__ */ e("span", { children: v }) })
221
81
  ] }),
222
- /* @__PURE__ */ c("div", { className: "bottom-section-details", children: [
223
- /* @__PURE__ */ c("div", { children: [
224
- /* @__PURE__ */ a("p", { children: "Class" }),
225
- /* @__PURE__ */ a("span", { children: r })
82
+ /* @__PURE__ */ i("div", { className: "bottom-section-details", children: [
83
+ /* @__PURE__ */ i("div", { children: [
84
+ /* @__PURE__ */ e("p", { children: "Class" }),
85
+ /* @__PURE__ */ e("span", { children: N })
226
86
  ] }),
227
- /* @__PURE__ */ c("div", { children: [
228
- /* @__PURE__ */ a("p", { children: "Passengers" }),
229
- /* @__PURE__ */ a("span", { children: n })
87
+ /* @__PURE__ */ i("div", { children: [
88
+ /* @__PURE__ */ e("p", { children: "Passengers" }),
89
+ /* @__PURE__ */ e("span", { children: g })
230
90
  ] })
231
91
  ] })
232
92
  ] })
233
93
  ] }) });
234
94
  };
235
95
  export {
236
- ve as FlightBooking
96
+ b as FlightBooking
237
97
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as e, jsx as i } from "react/jsx-runtime";
2
- import { G as g } from "../../../index-agnspg2e.js";
2
+ import { G as g } from "../../../index-CDh8vAM_.js";
3
3
  import { h as k } from "../../../arrayExtensions-DlcBOj5a.js";
4
4
  import { E as N } from "../../../DateFormats-DZD30Nea.js";
5
5
  import "react";