@konnectio/core 4.0.56-rc21 → 4.0.56-rc23

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 (43) hide show
  1. package/dist/{ActionField-mMYGNb-7.js → ActionField-BUeonTqc.js} +1 -1
  2. package/dist/ActionField-BUeonTqc.js.br +9 -0
  3. package/dist/{AvailabilitySkeleton-iD7Vbt5K.js → AvailabilitySkeleton-gympaD6B.js} +77 -75
  4. package/dist/AvailabilitySkeleton-gympaD6B.js.br +0 -0
  5. package/dist/CheckoutWindow-sws5X9v2.js +710 -0
  6. package/dist/CheckoutWindow-sws5X9v2.js.br +0 -0
  7. package/dist/{DateField.vue_vue_type_style_index_0_lang-seJ00xvJ.js → DateField.vue_vue_type_style_index_0_lang-Ts9271hZ.js} +2003 -1999
  8. package/dist/DateField.vue_vue_type_style_index_0_lang-Ts9271hZ.js.br +0 -0
  9. package/dist/{ErrorMessage-4GwDZEsl.js → ErrorMessage-GzJ2T5_d.js} +1 -1
  10. package/dist/ErrorMessage-GzJ2T5_d.js.br +0 -0
  11. package/dist/{EventAvailabilityForm-jvxOZKWx.js → EventAvailabilityForm-c0u7rObv.js} +26 -25
  12. package/dist/EventAvailabilityForm-c0u7rObv.js.br +0 -0
  13. package/dist/{Field-EqFBeBE_.js → Field-hjOjPQhC.js} +1 -1
  14. package/dist/Field-hjOjPQhC.js.br +0 -0
  15. package/dist/{ThankYou-pu1PDfhl.js → ThankYou-d129mmKn.js} +3077 -3563
  16. package/dist/ThankYou-d129mmKn.js.br +0 -0
  17. package/dist/{_--L3VvP-p.js → _-hKpeUU4C.js} +2264 -2243
  18. package/dist/_-hKpeUU4C.js.br +0 -0
  19. package/dist/availability.js +22 -22
  20. package/dist/availability.js.br +0 -0
  21. package/dist/event.js +61 -61
  22. package/dist/event.js.br +0 -0
  23. package/dist/gift-card-validation.js +20 -20
  24. package/dist/gift-card-validation.js.br +0 -0
  25. package/dist/gift-card.js +305 -291
  26. package/dist/gift-card.js.br +0 -0
  27. package/dist/hotel.js +926 -919
  28. package/dist/hotel.js.br +0 -0
  29. package/dist/polyfill.js +1 -1
  30. package/dist/polyfill.js.br +0 -0
  31. package/dist/style.css +1 -1
  32. package/dist/style.css.br +0 -0
  33. package/package.json +3 -2
  34. package/dist/ActionField-mMYGNb-7.js.br +0 -0
  35. package/dist/AvailabilitySkeleton-iD7Vbt5K.js.br +0 -0
  36. package/dist/CheckoutWindow-T32YH60g.js +0 -205
  37. package/dist/CheckoutWindow-T32YH60g.js.br +0 -0
  38. package/dist/DateField.vue_vue_type_style_index_0_lang-seJ00xvJ.js.br +0 -0
  39. package/dist/ErrorMessage-4GwDZEsl.js.br +0 -0
  40. package/dist/EventAvailabilityForm-jvxOZKWx.js.br +0 -0
  41. package/dist/Field-EqFBeBE_.js.br +0 -0
  42. package/dist/ThankYou-pu1PDfhl.js.br +0 -0
  43. package/dist/_--L3VvP-p.js.br +0 -0
package/dist/gift-card.js CHANGED
@@ -1,99 +1,100 @@
1
- import { V as re, W as de, B as Q, D as oe, k as C, a8 as $, $ as Z, c as _, a4 as ee, a0 as J, a3 as ue, a2 as ce, a9 as pe, d as X, j as ne, Y as me, o as c, a as I, w as G, b as s, h as g, f as i, u as e, C as B, i as V, n as ie, I as fe, E as ve, g as se, G as ge, l as he, S as be, t as ae, aa as D, ab as W, F as ye, J as ke, H as T, _ as Ce, L as _e, T as j, e as Ve, q as we, s as Fe, y as Pe, z as Te, A as Se, U as $e } from "./_--L3VvP-p.js";
2
- import { a as Ee, C as Ue, P as Ae, _ as Re } from "./CheckoutWindow-T32YH60g.js";
3
- import { F as M } from "./Field-EqFBeBE_.js";
4
- import { E as Ie } from "./ErrorMessage-4GwDZEsl.js";
5
- const le = re("giftCard", () => {
6
- const { pay: S } = de(), { bearerToken: m, metaData: w, currencyId: o } = Q(oe()), r = C($.InitialState), h = Z("konnectio_name", "", void 0, { serializer: J.string }), d = Z("konnectio_email", "", void 0, { serializer: J.string }), f = Z("konnectio_phone", "", void 0, { serializer: J.string }), n = C(""), v = C(1), p = C(!0), L = C(""), y = C({
1
+ import { W as ue, X as pe, D as ee, G as ae, k as w, aa as T, a0 as Y, c as y, a5 as ie, a1 as Q, a4 as me, a3 as fe, ab as ve, d as Z, j as le, Z as he, o as d, a as R, w as z, b as o, h as k, f as n, u as e, C as D, i as F, n as de, I as ge, E as be, g as ce, H as ye, l as ke, S as _e, t as se, ac as j, ad as H, F as Ce, K as Ve, J as P, _ as we, L as Fe, T as N, e as Pe, q as Se, s as Te, v as $e, x as Ee, y as Ue, z as Ae, A as Ie, V as Ge, B as Re } from "./_-hKpeUU4C.js";
2
+ import { B as Le, a as Me, C as qe, P as Be, _ as xe } from "./CheckoutWindow-sws5X9v2.js";
3
+ import { F as x } from "./Field-hjOjPQhC.js";
4
+ import { E as ze } from "./ErrorMessage-GzJ2T5_d.js";
5
+ const te = ue("giftCard", () => {
6
+ const { pay: v } = pe(), { bearerToken: c, metaData: _, currencyId: t } = ee(ae()), b = ae(), u = w(T.InitialState), r = Y("konnectio_name", "", void 0, { serializer: Q.string }), f = Y("konnectio_email", "", void 0, { serializer: Q.string }), i = Y("konnectio_phone", "", void 0, { serializer: Q.string }), h = w(""), m = w(1), q = w(!0), S = w(""), a = w({
7
7
  base64: "",
8
8
  type: "",
9
9
  name: ""
10
- }), l = C(void 0), u = C(0), b = C(!1), U = C(0), F = _(() => r.value === $.InitialState || r.value === $.WaitingForResponse), A = _(() => r.value === $.ReadyToPay), q = _(() => r.value === $.PaymentSuccess), P = _(() => {
11
- const a = {
10
+ }), p = w(void 0), V = w(0), $ = w(!1), C = w(0), E = y(() => b.metaData.hotels[0]), B = y(() => E.value.termsOfService ? E.value.termsOfService : ""), U = y(() => u.value === T.InitialState || u.value === T.WaitingForResponse), oe = y(() => u.value === T.ReadyToPay), J = y(() => u.value === T.PaymentSuccess), L = y(() => {
11
+ const g = {
12
12
  1: {
13
- label: ee.t("giftCard.hotelType"),
13
+ label: ie.t("giftCard.hotelType"),
14
14
  data: []
15
15
  },
16
16
  2: {
17
- label: ee.t("giftCard.restaurantType"),
17
+ label: ie.t("giftCard.restaurantType"),
18
18
  data: []
19
19
  }
20
- }, t = w.value.hotels[0].places;
21
- return t && t.forEach((k) => {
22
- a[k.placeType].data.push(k);
20
+ }, M = _.value.hotels[0].places;
21
+ return M && M.forEach((I) => {
22
+ g[I.placeType].data.push(I);
23
23
  }), Object.fromEntries(
24
- Object.entries(a).filter(([, k]) => k.data.length > 0)
24
+ Object.entries(g).filter(([, I]) => I.data.length > 0)
25
25
  );
26
- }), H = _(() => U.value !== 0), E = _(() => {
27
- let a;
28
- if (H.value)
29
- a = P.value[U.value].data[0];
30
- else if (u.value !== 0) {
31
- const t = l.value, k = P.value[u.value].data;
32
- k.length === 1 ? a = k[0] : t !== void 0 && k.forEach((z) => {
33
- String(z.id) === String(t) && (a = z);
26
+ }), O = y(() => C.value !== 0), A = y(() => {
27
+ let g;
28
+ if (O.value)
29
+ g = L.value[C.value].data[0];
30
+ else if (V.value !== 0) {
31
+ const M = p.value, I = L.value[V.value].data;
32
+ I.length === 1 ? g = I[0] : M !== void 0 && I.forEach((ne) => {
33
+ String(ne.id) === String(M) && (g = ne);
34
34
  });
35
35
  }
36
- return a;
37
- }), x = _(() => !(!h.value || !d.value || !(f.value.length >= 5) || !n.value || E.value === void 0)), N = _(() => !(r.value === $.InitialState && b.value)), K = _(() => !!(r.value === $.WaitingForResponse && b.value));
38
- async function Y() {
39
- r.value = $.WaitingForResponse, b.value = !0, await ue.post("https://production.hotel-service.konnectio.dk/api/gift-card/create", {
36
+ return g;
37
+ }), X = y(() => !(!r.value || !f.value || !(i.value.length >= 5) || !h.value || A.value === void 0)), G = y(() => !(u.value === T.InitialState && $.value)), s = y(() => !!(u.value === T.WaitingForResponse && $.value));
38
+ async function l() {
39
+ u.value = T.WaitingForResponse, $.value = !0, await me.post("https://production.hotel-service.konnectio.dk/api/gift-card/create", {
40
40
  termsOfserviceURL: window.location.origin,
41
41
  checkoutUrl: window.location.origin,
42
- currencyID: o.value,
43
- language: ce(),
44
- amount: n.value,
45
- quantity: v.value,
46
- freeText: L.value,
47
- showPrice: p.value,
48
- contactName: h.value,
49
- contactEmail: d.value,
50
- contactPhone: f.value,
51
- imageBase64: pe(y.value.base64),
52
- imageName: y.value.name,
53
- imageFormat: y.value.type,
54
- placeType: E.value ? E.value.placeType : void 0,
55
- placeID: E.value ? E.value.id : void 0
42
+ currencyID: t.value,
43
+ language: fe(),
44
+ amount: h.value,
45
+ quantity: m.value,
46
+ freeText: S.value,
47
+ showPrice: q.value,
48
+ contactName: r.value,
49
+ contactEmail: f.value,
50
+ contactPhone: i.value,
51
+ imageBase64: ve(a.value.base64),
52
+ imageName: a.value.name,
53
+ imageFormat: a.value.type,
54
+ placeType: A.value ? A.value.placeType : void 0,
55
+ placeID: A.value ? A.value.id : void 0
56
56
  }, {
57
57
  headers: {
58
- Authorization: m.value,
58
+ Authorization: c.value,
59
59
  Accept: "application/json",
60
- "Fresh-Booking-Ver": "4.0.56-rc21"
60
+ "Fresh-Booking-Ver": "4.0.56-rc23"
61
61
  }
62
- }).then((a) => {
63
- r.value = $.ReadyToPay, b.value = !1, S({
62
+ }).then((g) => {
63
+ u.value = T.ReadyToPay, $.value = !1, v({
64
64
  callback: () => console.log("Callback!"),
65
- response: a.data
65
+ response: g.data
66
66
  });
67
67
  });
68
68
  }
69
- function R(a) {
70
- a && (U.value = a);
69
+ function W(g) {
70
+ g && (C.value = g);
71
71
  }
72
72
  return {
73
- selectedPlace: E,
74
- moduleState: r,
75
- name: h,
76
- email: d,
77
- phone: f,
78
- value: n,
79
- remark: L,
80
- showValue: p,
81
- quantity: v,
82
- media: y,
83
- placeId: l,
84
- placeType: u,
85
- showFormPage: F,
86
- showPaymentPage: A,
87
- showConfirmationPage: q,
88
- places: P,
89
- hasFilledForm: x,
90
- hasForcedPlaceType: H,
91
- isWaitingForResponse: K,
92
- isMetaDataAvailable: N,
93
- orderGiftCard: Y,
94
- initialize: R
73
+ selectedPlace: A,
74
+ moduleState: u,
75
+ name: r,
76
+ email: f,
77
+ phone: i,
78
+ value: h,
79
+ remark: S,
80
+ showValue: q,
81
+ quantity: m,
82
+ media: a,
83
+ placeId: p,
84
+ placeType: V,
85
+ showFormPage: U,
86
+ showPaymentPage: oe,
87
+ showConfirmationPage: J,
88
+ places: L,
89
+ hasFilledForm: X,
90
+ hasForcedPlaceType: O,
91
+ isWaitingForResponse: s,
92
+ isMetaDataAvailable: G,
93
+ termsOfService: B,
94
+ orderGiftCard: l,
95
+ initialize: W
95
96
  };
96
- }), Le = { class: "media-selector" }, qe = ["accept"], Me = { class: "media-selector-wrapper" }, Ge = { class: "media-selector-tools" }, Be = { key: 0 }, xe = { key: 1 }, ze = { key: 2 }, De = ["src"], We = /* @__PURE__ */ X({
97
+ }), De = { class: "media-selector" }, Oe = ["accept"], We = { class: "media-selector-wrapper" }, je = { class: "media-selector-tools" }, He = { key: 0 }, Ne = { key: 1 }, Ke = { key: 2 }, Ze = ["src"], Je = /* @__PURE__ */ Z({
97
98
  __name: "MediaSelector",
98
99
  props: {
99
100
  modelValue: {},
@@ -103,94 +104,94 @@ const le = re("giftCard", () => {
103
104
  required: { type: Boolean, default: !1 }
104
105
  },
105
106
  emits: ["update:modelValue"],
106
- setup(S, { emit: m }) {
107
- const w = m, o = S, { t: r } = ne(), { display: h } = me(), d = C(), f = _(() => o.modelValue.base64 !== "");
108
- function n(l) {
109
- w("update:modelValue", l);
107
+ setup(v, { emit: c }) {
108
+ const _ = c, t = v, { t: b } = le(), { display: u } = he(), r = w(), f = y(() => t.modelValue.base64 !== "");
109
+ function i(a) {
110
+ _("update:modelValue", a);
110
111
  }
111
- function v() {
112
- n({
112
+ function h() {
113
+ i({
113
114
  base64: "",
114
115
  name: "",
115
116
  type: ""
116
- }), d.value && (d.value.value = "");
117
+ }), r.value && (r.value.value = "");
117
118
  }
118
- function p() {
119
- d.value && d.value.click();
119
+ function m() {
120
+ r.value && r.value.click();
120
121
  }
121
- function L(l, u) {
122
- const [b, U] = [l.name, l.type], F = new FileReader();
123
- F.onload = function(A) {
124
- if (A.target) {
125
- const q = A.target.result;
126
- u({ base64: q, name: b, type: U });
122
+ function q(a, p) {
123
+ const [V, $] = [a.name, a.type], C = new FileReader();
124
+ C.onload = function(E) {
125
+ if (E.target) {
126
+ const B = E.target.result;
127
+ p({ base64: B, name: V, type: $ });
127
128
  } else
128
- h({
129
- message: r("imageUploadError"),
129
+ u({
130
+ message: b("imageUploadError"),
130
131
  type: "error"
131
132
  });
132
- }, F.readAsDataURL(l);
133
+ }, C.readAsDataURL(a);
133
134
  }
134
- async function y() {
135
- let l;
136
- (l = d.value.files) instanceof FileList && L(l[0], n);
135
+ async function S() {
136
+ let a;
137
+ (a = r.value.files) instanceof FileList && q(a[0], i);
137
138
  }
138
- return (l, u) => (c(), I(fe, {
139
- label: l.label,
140
- required: l.required,
139
+ return (a, p) => (d(), R(ge, {
140
+ label: a.label,
141
+ required: a.required,
141
142
  type: "media"
142
143
  }, {
143
- default: G(() => [
144
- s("div", Le, [
145
- s("input", {
144
+ default: z(() => [
145
+ o("div", De, [
146
+ o("input", {
146
147
  ref_key: "fileInput",
147
- ref: d,
148
+ ref: r,
148
149
  type: "file",
149
150
  class: "hidden",
150
- accept: l.validation,
151
+ accept: a.validation,
151
152
  single: "",
152
- onChange: u[0] || (u[0] = (b) => y())
153
- }, null, 40, qe),
154
- s("div", Me, [
155
- s("ul", Ge, [
156
- f.value ? V("", !0) : (c(), g("li", Be, [
157
- i(B, {
158
- label: e(r)("uploadFile"),
153
+ onChange: p[0] || (p[0] = (V) => S())
154
+ }, null, 40, Oe),
155
+ o("div", We, [
156
+ o("ul", je, [
157
+ f.value ? F("", !0) : (d(), k("li", He, [
158
+ n(D, {
159
+ label: e(b)("uploadFile"),
159
160
  type: "button",
160
161
  icon: "upload",
161
- "icon-color": l.iconColor,
162
- onClickEvent: u[1] || (u[1] = (b) => p())
162
+ "icon-color": a.iconColor,
163
+ onClickEvent: p[1] || (p[1] = (V) => m())
163
164
  }, null, 8, ["label", "icon-color"])
164
165
  ])),
165
- f.value ? (c(), g("li", xe, [
166
- i(B, {
167
- label: e(r)("replaceFile"),
166
+ f.value ? (d(), k("li", Ne, [
167
+ n(D, {
168
+ label: e(b)("replaceFile"),
168
169
  type: "button",
169
170
  icon: "repeat-alt",
170
- "icon-color": l.iconColor,
171
- onClickEvent: u[2] || (u[2] = (b) => p())
171
+ "icon-color": a.iconColor,
172
+ onClickEvent: p[2] || (p[2] = (V) => m())
172
173
  }, null, 8, ["label", "icon-color"])
173
- ])) : V("", !0),
174
- f.value ? (c(), g("li", ze, [
175
- i(B, {
176
- label: e(r)("removeFile"),
174
+ ])) : F("", !0),
175
+ f.value ? (d(), k("li", Ke, [
176
+ n(D, {
177
+ label: e(b)("removeFile"),
177
178
  type: "button",
178
179
  icon: "trash-alt",
179
- "icon-color": l.iconColor,
180
- onClickEvent: u[3] || (u[3] = (b) => v())
180
+ "icon-color": a.iconColor,
181
+ onClickEvent: p[3] || (p[3] = (V) => h())
181
182
  }, null, 8, ["label", "icon-color"])
182
- ])) : V("", !0)
183
+ ])) : F("", !0)
183
184
  ]),
184
- s("div", {
185
- class: ie([
185
+ o("div", {
186
+ class: de([
186
187
  "media-selector-previewer",
187
188
  { opened: f.value }
188
189
  ])
189
190
  }, [
190
- l.modelValue ? (c(), g("img", {
191
+ a.modelValue ? (d(), k("img", {
191
192
  key: 0,
192
- src: l.modelValue.base64
193
- }, null, 8, De)) : V("", !0)
193
+ src: a.modelValue.base64
194
+ }, null, 8, Ze)) : F("", !0)
194
195
  ], 2)
195
196
  ])
196
197
  ])
@@ -199,9 +200,9 @@ const le = re("giftCard", () => {
199
200
  }, 8, ["label", "required"]));
200
201
  }
201
202
  });
202
- function te(S) {
203
- const m = S;
204
- m.__i18n = m.__i18n || [], m.__i18n.push({
203
+ function re(v) {
204
+ const c = v;
205
+ c.__i18n = c.__i18n || [], c.__i18n.push({
205
206
  locale: "",
206
207
  resource: {
207
208
  da: {
@@ -219,39 +220,48 @@ function te(S) {
219
220
  }
220
221
  });
221
222
  }
222
- typeof te == "function" && te(We);
223
- const je = { class: "gift-card-skeleton" }, Oe = { class: "gift-card-skeleton-form" }, He = /* @__PURE__ */ X({
223
+ typeof re == "function" && re(Je);
224
+ const Xe = { class: "gift-card-skeleton" }, Ye = { class: "gift-card-skeleton-form" }, Qe = /* @__PURE__ */ Z({
224
225
  __name: "GiftCardSkeleton",
225
- setup(S) {
226
- return (m, w) => (c(), g("div", je, [
227
- s("div", Oe, [
228
- i(M),
229
- i(M),
230
- i(M),
231
- i(M),
232
- i(M, { "is-text-area": "" }),
233
- i(ve, { height: "44px" })
226
+ setup(v) {
227
+ return (c, _) => (d(), k("div", Xe, [
228
+ o("div", Ye, [
229
+ n(x),
230
+ n(x),
231
+ n(x),
232
+ n(x),
233
+ n(x, { "is-text-area": "" }),
234
+ n(be, { height: "44px" })
234
235
  ])
235
236
  ]));
236
237
  }
237
- }), Ne = /* @__PURE__ */ se(He, [["__scopeId", "data-v-ba3efaa1"]]), Ke = {
238
+ }), ea = /* @__PURE__ */ ce(Qe, [["__scopeId", "data-v-ba3efaa1"]]), aa = /* @__PURE__ */ Z({
239
+ __name: "GiftCard",
240
+ setup(v) {
241
+ const { t: c } = le(), _ = te();
242
+ return (t, b) => (d(), R(Le, {
243
+ content: e(_).termsOfService,
244
+ "button-label": e(c)("giftCard.orderGiftCard")
245
+ }, null, 8, ["content", "button-label"]));
246
+ }
247
+ }), ta = (v) => ($e("data-v-30c8e35c"), v = v(), Ee(), v), la = {
238
248
  key: 0,
239
249
  id: "konnectio-gift-card-wrapper"
240
- }, Ye = { id: "konnectio-gift-card-title" }, Ze = { id: "konnectio-gift-card-content" }, Je = { id: "konnectio-gift-card-payment" }, Qe = ["innerHTML"], Xe = { key: 0 }, ea = {
250
+ }, oa = { id: "konnectio-gift-card-title" }, na = { id: "konnectio-gift-card-content" }, ia = { id: "konnectio-gift-card-payment" }, sa = ["innerHTML"], ra = { key: 0 }, da = {
241
251
  key: 0,
242
252
  id: "fresh-booking-select-place-type"
243
- }, aa = {
244
- class: /* @__PURE__ */ ie(["fresh-booking-label", "required"])
245
- }, la = { id: "fresh-booking-select-place-type-input" }, ta = ["innerHTML"], oa = {
253
+ }, ca = {
254
+ class: /* @__PURE__ */ de(["fresh-booking-label", "required"])
255
+ }, ua = { id: "fresh-booking-select-place-type-input" }, pa = ["innerHTML"], ma = {
246
256
  key: 0,
247
257
  id: "konnectio-gift-card-order"
248
- }, na = { class: "fresh-booking-panel" }, ia = {
258
+ }, fa = { class: "fresh-booking-panel" }, va = {
249
259
  key: 1,
250
260
  id: "konnectio-gift-card-remarks"
251
- }, sa = {
261
+ }, ha = {
252
262
  key: 2,
253
263
  id: "konnectio-gift-card-order-minimal"
254
- }, ra = { id: "konnectio-gift-card-recaptcha" }, da = /* @__PURE__ */ X({
264
+ }, ga = /* @__PURE__ */ ta(() => /* @__PURE__ */ o("div", { class: "konnectio-divider" }, null, -1)), ba = { id: "konnectio-gift-card-recaptcha" }, ya = /* @__PURE__ */ Z({
255
265
  name: "GiftCardLayout",
256
266
  __name: "GiftCard",
257
267
  props: {
@@ -260,205 +270,209 @@ const je = { class: "gift-card-skeleton" }, Oe = { class: "gift-card-skeleton-fo
260
270
  placeType: {},
261
271
  styling: {}
262
272
  },
263
- setup(S) {
264
- const m = S, w = _(() => ({
273
+ setup(v) {
274
+ const c = v, _ = y(() => ({
265
275
  panelMaxWidth: "800px",
266
- ...m.styling
267
- })), { t: o } = ne(), {
268
- name: r,
269
- email: h,
270
- phone: d,
276
+ ...c.styling
277
+ })), { t } = le(), {
278
+ name: b,
279
+ email: u,
280
+ phone: r,
271
281
  value: f,
272
- remark: n,
273
- showValue: v,
274
- quantity: p,
275
- media: L,
276
- placeId: y,
277
- placeType: l,
278
- showFormPage: u,
279
- showPaymentPage: b,
280
- showConfirmationPage: U,
281
- places: F,
282
- hasFilledForm: A,
283
- hasForcedPlaceType: q,
284
- isWaitingForResponse: P,
285
- isMetaDataAvailable: H
286
- } = Q(le()), { initialize: E, orderGiftCard: x } = le(), { isRecaptchaEnabled: N, currency: K, hasError: Y } = Q(oe());
287
- return ge(l, () => {
288
- y.value = void 0;
289
- }), he(() => {
290
- const R = m.placeType ? parseInt(m.placeType) : void 0;
291
- E(R);
292
- }), (R, a) => (c(), I(Fe, { styling: w.value }, {
293
- default: G(() => [
294
- (c(), I(be, null, {
295
- default: G(() => [
296
- i(we, {
282
+ remark: i,
283
+ showValue: h,
284
+ quantity: m,
285
+ media: q,
286
+ placeId: S,
287
+ placeType: a,
288
+ showFormPage: p,
289
+ showPaymentPage: V,
290
+ showConfirmationPage: $,
291
+ places: C,
292
+ hasFilledForm: E,
293
+ hasForcedPlaceType: B,
294
+ isWaitingForResponse: U,
295
+ isMetaDataAvailable: oe
296
+ } = ee(te()), { initialize: J, orderGiftCard: L } = te(), { isRecaptchaEnabled: O, currency: A, hasError: X } = ee(ae());
297
+ return ye(a, () => {
298
+ S.value = void 0;
299
+ }), ke(() => {
300
+ const G = c.placeType ? parseInt(c.placeType) : void 0;
301
+ J(G);
302
+ }), (G, s) => (d(), R(Te, { styling: _.value }, {
303
+ default: z(() => [
304
+ (d(), R(_e, null, {
305
+ default: z(() => [
306
+ n(Se, {
297
307
  id: "konnectio-gift-card-module",
298
308
  type: "gift-card",
299
- "access-token": R.accessToken,
300
- "data-layout": R.layout
309
+ "access-token": G.accessToken,
310
+ "data-layout": G.layout
301
311
  }, {
302
- default: G(() => [
303
- e(Y) ? (c(), I(Ie, {
312
+ default: z(() => [
313
+ e(X) ? (d(), R(ze, {
304
314
  key: 1,
305
315
  title: "Unable to render Gift card module",
306
316
  description: "Gift card functionality hasn't been setup for this account. Please contact Octopus PMS for support."
307
- })) : (c(), g("div", Ke, [
308
- s("h2", Ye, [
309
- s("span", null, ae(e(o)("giftCard.title")), 1)
317
+ })) : (d(), k("div", la, [
318
+ o("h2", oa, [
319
+ o("span", null, se(e(t)("giftCard.title")), 1)
310
320
  ]),
311
- s("div", Ze, [
312
- D(s("div", Je, [
313
- i(Ee)
321
+ o("div", na, [
322
+ j(o("div", ia, [
323
+ n(Me)
314
324
  ], 512), [
315
- [W, e(b)]
325
+ [H, e(V)]
316
326
  ]),
317
- D(s("div", null, [
318
- s("p", {
327
+ j(o("div", null, [
328
+ o("p", {
319
329
  id: "konnectio-gift-card-description",
320
- innerHTML: e(o)("giftCard.description")
321
- }, null, 8, Qe),
322
- s("form", null, [
323
- e(q) ? V("", !0) : (c(), g("div", Xe, [
324
- e(F) ? (c(), g("div", ea, [
325
- s("label", aa, [
326
- s("span", null, ae(e(o)("giftCard.selectType")), 1)
330
+ innerHTML: e(t)("giftCard.description")
331
+ }, null, 8, sa),
332
+ o("form", null, [
333
+ e(B) ? F("", !0) : (d(), k("div", ra, [
334
+ e(C) ? (d(), k("div", da, [
335
+ o("label", ca, [
336
+ o("span", null, se(e(t)("giftCard.selectType")), 1)
327
337
  ]),
328
- s("div", la, [
329
- s("ul", null, [
330
- (c(!0), g(ye, null, ke(e(F), (t, k) => (c(), g("li", { key: k }, [
331
- i(Ue, {
332
- modelValue: e(l),
333
- "onUpdate:modelValue": a[0] || (a[0] = (z) => T(l) ? l.value = z : null),
338
+ o("div", ua, [
339
+ o("ul", null, [
340
+ (d(!0), k(Ce, null, Ve(e(C), (l, W) => (d(), k("li", { key: W }, [
341
+ n(qe, {
342
+ modelValue: e(a),
343
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => P(a) ? a.value = g : null),
334
344
  type: "radio",
335
345
  name: "placeType",
336
- val: k,
337
- label: t.label
346
+ val: W,
347
+ label: l.label
338
348
  }, null, 8, ["modelValue", "val", "label"])
339
349
  ]))), 128))
340
350
  ]),
341
- e(F)[e(l)] && e(F)[e(l)].data.length > 1 ? (c(), I(Ce, {
351
+ e(C)[e(a)] && e(C)[e(a)].data.length > 1 ? (d(), R(we, {
342
352
  key: 0,
343
- modelValue: e(y),
344
- "onUpdate:modelValue": a[1] || (a[1] = (t) => T(y) ? y.value = t : null),
345
- placeholder: e(o)("giftCard.selectPlacePlaceholder"),
346
- options: e(F)[e(l)].data,
353
+ modelValue: e(S),
354
+ "onUpdate:modelValue": s[1] || (s[1] = (l) => P(S) ? S.value = l : null),
355
+ placeholder: e(t)("giftCard.selectPlacePlaceholder"),
356
+ options: e(C)[e(a)].data,
347
357
  labelKey: "name",
348
358
  valueKey: "id",
349
359
  required: ""
350
- }, null, 8, ["modelValue", "placeholder", "options"])) : V("", !0)
360
+ }, null, 8, ["modelValue", "placeholder", "options"])) : F("", !0)
351
361
  ])
352
- ])) : (c(), I(_e, { key: 1 }))
362
+ ])) : (d(), R(Fe, { key: 1 }))
353
363
  ])),
354
- i(j, {
355
- modelValue: e(r),
356
- "onUpdate:modelValue": a[2] || (a[2] = (t) => T(r) ? r.value = t : null),
364
+ n(N, {
365
+ modelValue: e(b),
366
+ "onUpdate:modelValue": s[2] || (s[2] = (l) => P(b) ? b.value = l : null),
357
367
  type: "text",
358
368
  name: "name",
359
369
  autocomplete: "name",
360
- label: e(o)("giftCard.name"),
370
+ label: e(t)("giftCard.name"),
361
371
  icon: "user-alt",
362
- placeholder: e(o)("giftCard.namePlaceholder"),
372
+ placeholder: e(t)("giftCard.namePlaceholder"),
363
373
  required: ""
364
374
  }, null, 8, ["modelValue", "label", "placeholder"]),
365
- i(j, {
366
- modelValue: e(h),
367
- "onUpdate:modelValue": a[3] || (a[3] = (t) => T(h) ? h.value = t : null),
375
+ n(N, {
376
+ modelValue: e(u),
377
+ "onUpdate:modelValue": s[3] || (s[3] = (l) => P(u) ? u.value = l : null),
368
378
  type: "email",
369
379
  name: "email",
370
380
  autocomplete: "email",
371
- label: e(o)("giftCard.email"),
381
+ label: e(t)("giftCard.email"),
372
382
  icon: "at",
373
- placeholder: e(o)("giftCard.emailPlaceholder"),
383
+ placeholder: e(t)("giftCard.emailPlaceholder"),
374
384
  required: ""
375
385
  }, null, 8, ["modelValue", "label", "placeholder"]),
376
- i(Ae, {
377
- modelValue: e(d),
378
- "onUpdate:modelValue": a[4] || (a[4] = (t) => T(d) ? d.value = t : null),
386
+ n(Be, {
387
+ modelValue: e(r),
388
+ "onUpdate:modelValue": s[4] || (s[4] = (l) => P(r) ? r.value = l : null),
379
389
  icon: "phone-office",
380
- label: e(o)("giftCard.phone"),
381
- placeholder: e(o)("giftCard.phonePlaceholder"),
390
+ label: e(t)("giftCard.phone"),
391
+ placeholder: e(t)("giftCard.phonePlaceholder"),
382
392
  required: ""
383
393
  }, null, 8, ["modelValue", "label", "placeholder"]),
384
- i(j, {
394
+ n(N, {
385
395
  modelValue: e(f),
386
- "onUpdate:modelValue": a[5] || (a[5] = (t) => T(f) ? f.value = t : null),
396
+ "onUpdate:modelValue": s[5] || (s[5] = (l) => P(f) ? f.value = l : null),
387
397
  type: "number",
388
398
  name: "value",
389
- label: e(o)("giftCard.value"),
399
+ label: e(t)("giftCard.value"),
390
400
  icon: "money-bill",
391
- placeholder: e(o)("giftCard.valuePlaceholder"),
392
- suffix: e(K),
401
+ placeholder: e(t)("giftCard.valuePlaceholder"),
402
+ suffix: e(A),
393
403
  required: ""
394
404
  }, null, 8, ["modelValue", "label", "placeholder", "suffix"]),
395
- V("", !0),
396
- V("", !0),
397
- i(Ve, {
398
- modelValue: e(p),
399
- "onUpdate:modelValue": a[8] || (a[8] = (t) => T(p) ? p.value = t : null),
400
- label: e(o)("giftCard.quantity"),
405
+ F("", !0),
406
+ F("", !0),
407
+ n(Pe, {
408
+ modelValue: e(m),
409
+ "onUpdate:modelValue": s[8] || (s[8] = (l) => P(m) ? m.value = l : null),
410
+ label: e(t)("giftCard.quantity"),
401
411
  icon: "gift-card",
402
412
  required: ""
403
413
  }, null, 8, ["modelValue", "label"])
404
414
  ])
405
415
  ], 512), [
406
- [W, e(u)]
416
+ [H, e(p)]
407
417
  ]),
408
- D(s("div", null, [
409
- s("div", {
410
- innerHTML: e(o)("giftCard.thankYou")
411
- }, null, 8, ta)
418
+ j(o("div", null, [
419
+ o("div", {
420
+ innerHTML: e(t)("giftCard.thankYou")
421
+ }, null, 8, pa)
412
422
  ], 512), [
413
- [W, e(U)]
423
+ [H, e($)]
414
424
  ])
415
425
  ]),
416
- R.layout !== "minimal" && e(u) ? (c(), g("div", oa, [
417
- s("div", na, [
418
- i(B, {
419
- label: e(o)("giftCard.orderGiftCard"),
426
+ G.layout !== "minimal" && e(p) ? (d(), k("div", ma, [
427
+ o("div", fa, [
428
+ n(D, {
429
+ label: e(t)("giftCard.orderGiftCard"),
420
430
  "full-width": !0,
421
- disabled: !e(A),
422
- "is-loading": e(P),
423
- "onUpdate:isLoading": a[9] || (a[9] = (t) => T(P) ? P.value = t : null),
424
- onClickEvent: e(x)
431
+ disabled: !e(E),
432
+ "is-loading": e(U),
433
+ "onUpdate:isLoading": s[9] || (s[9] = (l) => P(U) ? U.value = l : null),
434
+ onClickEvent: e(L)
425
435
  }, null, 8, ["label", "disabled", "is-loading", "onClickEvent"])
426
436
  ])
427
- ])) : V("", !0),
428
- e(u) ? (c(), g("div", ia, [
429
- i(j, {
430
- modelValue: e(n),
431
- "onUpdate:modelValue": a[10] || (a[10] = (t) => T(n) ? n.value = t : null),
437
+ ])) : F("", !0),
438
+ e(p) ? (d(), k("div", va, [
439
+ n(N, {
440
+ modelValue: e(i),
441
+ "onUpdate:modelValue": s[10] || (s[10] = (l) => P(i) ? i.value = l : null),
432
442
  type: "textarea",
433
443
  name: "remark",
434
- label: e(o)("giftCard.remark"),
444
+ label: e(t)("giftCard.remark"),
435
445
  icon: "info-circle",
436
- placeholder: e(o)("giftCard.remarkPlaceholder")
446
+ placeholder: e(t)("giftCard.remarkPlaceholder")
437
447
  }, null, 8, ["modelValue", "label", "placeholder"])
438
- ])) : V("", !0),
439
- e(u) ? (c(), g("div", sa, [
440
- i(B, {
441
- label: e(o)("giftCard.orderGiftCard"),
448
+ ])) : F("", !0),
449
+ e(p) ? (d(), k("div", ha, [
450
+ n(D, {
451
+ label: e(t)("giftCard.orderGiftCard"),
442
452
  "full-width": !0,
443
- disabled: !e(A),
453
+ disabled: !e(E),
444
454
  "data-test": "orderGiftCard",
445
- "is-loading": e(P),
446
- "onUpdate:isLoading": a[11] || (a[11] = (t) => T(P) ? P.value = t : null),
447
- onClickEvent: e(x)
455
+ "is-loading": e(U),
456
+ "onUpdate:isLoading": s[11] || (s[11] = (l) => P(U) ? U.value = l : null),
457
+ onClickEvent: e(L)
448
458
  }, null, 8, ["label", "disabled", "is-loading", "onClickEvent"]),
449
- D(s("div", ra, [
450
- i(Re)
459
+ o("div", null, [
460
+ ga,
461
+ n(aa)
462
+ ]),
463
+ j(o("div", ba, [
464
+ n(xe)
451
465
  ], 512), [
452
- [W, e(N)]
466
+ [H, e(O)]
453
467
  ])
454
- ])) : V("", !0)
468
+ ])) : F("", !0)
455
469
  ]))
456
470
  ]),
457
471
  _: 1
458
472
  }, 8, ["access-token", "data-layout"])
459
473
  ]),
460
- fallback: G(() => [
461
- i(Ne)
474
+ fallback: z(() => [
475
+ n(ea)
462
476
  ]),
463
477
  _: 1
464
478
  }))
@@ -466,8 +480,8 @@ const je = { class: "gift-card-skeleton" }, Oe = { class: "gift-card-skeleton-fo
466
480
  _: 1
467
481
  }, 8, ["styling"]));
468
482
  }
469
- }), O = /* @__PURE__ */ se(da, [["__scopeId", "data-v-3a6862b8"]]), ua = Pe();
470
- class ca extends HTMLElement {
483
+ }), K = /* @__PURE__ */ ce(ya, [["__scopeId", "data-v-30c8e35c"]]), ka = Ue(), _a = Re();
484
+ class Ca extends HTMLElement {
471
485
  vueApp;
472
486
  constructor() {
473
487
  super();
@@ -476,25 +490,25 @@ class ca extends HTMLElement {
476
490
  this.vueApp.unmount();
477
491
  }
478
492
  connectedCallback() {
479
- const m = typeof O == "function" ? O.options : O;
480
- let w = Array.isArray(m.props) ? m.props : Object.keys(m.props || {});
481
- const o = (n) => n.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (v, p) => (p ? "-" : "") + v.toLowerCase()), r = (n) => n.replace(/-./g, (v) => v[1].toUpperCase()), h = {};
482
- w = w.map(o);
483
- const d = {};
484
- for (const n of this.attributes) {
485
- const p = n.name.split(".");
486
- p.length > 1 && (d[p[0]] || (d[p[0]] = {}), d[p[0]][r(p[1])] = n.value);
493
+ const c = typeof K == "function" ? K.options : K;
494
+ let _ = Array.isArray(c.props) ? c.props : Object.keys(c.props || {});
495
+ const t = (i) => i.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (h, m) => (m ? "-" : "") + h.toLowerCase()), b = (i) => i.replace(/-./g, (h) => h[1].toUpperCase()), u = {};
496
+ _ = _.map(t);
497
+ const r = {};
498
+ for (const i of this.attributes) {
499
+ const m = i.name.split(".");
500
+ m.length > 1 && (r[m[0]] || (r[m[0]] = {}), r[m[0]][b(m[1])] = i.value);
487
501
  }
488
- for (const n of w) {
489
- let v = this.attributes.getNamedItem(n)?.value;
490
- d.hasOwnProperty(n) && (v = d[n]), h[n] = v;
502
+ for (const i of _) {
503
+ let h = this.attributes.getNamedItem(i)?.value;
504
+ r.hasOwnProperty(i) && (h = r[i]), u[i] = h;
491
505
  }
492
- this.vueApp = Te(O, h), this.vueApp.use(ua), this.vueApp.use(Se), this.vueApp.use($e, { bootstrap: !0 });
506
+ this.vueApp = Ae(K, u), this.vueApp.provide("emitter", _a), this.vueApp.use(ka), this.vueApp.use(Ie), this.vueApp.use(Ge, { bootstrap: !0 });
493
507
  const f = document.createElement("div");
494
508
  this.vueApp.mount(f), this.appendChild(f.children[0]);
495
509
  }
496
510
  }
497
- window.customElements.define("konnectio-gift-card", ca);
511
+ window.customElements.define("konnectio-gift-card", Ca);
498
512
  export {
499
- ca as default
513
+ Ca as default
500
514
  };