@konnectio/core 4.0.3 → 4.0.5
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.
- package/dist/{ActionField-1b4171c7.mjs → ActionField-0c047379.mjs} +5 -5
- package/dist/ActionField-0c047379.mjs.br +0 -0
- package/dist/{ActionField-97c0c682.js → ActionField-3640689b.js} +2 -2
- package/dist/ActionField-3640689b.js.br +0 -0
- package/dist/Clickable-386eceb6.mjs +12390 -0
- package/dist/Clickable-386eceb6.mjs.br +0 -0
- package/dist/Clickable-77afc133.js +768 -0
- package/dist/Clickable-77afc133.js.br +0 -0
- package/dist/{HotelAvailabilityForm-bab6ef4d.mjs → HotelAvailabilityForm-29f12395.mjs} +5 -5
- package/dist/HotelAvailabilityForm-29f12395.mjs.br +0 -0
- package/dist/{HotelAvailabilityForm-5750665b.js → HotelAvailabilityForm-89ba629d.js} +2 -2
- package/dist/HotelAvailabilityForm-89ba629d.js.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-99de44b7.mjs +4027 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-99de44b7.mjs.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-e8efabad.js +28 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-e8efabad.js.br +0 -0
- package/dist/{ReCaptchaVuePlugin-36454b0f.js → ReCaptchaVuePlugin-0988d77f.js} +2 -2
- package/dist/ReCaptchaVuePlugin-0988d77f.js.br +0 -0
- package/dist/{ReCaptchaVuePlugin-e4f378b2.mjs → ReCaptchaVuePlugin-616ef9b9.mjs} +2 -2
- package/dist/ReCaptchaVuePlugin-616ef9b9.mjs.br +0 -0
- package/dist/{SelectField.vue_vue_type_style_index_0_lang-a3371159.js → SelectField.vue_vue_type_style_index_0_lang-18843626.js} +2 -2
- package/dist/SelectField.vue_vue_type_style_index_0_lang-18843626.js.br +0 -0
- package/dist/{SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs → SelectField.vue_vue_type_style_index_0_lang-a45312d1.mjs} +3 -3
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a45312d1.mjs.br +0 -0
- package/dist/{ThankYou-23531d13.js → ThankYou-1096ca5a.js} +3 -3
- package/dist/ThankYou-1096ca5a.js.br +0 -0
- package/dist/{ThankYou-4299d606.mjs → ThankYou-f6205791.mjs} +11 -11
- package/dist/ThankYou-f6205791.mjs.br +0 -0
- package/dist/{applyGiftCard-eb7b85ee.mjs → applyGiftCard-02342491.mjs} +13 -13
- package/dist/applyGiftCard-02342491.mjs.br +0 -0
- package/dist/{applyGiftCard-9847fda1.js → applyGiftCard-e24bae0c.js} +2 -2
- package/dist/applyGiftCard-e24bae0c.js.br +0 -0
- package/dist/availability.cjs.js +1 -1
- package/dist/availability.cjs.js.br +0 -0
- package/dist/availability.es.js +46 -49
- package/dist/availability.es.js.br +0 -0
- package/dist/{event-1b888019.mjs → event-cc266121.mjs} +28 -28
- package/dist/event-cc266121.mjs.br +0 -0
- package/dist/{event-e8e0c6a2.js → event-d580e6e8.js} +2 -2
- package/dist/event-d580e6e8.js.br +0 -0
- package/dist/event.cjs.js +1 -1
- package/dist/event.cjs.js.br +0 -0
- package/dist/event.es.js +163 -166
- package/dist/event.es.js.br +0 -0
- package/dist/gift-card-validation.cjs.js +1 -1
- package/dist/gift-card-validation.cjs.js.br +0 -0
- package/dist/gift-card-validation.es.js +35 -38
- package/dist/gift-card-validation.es.js.br +0 -0
- package/dist/gift-card.cjs.js +1 -1
- package/dist/gift-card.cjs.js.br +0 -0
- package/dist/gift-card.es.js +87 -90
- package/dist/gift-card.es.js.br +0 -0
- package/dist/hotel.cjs.js +4 -4
- package/dist/hotel.cjs.js.br +0 -0
- package/dist/hotel.es.js +348 -350
- package/dist/hotel.es.js.br +0 -0
- package/dist/{index-937554a9.mjs → index-30f70976.mjs} +5 -5
- package/dist/index-30f70976.mjs.br +0 -0
- package/dist/index-4e9533a9.js +2 -0
- package/dist/index-4e9533a9.js.br +0 -0
- package/dist/navigation.cjs.js +1 -1
- package/dist/navigation.cjs.js.br +0 -0
- package/dist/navigation.es.js +1 -1
- package/dist/navigation.es.js.br +0 -0
- package/dist/{payment-b79997a8.mjs → payment-b3022c46.mjs} +3 -3
- package/dist/payment-b3022c46.mjs.br +0 -0
- package/dist/{payment-3140b25e.js → payment-bfd660a7.js} +2 -2
- package/dist/payment-bfd660a7.js.br +0 -0
- package/dist/polyfill.cjs.js +1 -1
- package/dist/polyfill.cjs.js.br +0 -0
- package/dist/polyfill.es.js +1 -1
- package/dist/polyfill.es.js.br +0 -0
- package/package.json +1 -4
- package/dist/ActionField-1b4171c7.mjs.br +0 -0
- package/dist/ActionField-97c0c682.js.br +0 -0
- package/dist/Clickable-eb931b15.mjs +0 -13899
- package/dist/Clickable-eb931b15.mjs.br +0 -0
- package/dist/Clickable-f57e16ad.js +0 -785
- package/dist/Clickable-f57e16ad.js.br +0 -0
- package/dist/HotelAvailabilityForm-5750665b.js.br +0 -0
- package/dist/HotelAvailabilityForm-bab6ef4d.mjs.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs +0 -5917
- package/dist/NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js +0 -56
- package/dist/NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-36454b0f.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-e4f378b2.mjs.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a3371159.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs.br +0 -0
- package/dist/ThankYou-23531d13.js.br +0 -0
- package/dist/ThankYou-4299d606.mjs.br +0 -0
- package/dist/applyGiftCard-9847fda1.js.br +0 -0
- package/dist/applyGiftCard-eb7b85ee.mjs.br +0 -0
- package/dist/event-1b888019.mjs.br +0 -0
- package/dist/event-e8e0c6a2.js.br +0 -0
- package/dist/index-937554a9.mjs.br +0 -0
- package/dist/index-aa255eba.js +0 -2
- package/dist/index-aa255eba.js.br +0 -0
- package/dist/payment-3140b25e.js.br +0 -0
- package/dist/payment-b79997a8.mjs.br +0 -0
package/dist/event.es.js.br
CHANGED
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./Clickable-
|
|
1
|
+
"use strict";const e=require("./Clickable-77afc133.js"),t=require("./NumberField.vue_vue_type_style_index_0_lang-e8efabad.js"),p=require("./applyGiftCard-e24bae0c.js"),y=require("./ActionField-3640689b.js");require("./SelectField.vue_vue_type_style_index_0_lang-18843626.js");require("./_commonjsHelpers-6763f629.js");const h=r=>(e.pushScopeId("data-v-64c7a8a4"),r=r(),e.popScopeId(),r),m=["innerHTML"],N={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},F=h(()=>e.createBaseVNode("span",null,"Loading...",-1)),k=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(r){const o=r,{t:a}=t.useI18n(),{voucher:u,isValid:f,amount:g,expirationDate:B,productName:b,isLoading:l}=t.storeToRefs(p.useApplyGiftCardStore()),{currency:C}=t.storeToRefs(t.useUtilityStore()),{apply:c}=p.useApplyGiftCardStore(),V={"--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(d,n)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(t._sfc_main,{id:"fresh-booking-gift-card-validation-module",class:"fresh-booking-app","access-token":d.accessToken,type:"gift-card",style:V},{default:e.withCtx(()=>[e.createBaseVNode("form",{onSubmit:n[3]||(n[3]=e.withModifiers(i=>e.unref(c)(),["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,m),e.createVNode(y.ActionField,{modelValue:e.unref(u),"onUpdate:modelValue":n[0]||(n[0]=i=>e.isRef(u)?u.value=i:null),icon:"gift-card",label:e.unref(a)("booking.reservation.giftCardCode"),buttonLabel:e.unref(a)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(l),"onUpdate:isLoading":n[1]||(n[1]=i=>e.isRef(l)?l.value=i:null),onAction:n[2]||(n[2]=i=>e.unref(c)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(l)&&e.unref(f)?(e.openBlock(),e.createElementBlock("table",N,[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","icon-color":d.headerColor},null,8,["icon-color"])]),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","icon-color":d.headerColor},null,8,["icon-color"])]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.expirationDate")),1),e.createVNode(e.Icon,{icon:"timer",type:"fas","icon-color":d.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(t.showPrice)(e.unref(g),e.unref(C))),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(t.showDate)(e.unref(B))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token"])]),fallback:e.withCtx(()=>[F]),_:1}))}});const _=e._export_sfc(k,[["__scopeId","data-v-64c7a8a4"]]),s=e.createApp({components:{GiftCardValidation:_}}),S=t.createPinia();s.use(S);s.use(t.instance);s.mount("#fresh-booking-gift-card-validation-app");
|
|
2
2
|
//# sourceMappingURL=gift-card-validation.cjs.js.map
|
|
Binary file
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { d as v, o as m, h as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as B } from "./applyGiftCard-
|
|
4
|
-
import { A as
|
|
5
|
-
import "./SelectField.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { d as v, o as m, h as R, w as c, a as d, b as t, t as l, u as n, i as C, c as T, I as g, k as z, j as W, S as P, p as X, l as I, _ as L, m as w } from "./Clickable-386eceb6.mjs";
|
|
2
|
+
import { u as x, s as h, h as A, g as D, l as G, _ as N, c as M, i as U } from "./NumberField.vue_vue_type_style_index_0_lang-99de44b7.mjs";
|
|
3
|
+
import { u as B } from "./applyGiftCard-02342491.mjs";
|
|
4
|
+
import { A as $ } from "./ActionField-0c047379.mjs";
|
|
5
|
+
import "./SelectField.vue_vue_type_style_index_0_lang-a45312d1.mjs";
|
|
6
6
|
import "./_commonjsHelpers-c5d32002.mjs";
|
|
7
|
-
const
|
|
7
|
+
const H = (i) => (X("data-v-64c7a8a4"), i = i(), I(), i), j = ["innerHTML"], E = {
|
|
8
8
|
key: 0,
|
|
9
9
|
id: "fresh-booking-gift-card-validation-resume",
|
|
10
10
|
class: "fresh-booking-panel"
|
|
11
|
-
},
|
|
11
|
+
}, q = /* @__PURE__ */ H(() => /* @__PURE__ */ t("span", null, "Loading...", -1)), J = /* @__PURE__ */ v({
|
|
12
12
|
__name: "GiftCardValidation",
|
|
13
13
|
props: {
|
|
14
14
|
accessToken: {},
|
|
@@ -40,12 +40,12 @@ const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O =
|
|
|
40
40
|
panelBorderRadius: {},
|
|
41
41
|
panelPadding: {}
|
|
42
42
|
},
|
|
43
|
-
setup(
|
|
44
|
-
const o =
|
|
45
|
-
voucher:
|
|
43
|
+
setup(i) {
|
|
44
|
+
const o = i, { t: e } = x(), {
|
|
45
|
+
voucher: p,
|
|
46
46
|
isValid: k,
|
|
47
|
-
amount:
|
|
48
|
-
expirationDate:
|
|
47
|
+
amount: y,
|
|
48
|
+
expirationDate: F,
|
|
49
49
|
productName: _,
|
|
50
50
|
isLoading: s
|
|
51
51
|
} = h(B()), { currency: S } = h(A()), { apply: b } = B(), V = {
|
|
@@ -77,28 +77,28 @@ const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O =
|
|
|
77
77
|
"--panelBorderRadius": o.panelBorderRadius,
|
|
78
78
|
"--panelPadding": o.panelPadding
|
|
79
79
|
};
|
|
80
|
-
return (u, a) => (m(),
|
|
81
|
-
default:
|
|
82
|
-
d(
|
|
80
|
+
return (u, a) => (m(), R(P, null, {
|
|
81
|
+
default: c(() => [
|
|
82
|
+
d(N, {
|
|
83
83
|
id: "fresh-booking-gift-card-validation-module",
|
|
84
84
|
class: "fresh-booking-app",
|
|
85
85
|
"access-token": u.accessToken,
|
|
86
86
|
type: "gift-card",
|
|
87
87
|
style: V
|
|
88
88
|
}, {
|
|
89
|
-
default:
|
|
89
|
+
default: c(() => [
|
|
90
90
|
t("form", {
|
|
91
91
|
onSubmit: a[3] || (a[3] = W((r) => n(b)(), ["prevent"]))
|
|
92
92
|
}, [
|
|
93
93
|
t("h4", null, [
|
|
94
|
-
t("span", null,
|
|
94
|
+
t("span", null, l(n(e)("giftCardValidation.title")), 1)
|
|
95
95
|
]),
|
|
96
96
|
t("p", {
|
|
97
97
|
innerHTML: n(e)("giftCardValidation.description")
|
|
98
|
-
}, null, 8,
|
|
99
|
-
d(
|
|
100
|
-
modelValue: n(
|
|
101
|
-
"onUpdate:modelValue": a[0] || (a[0] = (r) => C(
|
|
98
|
+
}, null, 8, j),
|
|
99
|
+
d($, {
|
|
100
|
+
modelValue: n(p),
|
|
101
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => C(p) ? p.value = r : null),
|
|
102
102
|
icon: "gift-card",
|
|
103
103
|
label: n(e)("booking.reservation.giftCardCode"),
|
|
104
104
|
buttonLabel: n(e)("giftCardValidation.submitButton"),
|
|
@@ -107,11 +107,11 @@ const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O =
|
|
|
107
107
|
"onUpdate:isLoading": a[1] || (a[1] = (r) => C(s) ? s.value = r : null),
|
|
108
108
|
onAction: a[2] || (a[2] = (r) => n(b)())
|
|
109
109
|
}, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
|
|
110
|
-
!n(s) && n(k) ? (m(),
|
|
110
|
+
!n(s) && n(k) ? (m(), T("table", E, [
|
|
111
111
|
t("thead", null, [
|
|
112
112
|
t("tr", null, [
|
|
113
113
|
t("th", null, [
|
|
114
|
-
t("span", null,
|
|
114
|
+
t("span", null, l(n(e)("giftCardValidation.giftCard")), 1),
|
|
115
115
|
d(g, {
|
|
116
116
|
icon: "gift-card",
|
|
117
117
|
type: "fas",
|
|
@@ -119,7 +119,7 @@ const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O =
|
|
|
119
119
|
}, null, 8, ["icon-color"])
|
|
120
120
|
]),
|
|
121
121
|
t("th", null, [
|
|
122
|
-
t("span", null,
|
|
122
|
+
t("span", null, l(n(e)("giftCardValidation.balance")), 1),
|
|
123
123
|
d(g, {
|
|
124
124
|
icon: "money-bill",
|
|
125
125
|
type: "fas",
|
|
@@ -127,7 +127,7 @@ const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O =
|
|
|
127
127
|
}, null, 8, ["icon-color"])
|
|
128
128
|
]),
|
|
129
129
|
t("th", null, [
|
|
130
|
-
t("span", null,
|
|
130
|
+
t("span", null, l(n(e)("giftCardValidation.expirationDate")), 1),
|
|
131
131
|
d(g, {
|
|
132
132
|
icon: "timer",
|
|
133
133
|
type: "fas",
|
|
@@ -139,34 +139,31 @@ const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O =
|
|
|
139
139
|
t("tbody", null, [
|
|
140
140
|
t("tr", null, [
|
|
141
141
|
t("td", null, [
|
|
142
|
-
t("span", null,
|
|
142
|
+
t("span", null, l(n(_)), 1)
|
|
143
143
|
]),
|
|
144
144
|
t("td", null, [
|
|
145
|
-
t("span", null,
|
|
145
|
+
t("span", null, l(n(D)(n(y), n(S))), 1)
|
|
146
146
|
]),
|
|
147
147
|
t("td", null, [
|
|
148
|
-
t("span", null,
|
|
148
|
+
t("span", null, l(n(G)(n(F))), 1)
|
|
149
149
|
])
|
|
150
150
|
])
|
|
151
151
|
])
|
|
152
|
-
])) :
|
|
152
|
+
])) : z("", !0)
|
|
153
153
|
], 32)
|
|
154
154
|
]),
|
|
155
155
|
_: 1
|
|
156
156
|
}, 8, ["access-token"])
|
|
157
157
|
]),
|
|
158
|
-
fallback:
|
|
159
|
-
|
|
158
|
+
fallback: c(() => [
|
|
159
|
+
q
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
162
162
|
}));
|
|
163
163
|
}
|
|
164
164
|
});
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
p.use(K);
|
|
170
|
-
p.use($);
|
|
171
|
-
p.mount("#fresh-booking-gift-card-validation-app");
|
|
165
|
+
const K = /* @__PURE__ */ L(J, [["__scopeId", "data-v-64c7a8a4"]]), f = w({ components: { GiftCardValidation: K } }), O = M();
|
|
166
|
+
f.use(O);
|
|
167
|
+
f.use(U);
|
|
168
|
+
f.mount("#fresh-booking-gift-card-validation-app");
|
|
172
169
|
//# sourceMappingURL=gift-card-validation.es.js.map
|
|
Binary file
|
package/dist/gift-card.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./Clickable-f57e16ad.js"),o=require("./NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js"),F=require("./index-aa255eba.js"),x=require("./ReCaptchaVuePlugin-36454b0f.js"),P=require("./SelectField.vue_vue_type_style_index_0_lang-a3371159.js");require("./_commonjsHelpers-6763f629.js");const G=o.defineStore("giftCard",()=>{const{display:p}=o.useAlertStore(),{bearerToken:t,metaData:a}=o.storeToRefs(o.useUtilityStore()),l=e.ref(o.GiftCardModuleState.InitialState),k=o.useStorage("freshBookingName","",void 0,{serializer:o.StorageSerializers.string}),s=o.useStorage("freshBookingEmail","",void 0,{serializer:o.StorageSerializers.string}),f=o.useStorage("freshBookingPhone","",void 0,{serializer:o.StorageSerializers.string}),v=e.ref(""),y=e.ref(1),_=e.ref(!0),N=e.ref(""),g=e.ref({base64:"",type:"",name:""}),r=e.ref(void 0),d=e.ref(0),m=e.ref(!1),C=e.ref(0),b=e.computed(()=>l.value===o.GiftCardModuleState.InitialState||l.value===o.GiftCardModuleState.WaitingForResponse),B=e.computed(()=>l.value===o.GiftCardModuleState.ReadyToPay),R=e.computed(()=>l.value===o.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const u={1:{label:o.i18n.t("giftCard.hotelType"),data:[]},2:{label:o.i18n.t("giftCard.restaurantType"),data:[]}},i=a.value.places;return i&&i.forEach(n=>{u[n.placeType].data.push(n)}),Object.fromEntries(Object.entries(u).filter(([,n])=>n.data.length>0))}),T=e.computed(()=>C.value!==0),V=e.computed(()=>{let u;if(T.value)u=h.value[C.value].data[0];else if(d.value!==0){const i=r.value,n=h.value[d.value].data;n.length===1?u=n[0]:i!==void 0&&n.forEach(w=>{String(w.id)===String(i)&&(u=w)})}return u}),z=e.computed(()=>!(!k.value||!s.value||!(f.value.length>=5)||!v.value||V.value===void 0)),E=e.computed(()=>!(l.value===o.GiftCardModuleState.InitialState&&m.value)),q=e.computed(()=>!!(l.value===o.GiftCardModuleState.WaitingForResponse&&m.value));async function U(){l.value=o.GiftCardModuleState.WaitingForResponse,m.value=!0,await o.axios.post("http://localhost:91/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:a.value.currency.id,language:o.getUserLanguage(),amount:v.value,quantity:y.value,freeText:N.value,showPrice:_.value,contactName:k.value,contactEmail:s.value,contactPhone:f.value,imageBase64:o.b2a(g.value.base64),imageName:g.value.name,imageFormat:g.value.type,placeType:V.value?V.value.placeType:void 0,placeID:V.value?V.value.id:void 0},{headers:{Authorization:t.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.3"}}).then(u=>{if(m.value=!1,u.data.easyPayment){l.value=o.GiftCardModuleState.ReadyToPay;const i=new Reepay.EmbeddedCheckout(u.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});i.addEventHandler(o.ReepayEvent.Accept,()=>{l.value=o.GiftCardModuleState.PaymentSuccess,p({message:o.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),i.addEventHandler(o.ReepayEvent.Error,()=>{p({message:o.i18n.t("booking.other.errorMessage"),type:"warning"})})}else l.value=o.GiftCardModuleState.InitialState,p({message:`${o.i18n.t("booking.other.errorMessage")} (HTTP: ${u.status})`,type:"warning"})})}function M(u){C.value=u}return{moduleState:l,name:k,email:s,phone:f,value:v,remark:N,showValue:_,quantity:y,media:g,placeId:r,placeType:d,showFormPage:b,showPaymentPage:B,showConfirmationPage:R,places:h,hasFilledForm:z,hasForcedPlaceType:T,isWaitingForResponse:q,isMetaDataAvailable:E,orderGiftCard:U,initialize:M}}),L={class:"media-selector"},W=["accept"],A={class:"media-selector-wrapper"},H={class:"media-selector-tools"},O={key:0},j={key:1},K={key:2},Y=["src"],J=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(p,{emit:t}){const a=p,{t:l}=o.useI18n(),{display:k}=o.useAlertStore(),s=e.ref(),f=e.computed(()=>a.modelValue.base64!=="");function v(r){t("update:modelValue",r)}function y(){v({base64:"",name:"",type:""}),s.value&&(s.value.value="")}function _(){s.value&&s.value.click()}function N(r,d){const[m,C]=[r.name,r.type],b=new FileReader;b.onload=function(B){if(B.target){const R=B.target.result;d({base64:R,name:m,type:C})}else k({message:l("imageUploadError"),type:"error"})},b.readAsDataURL(r)}async function g(){let r;(r=s.value.files)instanceof FileList&&N(r[0],v)}return(r,d)=>(e.openBlock(),e.createBlock(o.InputField,{label:r.label,required:r.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",L,[e.createBaseVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",accept:r.validation,single:"",onChange:d[0]||(d[0]=m=>g())},null,40,W),e.createBaseVNode("div",A,[e.createBaseVNode("ul",H,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",O,[e.createVNode(e.Clickable,{label:e.unref(l)("uploadFile"),type:"button",icon:"upload","icon-color":r.iconColor,onClickEvent:d[1]||(d[1]=m=>_())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(l)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":r.iconColor,onClickEvent:d[2]||(d[2]=m=>_())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",K,[e.createVNode(e.Clickable,{label:e.unref(l)("removeFile"),type:"button",icon:"trash-alt","icon-color":r.iconColor,onClickEvent:d[3]||(d[3]=m=>y())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[r.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.modelValue.base64},null,8,Y)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function I(p){const t=p;t.__i18n=t.__i18n||[],t.__i18n.push({locale:"",resource:{da:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload billede"])},removeFile:a=>{const{normalize:l}=a;return l(["Fjern billede"])},replaceFile:a=>{const{normalize:l}=a;return l(["Ersat billede"])},imageUploadError:a=>{const{normalize:l}=a;return l(["Der skete en fejl under billede upload!"])}},en:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload image"])},removeFile:a=>{const{normalize:l}=a;return l(["Remove image"])},replaceFile:a=>{const{normalize:l}=a;return l(["Replace image"])},imageUploadError:a=>{const{normalize:l}=a;return l(["An error occurred under image upload!"])}}}})}typeof I=="function"&&I(J);const Q=p=>(e.pushScopeId("data-v-10b51e8f"),p=p(),e.popScopeId(),p),X={key:0,id:"fresh-booking-gift-card-wrapper"},Z={id:"fresh-booking-gift-card-title"},ee={id:"fresh-booking-gift-card-content"},oe={id:"fresh-booking-gift-card-payment"},ae=["innerHTML"],te={key:0},le={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"],ce={key:0,id:"fresh-booking-gift-card-order"},de={class:"fresh-booking-panel"},ue={key:1,id:"fresh-booking-gift-card-remarks"},se={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},pe={id:"fresh-booking-gift-card-recaptcha"},fe=Q(()=>e.createBaseVNode("span",null,"Loading...",-1)),me=e.defineComponent({__name:"GiftCard",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},layout:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{},placeType:{},successColor:{}},setup(p){const t=p,{t:a}=o.useI18n(),{name:l,email:k,phone:s,value:f,remark:v,showValue:y,quantity:_,media:N,placeId:g,placeType:r,showFormPage:d,showPaymentPage:m,showConfirmationPage:C,places:b,hasFilledForm:B,hasForcedPlaceType:R,isWaitingForResponse:h,isMetaDataAvailable:T}=o.storeToRefs(G()),{initialize:V,orderGiftCard:z}=G(),{isRecaptchaEnabled:E,currency:q}=o.storeToRefs(o.useUtilityStore()),{display:U}=o.useAlertStore();async function M(){const i=x.useReCaptcha_1();if(E.value&&i){await i.recaptchaLoaded();const n=await i.executeRecaptcha("create_gift_card");(await o.axios.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${n}`)).data.success?await z():U({message:a("alert.error.robot"),type:"error"})}else await z()}e.watch(r,()=>{g.value=void 0}),e.onMounted(()=>{V(parseInt(t.placeType))});const u={"--accentColor":t.accentColor,"--buttonBackground":t.buttonBackground,"--buttonBorder":t.buttonBorder,"--buttonBorderRadius":t.buttonBorderRadius,"--buttonFontFamily":t.buttonFontFamily,"--buttonColor":t.buttonColor,"--buttonFontSize":t.buttonFontSize,"--buttonTextTransform":t.buttonTextTransform,"--buttonFontWeight":t.buttonFontWeight,"--fontColor":t.fontColor,"--fontFamily":t.fontFamily,"--fontSize":t.fontSize,"--fontWeight":t.fontWeight,"--grayColor":t.grayColor,"--headerColor":t.headerColor,"--headerFontSize":t.headerFontSize,"--inputBackground":t.inputBackground,"--inputBorder":t.inputBorder,"--inputBorderRadius":t.inputBorderRadius,"--inputFontColor":t.inputFontColor,"--labelFontWeight":t.labelFontWeight,"--labelPadding":t.labelPadding,"--loadingColor":t.loadingColor,"--panelBackground":t.panelBackground,"--panelBorder":t.panelBorder,"--panelBorderRadius":t.panelBorderRadius,"--panelPadding":t.panelPadding,"--successColor":t.successColor};return(i,n)=>{const w=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(o._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":i.accessToken,"data-layout":i.layout,style:u,"sticky-container":""},{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createElementBlock("div",X,[e.createBaseVNode("h4",Z,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.title")),1)]),e.createBaseVNode("div",ee,[e.withDirectives(e.createBaseVNode("div",oe,null,512),[[e.vShow,e.unref(m)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(a)("giftCard.description")},null,8,ae),e.createBaseVNode("form",null,[e.createVNode(P.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":n[0]||(n[0]=c=>e.isRef(l)?l.value=c:null),type:"text",name:"name",autocomplete:"name",label:e.unref(a)("giftCard.name"),icon:"user-alt","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(P.TextField,{modelValue:e.unref(k),"onUpdate:modelValue":n[1]||(n[1]=c=>e.isRef(k)?k.value=c:null),type:"email",name:"email",autocomplete:"email",label:e.unref(a)("giftCard.email"),icon:"at","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(F.PhoneField,{modelValue:e.unref(s),"onUpdate:modelValue":n[2]||(n[2]=c=>e.isRef(s)?s.value=c:null),icon:"phone-office","icon-color":i.accentColor,label:e.unref(a)("giftCard.phone"),placeholder:e.unref(a)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(R)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",te,[e.unref(b)?(e.openBlock(),e.createElementBlock("div",le,[e.createBaseVNode("label",ne,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.selectType")),1)]),e.createBaseVNode("div",re,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(c,$)=>(e.openBlock(),e.createElementBlock("li",{key:$},[e.createVNode(F.Checkbox,{modelValue:e.unref(r),"onUpdate:modelValue":n[3]||(n[3]=D=>e.isRef(r)?r.value=D:null),type:"radio",name:"placeType",val:$,label:c.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(b)[e.unref(r)]&&e.unref(b)[e.unref(r)].data.length>1?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,modelValue:e.unref(g),"onUpdate:modelValue":n[4]||(n[4]=c=>e.isRef(g)?g.value=c:null),placeholder:e.unref(a)("giftCard.selectPlacePlaceholder"),options:e.unref(b)[e.unref(r)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1,color:i.loadingColor},null,8,["color"]))])),e.createVNode(P.TextField,{modelValue:e.unref(f),"onUpdate:modelValue":n[5]||(n[5]=c=>e.isRef(f)?f.value=c:null),type:"number",name:"value",label:e.unref(a)("giftCard.value"),icon:"money-bill","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(F.Checkbox,{modelValue:e.unref(y),"onUpdate:modelValue":n[6]||(n[6]=c=>e.isRef(y)?y.value=c:null),type:"checkbox",name:"showValue",label:e.unref(a)("giftCard.showValue"),checked:e.unref(y)},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(a)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(C)]])]),i.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ce,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"is-loading":e.unref(h),"onUpdate:isLoading":n[9]||(n[9]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(P.TextField,{modelValue:e.unref(v),"onUpdate:modelValue":n[10]||(n[10]=c=>e.isRef(v)?v.value=c:null),type:"textarea",name:"remark",label:e.unref(a)("giftCard.remark"),icon:"info-circle","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","icon-color","placeholder"])])):e.createCommentVNode("",!0),e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"data-test":"orderGiftCard","is-loading":e.unref(h),"onUpdate:isLoading":n[11]||(n[11]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",pe,[e.createVNode(F._sfc_main)],512),[[e.vShow,e.unref(E)]])])),[[w]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[fe]),_:1})}}});const ge=e._export_sfc(me,[["__scopeId","data-v-10b51e8f"]]);process.env.NODE_ENV==="production"&&o.distExports.flare.light();const ve=o.createPinia(),S=e.createApp({components:{GiftCard:ge}});S.use(o.distExports$1.flareVue);S.use(ve);S.use(o.instance);S.use(F.StickyPlugin);S.use(F.install,{bootstrap:!1});S.mount("#fresh-booking-gift-card-app");
|
|
1
|
+
"use strict";const e=require("./Clickable-77afc133.js"),o=require("./NumberField.vue_vue_type_style_index_0_lang-e8efabad.js"),F=require("./index-4e9533a9.js"),L=require("./ReCaptchaVuePlugin-0988d77f.js"),w=require("./SelectField.vue_vue_type_style_index_0_lang-18843626.js");require("./_commonjsHelpers-6763f629.js");const G=o.defineStore("giftCard",()=>{const{display:p}=o.useAlertStore(),{bearerToken:t,metaData:a}=o.storeToRefs(o.useUtilityStore()),l=e.ref(o.GiftCardModuleState.InitialState),k=o.useStorage("freshBookingName","",void 0,{serializer:o.StorageSerializers.string}),s=o.useStorage("freshBookingEmail","",void 0,{serializer:o.StorageSerializers.string}),f=o.useStorage("freshBookingPhone","",void 0,{serializer:o.StorageSerializers.string}),v=e.ref(""),y=e.ref(1),_=e.ref(!0),S=e.ref(""),g=e.ref({base64:"",type:"",name:""}),r=e.ref(void 0),d=e.ref(0),m=e.ref(!1),C=e.ref(0),b=e.computed(()=>l.value===o.GiftCardModuleState.InitialState||l.value===o.GiftCardModuleState.WaitingForResponse),B=e.computed(()=>l.value===o.GiftCardModuleState.ReadyToPay),N=e.computed(()=>l.value===o.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const u={1:{label:o.i18n.t("giftCard.hotelType"),data:[]},2:{label:o.i18n.t("giftCard.restaurantType"),data:[]}},i=a.value.places;return i&&i.forEach(n=>{u[n.placeType].data.push(n)}),Object.fromEntries(Object.entries(u).filter(([,n])=>n.data.length>0))}),T=e.computed(()=>C.value!==0),V=e.computed(()=>{let u;if(T.value)u=h.value[C.value].data[0];else if(d.value!==0){const i=r.value,n=h.value[d.value].data;n.length===1?u=n[0]:i!==void 0&&n.forEach(R=>{String(R.id)===String(i)&&(u=R)})}return u}),z=e.computed(()=>!(!k.value||!s.value||!(f.value.length>=5)||!v.value||V.value===void 0)),E=e.computed(()=>!(l.value===o.GiftCardModuleState.InitialState&&m.value)),q=e.computed(()=>!!(l.value===o.GiftCardModuleState.WaitingForResponse&&m.value));async function U(){l.value=o.GiftCardModuleState.WaitingForResponse,m.value=!0,await o.axios.post("http://localhost:91/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:a.value.currency.id,language:o.getUserLanguage(),amount:v.value,quantity:y.value,freeText:S.value,showPrice:_.value,contactName:k.value,contactEmail:s.value,contactPhone:f.value,imageBase64:o.b2a(g.value.base64),imageName:g.value.name,imageFormat:g.value.type,placeType:V.value?V.value.placeType:void 0,placeID:V.value?V.value.id:void 0},{headers:{Authorization:t.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.5"}}).then(u=>{if(m.value=!1,u.data.easyPayment){l.value=o.GiftCardModuleState.ReadyToPay;const i=new Reepay.EmbeddedCheckout(u.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});i.addEventHandler(o.ReepayEvent.Accept,()=>{l.value=o.GiftCardModuleState.PaymentSuccess,p({message:o.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),i.addEventHandler(o.ReepayEvent.Error,()=>{p({message:o.i18n.t("booking.other.errorMessage"),type:"warning"})})}else l.value=o.GiftCardModuleState.InitialState,p({message:`${o.i18n.t("booking.other.errorMessage")} (HTTP: ${u.status})`,type:"warning"})})}function M(u){C.value=u}return{moduleState:l,name:k,email:s,phone:f,value:v,remark:S,showValue:_,quantity:y,media:g,placeId:r,placeType:d,showFormPage:b,showPaymentPage:B,showConfirmationPage:N,places:h,hasFilledForm:z,hasForcedPlaceType:T,isWaitingForResponse:q,isMetaDataAvailable:E,orderGiftCard:U,initialize:M}}),W={class:"media-selector"},x=["accept"],A={class:"media-selector-wrapper"},H={class:"media-selector-tools"},j={key:0},O={key:1},K={key:2},Y=["src"],J=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(p,{emit:t}){const a=p,{t:l}=o.useI18n(),{display:k}=o.useAlertStore(),s=e.ref(),f=e.computed(()=>a.modelValue.base64!=="");function v(r){t("update:modelValue",r)}function y(){v({base64:"",name:"",type:""}),s.value&&(s.value.value="")}function _(){s.value&&s.value.click()}function S(r,d){const[m,C]=[r.name,r.type],b=new FileReader;b.onload=function(B){if(B.target){const N=B.target.result;d({base64:N,name:m,type:C})}else k({message:l("imageUploadError"),type:"error"})},b.readAsDataURL(r)}async function g(){let r;(r=s.value.files)instanceof FileList&&S(r[0],v)}return(r,d)=>(e.openBlock(),e.createBlock(o.InputField,{label:r.label,required:r.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",W,[e.createBaseVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",accept:r.validation,single:"",onChange:d[0]||(d[0]=m=>g())},null,40,x),e.createBaseVNode("div",A,[e.createBaseVNode("ul",H,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(l)("uploadFile"),type:"button",icon:"upload","icon-color":r.iconColor,onClickEvent:d[1]||(d[1]=m=>_())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",O,[e.createVNode(e.Clickable,{label:e.unref(l)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":r.iconColor,onClickEvent:d[2]||(d[2]=m=>_())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",K,[e.createVNode(e.Clickable,{label:e.unref(l)("removeFile"),type:"button",icon:"trash-alt","icon-color":r.iconColor,onClickEvent:d[3]||(d[3]=m=>y())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[r.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.modelValue.base64},null,8,Y)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function I(p){const t=p;t.__i18n=t.__i18n||[],t.__i18n.push({locale:"",resource:{da:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload billede"])},removeFile:a=>{const{normalize:l}=a;return l(["Fjern billede"])},replaceFile:a=>{const{normalize:l}=a;return l(["Ersat billede"])},imageUploadError:a=>{const{normalize:l}=a;return l(["Der skete en fejl under billede upload!"])}},en:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload image"])},removeFile:a=>{const{normalize:l}=a;return l(["Remove image"])},replaceFile:a=>{const{normalize:l}=a;return l(["Replace image"])},imageUploadError:a=>{const{normalize:l}=a;return l(["An error occurred under image upload!"])}}}})}typeof I=="function"&&I(J);const Q=p=>(e.pushScopeId("data-v-10b51e8f"),p=p(),e.popScopeId(),p),X={key:0,id:"fresh-booking-gift-card-wrapper"},Z={id:"fresh-booking-gift-card-title"},ee={id:"fresh-booking-gift-card-content"},oe={id:"fresh-booking-gift-card-payment"},ae=["innerHTML"],te={key:0},le={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"],ce={key:0,id:"fresh-booking-gift-card-order"},de={class:"fresh-booking-panel"},ue={key:1,id:"fresh-booking-gift-card-remarks"},se={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},pe={id:"fresh-booking-gift-card-recaptcha"},fe=Q(()=>e.createBaseVNode("span",null,"Loading...",-1)),me=e.defineComponent({__name:"GiftCard",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},layout:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{},placeType:{},successColor:{}},setup(p){const t=p,{t:a}=o.useI18n(),{name:l,email:k,phone:s,value:f,remark:v,showValue:y,quantity:_,media:S,placeId:g,placeType:r,showFormPage:d,showPaymentPage:m,showConfirmationPage:C,places:b,hasFilledForm:B,hasForcedPlaceType:N,isWaitingForResponse:h,isMetaDataAvailable:T}=o.storeToRefs(G()),{initialize:V,orderGiftCard:z}=G(),{isRecaptchaEnabled:E,currency:q}=o.storeToRefs(o.useUtilityStore()),{display:U}=o.useAlertStore();async function M(){const i=L.useReCaptcha_1();if(E.value&&i){await i.recaptchaLoaded();const n=await i.executeRecaptcha("create_gift_card");(await o.axios.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${n}`)).data.success?await z():U({message:a("alert.error.robot"),type:"error"})}else await z()}e.watch(r,()=>{g.value=void 0}),e.onMounted(()=>{V(parseInt(t.placeType))});const u={"--accentColor":t.accentColor,"--buttonBackground":t.buttonBackground,"--buttonBorder":t.buttonBorder,"--buttonBorderRadius":t.buttonBorderRadius,"--buttonFontFamily":t.buttonFontFamily,"--buttonColor":t.buttonColor,"--buttonFontSize":t.buttonFontSize,"--buttonTextTransform":t.buttonTextTransform,"--buttonFontWeight":t.buttonFontWeight,"--fontColor":t.fontColor,"--fontFamily":t.fontFamily,"--fontSize":t.fontSize,"--fontWeight":t.fontWeight,"--grayColor":t.grayColor,"--headerColor":t.headerColor,"--headerFontSize":t.headerFontSize,"--inputBackground":t.inputBackground,"--inputBorder":t.inputBorder,"--inputBorderRadius":t.inputBorderRadius,"--inputFontColor":t.inputFontColor,"--labelFontWeight":t.labelFontWeight,"--labelPadding":t.labelPadding,"--loadingColor":t.loadingColor,"--panelBackground":t.panelBackground,"--panelBorder":t.panelBorder,"--panelBorderRadius":t.panelBorderRadius,"--panelPadding":t.panelPadding,"--successColor":t.successColor};return(i,n)=>{const R=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(o._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":i.accessToken,"data-layout":i.layout,style:u,"sticky-container":""},{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createElementBlock("div",X,[e.createBaseVNode("h4",Z,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.title")),1)]),e.createBaseVNode("div",ee,[e.withDirectives(e.createBaseVNode("div",oe,null,512),[[e.vShow,e.unref(m)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(a)("giftCard.description")},null,8,ae),e.createBaseVNode("form",null,[e.createVNode(w.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":n[0]||(n[0]=c=>e.isRef(l)?l.value=c:null),type:"text",name:"name",autocomplete:"name",label:e.unref(a)("giftCard.name"),icon:"user-alt","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(w.TextField,{modelValue:e.unref(k),"onUpdate:modelValue":n[1]||(n[1]=c=>e.isRef(k)?k.value=c:null),type:"email",name:"email",autocomplete:"email",label:e.unref(a)("giftCard.email"),icon:"at","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(F.PhoneField,{modelValue:e.unref(s),"onUpdate:modelValue":n[2]||(n[2]=c=>e.isRef(s)?s.value=c:null),icon:"phone-office","icon-color":i.accentColor,label:e.unref(a)("giftCard.phone"),placeholder:e.unref(a)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(N)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",te,[e.unref(b)?(e.openBlock(),e.createElementBlock("div",le,[e.createBaseVNode("label",ne,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.selectType")),1)]),e.createBaseVNode("div",re,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(c,$)=>(e.openBlock(),e.createElementBlock("li",{key:$},[e.createVNode(F.Checkbox,{modelValue:e.unref(r),"onUpdate:modelValue":n[3]||(n[3]=D=>e.isRef(r)?r.value=D:null),type:"radio",name:"placeType",val:$,label:c.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(b)[e.unref(r)]&&e.unref(b)[e.unref(r)].data.length>1?(e.openBlock(),e.createBlock(w._sfc_main,{key:0,modelValue:e.unref(g),"onUpdate:modelValue":n[4]||(n[4]=c=>e.isRef(g)?g.value=c:null),placeholder:e.unref(a)("giftCard.selectPlacePlaceholder"),options:e.unref(b)[e.unref(r)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1,color:i.loadingColor},null,8,["color"]))])),e.createVNode(w.TextField,{modelValue:e.unref(f),"onUpdate:modelValue":n[5]||(n[5]=c=>e.isRef(f)?f.value=c:null),type:"number",name:"value",label:e.unref(a)("giftCard.value"),icon:"money-bill","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(F.Checkbox,{modelValue:e.unref(y),"onUpdate:modelValue":n[6]||(n[6]=c=>e.isRef(y)?y.value=c:null),type:"checkbox",name:"showValue",label:e.unref(a)("giftCard.showValue"),checked:e.unref(y)},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(a)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(C)]])]),i.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ce,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"is-loading":e.unref(h),"onUpdate:isLoading":n[9]||(n[9]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w.TextField,{modelValue:e.unref(v),"onUpdate:modelValue":n[10]||(n[10]=c=>e.isRef(v)?v.value=c:null),type:"textarea",name:"remark",label:e.unref(a)("giftCard.remark"),icon:"info-circle","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","icon-color","placeholder"])])):e.createCommentVNode("",!0),e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"data-test":"orderGiftCard","is-loading":e.unref(h),"onUpdate:isLoading":n[11]||(n[11]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",pe,[e.createVNode(F._sfc_main)],512),[[e.vShow,e.unref(E)]])])),[[R]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[fe]),_:1})}}});const ge=e._export_sfc(me,[["__scopeId","data-v-10b51e8f"]]),ve=o.createPinia(),P=e.createApp({components:{GiftCard:ge}});P.use(ve);P.use(o.instance);P.use(F.StickyPlugin);P.use(F.install,{bootstrap:!1});P.mount("#fresh-booking-gift-card-app");
|
|
2
2
|
//# sourceMappingURL=gift-card.cjs.js.map
|
package/dist/gift-card.cjs.js.br
CHANGED
|
Binary file
|