@konnectio/core 4.0.56-rc8 → 4.0.56

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