@konnectio/core 4.0.9 → 4.0.11

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 (119) hide show
  1. package/dist/ActionField-8a007a6c.cjs +1 -0
  2. package/dist/{ActionField-f3d5b218.js → ActionField-d1266f8b.js} +4 -4
  3. package/dist/ActionField-d1266f8b.js.br +0 -0
  4. package/dist/AvailabilitySkeleton-0e6d048b.js +382 -0
  5. package/dist/AvailabilitySkeleton-0e6d048b.js.br +0 -0
  6. package/dist/AvailabilitySkeleton-3ba8c412.cjs +1 -0
  7. package/dist/DateField.vue_vue_type_style_index_0_lang-31a9e5dc.cjs +5 -0
  8. package/dist/{payment-cce506b8.js → DateField.vue_vue_type_style_index_0_lang-3f5993f7.js} +3216 -2953
  9. package/dist/DateField.vue_vue_type_style_index_0_lang-3f5993f7.js.br +0 -0
  10. package/dist/Field-028d9987.cjs +1 -0
  11. package/dist/Field-ea77905a.js +42 -0
  12. package/dist/Field-ea77905a.js.br +0 -0
  13. package/dist/{applyGiftCard-dea77ba6.js → NumberField.vue_vue_type_script_setup_true_lang-d3b3206f.js} +59 -59
  14. package/dist/NumberField.vue_vue_type_script_setup_true_lang-d3b3206f.js.br +0 -0
  15. package/dist/NumberField.vue_vue_type_script_setup_true_lang-d756efc3.cjs +1 -0
  16. package/dist/SelectField.vue_vue_type_style_index_0_lang-2b92f88c.cjs +806 -0
  17. package/dist/SelectField.vue_vue_type_style_index_0_lang-d1f9b48d.js +19169 -0
  18. package/dist/SelectField.vue_vue_type_style_index_0_lang-d1f9b48d.js.br +0 -0
  19. package/dist/{TextField-b8f4462a.js → TextField-4e7defc6.js} +139 -137
  20. package/dist/TextField-4e7defc6.js.br +0 -0
  21. package/dist/{TextField-99e69631.cjs → TextField-641e6fd1.cjs} +1 -1
  22. package/dist/ThankYou-2c1ee36b.cjs +54 -0
  23. package/dist/ThankYou-6fc9044f.js +11777 -0
  24. package/dist/ThankYou-6fc9044f.js.br +0 -0
  25. package/dist/_-82677476.cjs +1 -0
  26. package/dist/_-f5a3364b.js +82 -0
  27. package/dist/_-f5a3364b.js.br +0 -0
  28. package/dist/assets/typescript/mixins.d.ts +1 -4
  29. package/dist/availability.cjs +2 -2
  30. package/dist/availability.js +94 -142
  31. package/dist/availability.js.br +0 -0
  32. package/dist/components/Icon.vue.d.ts +1 -1
  33. package/dist/components/forms/EventAvailabilityForm.vue.d.ts +1 -1
  34. package/dist/components/forms/HotelAvailabilityForm.vue.d.ts +1 -1
  35. package/dist/components/forms/HotelReservationForm.vue.d.ts +4 -0
  36. package/dist/components/forms/HotelReservationForm.vue.d.ts.map +1 -0
  37. package/dist/components/forms/MultiStepForm.vue.d.ts +1 -1
  38. package/dist/components/forms/ReservationForm.vue.d.ts +1 -1
  39. package/dist/components/forms/_.vue.d.ts +4 -0
  40. package/dist/components/forms/_.vue.d.ts.map +1 -0
  41. package/dist/components/inputs/InputField.vue.d.ts +1 -1
  42. package/dist/components/listings/Base.vue.d.ts +1 -1
  43. package/dist/components/listings/Event.vue.d.ts +1 -1
  44. package/dist/components/listings/{Test.vue.d.ts → Hotel.vue.d.ts} +3 -3
  45. package/dist/components/listings/Hotel.vue.d.ts.map +1 -0
  46. package/dist/components/modals/Info.vue.d.ts +1 -1
  47. package/dist/components/skeletons/AvailabilitySkeleton.vue.d.ts +1 -1
  48. package/dist/components/skeletons/Field.vue.d.ts +1 -1
  49. package/dist/components/skeletons/HotelSkeleton.vue.d.ts +1 -1
  50. package/dist/components/{side-panels/Hotel.vue.d.ts → skeletons/Sidebar.vue.d.ts} +3 -3
  51. package/dist/components/skeletons/Sidebar.vue.d.ts.map +1 -0
  52. package/dist/components/skeletons/_.vue.d.ts +1 -1
  53. package/dist/components/views/CheckoutWindow.vue.d.ts +1 -1
  54. package/dist/components/views/TermsOfService.vue.d.ts +1 -1
  55. package/dist/components/views/ThankYou.vue.d.ts +1 -1
  56. package/dist/{event-a9067cf5.js → event-46a84617.js} +43 -43
  57. package/dist/event-46a84617.js.br +0 -0
  58. package/dist/event-8738e24d.cjs +1 -0
  59. package/dist/event.cjs +1 -2
  60. package/dist/event.js +402 -706
  61. package/dist/event.js.br +0 -0
  62. package/dist/gift-card-validation.cjs +1 -1
  63. package/dist/gift-card-validation.js +72 -126
  64. package/dist/gift-card-validation.js.br +0 -0
  65. package/dist/gift-card.cjs +1 -1
  66. package/dist/gift-card.js +303 -391
  67. package/dist/gift-card.js.br +0 -0
  68. package/dist/hotel.cjs +5 -5
  69. package/dist/hotel.js +2215 -2229
  70. package/dist/hotel.js.br +0 -0
  71. package/dist/{index-d080b5a0.js → index-a3de1ca3.js} +32 -14
  72. package/dist/index-a3de1ca3.js.br +0 -0
  73. package/dist/{index-ec04c269.cjs → index-e81b12be.cjs} +1 -1
  74. package/dist/layouts/Availability.vue.d.ts +20 -67
  75. package/dist/layouts/Event.vue.d.ts +16 -242
  76. package/dist/layouts/GiftCard.vue.d.ts +29 -280
  77. package/dist/layouts/GiftCardValidation.vue.d.ts +16 -226
  78. package/dist/layouts/Hotel.vue.d.ts +33 -378
  79. package/dist/layouts/_.vue.d.ts +31 -20
  80. package/dist/polyfill.cjs +4 -4
  81. package/dist/polyfill.js +1587 -1576
  82. package/dist/polyfill.js.br +0 -0
  83. package/dist/store/availability.d.ts +1 -1
  84. package/dist/store/giftCard.d.ts +3 -3
  85. package/dist/store/hotel.d.ts +318 -204
  86. package/dist/store/tracking.d.ts +6 -14
  87. package/dist/store/utilities.d.ts +87 -81
  88. package/dist/style.css +1 -1
  89. package/dist/style.css.br +0 -0
  90. package/dist/types/index.d.ts +44 -8
  91. package/package.json +21 -21
  92. package/dist/ActionField-b87d2fd7.cjs +0 -1
  93. package/dist/ActionField-f3d5b218.js.br +0 -0
  94. package/dist/AvailabilitySkeleton-019ec202.js +0 -150
  95. package/dist/AvailabilitySkeleton-019ec202.js.br +0 -0
  96. package/dist/AvailabilitySkeleton-e288f5be.cjs +0 -1
  97. package/dist/Field-21bb32d7.cjs +0 -1
  98. package/dist/Field-6bfeedce.js +0 -59
  99. package/dist/Field-6bfeedce.js.br +0 -0
  100. package/dist/SelectField.vue_vue_type_style_index_0_lang-701aecad.js +0 -17193
  101. package/dist/SelectField.vue_vue_type_style_index_0_lang-701aecad.js.br +0 -0
  102. package/dist/SelectField.vue_vue_type_style_index_0_lang-a370e66d.cjs +0 -797
  103. package/dist/TextField-b8f4462a.js.br +0 -0
  104. package/dist/ThankYou-add684c1.cjs +0 -66
  105. package/dist/ThankYou-edbf753b.js +0 -14279
  106. package/dist/ThankYou-edbf753b.js.br +0 -0
  107. package/dist/applyGiftCard-c21f13ac.cjs +0 -1
  108. package/dist/applyGiftCard-dea77ba6.js.br +0 -0
  109. package/dist/components/forms/ReservationFormTest.vue.d.ts +0 -5
  110. package/dist/components/forms/ReservationFormTest.vue.d.ts.map +0 -1
  111. package/dist/components/listings/Test.vue.d.ts.map +0 -1
  112. package/dist/components/side-panels/Base.vue.d.ts +0 -5
  113. package/dist/components/side-panels/Base.vue.d.ts.map +0 -1
  114. package/dist/components/side-panels/Hotel.vue.d.ts.map +0 -1
  115. package/dist/event-2c6a2138.cjs +0 -1
  116. package/dist/event-a9067cf5.js.br +0 -0
  117. package/dist/index-d080b5a0.js.br +0 -0
  118. package/dist/payment-95b2392a.cjs +0 -2
  119. package/dist/payment-cce506b8.js.br +0 -0
package/dist/event.js.br CHANGED
Binary file
@@ -1 +1 @@
1
- "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-a370e66d.cjs"),c=require("./applyGiftCard-c21f13ac.cjs"),V=require("./ActionField-b87d2fd7.cjs");require("./TextField-99e69631.cjs");require("./_commonjsHelpers-6763f629.cjs");const y=a=>(e.pushScopeId("data-v-72b6e39c"),a=a(),e.popScopeId(),a),h=["innerHTML"],m={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},N=y(()=>e.createBaseVNode("span",null,"Loading...",-1)),F=e.defineComponent({__name:"GiftCardValidation",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{}},setup(a){const o=a,{t:n}=e.useI18n(),{voucher:u,isValid:p,amount:f,expirationDate:g,productName:B,isLoading:i}=e.storeToRefs(c.useApplyGiftCardStore()),{currency:b}=e.storeToRefs(e.useUtilityStore()),{apply:s}=c.useApplyGiftCardStore(),C={"--accentColor":o.accentColor,"--buttonBackground":o.buttonBackground,"--buttonBorder":o.buttonBorder,"--buttonBorderRadius":o.buttonBorderRadius,"--buttonColor":o.buttonColor,"--buttonFontFamily":o.buttonFontFamily,"--buttonFontSize":o.buttonFontSize,"--buttonTextTransform":o.buttonTextTransform,"--buttonFontWeight":o.buttonFontWeight,"--fontColor":o.fontColor,"--fontFamily":o.fontFamily,"--fontSize":o.fontSize,"--fontWeight":o.fontWeight,"--grayColor":o.grayColor,"--headerColor":o.headerColor,"--headerFontSize":o.headerFontSize,"--inputBackground":o.inputBackground,"--inputBorder":o.inputBorder,"--inputBorderRadius":o.inputBorderRadius,"--inputFontColor":o.inputFontColor,"--labelFontWeight":o.labelFontWeight,"--labelPadding":o.labelPadding,"--loadingColor":o.loadingColor,"--panelBackground":o.panelBackground,"--panelBorder":o.panelBorder,"--panelBorderRadius":o.panelBorderRadius,"--panelPadding":o.panelPadding};return(l,t)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-validation-module",class:"fresh-booking-app","access-token":l.accessToken,type:"gift-card",style:C},{default:e.withCtx(()=>[e.createBaseVNode("form",{onSubmit:t[3]||(t[3]=e.withModifiers(r=>e.unref(s)(),["prevent"]))},[e.createBaseVNode("h4",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.title")),1)]),e.createBaseVNode("p",{innerHTML:e.unref(n)("giftCardValidation.description")},null,8,h),e.createVNode(V.ActionField,{modelValue:e.unref(u),"onUpdate:modelValue":t[0]||(t[0]=r=>e.isRef(u)?u.value=r:null),icon:"gift-card",label:e.unref(n)("booking.reservation.giftCardCode"),buttonLabel:e.unref(n)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(i),"onUpdate:isLoading":t[1]||(t[1]=r=>e.isRef(i)?i.value=r:null),onAction:t[2]||(t[2]=r=>e.unref(s)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(i)&&e.unref(p)?(e.openBlock(),e.createElementBlock("table",m,[e.createBaseVNode("thead",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.giftCard")),1),e.createVNode(e.Icon,{icon:"gift-card",type:"fas","icon-color":l.headerColor},null,8,["icon-color"])]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.balance")),1),e.createVNode(e.Icon,{icon:"money-bill",type:"fas","icon-color":l.headerColor},null,8,["icon-color"])]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.expirationDate")),1),e.createVNode(e.Icon,{icon:"timer",type:"fas","icon-color":l.headerColor},null,8,["icon-color"])])])]),e.createBaseVNode("tbody",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(B)),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showPrice)(e.unref(f),e.unref(b))),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showDate)(e.unref(g))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token"])]),fallback:e.withCtx(()=>[N]),_:1}))}});const k=e._export_sfc(F,[["__scopeId","data-v-72b6e39c"]]),d=e.createApp({components:{GiftCardValidation:k}}),S=e.createPinia();d.use(S);d.use(e.instance);d.mount("#konnectio-gift-card-validation-app");module.exports=d;
1
+ "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-2b92f88c.cjs"),c=require("./NumberField.vue_vue_type_script_setup_true_lang-d756efc3.cjs"),_=require("./ActionField-8a007a6c.cjs");require("./TextField-641e6fd1.cjs");require("./_commonjsHelpers-6763f629.cjs");const y=o=>(e.pushScopeId("data-v-5d5827dc"),o=o(),e.popScopeId(),o),N=["innerHTML"],B={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},m=y(()=>e.createBaseVNode("span",null,"Loading...",-1)),C=e.defineComponent({name:"GiftCardValidationLayout",__name:"GiftCardValidation",props:{accessToken:{},styling:{}},setup(o){const{t:a}=e.useI18n(),{voucher:l,isValid:u,amount:p,expirationDate:f,productName:V,isLoading:i}=e.storeToRefs(c.useApplyGiftCardStore()),{currency:g}=e.storeToRefs(e.useUtilityStore()),{apply:s}=c.useApplyGiftCardStore();return(d,t)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-validation-module","access-token":d.accessToken,type:"gift-card",styling:d.styling},{default:e.withCtx(()=>[e.createBaseVNode("form",{onSubmit:t[3]||(t[3]=e.withModifiers(n=>e.unref(s)(),["prevent"]))},[e.createBaseVNode("h4",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.title")),1)]),e.createBaseVNode("p",{innerHTML:e.unref(a)("giftCardValidation.description")},null,8,N),e.createVNode(_.ActionField,{modelValue:e.unref(l),"onUpdate:modelValue":t[0]||(t[0]=n=>e.isRef(l)?l.value=n:null),icon:"gift-card",label:e.unref(a)("booking.reservation.giftCardCode"),buttonLabel:e.unref(a)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(i),"onUpdate:isLoading":t[1]||(t[1]=n=>e.isRef(i)?i.value=n:null),onAction:t[2]||(t[2]=n=>e.unref(s)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(i)&&e.unref(u)?(e.openBlock(),e.createElementBlock("table",B,[e.createBaseVNode("thead",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.giftCard")),1),e.createVNode(e.Icon,{icon:"gift-card",type:"fas",color:"header"})]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.balance")),1),e.createVNode(e.Icon,{icon:"money-bill",type:"fas",color:"header"})]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.expirationDate")),1),e.createVNode(e.Icon,{icon:"timer",type:"fas",color:"header"})])])]),e.createBaseVNode("tbody",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(V)),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showPrice)(e.unref(p),e.unref(g))),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showDate)(e.unref(f))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token","styling"])]),fallback:e.withCtx(()=>[m]),_:1}))}});const b=e._export_sfc(C,[["__scopeId","data-v-5d5827dc"]]),r=e.createApp({components:{GiftCardValidation:b}}),v=e.createPinia();r.use(v);r.use(e.instance);r.mount("#konnectio-gift-card-validation-app");module.exports=r;
@@ -1,170 +1,116 @@
1
- import { h as v, t as R, s as C, a as T, k as m, l as z, w as c, m as d, q as t, v as l, n, x as B, y as W, z as g, A as L, B as P, D as X, F as x, G as w, H as A, J as I, K as D, _ as G, L as N, M, N as H } from "./SelectField.vue_vue_type_style_index_0_lang-701aecad.js";
2
- import { u as h } from "./applyGiftCard-dea77ba6.js";
3
- import { A as U } from "./ActionField-f3d5b218.js";
4
- import "./TextField-b8f4462a.js";
1
+ import { h as L, y as S, s as g, a as X, k as _, l as w, w as u, m as l, x as a, z as o, n as t, A as y, q as x, B as p, D as A, F as B, t as G, G as I, H as D, J as N, K as T, L as M, _ as H, M as P, N as U, P as $ } from "./SelectField.vue_vue_type_style_index_0_lang-d1f9b48d.js";
2
+ import { u as b } from "./NumberField.vue_vue_type_script_setup_true_lang-d3b3206f.js";
3
+ import { A as F } from "./ActionField-d1266f8b.js";
4
+ import "./TextField-4e7defc6.js";
5
5
  import "./_commonjsHelpers-c5d32002.js";
6
- const $ = (i) => (I("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E = {
6
+ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z = {
7
7
  key: 0,
8
8
  id: "fresh-booking-gift-card-validation-resume",
9
9
  class: "fresh-booking-panel"
10
- }, J = /* @__PURE__ */ $(() => /* @__PURE__ */ t("span", null, "Loading...", -1)), K = /* @__PURE__ */ v({
10
+ }, E = /* @__PURE__ */ R(() => /* @__PURE__ */ a("span", null, "Loading...", -1)), J = /* @__PURE__ */ L({
11
+ name: "GiftCardValidationLayout",
11
12
  __name: "GiftCardValidation",
12
13
  props: {
13
14
  accessToken: {},
14
- accentColor: {},
15
- buttonBackground: {},
16
- buttonBorder: {},
17
- buttonBorderRadius: {},
18
- buttonColor: {},
19
- buttonFontFamily: {},
20
- buttonFontSize: {},
21
- buttonTextTransform: {},
22
- buttonFontWeight: {},
23
- fontColor: {},
24
- fontFamily: {},
25
- fontSize: {},
26
- fontWeight: {},
27
- grayColor: {},
28
- headerColor: {},
29
- headerFontSize: {},
30
- inputBackground: {},
31
- inputBorder: {},
32
- inputBorderRadius: {},
33
- inputFontColor: {},
34
- labelFontWeight: {},
35
- labelPadding: {},
36
- loadingColor: {},
37
- panelBackground: {},
38
- panelBorder: {},
39
- panelBorderRadius: {},
40
- panelPadding: {}
15
+ styling: {}
41
16
  },
42
- setup(i) {
43
- const o = i, { t: e } = R(), {
44
- voucher: p,
45
- isValid: y,
46
- amount: F,
47
- expirationDate: k,
48
- productName: _,
49
- isLoading: s
50
- } = C(h()), { currency: S } = C(T()), { apply: b } = h(), V = {
51
- "--accentColor": o.accentColor,
52
- "--buttonBackground": o.buttonBackground,
53
- "--buttonBorder": o.buttonBorder,
54
- "--buttonBorderRadius": o.buttonBorderRadius,
55
- "--buttonColor": o.buttonColor,
56
- "--buttonFontFamily": o.buttonFontFamily,
57
- "--buttonFontSize": o.buttonFontSize,
58
- "--buttonTextTransform": o.buttonTextTransform,
59
- "--buttonFontWeight": o.buttonFontWeight,
60
- "--fontColor": o.fontColor,
61
- "--fontFamily": o.fontFamily,
62
- "--fontSize": o.fontSize,
63
- "--fontWeight": o.fontWeight,
64
- "--grayColor": o.grayColor,
65
- "--headerColor": o.headerColor,
66
- "--headerFontSize": o.headerFontSize,
67
- "--inputBackground": o.inputBackground,
68
- "--inputBorder": o.inputBorder,
69
- "--inputBorderRadius": o.inputBorderRadius,
70
- "--inputFontColor": o.inputFontColor,
71
- "--labelFontWeight": o.labelFontWeight,
72
- "--labelPadding": o.labelPadding,
73
- "--loadingColor": o.loadingColor,
74
- "--panelBackground": o.panelBackground,
75
- "--panelBorder": o.panelBorder,
76
- "--panelBorderRadius": o.panelBorderRadius,
77
- "--panelPadding": o.panelPadding
78
- };
79
- return (u, a) => (m(), z(A, null, {
80
- default: c(() => [
81
- d(w, {
17
+ setup(s) {
18
+ const { t: e } = S(), {
19
+ voucher: r,
20
+ isValid: C,
21
+ amount: V,
22
+ expirationDate: h,
23
+ productName: k,
24
+ isLoading: d
25
+ } = g(b()), { currency: v } = g(X()), { apply: f } = b();
26
+ return (m, n) => (_(), w(N, null, {
27
+ default: u(() => [
28
+ l(D, {
82
29
  id: "fresh-booking-gift-card-validation-module",
83
- class: "fresh-booking-app",
84
- "access-token": u.accessToken,
30
+ "access-token": m.accessToken,
85
31
  type: "gift-card",
86
- style: V
32
+ styling: m.styling
87
33
  }, {
88
- default: c(() => [
89
- t("form", {
90
- onSubmit: a[3] || (a[3] = x((r) => n(b)(), ["prevent"]))
34
+ default: u(() => [
35
+ a("form", {
36
+ onSubmit: n[3] || (n[3] = I((i) => t(f)(), ["prevent"]))
91
37
  }, [
92
- t("h4", null, [
93
- t("span", null, l(n(e)("giftCardValidation.title")), 1)
38
+ a("h4", null, [
39
+ a("span", null, o(t(e)("giftCardValidation.title")), 1)
94
40
  ]),
95
- t("p", {
96
- innerHTML: n(e)("giftCardValidation.description")
41
+ a("p", {
42
+ innerHTML: t(e)("giftCardValidation.description")
97
43
  }, null, 8, q),
98
- d(U, {
99
- modelValue: n(p),
100
- "onUpdate:modelValue": a[0] || (a[0] = (r) => B(p) ? p.value = r : null),
44
+ l(F, {
45
+ modelValue: t(r),
46
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => y(r) ? r.value = i : null),
101
47
  icon: "gift-card",
102
- label: n(e)("booking.reservation.giftCardCode"),
103
- buttonLabel: n(e)("giftCardValidation.submitButton"),
48
+ label: t(e)("booking.reservation.giftCardCode"),
49
+ buttonLabel: t(e)("giftCardValidation.submitButton"),
104
50
  placeholder: "XXXXXXXX",
105
- "is-loading": n(s),
106
- "onUpdate:isLoading": a[1] || (a[1] = (r) => B(s) ? s.value = r : null),
107
- onAction: a[2] || (a[2] = (r) => n(b)())
51
+ "is-loading": t(d),
52
+ "onUpdate:isLoading": n[1] || (n[1] = (i) => y(d) ? d.value = i : null),
53
+ onAction: n[2] || (n[2] = (i) => t(f)())
108
54
  }, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
109
- !n(s) && n(y) ? (m(), W("table", E, [
110
- t("thead", null, [
111
- t("tr", null, [
112
- t("th", null, [
113
- t("span", null, l(n(e)("giftCardValidation.giftCard")), 1),
114
- d(g, {
55
+ !t(d) && t(C) ? (_(), x("table", z, [
56
+ a("thead", null, [
57
+ a("tr", null, [
58
+ a("th", null, [
59
+ a("span", null, o(t(e)("giftCardValidation.giftCard")), 1),
60
+ l(p, {
115
61
  icon: "gift-card",
116
62
  type: "fas",
117
- "icon-color": u.headerColor
118
- }, null, 8, ["icon-color"])
63
+ color: "header"
64
+ })
119
65
  ]),
120
- t("th", null, [
121
- t("span", null, l(n(e)("giftCardValidation.balance")), 1),
122
- d(g, {
66
+ a("th", null, [
67
+ a("span", null, o(t(e)("giftCardValidation.balance")), 1),
68
+ l(p, {
123
69
  icon: "money-bill",
124
70
  type: "fas",
125
- "icon-color": u.headerColor
126
- }, null, 8, ["icon-color"])
71
+ color: "header"
72
+ })
127
73
  ]),
128
- t("th", null, [
129
- t("span", null, l(n(e)("giftCardValidation.expirationDate")), 1),
130
- d(g, {
74
+ a("th", null, [
75
+ a("span", null, o(t(e)("giftCardValidation.expirationDate")), 1),
76
+ l(p, {
131
77
  icon: "timer",
132
78
  type: "fas",
133
- "icon-color": u.headerColor
134
- }, null, 8, ["icon-color"])
79
+ color: "header"
80
+ })
135
81
  ])
136
82
  ])
137
83
  ]),
138
- t("tbody", null, [
139
- t("tr", null, [
140
- t("td", null, [
141
- t("span", null, l(n(_)), 1)
84
+ a("tbody", null, [
85
+ a("tr", null, [
86
+ a("td", null, [
87
+ a("span", null, o(t(k)), 1)
142
88
  ]),
143
- t("td", null, [
144
- t("span", null, l(n(L)(n(F), n(S))), 1)
89
+ a("td", null, [
90
+ a("span", null, o(t(A)(t(V), t(v))), 1)
145
91
  ]),
146
- t("td", null, [
147
- t("span", null, l(n(P)(n(k))), 1)
92
+ a("td", null, [
93
+ a("span", null, o(t(B)(t(h))), 1)
148
94
  ])
149
95
  ])
150
96
  ])
151
- ])) : X("", !0)
97
+ ])) : G("", !0)
152
98
  ], 32)
153
99
  ]),
154
100
  _: 1
155
- }, 8, ["access-token"])
101
+ }, 8, ["access-token", "styling"])
156
102
  ]),
157
- fallback: c(() => [
158
- J
103
+ fallback: u(() => [
104
+ E
159
105
  ]),
160
106
  _: 1
161
107
  }));
162
108
  }
163
109
  });
164
- const j = /* @__PURE__ */ G(K, [["__scopeId", "data-v-72b6e39c"]]), f = N({ components: { GiftCardValidation: j } }), O = M();
165
- f.use(O);
166
- f.use(H);
167
- f.mount("#konnectio-gift-card-validation-app");
110
+ const K = /* @__PURE__ */ H(J, [["__scopeId", "data-v-5d5827dc"]]), c = P({ components: { GiftCardValidation: K } }), j = U();
111
+ c.use(j);
112
+ c.use($);
113
+ c.mount("#konnectio-gift-card-validation-app");
168
114
  export {
169
- f as default
115
+ c as default
170
116
  };
Binary file
@@ -1 +1 @@
1
- "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-a370e66d.cjs"),F=require("./index-ec04c269.cjs"),R=require("./TextField-99e69631.cjs"),V=require("./Field-21bb32d7.cjs");require("./_commonjsHelpers-6763f629.cjs");const G=e.defineStore("giftCard",()=>{const{display:p}=e.useAlertStore(),{bearerToken:o,metaData:t}=e.storeToRefs(e.useUtilityStore()),l=e.ref(e.GiftCardModuleState.InitialState),y=e.useStorage("freshBookingName","",void 0,{serializer:e.StorageSerializers.string}),u=e.useStorage("freshBookingEmail","",void 0,{serializer:e.StorageSerializers.string}),c=e.useStorage("freshBookingPhone","",void 0,{serializer:e.StorageSerializers.string}),m=e.ref(""),b=e.ref(1),B=e.ref(!0),S=e.ref(""),f=e.ref({base64:"",type:"",name:""}),n=e.ref(void 0),d=e.ref(0),s=e.ref(!1),h=e.ref(0),g=e.computed(()=>l.value===e.GiftCardModuleState.InitialState||l.value===e.GiftCardModuleState.WaitingForResponse),k=e.computed(()=>l.value===e.GiftCardModuleState.ReadyToPay),N=e.computed(()=>l.value===e.GiftCardModuleState.PaymentSuccess),v=e.computed(()=>{const r={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},a=t.value.places;return a&&a.forEach(_=>{r[_.placeType].data.push(_)}),Object.fromEntries(Object.entries(r).filter(([,_])=>_.data.length>0))}),z=e.computed(()=>h.value!==0),C=e.computed(()=>{let r;if(z.value)r=v.value[h.value].data[0];else if(d.value!==0){const a=n.value,_=v.value[d.value].data;_.length===1?r=_[0]:a!==void 0&&_.forEach(i=>{String(i.id)===String(a)&&(r=i)})}return r}),w=e.computed(()=>!(!y.value||!u.value||!(c.value.length>=5)||!m.value||C.value===void 0)),x=e.computed(()=>!(l.value===e.GiftCardModuleState.InitialState&&s.value)),E=e.computed(()=>!!(l.value===e.GiftCardModuleState.WaitingForResponse&&s.value));async function P(){l.value=e.GiftCardModuleState.WaitingForResponse,s.value=!0,await e.axios.post("https://stage.hotel-service.freshbooking.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:t.value.currency.id,language:e.getUserLanguage(),amount:m.value,quantity:b.value,freeText:S.value,showPrice:B.value,contactName:y.value,contactEmail:u.value,contactPhone:c.value,imageBase64:e.b2a(f.value.base64),imageName:f.value.name,imageFormat:f.value.type,placeType:C.value?C.value.placeType:void 0,placeID:C.value?C.value.id:void 0},{headers:{Authorization:o.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.9"}}).then(r=>{if(s.value=!1,r.data.easyPayment){l.value=e.GiftCardModuleState.ReadyToPay;const a=new Reepay.EmbeddedCheckout(r.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});a.addEventHandler(e.ReepayEvent.Accept,()=>{l.value=e.GiftCardModuleState.PaymentSuccess,p({message:e.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),a.addEventHandler(e.ReepayEvent.Error,()=>{p({message:e.i18n.t("booking.other.errorMessage"),type:"warning"})})}else l.value=e.GiftCardModuleState.InitialState,p({message:`${e.i18n.t("booking.other.errorMessage")} (HTTP: ${r.status})`,type:"warning"})})}function M(r){h.value=r}return{moduleState:l,name:y,email:u,phone:c,value:m,remark:S,showValue:B,quantity:b,media:f,placeId:n,placeType:d,showFormPage:g,showPaymentPage:k,showConfirmationPage:N,places:v,hasFilledForm:w,hasForcedPlaceType:z,isWaitingForResponse:E,isMetaDataAvailable:x,orderGiftCard:P,initialize:M}}),I={class:"media-selector"},W=["accept"],D={class:"media-selector-wrapper"},L={class:"media-selector-tools"},A={key:0},H={key:1},j={key:2},O=["src"],K=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(p,{emit:o}){const t=p,{t:l}=e.useI18n(),{display:y}=e.useAlertStore(),u=e.ref(),c=e.computed(()=>t.modelValue.base64!=="");function m(n){o("update:modelValue",n)}function b(){m({base64:"",name:"",type:""}),u.value&&(u.value.value="")}function B(){u.value&&u.value.click()}function S(n,d){const[s,h]=[n.name,n.type],g=new FileReader;g.onload=function(k){if(k.target){const N=k.target.result;d({base64:N,name:s,type:h})}else y({message:l("imageUploadError"),type:"error"})},g.readAsDataURL(n)}async function f(){let n;(n=u.value.files)instanceof FileList&&S(n[0],m)}return(n,d)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",I,[e.createBaseVNode("input",{ref_key:"fileInput",ref:u,type:"file",class:"hidden",accept:n.validation,single:"",onChange:d[0]||(d[0]=s=>f())},null,40,W),e.createBaseVNode("div",D,[e.createBaseVNode("ul",L,[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(e.Clickable,{label:e.unref(l)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:d[1]||(d[1]=s=>B())},null,8,["label","icon-color"])])),c.value?(e.openBlock(),e.createElementBlock("li",H,[e.createVNode(e.Clickable,{label:e.unref(l)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:d[2]||(d[2]=s=>B())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(l)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:d[3]||(d[3]=s=>b())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:c.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,O)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function U(p){const o=p;o.__i18n=o.__i18n||[],o.__i18n.push({locale:"",resource:{da:{uploadFile:t=>{const{normalize:l}=t;return l(["Upload billede"])},removeFile:t=>{const{normalize:l}=t;return l(["Fjern billede"])},replaceFile:t=>{const{normalize:l}=t;return l(["Ersat billede"])},imageUploadError:t=>{const{normalize:l}=t;return l(["Der skete en fejl under billede upload!"])}},en:{uploadFile:t=>{const{normalize:l}=t;return l(["Upload image"])},removeFile:t=>{const{normalize:l}=t;return l(["Remove image"])},replaceFile:t=>{const{normalize:l}=t;return l(["Replace image"])},imageUploadError:t=>{const{normalize:l}=t;return l(["An error occurred under image upload!"])}}}})}typeof U=="function"&&U(K);const Y={class:"gift-card-skeleton"},J={class:"gift-card-skeleton-form"},Q=e.defineComponent({__name:"GiftCardSkeleton",setup(p){return(o,t)=>(e.openBlock(),e.createElementBlock("div",Y,[e.createBaseVNode("div",J,[e.createVNode(V.Field),e.createVNode(V.Field),e.createVNode(V.Field),e.createVNode(V.Field),e.createVNode(V.Field,{"is-text-area":""}),e.createVNode(V.Element,{height:"44px"})])]))}});const X=e._export_sfc(Q,[["__scopeId","data-v-2600a731"]]),Z={key:0,id:"fresh-booking-gift-card-wrapper"},ee={id:"fresh-booking-gift-card-title"},te={id:"fresh-booking-gift-card-content"},oe={id:"fresh-booking-gift-card-payment"},le=["innerHTML"],ae={key:0},ne={key:0,id:"fresh-booking-select-place-type"},re={class:e.normalizeClass(["fresh-booking-label","required"])},ie={id:"fresh-booking-select-place-type-input"},de=["innerHTML"],ue={key:0,id:"fresh-booking-gift-card-order"},ce={class:"fresh-booking-panel"},se={key:1,id:"fresh-booking-gift-card-remarks"},fe={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},pe={id:"fresh-booking-gift-card-recaptcha"},me=e.defineComponent({__name:"GiftCard",props:{accessToken:{},accentColor:{default:"#6ab1e6"},buttonBackground:{default:"#068175"},buttonBorder:{default:null},buttonBorderRadius:{default:"4px"},buttonColor:{default:"#FFF"},buttonFontFamily:{default:"inherit"},buttonFontSize:{default:"14px"},buttonTextTransform:{default:"uppercase"},buttonFontWeight:{default:"400"},fontColor:{default:"#3b3b3b"},fontFamily:{default:"inherit"},fontSize:{default:"16px"},fontWeight:{},grayColor:{default:"grey"},headerColor:{default:"#000"},headerFontSize:{},inputBackground:{default:"#fff"},inputBorder:{default:"1px solid rgba(0, 0, 0, 0.15)"},inputBorderRadius:{default:"0px"},inputBorderWidth:{default:"1px"},inputFontColor:{default:"#000000"},labelFontWeight:{default:"bold"},labelPadding:{default:"6px"},layout:{default:"minimal"},loadingColor:{default:"#000"},panelBackground:{default:"#ffffff"},panelBorder:{default:null},panelBorderRadius:{default:"8px"},panelPadding:{default:"24px"},placeType:{},successColor:{default:"green"}},setup(p){const o=p,{t}=e.useI18n(),{name:l,email:y,phone:u,value:c,remark:m,showValue:b,quantity:B,media:S,placeId:f,placeType:n,showFormPage:d,showPaymentPage:s,showConfirmationPage:h,places:g,hasFilledForm:k,hasForcedPlaceType:N,isWaitingForResponse:v,isMetaDataAvailable:z}=e.storeToRefs(G()),{initialize:C,orderGiftCard:w}=G(),{isRecaptchaEnabled:x,currency:E}=e.storeToRefs(e.useUtilityStore());e.useAlertStore();async function P(){await w()}e.watch(n,()=>{f.value=void 0}),e.onMounted(()=>{C(parseInt(o.placeType))});const M={"--accentColor":o.accentColor,"--buttonBackground":o.buttonBackground,"--buttonBorder":o.buttonBorder,"--buttonBorderRadius":o.buttonBorderRadius,"--buttonFontFamily":o.buttonFontFamily,"--buttonColor":o.buttonColor,"--buttonFontSize":o.buttonFontSize,"--buttonTextTransform":o.buttonTextTransform,"--buttonFontWeight":o.buttonFontWeight,"--fontColor":o.fontColor,"--fontFamily":o.fontFamily,"--fontSize":o.fontSize,"--fontWeight":o.fontWeight,"--grayColor":o.grayColor,"--headerColor":o.headerColor,"--headerFontSize":o.headerFontSize,"--inputBackground":o.inputBackground,"--inputBorder":o.inputBorder,"--inputBorderRadius":o.inputBorderRadius,"--inputFontColor":o.inputFontColor,"--inputBorderWidth":o.inputBorderWidth,"--labelFontWeight":o.labelFontWeight,"--labelPadding":o.labelPadding,"--loadingColor":o.loadingColor,"--panelBackground":o.panelBackground,"--panelBorder":o.panelBorder,"--panelBorderRadius":o.panelBorderRadius,"--panelPadding":o.panelPadding,"--successColor":o.successColor};return(r,a)=>{const _=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":r.accessToken,"data-layout":r.layout,style:M,"sticky-container":""},{default:e.withCtx(()=>[e.unref(z)?(e.openBlock(),e.createElementBlock("div",Z,[e.createBaseVNode("h4",ee,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(t)("giftCard.title")),1)]),e.createBaseVNode("div",te,[e.withDirectives(e.createBaseVNode("div",oe,null,512),[[e.vShow,e.unref(s)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(t)("giftCard.description")},null,8,le),e.createBaseVNode("form",null,[e.createVNode(R.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":a[0]||(a[0]=i=>e.isRef(l)?l.value=i:null),type:"text",name:"name",autocomplete:"name",label:e.unref(t)("giftCard.name"),icon:"user-alt","icon-color":r.accentColor,placeholder:e.unref(t)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(R.TextField,{modelValue:e.unref(y),"onUpdate:modelValue":a[1]||(a[1]=i=>e.isRef(y)?y.value=i:null),type:"email",name:"email",autocomplete:"email",label:e.unref(t)("giftCard.email"),icon:"at","icon-color":r.accentColor,placeholder:e.unref(t)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(F.PhoneField,{modelValue:e.unref(u),"onUpdate:modelValue":a[2]||(a[2]=i=>e.isRef(u)?u.value=i:null),icon:"phone-office","icon-color":r.accentColor,label:e.unref(t)("giftCard.phone"),placeholder:e.unref(t)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(N)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ae,[e.unref(g)?(e.openBlock(),e.createElementBlock("div",ne,[e.createBaseVNode("label",re,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(t)("giftCard.selectType")),1)]),e.createBaseVNode("div",ie,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(i,q)=>(e.openBlock(),e.createElementBlock("li",{key:q},[e.createVNode(F.Checkbox,{modelValue:e.unref(n),"onUpdate:modelValue":a[3]||(a[3]=$=>e.isRef(n)?n.value=$:null),type:"radio",name:"placeType",val:q,label:i.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(g)[e.unref(n)]&&e.unref(g)[e.unref(n)].data.length>1?(e.openBlock(),e.createBlock(R._sfc_main,{key:0,modelValue:e.unref(f),"onUpdate:modelValue":a[4]||(a[4]=i=>e.isRef(f)?f.value=i:null),placeholder:e.unref(t)("giftCard.selectPlacePlaceholder"),options:e.unref(g)[e.unref(n)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1,color:r.loadingColor},null,8,["color"]))])),e.createVNode(R.TextField,{modelValue:e.unref(c),"onUpdate:modelValue":a[5]||(a[5]=i=>e.isRef(c)?c.value=i:null),type:"number",name:"value",label:e.unref(t)("giftCard.value"),icon:"money-bill","icon-color":r.accentColor,placeholder:e.unref(t)("giftCard.valuePlaceholder"),suffix:e.unref(E),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(F.Checkbox,{modelValue:e.unref(b),"onUpdate:modelValue":a[6]||(a[6]=i=>e.isRef(b)?b.value=i:null),type:"checkbox",name:"showValue",label:e.unref(t)("giftCard.showValue"),checked:e.unref(b)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(d)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(t)("giftCard.thankYou")},null,8,de)],512),[[e.vShow,e.unref(h)]])]),r.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createBaseVNode("div",ce,[e.createVNode(e.Clickable,{label:e.unref(t)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"is-loading":e.unref(v),"onUpdate:isLoading":a[9]||(a[9]=i=>e.isRef(v)?v.value=i:null),onClickEvent:P},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(R.TextField,{modelValue:e.unref(m),"onUpdate:modelValue":a[10]||(a[10]=i=>e.isRef(m)?m.value=i:null),type:"textarea",name:"remark",label:e.unref(t)("giftCard.remark"),icon:"info-circle","icon-color":r.accentColor,placeholder:e.unref(t)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","icon-color","placeholder"])])):e.createCommentVNode("",!0),e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(e.Clickable,{label:e.unref(t)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"data-test":"orderGiftCard","is-loading":e.unref(v),"onUpdate:isLoading":a[11]||(a[11]=i=>e.isRef(v)?v.value=i:null),onClickEvent:P},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",pe,[e.createVNode(F._sfc_main)],512),[[e.vShow,e.unref(x)]])])),[[_]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[e.createVNode(X)]),_:1})}}});const ge=e._export_sfc(me,[["__scopeId","data-v-05b676e9"]]),ve=e.createPinia(),T=e.createApp({components:{GiftCard:ge}});T.use(ve);T.use(e.instance);T.use(F.StickyPlugin);T.use(F.install,{bootstrap:!1});T.mount("#konnectio-gift-card-app");
1
+ "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-2b92f88c.cjs"),V=require("./index-e81b12be.cjs"),M=require("./_-82677476.cjs"),x=require("./TextField-641e6fd1.cjs"),R=require("./Field-028d9987.cjs");require("./_commonjsHelpers-6763f629.cjs");const U=e.defineStore("giftCard",()=>{e.useAlertStore();const{pay:y}=M.usePaymentStore(),{bearerToken:l,metaData:o}=e.storeToRefs(e.useUtilityStore()),t=e.ref(e.GiftCardModuleState.InitialState),g=e.useStorage("freshBookingName","",void 0,{serializer:e.StorageSerializers.string}),d=e.useStorage("freshBookingEmail","",void 0,{serializer:e.StorageSerializers.string}),c=e.useStorage("freshBookingPhone","",void 0,{serializer:e.StorageSerializers.string}),p=e.ref(""),F=e.ref(1),C=e.ref(!0),k=e.ref(""),s=e.ref({base64:"",type:"",name:""}),n=e.ref(void 0),i=e.ref(0),f=e.ref(!1),m=e.ref(0),h=e.computed(()=>t.value===e.GiftCardModuleState.InitialState||t.value===e.GiftCardModuleState.WaitingForResponse),B=e.computed(()=>t.value===e.GiftCardModuleState.ReadyToPay),v=e.computed(()=>t.value===e.GiftCardModuleState.PaymentSuccess),w=e.computed(()=>{const u={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},a=o.value.places;return a&&a.forEach(_=>{u[_.placeType].data.push(_)}),Object.fromEntries(Object.entries(u).filter(([,_])=>_.data.length>0))}),T=e.computed(()=>m.value!==0),b=e.computed(()=>{let u;if(T.value)u=w.value[m.value].data[0];else if(i.value!==0){const a=n.value,_=w.value[i.value].data;_.length===1?u=_[0]:a!==void 0&&_.forEach(z=>{String(z.id)===String(a)&&(u=z)})}return u}),E=e.computed(()=>!(!g.value||!d.value||!(c.value.length>=5)||!p.value||b.value===void 0)),q=e.computed(()=>!(t.value===e.GiftCardModuleState.InitialState&&f.value)),P=e.computed(()=>!!(t.value===e.GiftCardModuleState.WaitingForResponse&&f.value));async function N(){t.value=e.GiftCardModuleState.WaitingForResponse,f.value=!0,await e.axios.post("https://stage.hotel_service.konnectio.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:o.value.currency.id,language:e.getUserLanguage(),amount:p.value,quantity:F.value,freeText:k.value,showPrice:C.value,contactName:g.value,contactEmail:d.value,contactPhone:c.value,imageBase64:e.b2a(s.value.base64),imageName:s.value.name,imageFormat:s.value.type,placeType:b.value?b.value.placeType:void 0,placeID:b.value?b.value.id:void 0},{headers:{Authorization:l.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.11"}}).then(u=>{t.value=e.GiftCardModuleState.ReadyToPay,f.value=!1,y({callback:()=>console.log("Callback!"),response:u.data})})}function r(u){u&&(m.value=u)}return{moduleState:t,name:g,email:d,phone:c,value:p,remark:k,showValue:C,quantity:F,media:s,placeId:n,placeType:i,showFormPage:h,showPaymentPage:B,showConfirmationPage:v,places:w,hasFilledForm:E,hasForcedPlaceType:T,isWaitingForResponse:P,isMetaDataAvailable:q,orderGiftCard:N,initialize:r}}),$={class:"media-selector"},D=["accept"],I={class:"media-selector-wrapper"},L={class:"media-selector-tools"},A={key:0},W={key:1},j={key:2},H=["src"],O=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(y,{emit:l}){const o=y,{t}=e.useI18n(),{display:g}=e.useAlertStore(),d=e.ref(),c=e.computed(()=>o.modelValue.base64!=="");function p(n){l("update:modelValue",n)}function F(){p({base64:"",name:"",type:""}),d.value&&(d.value.value="")}function C(){d.value&&d.value.click()}function k(n,i){const[f,m]=[n.name,n.type],h=new FileReader;h.onload=function(B){if(B.target){const v=B.target.result;i({base64:v,name:f,type:m})}else g({message:t("imageUploadError"),type:"error"})},h.readAsDataURL(n)}async function s(){let n;(n=d.value.files)instanceof FileList&&k(n[0],p)}return(n,i)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",$,[e.createBaseVNode("input",{ref_key:"fileInput",ref:d,type:"file",class:"hidden",accept:n.validation,single:"",onChange:i[0]||(i[0]=f=>s())},null,40,D),e.createBaseVNode("div",I,[e.createBaseVNode("ul",L,[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(e.Clickable,{label:e.unref(t)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:i[1]||(i[1]=f=>C())},null,8,["label","icon-color"])])),c.value?(e.openBlock(),e.createElementBlock("li",W,[e.createVNode(e.Clickable,{label:e.unref(t)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:i[2]||(i[2]=f=>C())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(t)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:i[3]||(i[3]=f=>F())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:c.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,H)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function G(y){const l=y;l.__i18n=l.__i18n||[],l.__i18n.push({locale:"",resource:{da:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload billede"])},removeFile:o=>{const{normalize:t}=o;return t(["Fjern billede"])},replaceFile:o=>{const{normalize:t}=o;return t(["Ersat billede"])},imageUploadError:o=>{const{normalize:t}=o;return t(["Der skete en fejl under billede upload!"])}},en:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload image"])},removeFile:o=>{const{normalize:t}=o;return t(["Remove image"])},replaceFile:o=>{const{normalize:t}=o;return t(["Replace image"])},imageUploadError:o=>{const{normalize:t}=o;return t(["An error occurred under image upload!"])}}}})}typeof G=="function"&&G(O);const K={class:"gift-card-skeleton"},Y={class:"gift-card-skeleton-form"},J=e.defineComponent({__name:"GiftCardSkeleton",setup(y){return(l,o)=>(e.openBlock(),e.createElementBlock("div",K,[e.createBaseVNode("div",Y,[e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field,{"is-text-area":""}),e.createVNode(M.Element,{height:"44px"})])]))}});const Q=e._export_sfc(J,[["__scopeId","data-v-2600a731"]]),X={key:0,id:"fresh-booking-gift-card-wrapper"},Z={id:"fresh-booking-gift-card-title"},ee={id:"fresh-booking-gift-card-content"},te={id:"fresh-booking-gift-card-payment"},ae=["innerHTML"],le={key:0},oe={key:0,id:"fresh-booking-select-place-type"},ne={class:e.normalizeClass(["fresh-booking-label","required"])},re={id:"fresh-booking-select-place-type-input"},ie=["innerHTML"],de={key:0,id:"fresh-booking-gift-card-order"},se={class:"fresh-booking-panel"},ue={key:1,id:"fresh-booking-gift-card-remarks"},ce={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},fe={id:"fresh-booking-gift-card-recaptcha"},pe=e.defineComponent({name:"GiftCardLayout",__name:"GiftCard",props:{accessToken:{},layout:{default:"minimal"},placeType:{},styling:{}},setup(y){const{t:l}=e.useI18n(),{name:o,email:t,phone:g,value:d,remark:c,showValue:p,quantity:F,media:C,placeId:k,placeType:s,showFormPage:n,showPaymentPage:i,showConfirmationPage:f,places:m,hasFilledForm:h,hasForcedPlaceType:B,isWaitingForResponse:v,isMetaDataAvailable:w}=e.storeToRefs(U()),{initialize:T,orderGiftCard:b}=U(),{isRecaptchaEnabled:E,currency:q}=e.storeToRefs(e.useUtilityStore());async function P(){await b()}return e.watch(s,()=>{k.value=void 0}),e.onMounted(()=>{T()}),(N,r)=>{const u=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-module",type:"gift-card","access-token":N.accessToken,"data-layout":N.layout,styling:N.styling,"sticky-container":""},{default:e.withCtx(()=>[e.unref(w)?(e.openBlock(),e.createElementBlock("div",X,[e.createBaseVNode("h4",Z,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.title")),1)]),e.createBaseVNode("div",ee,[e.withDirectives(e.createBaseVNode("div",te,[e.createVNode(V.CheckoutWindow)],512),[[e.vShow,e.unref(i)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(l)("giftCard.description")},null,8,ae),e.createBaseVNode("form",null,[e.createVNode(x.TextField,{modelValue:e.unref(o),"onUpdate:modelValue":r[0]||(r[0]=a=>e.isRef(o)?o.value=a:null),type:"text",name:"name",autocomplete:"name",label:e.unref(l)("giftCard.name"),icon:"user-alt",placeholder:e.unref(l)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(x.TextField,{modelValue:e.unref(t),"onUpdate:modelValue":r[1]||(r[1]=a=>e.isRef(t)?t.value=a:null),type:"email",name:"email",autocomplete:"email",label:e.unref(l)("giftCard.email"),icon:"at",placeholder:e.unref(l)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(V.PhoneField,{modelValue:e.unref(g),"onUpdate:modelValue":r[2]||(r[2]=a=>e.isRef(g)?g.value=a:null),icon:"phone-office",label:e.unref(l)("giftCard.phone"),placeholder:e.unref(l)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.unref(B)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",le,[e.unref(m)?(e.openBlock(),e.createElementBlock("div",oe,[e.createBaseVNode("label",ne,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.selectType")),1)]),e.createBaseVNode("div",re,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(a,_)=>(e.openBlock(),e.createElementBlock("li",{key:_},[e.createVNode(V.Checkbox,{modelValue:e.unref(s),"onUpdate:modelValue":r[3]||(r[3]=z=>e.isRef(s)?s.value=z:null),type:"radio",name:"placeType",val:_,label:a.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(m)[e.unref(s)]&&e.unref(m)[e.unref(s)].data.length>1?(e.openBlock(),e.createBlock(x._sfc_main,{key:0,modelValue:e.unref(k),"onUpdate:modelValue":r[4]||(r[4]=a=>e.isRef(k)?k.value=a:null),placeholder:e.unref(l)("giftCard.selectPlacePlaceholder"),options:e.unref(m)[e.unref(s)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))])),e.createVNode(x.TextField,{modelValue:e.unref(d),"onUpdate:modelValue":r[5]||(r[5]=a=>e.isRef(d)?d.value=a:null),type:"number",name:"value",label:e.unref(l)("giftCard.value"),icon:"money-bill",placeholder:e.unref(l)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","placeholder","suffix"]),e.createVNode(V.Checkbox,{modelValue:e.unref(p),"onUpdate:modelValue":r[6]||(r[6]=a=>e.isRef(p)?p.value=a:null),type:"checkbox",name:"showValue",label:e.unref(l)("giftCard.showValue"),checked:e.unref(p)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(n)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(l)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(f)]])]),N.layout!=="minimal"&&e.unref(n)?(e.openBlock(),e.createElementBlock("div",de,[e.createBaseVNode("div",se,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(h),"is-loading":e.unref(v),"onUpdate:isLoading":r[9]||(r[9]=a=>e.isRef(v)?v.value=a:null),onClickEvent:P},null,8,["label","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(n)?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(x.TextField,{modelValue:e.unref(c),"onUpdate:modelValue":r[10]||(r[10]=a=>e.isRef(c)?c.value=a:null),type:"textarea",name:"remark",label:e.unref(l)("giftCard.remark"),icon:"info-circle",placeholder:e.unref(l)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","placeholder"])])):e.createCommentVNode("",!0),e.unref(n)?e.withDirectives((e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(h),"data-test":"orderGiftCard","is-loading":e.unref(v),"onUpdate:isLoading":r[11]||(r[11]=a=>e.isRef(v)?v.value=a:null),onClickEvent:P},null,8,["label","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",fe,[e.createVNode(V._sfc_main)],512),[[e.vShow,e.unref(E)]])])),[[u]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout","styling"])]),fallback:e.withCtx(()=>[e.createVNode(Q)]),_:1})}}});const me=e._export_sfc(pe,[["__scopeId","data-v-e4aa1e4c"]]),_e=e.createPinia(),ve=e.zo(),S=e.createApp({components:{GiftCard:me}});S.use(_e);S.use(e.instance);S.use(ve);S.use(V.StickyPlugin);S.use(V.install,{bootstrap:!1});S.mount("#konnectio-gift-card-app");