@konnectio/core
Version:
Konnectio Core Frontend Integration.
1,158 lines (1,157 loc) • 48.3 kB
JavaScript
import { d as U, u as x, s as z, c as Z, r as Ie, a as v, b as l, g as e, w as p, q as K, e as t, i as u, f, n as rt, h as r, t as o, F as A, v as M, o as dt, j as ut, x as ve, y as ct, z as S, A as mt, S as pt, k as vt, _ as bt, l as gt, m as ft, p as kt } from "./mitt-CWSmi8M-.js";
import { G as yt } from "./style-DJF9fHLt.js";
import { a as we, f as re, g as X, h as Se, B as ht, i as se, l as Dt, s as G, e as be, _ as q, I as ie, j as Pt, k as ge, u as $e, m as Et, n as $t, o as wt, p as J, T as pe, O as Ot, q as Tt, r as Ve, C as Vt, t as _t, v as Nt } from "./SelectField.vue_vue_type_style_index_0_lang-Cev1TH7y.js";
import { _ as Ft } from "./_.vue_vue_type_style_index_0_lang-CW619CRS.js";
import { B as Ct, _ as Lt, R as Bt, L as Re, S as At, M as It, T as St, C as Rt, V as Mt, a as Ut } from "./masonry.plugin-DnqS8CJ4.js";
import { g as Ht, e as Gt, c as zt, n as qt, a as _e, m as Ne, b as Fe, d as Ce, f as Le, _ as Yt } from "./AvailabilitySkeleton.vue_vue_type_style_index_0_scoped_86730e88_lang-XzdmauPt.js";
import { C as jt, P as Wt, a as Be } from "./CheckoutWindow-CF2-eaiR.js";
import { E as Zt } from "./EventAvailabilityForm-CcQwnzol.js";
import "./Field.vue_vue_type_style_index_0_scoped_6ef33e68_lang-NEWgHGKm.js";
import { f as Qt } from "./index-Dp94FdK7.js";
function Jt(E) {
return (a) => {
const h = (E ? Math[E] : Math.trunc)(a);
return h === 0 ? 0 : h;
};
}
function Kt(E, a, n) {
const h = Ht(), b = n?.locale ?? h.locale ?? Gt, k = zt(E, a);
if (isNaN(k))
throw new RangeError("Invalid time value");
const i = Object.assign({}, n, {
addSuffix: n?.addSuffix,
comparison: k
}), [D, P] = qt(
n?.in,
...k > 0 ? [a, E] : [E, a]
), s = Jt("round"), T = P.getTime() - D.getTime(), $ = T / Le, C = _e(P) - _e(D), V = (T - C) / Le, N = n?.unit;
let m;
if ($ < 1 ? m = "second" : $ < 60 ? m = "minute" : $ < Ne ? m = "hour" : V < Fe ? m = "day" : V < Ce ? m = "month" : m = "year", m === "second") {
const w = s(T / 1e3);
return b.formatDistance("xSeconds", w, i);
} else if (m === "minute") {
const w = s($);
return b.formatDistance("xMinutes", w, i);
} else if (m === "hour") {
const w = s($ / 60);
return b.formatDistance("xHours", w, i);
} else if (m === "day") {
const w = s(V / Ne);
return b.formatDistance("xDays", w, i);
} else if (m === "month") {
const w = s(V / Fe);
return w === 12 && N !== "month" ? b.formatDistance("xYears", 1, i) : b.formatDistance("xMonths", w, i);
} else {
const w = s(V / Ce);
return b.formatDistance("xYears", w, i);
}
}
const Xt = { class: "konnectio-event-listing-action-button" }, xt = /* @__PURE__ */ U({
__name: "_",
props: {
name: {},
description: {},
toDate: {},
listingId: {},
tableGroupId: {},
days: {},
length: {},
timeFrom: {},
timeTo: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
maxGuests: {},
fromPrice: { default: 0 },
gallery: {},
soldOut: { type: Boolean, default: !1 },
useNumberOfProductsForPersons: { type: Boolean },
type: {},
trackingEnabled: { type: Boolean },
disableDeepLink: { type: Boolean, default: !1 },
callback: {}
},
setup(E) {
const { t: a } = x(), n = E, { display: h } = we(), {
hideEventGuestAmount: b
} = z(re()), {
maxNumberOfPeople: k,
numberOfPeople: i,
eventId: D,
currentEventDate: P,
tableGroupId: s
} = z(X()), {
getTemplateAvailability: T,
getEventAvailability: $,
isEventListingLoading: C
} = X(), { addToCart: V } = Se(), N = Z(() => n.maxGuests || n.maxOnlineReservationLimit || k.value || 1 / 0), m = Ie(0), w = Z(() => C(n.listingId)), ee = () => {
if (!n.useNumberOfProductsForPersons && (m.value === 0 || isNaN(m.value))) {
h({
type: "error",
message: a("alert.error.selectPeople")
});
return;
}
n.trackingEnabled && V({
id: n.listingId,
name: n.name,
value: n.fromPrice || 0
}), D.value = n.listingId, i.value = n.useNumberOfProductsForPersons ? NaN : m.value, T(n.callback);
}, Y = () => {
if (!n.useNumberOfProductsForPersons && (m.value === 0 || isNaN(m.value))) {
h({
type: "error",
message: a("alert.error.selectPeople")
});
return;
}
n.trackingEnabled && V({
id: n.listingId,
name: n.name,
value: n.fromPrice || 0
}), D.value = n.listingId, s.value = n.tableGroupId, i.value = n.useNumberOfProductsForPersons ? NaN : m.value, $(n.callback);
};
return (y, R) => (l(), v(Ct, {
type: "event",
"listing-id": y.listingId,
gallery: y.gallery,
name: y.name,
description: y.description,
"prices-from": y.fromPrice,
"to-date": y.toDate,
layout: e(ht).Event,
"disable-deep-link": y.disableDeepLink
}, {
description: p(() => [
K(y.$slots, "description", { maxNumberOfPeople: e(k) }, void 0, !0)
]),
action: p(() => [
K(y.$slots, "action", {}, () => [
t("div", {
class: rt([
"konnectio-event-listing-action",
{ "no-selectable-people": y.useNumberOfProductsForPersons }
])
}, [
y.useNumberOfProductsForPersons ? u("", !0) : (l(), v(se, {
key: 0,
modelValue: m.value,
"onUpdate:modelValue": R[0] || (R[0] = (Q) => m.value = Q),
label: e(a)("event.numberOfGuests"),
icon: "users",
"icon-type": "fas",
"icon-placement": "label",
description: N.value <= 20 && !e(b) ? `${e(a)("general.availableFor")}: 1 - ${N.value} ${e(Dt)(e(a)("general.guests"))}` : void 0,
"min-value": 0,
"max-value": N.value
}, null, 8, ["modelValue", "label", "description", "max-value"])),
t("div", Xt, [
f(be, {
label: y.soldOut ? e(a)("event.soldOut") : e(a)("event.bookNowButton"),
disabled: y.soldOut,
"is-loading": w.value,
"full-width": "",
"sub-label": e(G)(e(P)),
onClickEvent: R[1] || (R[1] = (Q) => y.type === "event" ? Y() : ee())
}, null, 8, ["label", "disabled", "is-loading", "sub-label"])
])
], 2)
], !0)
]),
_: 3
}, 8, ["listing-id", "gallery", "name", "description", "prices-from", "to-date", "layout", "disable-deep-link"]));
}
}), Me = /* @__PURE__ */ q(xt, [["__scopeId", "data-v-23ac9949"]]), en = { class: "konnectio-event-listing-information-new" };
const tn = {
key: 1,
class: "konnectio-pill-button"
}, nn = {
key: 2,
class: "konnectio-pill-button"
}, an = { key: 0 }, ln = { key: 1 }, on = /* @__PURE__ */ U({
__name: "Event",
props: {
name: {},
description: {},
fromDate: {},
toDate: {},
length: {},
timeFrom: {},
timeTo: {},
gallery: {},
days: {},
listingId: {},
tableGroupId: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
fromPrice: { default: 0 },
soldOut: { type: Boolean },
useNumberOfProductsForPersons: { type: Boolean },
trackingEnabled: { type: Boolean },
callback: {}
},
setup(E) {
const a = E, { t: n } = x(), {
hideEventLength: h,
hideEventEndTime: b
} = z(re()), k = Z(() => {
if (!a.length)
return;
const i = a.length.split(":");
return Kt(
new Date(2e3, 0, 1, Number(i[0]), Number(i[1]), 0),
new Date(2e3, 0, 1, 0, 0, 0)
);
});
return (i, D) => (l(), v(Me, {
"listing-id": i.listingId,
name: i.name,
description: i.description,
gallery: i.gallery,
"prices-from": i.fromPrice,
"table-group-id": i.tableGroupId,
"max-guests": i.maxOnlineReservationLimit,
"use-number-of-products-for-persons": i.useNumberOfProductsForPersons,
"to-date": i.toDate,
"sold-out": i.soldOut,
type: "event",
"tracking-enabled": i.trackingEnabled,
callback: i.callback
}, {
description: p(() => [
i.description ? (l(), v(Lt, {
key: 0,
text: i.description
}, null, 8, ["text"])) : u("", !0),
t("ul", en, [
u("", !0),
!e(h) && k.value ? (l(), r("li", tn, [
t("div", null, [
f(ie, {
icon: "calendar-clock",
color: "header"
}),
t("span", null, o(e(n)("event.lengthOfEvent")), 1)
]),
t("span", null, o(k.value), 1)
])) : u("", !0),
i.timeFrom ? (l(), r("li", nn, [
t("div", null, [
f(ie, {
icon: "calendar-clock",
color: "header"
}),
t("span", null, o(e(n)("event.startAndEndTime")), 1)
]),
e(b) ? (l(), r("span", ln, o(e(ge)(i.timeFrom)), 1)) : (l(), r("span", an, o(e(Pt)(i.timeFrom, i.timeTo)), 1))
])) : u("", !0)
])
]),
action: p(() => [
K(i.$slots, "action", {}, void 0, !0)
]),
_: 3
}, 8, ["listing-id", "name", "description", "gallery", "prices-from", "table-group-id", "max-guests", "use-number-of-products-for-persons", "to-date", "sold-out", "tracking-enabled", "callback"]));
}
}), fe = /* @__PURE__ */ q(on, [["__scopeId", "data-v-40cbbf2c"]]), sn = {
key: 0,
class: "konnectio-event-grouped-listings-container"
}, rn = { class: "konnectio-event-grouped-listings" }, dn = /* @__PURE__ */ U({
__name: "Event",
props: {
name: {},
events: {},
trackingEnabled: { type: Boolean },
callback: { type: Function }
},
setup(E) {
return (a, n) => a.events && a.events.length > 1 ? (l(), r("div", sn, [
u("", !0),
t("ul", rn, [
(l(!0), r(A, null, M(a.events, ({
id: h,
days: b,
name: k,
timeFrom: i,
timeTo: D,
tableGroupId: P,
description: s,
soldOut: T,
length: $,
images: C,
maxOnlineReservationLimit: V,
maxPaxPerReservation: N,
useNumberOfProductsForPersons: m,
maxTicketsLimit: w
}) => (l(), v(fe, {
key: h,
type: "event",
"listing-id": h,
"table-group-id": P,
description: s,
name: k,
length: $,
gallery: C,
days: b,
"max-online-reservation-limit": N || V || w || void 0,
"time-from": i,
"time-to": D,
"sold-out": T,
"use-number-of-products-for-persons": m,
"tracking-enabled": a.trackingEnabled,
callback: a.callback
}, null, 8, ["listing-id", "table-group-id", "description", "name", "length", "gallery", "days", "max-online-reservation-limit", "time-from", "time-to", "sold-out", "use-number-of-products-for-persons", "tracking-enabled", "callback"]))), 128))
])
])) : a.events ? (l(), v(fe, {
key: a.events[0].id,
type: "event",
"listing-id": a.events[0].id,
"table-group-id": a.events[0].tableGroupId,
description: a.events[0].description,
name: a.events[0].name,
length: a.events[0].length,
gallery: a.events[0].images,
days: a.events[0].days,
"from-date": a.events[0].fromDate,
"to-date": a.events[0].toDate,
"max-online-reservation-limit": a.events[0].maxPaxPerReservation || a.events[0].maxOnlineReservationLimit || a.events[0].maxTicketsLimit || void 0,
"time-from": a.events[0].timeFrom,
"time-to": a.events[0].timeTo,
"sold-out": a.events[0].soldOut,
"use-number-of-products-for-persons": a.events[0].useNumberOfProductsForPersons,
"tracking-enabled": a.trackingEnabled,
callback: a.callback
}, null, 8, ["listing-id", "table-group-id", "description", "name", "length", "gallery", "days", "from-date", "to-date", "max-online-reservation-limit", "time-from", "time-to", "sold-out", "use-number-of-products-for-persons", "tracking-enabled", "callback"])) : u("", !0);
}
}), un = /* @__PURE__ */ q(dn, [["__scopeId", "data-v-374ad034"]]), cn = { class: "konnectio-special-offer-availability" }, mn = { class: "konnectio-special-offer-availability-button" }, pn = { class: "konnectio-warning-notice" }, vn = { key: 0 }, bn = { key: 1 }, gn = /* @__PURE__ */ U({
__name: "NextEvent",
props: {
name: {},
description: {},
fromDate: {},
toDate: {},
length: {},
timeFrom: {},
timeTo: {},
gallery: {},
days: {},
listingId: {},
tableGroupId: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
soldOut: { type: Boolean },
useNumberOfProductsForPersons: { type: Boolean },
trackingEnabled: { type: Boolean },
callback: { type: Function }
},
setup(E) {
const { t: a } = x(), { updateEventDate: n } = $e(), { display: h } = we(), b = Ie(), k = E;
function i() {
b.value ? n(b.value) : h({
message: a("alert.error.selectDate"),
type: "error"
});
}
const D = Z(() => Et(k.fromDate, k.toDate) <= 1), P = Z(() => [0, 1, 2, 3, 4, 5, 6].filter((s) => !$t(k.days).includes(s)));
return dt(() => {
D.value && (b.value = new Date(k.fromDate));
}), (s, T) => (l(), v(fe, {
name: s.name,
description: s.description,
"from-date": s.fromDate,
"to-date": s.toDate,
length: s.length,
"time-from": s.timeFrom,
"time-to": s.timeTo,
gallery: s.gallery,
days: s.days,
"listing-id": s.listingId,
"table-group-id": s.tableGroupId,
"max-online-reservation-limit": s.maxOnlineReservationLimit,
"minimum-person-count": s.minimumPersonCount,
"use-number-of-products-for-persons": s.useNumberOfProductsForPersons,
"tracking-enabled": s.trackingEnabled,
"sold-out": s.soldOut,
callback: s.callback,
"disable-deep-link": !0
}, {
action: p(() => [
t("div", null, [
t("div", cn, [
f(Yt, {
modelValue: b.value,
"onUpdate:modelValue": T[0] || (T[0] = ($) => b.value = $),
label: `${e(a)("event.selectDate")}*`,
placeholder: e(a)("event.selectDate"),
"icon-type": "fas",
"icon-placement": "label",
readonly: D.value,
"start-date": s.fromDate !== "0001-01-01T00:00:00Z" ? new Date(s.fromDate) : new Date(s.toDate),
"min-date": s.fromDate !== "0001-01-01T00:00:00Z" ? new Date(s.fromDate) : new Date(s.toDate),
"max-date": new Date(s.toDate),
"disabled-week-days": P.value
}, null, 8, ["modelValue", "label", "placeholder", "readonly", "start-date", "min-date", "max-date", "disabled-week-days"]),
t("div", mn, [
f(be, {
label: e(a)("availability.buttonLabel"),
onClick: ut(i, ["prevent"])
}, null, 8, ["label"])
])
]),
t("div", pn, [
D.value ? (l(), r("span", vn, [
ve("*" + o(e(a)("event.canBeBooked")) + " ", 1),
t("u", null, o(e(G)(s.fromDate)), 1)
])) : (l(), r("span", bn, [
ve("*" + o(e(a)("event.canBeBooked")) + " ", 1),
t("u", null, o(e(wt)(s.days)), 1)
]))
])
])
]),
_: 1
}, 8, ["name", "description", "from-date", "to-date", "length", "time-from", "time-to", "gallery", "days", "listing-id", "table-group-id", "max-online-reservation-limit", "minimum-person-count", "use-number-of-products-for-persons", "tracking-enabled", "sold-out", "callback"]));
}
}), fn = /* @__PURE__ */ q(gn, [["__scopeId", "data-v-f6aed3b0"]]), kn = ["innerHTML"], yn = /* @__PURE__ */ U({
__name: "FallbackEvent",
props: {
name: {},
description: {},
fromDate: {},
gallery: {},
days: {},
listingId: {},
trackingEnabled: { type: Boolean },
callback: { type: Function }
},
setup(E) {
const { t: a } = x();
return (n, h) => (l(), v(fe, {
name: n.name,
description: n.description,
"from-date": n.fromDate,
gallery: n.gallery,
days: n.days,
"listing-id": n.listingId,
"tracking-enabled": n.trackingEnabled,
callback: n.callback,
"disable-deep-link": !0
}, {
action: p(() => [
t("div", {
class: "konnectio-filter-notice konnectio-top-message",
innerHTML: e(a)("event.notAvailable", { name: `<b>${n.name}</b>` })
}, null, 8, kn)
]),
_: 1
}, 8, ["name", "description", "from-date", "gallery", "days", "listing-id", "tracking-enabled", "callback"]));
}
}), hn = /* @__PURE__ */ q(yn, [["__scopeId", "data-v-0167deff"]]), Dn = /* @__PURE__ */ U({
__name: "Template",
props: {
name: {},
description: {},
fromDate: {},
toDate: {},
listingId: {},
tableGroupId: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
fromPrice: { default: 0 },
images: {},
trackingEnabled: { type: Boolean },
callback: {}
},
setup(E) {
return (a, n) => (l(), v(Me, {
"listing-id": a.listingId,
gallery: a.images,
name: a.name,
description: a.description,
"prices-from": a.fromPrice,
"to-date": a.toDate,
type: "template",
"tracking-enabled": a.trackingEnabled,
callback: a.callback
}, null, 8, ["listing-id", "gallery", "name", "description", "prices-from", "to-date", "tracking-enabled", "callback"]));
}
}), Pn = {
key: 0,
class: "konnectio-panel konnectio-reservation-notice-mobile"
}, En = ["innerHTML"], $n = { key: 0 }, wn = { key: 1 }, On = { key: 2 }, Tn = { key: 0 }, Vn = { key: 4 }, _n = { key: 5 }, Nn = { key: 6 }, Fn = { key: 0 }, Cn = { key: 0 }, Ln = { key: 1 }, Bn = {
key: 0,
class: "konnectio-capitalize"
}, An = /* @__PURE__ */ U({
__name: "EventReservationForm",
props: {
showGiftCard: { type: Boolean, default: !1 },
showTermsNotice: { type: Boolean, default: !1 },
prevCallback: {}
},
setup(E) {
const { t: a } = x(), n = ct(), {
areListingsAvailable: h,
arrivalTime: b,
numberOfPeople: k,
numberOfRooms: i,
numberOfTotalDays: D,
isTemplateEvent: P,
currentEventDate: s,
length: T,
fromDate: $,
tableBasePrice: C,
getTemplateData: V,
basePrice: N,
totalPrice: m,
weekendFee: w,
roomUpgrade: ee,
discountCode: Y,
totalSelectedProducts: y,
discountValue: R,
appliedDiscountCode: Q
} = z(X()), { totalAddonPrice: de, validateDiscountCode: ke } = X(), { currency: ue, hideEventLength: ye } = z(re()), te = a("event.reservationNotice");
return (H, ce) => (l(), v(Bt, {
"discount-code": e(Y),
"onUpdate:discountCode": ce[0] || (ce[0] = (j) => S(Y) ? Y.value = j : null),
"validate-discount-code": e(ke),
"show-gift-card": H.showGiftCard,
"show-terms-notice": H.showTermsNotice,
"is-sidebar-loading": !e(h),
"base-price": e(N),
"total-price": e(m),
"weekend-fee": e(w),
"room-upgrade": e(ee),
notice: e(te),
"prev-callback": H.prevCallback
}, mt({
form: p(() => [
K(H.$slots, "form", {}, void 0, !0),
e(te) ? (l(), r("div", Pn, [
t("p", {
innerHTML: e(te),
class: "konnectio-wysiwyg"
}, null, 8, En)
])) : u("", !0)
]),
"reservation-summary": p(() => [
e(P) ? u("", !0) : (l(), r("li", $n, [
t("span", null, o(e(a)("general.date")), 1),
t("b", null, o(e(G)(e(s))), 1)
])),
e(k) > 0 ? (l(), r("li", wn, [
t("span", null, o(e(a)("event.numberOfGuests")), 1),
t("b", null, o(e(k)), 1)
])) : u("", !0),
!e(P) && e(y) > 0 ? (l(), r("li", On, [
t("span", null, o(e(a)("event.numberOfProducts")), 1),
t("b", null, o(e(y)), 1)
])) : u("", !0),
e(P) ? (l(), r(A, { key: 3 }, [
t("li", null, [
t("span", null, o(e(a)("booking.reservation.arrival")), 1),
t("b", null, o(e(G)(e($))), 1)
]),
t("li", null, [
t("span", null, o(e(a)("booking.reservation.departure")), 1),
t("b", null, o(e(G)(e($), e(D))), 1)
]),
t("li", null, [
t("span", null, o(e(a)("event.numberOfRooms")), 1),
t("b", null, o(e(i)), 1)
]),
e(D) > 0 ? (l(), r("li", Tn, [
t("span", null, o(e(a)("event.numberOfDays")), 1),
t("b", null, o(e(D)), 1)
])) : u("", !0)
], 64)) : u("", !0),
!e(P) && e(b) ? (l(), r("li", Vn, [
t("span", null, o(e(a)("event.startOfEvent")), 1),
t("b", null, o(e(ge)(e(b))), 1)
])) : u("", !0),
!e(P) && e(T) && !e(ye) ? (l(), r("li", _n, [
t("span", null, o(e(a)("event.lengthOfEvent")), 1),
t("b", null, o(e(ge)(e(T))), 1)
])) : u("", !0),
e(R) ? (l(), r("li", Nn, [
t("span", null, o(e(a)("general.discountCode")), 1),
t("b", null, o(e(Q)), 1)
])) : u("", !0)
]),
"price-summary": p(() => [
!e(P) && e(C) > 0 ? (l(), r("li", Fn, [
t("span", null, o(e(a)("booking.availability.basePrice")), 1),
t("b", null, o(e(J)(e(C), e(ue))), 1)
])) : u("", !0),
e(V) ? (l(!0), r(A, { key: 1 }, M(e(V), ({ roomGroupId: j }, W) => (l(), r(A, null, [
e(de)(j, W) > 0 ? (l(), r("li", { key: j }, [
t("span", null, o(e(a)("booking.reservation.addons")) + " - " + o(e(a)("booking.reservation.room")) + " #" + o(W + 1), 1),
t("b", null, o(e(J)(e(de)(j, W), e(ue))), 1)
])) : u("", !0)
], 64))), 256)) : u("", !0)
]),
navigation: p(() => [
K(H.$slots, "navigation", {}, void 0, !0)
]),
"mobile-under-price": p(() => [
e(P) && e(D) > 0 ? (l(), r("div", Cn, [
t("span", null, o(e(G)(e($))) + " - " + o(e(G)(e($), e(D))), 1)
])) : (l(), r("div", Ln, [
t("span", null, o(e(G)(e(s))), 1)
]))
]),
"mobile-summary": p(() => [
!e(P) && e(y) > 0 ? (l(), r("span", Bn, o(e(a)("event.numberOfProducts")) + ": " + o(e(y)), 1)) : u("", !0)
]),
_: 2
}, [
e(n).sidebar ? {
name: "sidebar",
fn: p(() => [
K(H.$slots, "sidebar", {}, void 0, !0)
]),
key: "0"
} : void 0
]), 1032, ["discount-code", "validate-discount-code", "show-gift-card", "show-terms-notice", "is-sidebar-loading", "base-price", "total-price", "weekend-fee", "room-upgrade", "notice", "prev-callback"]));
}
}), Ee = /* @__PURE__ */ q(An, [["__scopeId", "data-v-d2ff3f68"]]), In = { class: "event-skeleton" }, Sn = { class: "event-skeleton-content" }, Rn = { class: "event-skeleton-sidebar" }, Mn = /* @__PURE__ */ U({
__name: "EventSkeleton",
setup(E) {
return (a, n) => (l(), r("div", In, [
t("div", Sn, [
f(Re)
]),
t("div", Rn, [
u("", !0),
f(At)
])
]));
}
}), Un = /* @__PURE__ */ q(Mn, [["__scopeId", "data-v-3e15c4e3"]]), Hn = {
key: 0,
id: "konnectio-event-listings-wrapper"
}, Gn = {
key: 1,
class: "konnectio-hotel-availability-title"
}, zn = { class: "konnectio-event-listings" }, qn = { class: "konnectio-hotel-availability-title" }, Yn = { class: "konnectio-event-listings" }, jn = ["innerHTML"], Wn = { class: "konnectio-panel" }, Zn = {
key: 0,
id: "konnectio-event-addons"
}, Qn = { class: "konnectio-table with-lines" }, Jn = { class: "konnectio-event-addons-price" }, Kn = { class: "konnectio-event-addons-input" }, Xn = { class: "konnectio-event-addons-price" }, xn = { class: "konnectio-event-addons-price" }, ea = {
key: 1,
class: "konnectio-table with-lines without-header"
}, ta = { class: "konnectio-table-addons-information" }, na = { key: 0 }, aa = { class: "konnectio-table-addons-option" }, la = { class: "konnectio-panel" }, oa = /* @__PURE__ */ U({
name: "EventLayout",
__name: "Event",
props: {
accessToken: {},
onlyShow: { default: "everything" },
selectedLocation: {},
resetDate: { default: "no" },
hideLocations: { default: "no" },
hideRemarks: { default: "no" },
hideAllergies: { default: "no" },
showFlagOnTable: { default: "no" },
showHighChairs: {},
styling: {}
},
setup(E) {
const a = E, { t: n } = x(), {
addons: h,
products: b,
numberOfDays: k,
flagOnTable: i,
numberOfHighChairs: D,
name: P,
phone: s,
email: T,
remark: $,
allergies: C,
arrivalTime: V,
hasEvents: N,
hasTemplates: m,
getEvents: w,
getTemplates: ee,
getEventData: Y,
getTemplateData: y,
getEventTableData: R,
hasProducts: Q,
eventRateType: de,
areListingsAvailable: ke,
isAvailabilityDataAvailable: ue,
hasListingData: ye,
isPaymentLoading: te,
isReservationFormFilled: H,
requiresArrivalTime: ce,
hasSelectedRequiredProducts: j,
getUnavailableEvents: W,
hasFallbackEvents: Oe,
getFallbackEvents: Ue
} = z(X()), { currency: me, enableTracking: ne } = z(re()), { setActiveIdFilter: He } = re(), { eventDate: Ge, eventLocation: ze } = z($e()), { isValidRestaurantId: qe } = $e(), {
initialize: Ye,
fetchListings: je,
createBooking: We,
localAddonPrice: Ze,
totalAddonPrice: Qe,
reset: Je,
goBack: Te
} = X(), { beginEventCheckout: Ke } = Se(), { display: he } = we(), Xe = Z(() => [
{
id: "availability",
label: n("booking.availability.title"),
icon: "search"
},
{
id: "addons",
label: n("general.addons"),
icon: "shopping-cart",
hidden: !1
},
{
id: "reservation",
label: n("booking.reservation.title"),
icon: "concierge-bell"
},
{
id: "payment",
hidden: !0
},
{
id: "confirmation",
label: n("booking.confirmation.title"),
icon: "calendar-check"
}
]), xe = Z(() => {
const g = [];
return R.value && R.value.forEach((c) => {
g.find((F) => F.value === c.time) || g.push({
label: ge(c.time),
value: c.time
});
}), g;
});
function et() {
Je(a.resetDate === "yes");
}
function tt(g) {
ne.value && Ke(), We(g);
}
function nt() {
const g = _t("history", {
removeNullishValues: !0
}), c = parseInt(g.rid), F = g.d, O = parseInt(g.eid);
if (F)
if (Nt(F)) {
const d = new Date(F), L = d.setHours(12, 0, 0, 0), I = (/* @__PURE__ */ new Date()).setHours(12, 0, 0, 0);
L >= I ? Ge.value = d : (he({
message: n("alert.error.invalidDateRange"),
type: "error"
}), g.d = void 0);
} else
he({
message: n("alert.error.wrongDateFormat"),
type: "error"
});
isNaN(c) || (qe(c) ? ze.value = c : (g.rid = void 0, he({
message: n("alert.error.hotelIdNotFound"),
type: "error"
}))), isNaN(O) || He(O), je();
}
return (g, c) => (l(), v(Vt, { styling: g.styling }, {
default: p(() => [
(l(), v(pt, { onResolve: nt }, {
default: p(() => [
f(Ft, {
id: "konnectio-event-module",
"access-token": g.accessToken,
callback: e(Ye)
}, {
default: p(() => [
f(It, {
steps: Xe.value,
onReset: et
}, {
availability: p(({ next: F }) => [
f(Ee, null, {
sidebar: p(() => [
f(Zt, {
redirection: !1,
"selected-location": Number(g.selectedLocation),
"hide-locations": g.hideLocations === "yes"
}, null, 8, ["selected-location", "hide-locations"])
]),
form: p(() => [
e(ye) && e(ke) ? (l(), r("div", Hn, [
e(Oe) ? (l(!0), r(A, { key: 0 }, M(e(Ue), ({
id: O,
name: d,
description: L,
images: I
}) => (l(), v(hn, {
key: O,
type: "event",
"listing-id": O,
description: L,
name: d,
gallery: I,
"tracking-enabled": e(ne),
callback: F
}, null, 8, ["listing-id", "description", "name", "gallery", "tracking-enabled", "callback"]))), 128)) : u("", !0),
e(N) && e(W).length > 0 ? (l(), r("h2", Gn, [
f(ie, {
icon: "calendar-clock",
type: "fal",
color: "header"
}),
t("span", null, o(e(n)("event.availableNow")), 1)
])) : u("", !0),
t("ul", zn, [
e(N) && g.onlyShow !== "templates" ? (l(!0), r(A, { key: 0 }, M(e(w), (O) => (l(), v(un, {
name: O.name,
events: O.events,
"tracking-enabled": e(ne),
callback: F
}, null, 8, ["name", "events", "tracking-enabled", "callback"]))), 256)) : u("", !0),
e(m) && g.onlyShow !== "events" ? (l(!0), r(A, { key: 1 }, M(e(ee), ({
id: O,
name: d,
fromDate: L,
toDate: I,
minimumPersonCount: _,
fromPrice: B,
description: ae,
images: le
}) => (l(), v(Dn, {
key: O,
"listing-id": O,
name: d,
images: le,
description: ae,
"from-date": L,
"to-date": I,
"minimum-person-count": _,
fromPrice: B,
"tracking-enabled": e(ne),
callback: F
}, null, 8, ["listing-id", "name", "images", "description", "from-date", "to-date", "minimum-person-count", "fromPrice", "tracking-enabled", "callback"]))), 128)) : u("", !0)
]),
e(W).length > 0 && g.onlyShow !== "templates" ? (l(), r(A, { key: 2 }, [
t("h2", qn, [
f(ie, {
icon: "calendar-circle-exclamation",
type: "fal",
color: "header"
}),
t("span", null, o(e(n)("event.availableLater")), 1)
]),
t("ul", Yn, [
(l(!0), r(A, null, M(e(W), ({
id: O,
days: d,
name: L,
timeFrom: I,
timeTo: _,
fromDate: B,
toDate: ae,
tableGroupId: le,
description: De,
soldOut: Pe,
length: oe,
images: at,
maxOnlineReservationLimit: lt,
maxPaxPerReservation: ot,
useNumberOfProductsForPersons: st,
maxTicketsLimit: it
}) => (l(), v(fn, {
key: O,
type: "event",
"listing-id": O,
"table-group-id": le,
description: De,
name: L,
length: oe,
gallery: at,
days: d,
"from-date": B,
"to-date": ae,
"max-online-reservation-limit": ot || lt || it,
"time-from": I,
"time-to": _,
"sold-out": Pe,
"use-number-of-products-for-persons": st,
"tracking-enabled": e(ne),
callback: F
}, null, 8, ["listing-id", "table-group-id", "description", "name", "length", "gallery", "days", "from-date", "to-date", "max-online-reservation-limit", "time-from", "time-to", "sold-out", "use-number-of-products-for-persons", "tracking-enabled", "callback"]))), 128))
])
], 64)) : u("", !0),
(!e(N) && !e(m) || !e(N) && g.onlyShow === "events" || !e(m) && g.onlyShow === "templates") && !e(Oe) ? (l(), r("div", {
key: 3,
class: "konnectio-panel",
innerHTML: e(n)("event.nothingAvailable")
}, null, 8, jn)) : u("", !0)
])) : (l(), v(Re, { key: 1 }))
]),
_: 2
}, 1024)
]),
addons: p(({ next: F, prev: O }) => [
e(ue) ? (l(), v(Ee, {
key: 0,
"prev-callback": () => e(Te)(O)
}, {
form: p(() => [
t("form", Wn, [
t("h2", null, [
t("span", null, o(e(n)("event.selectProducts")), 1)
]),
e(y) && e(y).length > 0 ? (l(), r("ul", Zn, [
(l(!0), r(A, null, M(e(y), ({
roomGroupId: d,
addons: L,
adultPerRoom: I
}, _) => (l(), r("li", { key: d }, [
t("h5", null, [
t("span", null, o(e(n)("booking.reservation.room")) + " #" + o(_ + 1), 1),
c[9] || (c[9] = ve(" (", -1)),
f(ie, {
icon: "male",
type: "fas",
color: "header"
}),
ve(" " + o(I) + ") ", 1)
]),
t("table", Qn, [
t("thead", null, [
t("tr", null, [
t("th", null, [
t("span", null, o(e(n)("booking.reservation.addons")), 1)
]),
c[10] || (c[10] = t("th", { class: "konnectio-event-addons-input" }, null, -1)),
t("th", Jn, [
t("span", null, o(e(n)("booking.availability.price")), 1)
])
])
]),
t("tbody", null, [
(l(!0), r(A, null, M(L, ({
id: B,
cardinality: ae,
name: le,
price: De,
quantityStrategy: Pe
}) => (l(), r("tr", { key: B }, [
t("td", null, [
t("b", null, o(le), 1),
c[11] || (c[11] = t("br", null, null, -1)),
t("span", null, o(e(J)(De, e(me))) + " " + o(e(Tt)(Pe)), 1)
]),
t("td", Kn, [
ae === 3 ? (l(), v(se, {
key: 0,
modelValue: e(h)[`${d}.${B}.${_}`],
"onUpdate:modelValue": (oe) => e(h)[`${d}.${B}.${_}`] = oe,
small: !0,
"min-value": 0
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : (l(), v(Be, {
key: 1,
modelValue: e(h)[`${d}.${B}.${_}`],
"onUpdate:modelValue": (oe) => e(h)[`${d}.${B}.${_}`] = oe,
numeric: !0
}, null, 8, ["modelValue", "onUpdate:modelValue"]))
]),
t("td", Xn, [
t("span", null, o(e(J)(e(Ze)(B, d, _), e(me))), 1)
])
]))), 128))
]),
t("tfoot", null, [
t("tr", null, [
c[12] || (c[12] = t("td", null, null, -1)),
c[13] || (c[13] = t("td", null, null, -1)),
t("td", xn, [
t("u", null, [
t("span", null, o(e(J)(e(Qe)(d, _), e(me))), 1)
])
])
])
])
])
]))), 128))
])) : u("", !0),
e(Q) ? (l(), r("table", ea, [
t("tbody", null, [
(l(!0), r(A, null, M(e(Y).products, ({ id: d, name: L, price: I, description: _ }) => (l(), r("tr", { key: d }, [
t("td", ta, [
t("b", null, [
t("span", null, o(e(Ve)(L)), 1)
]),
_ && _ !== L ? (l(), r("span", na, o(e(Ve)(_)), 1)) : u("", !0),
t("u", null, o(e(J)(I, e(me))), 1)
]),
t("td", aa, [
f(se, {
modelValue: e(b)[d],
"onUpdate:modelValue": (B) => e(b)[d] = B,
small: !0,
"min-value": 0
}, null, 8, ["modelValue", "onUpdate:modelValue"])
])
]))), 128))
])
])) : u("", !0)
])
]),
navigation: p(() => [
f(be, {
label: e(n)("event.startReservation"),
disabled: !e(j),
"full-width": "",
onClickEvent: F
}, null, 8, ["label", "disabled", "onClickEvent"])
]),
_: 2
}, 1032, ["prev-callback"])) : u("", !0)
]),
reservation: p(({ next: F, prev: O }) => [
f(Ee, {
"show-terms-notice": !0,
"show-gift-card": !0,
"prev-callback": () => e(Te)(O)
}, {
form: p(() => [
t("form", la, [
t("h2", null, [
t("span", null, o(e(n)("booking.reservation.detailsTitle")), 1)
]),
f(pe, {
modelValue: e(P),
"onUpdate:modelValue": c[0] || (c[0] = (d) => S(P) ? P.value = d : null),
type: "text",
label: e(n)("booking.reservation.name"),
icon: "user-alt",
placeholder: e(n)("booking.reservation.namePlaceholder"),
required: ""
}, null, 8, ["modelValue", "label", "placeholder"]),
f(pe, {
modelValue: e(T),
"onUpdate:modelValue": c[1] || (c[1] = (d) => S(T) ? T.value = d : null),
label: e(n)("booking.reservation.email"),
type: "email",
name: "email",
autocomplete: "email",
icon: "at",
placeholder: e(n)("booking.reservation.emailPlaceholder"),
required: ""
}, null, 8, ["modelValue", "label", "placeholder"]),
f(Wt, {
modelValue: e(s),
"onUpdate:modelValue": c[2] || (c[2] = (d) => S(s) ? s.value = d : null),
label: e(n)("booking.reservation.phone"),
icon: "phone-office",
placeholder: e(n)("booking.reservation.phonePlaceholder"),
required: ""
}, null, 8, ["modelValue", "label", "placeholder"]),
e(ce) ? (l(), v(Rt, {
key: 0,
modelValue: e(V),
"onUpdate:modelValue": c[3] || (c[3] = (d) => S(V) ? V.value = d : null),
label: e(n)("event.selectArrivalTime"),
name: "eventTimeTable",
checkboxes: xe.value,
required: ""
}, null, 8, ["modelValue", "label", "checkboxes"])) : u("", !0),
e(de) === e(Ot).FullDayEvent ? (l(), v(se, {
key: 1,
modelValue: e(k),
"onUpdate:modelValue": c[4] || (c[4] = (d) => S(k) ? k.value = d : null),
label: e(n)("event.numberOfDays"),
"min-value": 1,
required: ""
}, null, 8, ["modelValue", "label"])) : u("", !0),
g.showHighChairs === "yes" ? (l(), v(se, {
key: 2,
modelValue: e(D),
"onUpdate:modelValue": c[5] || (c[5] = (d) => S(D) ? D.value = d : null),
label: e(n)("event.numberOfHighChairs"),
icon: "baby",
"no-optional-label": !1
}, null, 8, ["modelValue", "label"])) : u("", !0),
g.showFlagOnTable === "yes" ? (l(), v(Be, {
key: 3,
modelValue: e(i),
"onUpdate:modelValue": c[6] || (c[6] = (d) => S(i) ? i.value = d : null),
label: e(n)("event.flagOnTable")
}, null, 8, ["modelValue", "label"])) : u("", !0),
g.hideRemarks !== "yes" ? (l(), v(pe, {
key: 4,
modelValue: e($),
"onUpdate:modelValue": c[7] || (c[7] = (d) => S($) ? $.value = d : null),
type: "textarea",
label: e(n)("booking.reservation.remark"),
icon: "info-circle",
placeholder: e(n)("booking.reservation.remarkPlaceholder")
}, null, 8, ["modelValue", "label", "placeholder"])) : u("", !0),
g.hideAllergies !== "yes" ? (l(), v(pe, {
key: 5,
modelValue: e(C),
"onUpdate:modelValue": c[8] || (c[8] = (d) => S(C) ? C.value = d : null),
type: "textarea",
label: e(n)("booking.reservation.allergies"),
icon: "allergies",
placeholder: e(n)("booking.reservation.allergiesPlaceholder")
}, null, 8, ["modelValue", "label", "placeholder"])) : u("", !0)
])
]),
navigation: p(() => [
f(be, {
label: e(n)("general.confirmReservation"),
"is-loading": e(te),
disabled: !e(H),
"full-width": "",
onClickEvent: (d) => tt(F)
}, null, 8, ["label", "is-loading", "disabled", "onClickEvent"])
]),
_: 2
}, 1032, ["prev-callback"])
]),
payment: p(() => [
f(jt)
]),
confirmation: p(() => [
f(St, {
message: e(n)("event.confirmationMessage")
}, null, 8, ["message"])
]),
_: 1
}, 8, ["steps"])
]),
_: 1
}, 8, ["access-token", "callback"])
]),
fallback: p(() => [
f(Un)
]),
_: 1
}))
]),
_: 1
}, 8, ["styling"]));
}
}), Ae = /* @__PURE__ */ q(oa, [["__scopeId", "data-v-b0302ba5"]]), sa = vt(), ia = bt, ra = ia();
class da extends HTMLElement {
vueApp;
constructor() {
super();
}
disconnectedCallback() {
this.vueApp.unmount();
}
connectedCallback() {
const a = gt(Ae, this.attributes);
this.vueApp = ft(Ae, a), this.vueApp.provide("emitter", ra), this.vueApp.use(Qt), this.vueApp.use(kt), this.vueApp.use(sa), this.vueApp.use(Mt), this.vueApp.use(yt), this.vueApp.use(Ut);
const n = document.createElement("div");
this.vueApp.mount(n), this.appendChild(n.children[0]);
}
}
window.customElements.define("konnectio-event", da);
export {
da as default
};
//# sourceMappingURL=event.js.map