@konnectio/core 4.0.56-rc23 → 4.0.56-rc25

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.
Files changed (44) hide show
  1. package/dist/{ActionField-BUeonTqc.js → ActionField-7P8dDME0.js} +10 -10
  2. package/dist/ActionField-7P8dDME0.js.br +0 -0
  3. package/dist/{DateField.vue_vue_type_style_index_0_lang-Ts9271hZ.js → AvailabilitySkeleton-kd2z0IL5.js} +1376 -1324
  4. package/dist/AvailabilitySkeleton-kd2z0IL5.js.br +0 -0
  5. package/dist/{CheckoutWindow-sws5X9v2.js → CheckoutWindow-Cru3v8It.js} +26 -26
  6. package/dist/CheckoutWindow-Cru3v8It.js.br +0 -0
  7. package/dist/{ErrorMessage-GzJ2T5_d.js → ErrorMessage-5TxZYuTj.js} +1 -1
  8. package/dist/ErrorMessage-5TxZYuTj.js.br +0 -0
  9. package/dist/EventAvailabilityForm--XuKLthM.js +325 -0
  10. package/dist/EventAvailabilityForm--XuKLthM.js.br +0 -0
  11. package/dist/{_-hKpeUU4C.js → Field-pY1XGbPQ.js} +13128 -12492
  12. package/dist/Field-pY1XGbPQ.js.br +0 -0
  13. package/dist/HotelAvailabilityForm-hWTsZCGI.js +164 -0
  14. package/dist/HotelAvailabilityForm-hWTsZCGI.js.br +0 -0
  15. package/dist/availability.js +22 -21
  16. package/dist/availability.js.br +0 -0
  17. package/dist/event.js +578 -304
  18. package/dist/event.js.br +0 -0
  19. package/dist/gift-card-validation.js +41 -42
  20. package/dist/gift-card-validation.js.br +0 -0
  21. package/dist/gift-card.js +69 -70
  22. package/dist/gift-card.js.br +0 -0
  23. package/dist/hotel.js +1081 -2224
  24. package/dist/hotel.js.br +0 -0
  25. package/dist/masonry.plugin-MNkmNEdZ.js +12726 -0
  26. package/dist/masonry.plugin-MNkmNEdZ.js.br +0 -0
  27. package/dist/polyfill.js +3014 -2962
  28. package/dist/polyfill.js.br +0 -0
  29. package/dist/style.css +1 -1
  30. package/dist/style.css.br +0 -0
  31. package/package.json +8 -8
  32. package/dist/ActionField-BUeonTqc.js.br +0 -9
  33. package/dist/AvailabilitySkeleton-gympaD6B.js +0 -217
  34. package/dist/AvailabilitySkeleton-gympaD6B.js.br +0 -0
  35. package/dist/CheckoutWindow-sws5X9v2.js.br +0 -0
  36. package/dist/DateField.vue_vue_type_style_index_0_lang-Ts9271hZ.js.br +0 -0
  37. package/dist/ErrorMessage-GzJ2T5_d.js.br +0 -0
  38. package/dist/EventAvailabilityForm-c0u7rObv.js +0 -367
  39. package/dist/EventAvailabilityForm-c0u7rObv.js.br +0 -0
  40. package/dist/Field-hjOjPQhC.js +0 -41
  41. package/dist/Field-hjOjPQhC.js.br +0 -0
  42. package/dist/ThankYou-d129mmKn.js +0 -11549
  43. package/dist/ThankYou-d129mmKn.js.br +0 -0
  44. package/dist/_-hKpeUU4C.js.br +0 -0
package/dist/style.css.br CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konnectio/core",
3
- "version": "4.0.56-rc23",
3
+ "version": "4.0.56-rc25",
4
4
  "author": "Konnectio <info@freshcase.dk> (https://konnectio.dk)",
5
5
  "homepage": "https://konnectio.dk",
6
6
  "description": "Konnectio Core Frontend Integration.",
@@ -50,7 +50,7 @@
50
50
  "@vueup/vue-quill": "1.2.0",
51
51
  "@vueuse/core": "10.7.2",
52
52
  "axios": "1.6.7",
53
- "core-js": "3.35.1",
53
+ "core-js": "3.36.0",
54
54
  "cqfill": "0.6.1",
55
55
  "floating-vue": "5.2.2",
56
56
  "linkify-html": "4.1.3",
@@ -61,7 +61,7 @@
61
61
  "recaptcha-v3": "1.10.0",
62
62
  "regenerator-runtime": "0.14.1",
63
63
  "text-clipper": "2.2.0",
64
- "vue": "^3.3.10",
64
+ "vue": "3.4.19",
65
65
  "vue-gtag": "2.0.1",
66
66
  "vue-i18n": "9.9.1",
67
67
  "vue-inner-image-zoom": "2.0.0",
@@ -75,9 +75,9 @@
75
75
  "devDependencies": {
76
76
  "@babel/eslint-parser": "7.23.10",
77
77
  "@originjs/vite-plugin-commonjs": "1.0.3",
78
- "@types/node": "20.11.17",
79
- "@typescript-eslint/eslint-plugin": "6.21.0",
80
- "@typescript-eslint/parser": "6.21.0",
78
+ "@types/node": "20.11.19",
79
+ "@typescript-eslint/eslint-plugin": "7.0.1",
80
+ "@typescript-eslint/parser": "7.0.1",
81
81
  "@vitejs/plugin-vue": "5.0.4",
82
82
  "@vue/eslint-config-typescript": "12.0.0",
83
83
  "@vue/test-utils": "2.4.4",
@@ -86,11 +86,11 @@
86
86
  "eslint": "8.56.0",
87
87
  "eslint-plugin-vue": "9.21.1",
88
88
  "rollup-plugin-typescript2": "0.36.0",
89
- "sass": "1.70.0",
89
+ "sass": "1.71.0",
90
90
  "ts-node": "10.9.2",
91
91
  "tslib": "2.6.2",
92
92
  "typescript": "5.3.3",
93
- "vite": "5.1.1",
93
+ "vite": "5.1.3",
94
94
  "vite-plugin-compression": "0.5.1",
95
95
  "vue-tsc": "1.8.27"
96
96
  },
@@ -1,9 +0,0 @@
1
- � ��1��/^�],����/Yh[=M5�oA-���&��$�Y ��O(x�Y� Z
2
- ^by��3
3
- _:Bɝ�JW� �k�b"_EW�c]o!�]C0tdz*��T�J�����V��+J^�Wk����
4
- �1�)hf�&�� � x-ET�k��7'8�V��F�V�7l�2�)a(V$<{&t5�(8����EJ��[��NN��
5
- ���Z��e-n;8e$�Z7$��@T3qtq!+������ �3Y��Ԧ���k+$��C�;�Ֆ�®��@cC_�����S=�֖\
6
- tK5���l��tjk6�O�~C׆�����b9� �YС̢a*n��M�B�2�NU.0��:��U<�\8g����=~��v(ߠ�� E +9%ՖԐՔ��VJ��1[q��l�lE�i�tҗ* To��9{]�zM�<*�Ԣ$���-c��ta�h��?U��i���ǽ�m��
7
- �w鰯N9j2��Vۿ�e�b1UüGDL��VuM�ڴ4�ϧ�F��S
8
- %(EսJ��3k[xÂ:��2������c����~�W�F���|�<ڻ��c��&d�k!<8h���r�%�
9
- ����Q#�����cҒ�s�I �7�?S[iF9S��9�03�u��t���CK5�j|�J���d�+�9��R�����d�&�$
@@ -1,217 +0,0 @@
1
- import { d as T, j as W, a7 as X, D as A, a8 as F, a9 as R, G as Y, k as Z, c as v, H as B, l as ee, o as t, h as s, b as w, u as e, f as i, J as k, _ as ae, i as f, F as H, a as D, T as E, e as I, C as N, n as S, m as le, a3 as te, g as j, E as O } from "./_-hKpeUU4C.js";
2
- import { _ as ie } from "./DateField.vue_vue_type_style_index_0_lang-Ts9271hZ.js";
3
- import { F as p } from "./Field-hjOjPQhC.js";
4
- const ne = {
5
- key: 0,
6
- class: "konnectio-availability-location"
7
- }, oe = { id: "fresh-booking-availability-date-selection" }, se = {
8
- key: 1,
9
- id: "fresh-booking-availability-guest-selection"
10
- }, de = { id: "fresh-booking-availability-confirmation" }, ce = /* @__PURE__ */ T({
11
- __name: "HotelAvailabilityForm",
12
- props: {
13
- booking: { type: Boolean, default: !1 },
14
- link: {}
15
- },
16
- setup(x) {
17
- const { t: a } = W(), L = X("emitter"), d = x, {
18
- adults: c,
19
- children: r,
20
- arrivalDate: b,
21
- departureDate: y,
22
- location: _,
23
- isExpired: z
24
- } = A(F()), { reset: M } = F(), { fetchAvailabilityData: q } = R(), { areListingsLoading: U, hotelList: G, hasHotelList: h } = A(R()), {
25
- firstSelectableDateOffset: $,
26
- lastSelectableDateOffset: C,
27
- disableChildSelection: m,
28
- disableAdultSelection: u
29
- } = A(Y()), g = Z([]), J = v(() => new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + ($.value - 1))));
30
- v(() => new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + C.value))), v(() => new Date((/* @__PURE__ */ new Date()).setDate(b.value.getDate() + $.value)));
31
- const K = v(() => new Date((/* @__PURE__ */ new Date()).setDate(b.value.getDate() + (C.value + 1)))), V = v(() => !(!u && c.value === 0)), P = v(() => typeof d.link != "string");
32
- function Q() {
33
- if (d.booking === !1)
34
- if (P.value) {
35
- const n = te();
36
- d.link[n] ? window.location.replace(d.link[n]) : d.link.en ? window.location.replace(d.link.en) : console.log("Sprog understøttes ikke");
37
- } else
38
- window.location.replace(d.link);
39
- else
40
- V.value && q();
41
- }
42
- return B(b, (n) => {
43
- const l = new Date(new Date(n).setDate(new Date(n).getDate() + 1));
44
- new Date(y.value) < l && (y.value = l);
45
- }), L.on("forcedDateChange", () => {
46
- g.value = [b.value, y.value];
47
- }), B(g, (n) => {
48
- b.value = n[0], y.value = n[1];
49
- }), ee(() => {
50
- z.value && M(), g.value = [b.value, y.value];
51
- }), (n, l) => (t(), s("form", {
52
- id: "konnectio-availability-form",
53
- class: S({ reservation: n.booking }),
54
- type: "availability",
55
- onSubmit: le(Q, ["prevent"])
56
- }, [
57
- w("ul", {
58
- id: "konnectio-availability-form-content",
59
- class: S([
60
- { "is-booking-page": n.booking },
61
- { "only-adult-guests": !e(u) && e(m) },
62
- { "only-child-guests": !e(m) && e(u) },
63
- { "no-guests": e(u) && e(m) },
64
- { "all-guests": !e(u) && !e(m) },
65
- { "has-location": e(h) }
66
- ])
67
- }, [
68
- e(h) ? (t(), s("li", ne, [
69
- i(ae, {
70
- modelValue: e(_),
71
- "onUpdate:modelValue": l[0] || (l[0] = (o) => k(_) ? _.value = o : null),
72
- label: e(a)("general.location"),
73
- icon: "location-dot",
74
- "icon-type": "fas",
75
- "icon-placement": "label",
76
- options: e(G),
77
- searchable: !1
78
- }, null, 8, ["modelValue", "label", "options"])
79
- ])) : f("", !0),
80
- w("li", oe, [
81
- i(ie, {
82
- modelValue: g.value,
83
- "onUpdate:modelValue": l[1] || (l[1] = (o) => g.value = o),
84
- label: e(a)("availability.checkInOut"),
85
- "icon-type": "fas",
86
- "icon-placement": "label",
87
- "min-range": 1,
88
- "min-date": J.value,
89
- "max-date": K.value,
90
- range: ""
91
- }, null, 8, ["modelValue", "label", "min-date", "max-date"]),
92
- f("", !0)
93
- ]),
94
- !e(u) || !e(m) ? (t(), s("li", se, [
95
- e(u) ? f("", !0) : (t(), s(H, { key: 0 }, [
96
- e(h) ? (t(), D(E, {
97
- key: 0,
98
- modelValue: e(c),
99
- "onUpdate:modelValue": l[4] || (l[4] = (o) => k(c) ? c.value = o : null),
100
- label: e(a)("availability.adults"),
101
- description: e(a)("general.adultAgeRange"),
102
- "icon-type": "fas",
103
- "icon-placement": "label",
104
- name: "adults",
105
- icon: "male"
106
- }, null, 8, ["modelValue", "label", "description"])) : (t(), D(I, {
107
- key: 1,
108
- modelValue: e(c),
109
- "onUpdate:modelValue": l[5] || (l[5] = (o) => k(c) ? c.value = o : null),
110
- label: e(a)("availability.adults"),
111
- description: e(a)("general.adultAgeRange"),
112
- "icon-type": "fas",
113
- "icon-placement": "label",
114
- name: "adults",
115
- icon: "male"
116
- }, null, 8, ["modelValue", "label", "description"]))
117
- ], 64)),
118
- e(m) ? f("", !0) : (t(), s(H, { key: 1 }, [
119
- e(h) ? (t(), D(E, {
120
- key: 0,
121
- modelValue: e(r),
122
- "onUpdate:modelValue": l[6] || (l[6] = (o) => k(r) ? r.value = o : null),
123
- label: e(a)("availability.children"),
124
- description: e(a)("general.childAgeRange"),
125
- "icon-type": "fas",
126
- "icon-placement": "label",
127
- name: "children",
128
- icon: "child"
129
- }, null, 8, ["modelValue", "label", "description"])) : (t(), D(I, {
130
- key: 1,
131
- modelValue: e(r),
132
- "onUpdate:modelValue": l[7] || (l[7] = (o) => k(r) ? r.value = o : null),
133
- label: e(a)("availability.children"),
134
- description: e(a)("general.childAgeRange"),
135
- "icon-type": "fas",
136
- "icon-placement": "label",
137
- name: "children",
138
- icon: "child"
139
- }, null, 8, ["modelValue", "label", "description"]))
140
- ], 64))
141
- ])) : f("", !0),
142
- w("li", de, [
143
- i(N, {
144
- class: "konnectio-availability-submit-small",
145
- type: "submit",
146
- icon: "search",
147
- "icon-type": "fas",
148
- disabled: !V.value,
149
- "is-loading": e(U)
150
- }, null, 8, ["disabled", "is-loading"]),
151
- i(N, {
152
- class: "konnectio-availability-submit-large",
153
- type: "submit",
154
- label: e(a)("availability.buttonLabel"),
155
- disabled: !V.value,
156
- "is-loading": e(U)
157
- }, null, 8, ["label", "disabled", "is-loading"])
158
- ])
159
- ], 2)
160
- ], 34));
161
- }
162
- }), ge = /* @__PURE__ */ j(ce, [["__scopeId", "data-v-25343459"]]), ue = { class: "availability-skeleton" }, re = {
163
- key: 0,
164
- class: "availability-skeleton-navigation"
165
- }, be = { class: "availability-skeleton-content" }, me = {
166
- key: 1,
167
- class: "availability-skeleton-event"
168
- }, ve = /* @__PURE__ */ T({
169
- __name: "AvailabilitySkeleton",
170
- props: {
171
- view: { default: "hotel" },
172
- hotel: { type: Boolean, default: !1 }
173
- },
174
- setup(x) {
175
- return (a, L) => (t(), s("div", ue, [
176
- a.view === "both" ? (t(), s("div", re, [
177
- i(O, {
178
- height: "28px",
179
- width: "60px",
180
- "border-radius": "20px"
181
- }),
182
- i(O, {
183
- height: "28px",
184
- width: "60px",
185
- "border-radius": "20px"
186
- })
187
- ])) : f("", !0),
188
- w("div", be, [
189
- a.view !== "event" ? (t(), s("div", {
190
- key: 0,
191
- class: S([
192
- "availability-skeleton-hotel",
193
- { "within-hotel": a.hotel }
194
- ])
195
- }, [
196
- i(p, { "with-icon": "" }),
197
- i(p, { "with-icon": "" }),
198
- i(p, { "with-icon": "" }),
199
- i(p, {
200
- "with-icon": "",
201
- "no-label": ""
202
- })
203
- ], 2)) : (t(), s("div", me, [
204
- i(p, { "with-icon": "" }),
205
- i(p, {
206
- "with-icon": "",
207
- "no-label": ""
208
- })
209
- ]))
210
- ])
211
- ]));
212
- }
213
- }), ke = /* @__PURE__ */ j(ve, [["__scopeId", "data-v-17762b9b"]]);
214
- export {
215
- ke as A,
216
- ge as H
217
- };
Binary file
Binary file
@@ -1,367 +0,0 @@
1
- import { W as Ke, X as qe, D as j, Y as xe, Z as je, G as re, k as s, $ as v, a0 as K, c as a, O as se, a1 as q, a2 as Je, a3 as $, a4 as E, a5 as A, d as ue, o as ce, h as Qe, a6 as We, m as ve, j as Xe, a as Ye, w as Ze, f as ie, u as x, J as He, b as et, C as tt, g as at } from "./_-hKpeUU4C.js";
2
- import { _ as nt } from "./DateField.vue_vue_type_style_index_0_lang-Ts9271hZ.js";
3
- const ot = Ke("event", () => {
4
- const T = qe(), { voucher: f } = j(xe()), { display: c } = je(), { bearerToken: g, metaData: I } = j(re()), d = s({}), t = s(void 0), o = s(!0), i = s(v.InitialState), J = s(/* @__PURE__ */ new Date()), N = s(NaN), F = s(1), S = s(NaN), Q = s(NaN), C = s(""), R = K("konnectio_name", "", void 0, { serializer: q.string }), L = K("konnectio_phone", "", void 0, { serializer: q.string }), O = K("konnectio_email", "", void 0, { serializer: q.string }), W = s(""), w = s({}), y = s({}), V = s("");
5
- function l(e) {
6
- return e.templateID !== void 0;
7
- }
8
- const de = "DKK", pe = 10, me = "Test", fe = "Test 2", ge = [], _ = a(() => J.value.toISOString()), ye = a(() => l(t.value)), z = a(() => l(t.value) ? t.value.numberOfDays : F.value), he = a(() => l(t.value) ? t.value.packageCount : 0), be = a(() => l(t.value) ? t.value.fromDate : ""), k = a(() => d.value.events.find((e) => e.id === S.value)), ke = a(() => k.value ? k.value.length : void 0), X = a(() => l(t.value) ? t.value.templateID : 0), De = a(() => d.value.events), Ie = a(() => d.value.templates), Se = a(() => d.value.events.length > 0), we = a(() => d.value.templates.length > 0), Y = a(() => k.value && k.value.eventRateType ? k.value.eventRateType : se.None), B = a(() => {
9
- if (!l(t.value))
10
- return t.value;
11
- }), Z = a(() => {
12
- if (B.value !== void 0) {
13
- const e = B.value.find(
14
- (n) => n.time === C.value
15
- );
16
- if (e && e.price)
17
- return e.price;
18
- }
19
- return 0;
20
- }), H = a(() => {
21
- if (l(t.value))
22
- return t.value.templateCounts;
23
- }), _e = a(() => (e) => I.value.eventImages.filter((n) => n.eventID === e));
24
- function G(e, n, r) {
25
- let p = 0;
26
- if (l(t.value)) {
27
- const u = t.value.templateCounts[r];
28
- if (u) {
29
- const D = u.addons, h = w.value[`${n}.${e}.${r}`] || 0;
30
- if (h > 0) {
31
- const b = D?.find((P) => P.addonID === e), m = typeof h == "boolean" ? 1 : h;
32
- p += Je(b?.price, b?.quantityStrategy, z.value, u.adultPerRoom) * m;
33
- }
34
- }
35
- } else {
36
- const u = y.value[e] || 0;
37
- if (u > 0) {
38
- const D = k.value?.products?.find((h) => h.productID === e);
39
- D && (p += D.price * u);
40
- }
41
- }
42
- return p;
43
- }
44
- function M(e, n) {
45
- let r = 0;
46
- if (l(t.value))
47
- for (const p in w.value) {
48
- const u = p.split(".");
49
- parseInt(u[0]) === e && parseInt(u[2]) === n && (r += G(parseInt(u[1]), e, n));
50
- }
51
- else
52
- for (const p in y.value)
53
- r += G(parseInt(p)) * F.value;
54
- return r;
55
- }
56
- const ee = a(() => l(t.value) && t.value.totalPrice || 0), Pe = a(() => {
57
- if (l(t.value))
58
- return t.value.templateCounts === void 0 ? NaN : t.value.templateCounts.flatMap((e) => e.roomGroupID).reduce(
59
- (e, n, r) => e + M(n, r),
60
- ee.value
61
- ) || 0;
62
- {
63
- let e = M();
64
- return e += Z.value, e;
65
- }
66
- }), Ae = a(() => l(t.value) && t.value.templateCounts !== void 0 && t.value.templateCounts.flatMap((e) => e.weekendFee).reduce((e, n) => e + n, 0) || 0), Ce = a(() => l(t.value) && t.value.templateCounts !== void 0 && t.value.templateCounts.flatMap((e) => e.roomUpgrade).reduce((e, n) => e + n, 0) || 0), Ee = a(() => {
67
- const e = y.value;
68
- let n = 0;
69
- for (const r in e)
70
- n += Number.isNaN(e[r]) ? 0 : e[r];
71
- return n > 0;
72
- }), te = a(() => l(t.value) ? !1 : Object.keys(y.value).length > 0), $e = a(() => !!(R.value !== "" && O.value !== "" && L.value.length >= 5 && (!te.value || Ee.value) && (!(!l(t.value) && Y.value !== se.FullDayEvent) || C.value !== "")));
73
- function Te(e) {
74
- return i.value === v.ReservationState && S.value === e && o.value;
75
- }
76
- const Ne = a(() => !(i.value === v.InitialState && o.value)), Fe = a(() => !(i.value === v.AvailabilityState && o.value)), Re = a(() => t.value !== void 0), Le = a(() => i.value === v.PaymentState && o.value);
77
- async function Oe() {
78
- i.value = v.AvailabilityState, o.value = !0;
79
- try {
80
- const e = (await E.get("https://production.hotel-service.konnectio.dk/api/event/get", {
81
- params: {
82
- language: $(),
83
- restaurantId: 42,
84
- date: _.value
85
- },
86
- headers: {
87
- Authorization: g.value,
88
- "Fresh-Booking-Ver": "4.0.56-rc23"
89
- }
90
- })).data;
91
- d.value = e, o.value = !1;
92
- } catch {
93
- c({
94
- message: A.t("alert.error.couldntFetchListings"),
95
- type: "warning"
96
- });
97
- }
98
- }
99
- async function Ve(e) {
100
- i.value = v.ReservationState, o.value = !0;
101
- try {
102
- const n = (await E.get("https://production.hotel-service.konnectio.dk/api/v3/event/get-availability", {
103
- params: {
104
- language: $(),
105
- date: _.value,
106
- templateId: S.value,
107
- numberOfPeople: N.value
108
- },
109
- headers: {
110
- Authorization: g.value,
111
- "Fresh-Booking-Ver": "4.0.56-rc23"
112
- }
113
- })).data;
114
- n.templateCounts.length === 0 ? c({
115
- message: A.t("alert.error.eventNotAvailable"),
116
- type: "warning"
117
- }) : (t.value = n, e()), o.value = !1;
118
- } catch {
119
- o.value = !1, i.value = v.AvailabilityState, c({
120
- message: A.t("alert.error.couldntFetchEvent"),
121
- type: "warning"
122
- });
123
- }
124
- }
125
- async function ze(e) {
126
- i.value = v.ReservationState, o.value = !0;
127
- try {
128
- const n = (await E.get("https://production.hotel-service.konnectio.dk/api/v3/event/get-table-availability", {
129
- params: {
130
- language: $(),
131
- date: _.value,
132
- numberOfPeople: N.value,
133
- eventId: S.value,
134
- tableGroupId: Q.value
135
- },
136
- headers: {
137
- Authorization: g.value,
138
- "Fresh-Booking-Ver": "4.0.56-rc23"
139
- }
140
- })).data;
141
- t.value = n, o.value = !1, e();
142
- } catch {
143
- o.value = !1, i.value = v.AvailabilityState, c({
144
- message: A.t("alert.error.couldntFetchEvent"),
145
- type: "warning"
146
- });
147
- }
148
- }
149
- async function Be() {
150
- try {
151
- const e = (await E.get("https://production.hotel-service.konnectio.dk/api/v3/event/validate-discount-code", {
152
- params: {
153
- language: $(),
154
- date: _.value,
155
- discountCode: V.value
156
- },
157
- headers: {
158
- Authorization: g.value,
159
- "Fresh-Booking-Ver": "4.0.56-rc23"
160
- }
161
- })).data;
162
- console.log(e);
163
- } catch (e) {
164
- console.log(e), c({
165
- message: A.t("alert.error.discountCodeValidation"),
166
- type: "warning"
167
- });
168
- }
169
- }
170
- async function Ge(e) {
171
- i.value = v.PaymentState, o.value = !0;
172
- const n = () => {
173
- o.value = !1, i.value = v.ReservationState, c({
174
- message: A.t("booking.other.errorMessage"),
175
- type: "warning"
176
- });
177
- };
178
- let r, p, u;
179
- const D = [];
180
- if (l(t.value))
181
- H.value?.forEach((m, P) => {
182
- const ae = [];
183
- let ne = 0;
184
- for (const oe in w.value) {
185
- const U = oe.split("."), le = w.value[oe];
186
- parseInt(U[0]) === m.roomGroupID && parseInt(U[2]) === P && le > 0 && (ae.push({
187
- id: ne,
188
- addonID: parseInt(U[1]),
189
- quantity: le
190
- }), ne++);
191
- }
192
- D.push({
193
- adultPerRoom: m.adultPerRoom,
194
- count: m.count,
195
- roomGroupID: m.roomGroupID,
196
- addons: ae
197
- });
198
- }), r = {
199
- templateID: X.value,
200
- numberOfDays: F.value,
201
- templateCounts: D
202
- };
203
- else {
204
- p = [], u = C.value;
205
- for (const m in y.value) {
206
- const P = y.value[parseInt(m)];
207
- P > 0 && p.push({
208
- id: parseInt(m),
209
- quantity: P
210
- });
211
- }
212
- }
213
- let h = "https://production.hotel-service.konnectio.dk/api/v3/event/template-book";
214
- const b = {
215
- date: _.value,
216
- name: R.value,
217
- email: O.value,
218
- phone: L.value,
219
- remark: W.value,
220
- numberOfPeople: N.value,
221
- days: z.value,
222
- discountCode: V.value,
223
- giftCardCode: f.value,
224
- checkoutUrl: window.location.origin,
225
- privacyUrl: window.location.origin
226
- };
227
- l(t.value) ? b.templateGroup = r : (b.time = u, b.eventId = S.value, b.products = p, h = "https://production.hotel-service.konnectio.dk/api/v3/event/event-book"), await E.post(h, b, {
228
- headers: {
229
- Authorization: g.value,
230
- "Fresh-Booking-Ver": "4.0.56-rc23"
231
- }
232
- }).then((m) => {
233
- o.value = !1, T.pay({
234
- callback: e,
235
- response: m.data
236
- });
237
- }).catch(() => n());
238
- }
239
- function Me(e) {
240
- w.value = {}, y.value = {}, C.value = "", e();
241
- }
242
- function Ue() {
243
- }
244
- return {
245
- metaData: I,
246
- listingData: d,
247
- tableBasePrice: Z,
248
- availabilityData: t,
249
- isLoading: o,
250
- moduleState: i,
251
- searchDate: J,
252
- numberOfPeople: N,
253
- numberOfDays: F,
254
- eventId: S,
255
- tableGroupId: Q,
256
- arrivalTime: C,
257
- addons: w,
258
- products: y,
259
- discountCode: V,
260
- name: R,
261
- phone: L,
262
- email: O,
263
- remark: W,
264
- isTemplateEvent: ye,
265
- currency: de,
266
- maxNumberOfPeople: pe,
267
- title: me,
268
- subtitle: fe,
269
- slideshow: ge,
270
- date: _,
271
- numberOfTotalDays: z,
272
- numberOfRooms: he,
273
- fromDate: be,
274
- getEventData: k,
275
- length: ke,
276
- templateId: X,
277
- getEvents: De,
278
- getTemplates: Ie,
279
- hasEvents: Se,
280
- hasTemplates: we,
281
- basePrice: ee,
282
- totalPrice: Pe,
283
- getTemplateData: H,
284
- getEventTableData: B,
285
- roomUpgrade: Ce,
286
- weekendFee: Ae,
287
- hasProducts: te,
288
- eventRateType: Y,
289
- isReservationFormFilled: $e,
290
- isMetaDataAvailable: Ne,
291
- areListingsAvailable: Fe,
292
- isAvailabilityDataAvailable: Re,
293
- isPaymentLoading: Le,
294
- getEventImages: _e,
295
- isEventListingLoading: Te,
296
- // fetchMetaData,
297
- fetchListings: Oe,
298
- getTemplateAvailability: Ve,
299
- getEventAvailability: ze,
300
- validateDiscountCode: Be,
301
- localAddonPrice: G,
302
- totalAddonPrice: M,
303
- createBooking: Ge,
304
- reset: Me,
305
- initialize: Ue
306
- };
307
- }), lt = /* @__PURE__ */ ue({
308
- __name: "_",
309
- props: {
310
- type: { default: "submit" }
311
- },
312
- emits: ["submit"],
313
- setup(T, { emit: f }) {
314
- const c = s(!1), g = f;
315
- re();
316
- function I() {
317
- g("submit");
318
- }
319
- return (d, t) => (ce(), Qe("form", {
320
- onSubmit: ve(I, ["prevent"])
321
- }, [
322
- We(d.$slots, "default", { isLoading: c.value })
323
- ], 32));
324
- }
325
- }), st = { class: "konnectio-search-button" }, it = /* @__PURE__ */ ue({
326
- __name: "EventAvailabilityForm",
327
- props: {
328
- link: {}
329
- },
330
- setup(T) {
331
- const f = T, { searchDate: c } = j(ot()), { t: g } = Xe(), I = a(() => typeof f.link != "string");
332
- function d() {
333
- if (I.value) {
334
- const t = $();
335
- f.link[t] ? window.location.replace(f.link[t]) : f.link.en && window.location.replace(f.link.en);
336
- } else
337
- window.location.replace(f.link);
338
- }
339
- return (t, o) => (ce(), Ye(lt, {
340
- id: "konnectio-event-search-form",
341
- type: "availability",
342
- onSubmit: ve(d, ["prevent"])
343
- }, {
344
- default: Ze(() => [
345
- ie(nt, {
346
- modelValue: x(c),
347
- "onUpdate:modelValue": o[0] || (o[0] = (i) => He(c) ? c.value = i : null),
348
- label: x(g)("event.selectDate"),
349
- "icon-type": "fas",
350
- "icon-placement": "label",
351
- "min-date": /* @__PURE__ */ new Date()
352
- }, null, 8, ["modelValue", "label", "min-date"]),
353
- et("div", st, [
354
- ie(tt, {
355
- type: "submit",
356
- label: x(g)("availability.buttonLabel")
357
- }, null, 8, ["label"])
358
- ])
359
- ]),
360
- _: 1
361
- }));
362
- }
363
- }), ct = /* @__PURE__ */ at(it, [["__scopeId", "data-v-0a3de19e"]]);
364
- export {
365
- ct as E,
366
- ot as u
367
- };