@konnectio/core 4.0.13 → 4.0.15
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-74fc14cf.cjs → ActionField-bcecb3ad.cjs} +1 -1
- package/dist/{ActionField-54349124.js → ActionField-d82454ed.js} +3 -3
- package/dist/ActionField-d82454ed.js.br +0 -0
- package/dist/AvailabilitySkeleton-120dbd72.cjs +1 -0
- package/dist/{AvailabilitySkeleton-f7c1b363.js → AvailabilitySkeleton-9e34fdd6.js} +7 -6
- package/dist/AvailabilitySkeleton-9e34fdd6.js.br +0 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-6f00c90f.cjs +5 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-a494ebda.js +10010 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-a494ebda.js.br +0 -0
- package/dist/{Field-c8c55b91.cjs → Field-11498556.cjs} +1 -1
- package/dist/{Field-0b82e3dc.js → Field-2fb37b34.js} +2 -2
- package/dist/Field-2fb37b34.js.br +0 -0
- package/dist/{NumberField.vue_vue_type_script_setup_true_lang-001ceb59.js → NumberField.vue_vue_type_script_setup_true_lang-21318607.js} +8 -8
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-21318607.js.br +0 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-e92e7311.cjs +1 -0
- package/dist/{SelectField.vue_vue_type_style_index_0_lang-b92d158e.cjs → SelectField.vue_vue_type_style_index_0_lang-354a8ba7.cjs} +23 -23
- package/dist/{SelectField.vue_vue_type_style_index_0_lang-ba987c3e.js → SelectField.vue_vue_type_style_index_0_lang-a75b8f32.js} +3401 -3401
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a75b8f32.js.br +0 -0
- package/dist/{TextField-cbed3348.js → TextField-46d88ef6.js} +1 -1
- package/dist/TextField-46d88ef6.js.br +0 -0
- package/dist/{TextField-52bc45b8.cjs → TextField-afd7af9b.cjs} +1 -1
- package/dist/{ThankYou-a6b0d51e.js → ThankYou-a44a3589.js} +213 -212
- package/dist/ThankYou-a44a3589.js.br +0 -0
- package/dist/{ThankYou-d4fae82e.cjs → ThankYou-e988ffbe.cjs} +6 -6
- package/dist/{_-f5fc7dd6.cjs → _-0e8547fb.cjs} +1 -1
- package/dist/{_-66cf2aa1.js → _-6e32ea4d.js} +14 -14
- package/dist/_-6e32ea4d.js.br +0 -0
- package/dist/availability.cjs +2 -2
- package/dist/availability.js +61 -61
- package/dist/availability.js.br +0 -0
- package/dist/components/Clickable.vue.d.ts +1 -1
- package/dist/components/forms/HotelAvailabilityForm.vue.d.ts +1 -1
- package/dist/components/listings/Base.vue.d.ts +1 -1
- package/dist/components/skeletons/_.vue.d.ts +1 -1
- package/dist/event-a09daadc.js +330 -0
- package/dist/event-a09daadc.js.br +0 -0
- package/dist/event-d85117b3.cjs +1 -0
- package/dist/event.cjs +1 -1
- package/dist/event.js +9 -9
- package/dist/event.js.br +0 -0
- package/dist/gift-card-validation.cjs +1 -1
- package/dist/gift-card-validation.js +4 -4
- package/dist/gift-card-validation.js.br +0 -0
- package/dist/gift-card.cjs +1 -1
- package/dist/gift-card.js +71 -71
- package/dist/gift-card.js.br +0 -0
- package/dist/hotel.cjs +5 -5
- package/dist/hotel.js +1258 -1250
- package/dist/hotel.js.br +0 -0
- package/dist/{index-2018df9e.cjs → index-3a59acc2.cjs} +1 -1
- package/dist/{index-b69ec10e.js → index-84c4adc0.js} +2 -2
- package/dist/index-84c4adc0.js.br +0 -0
- package/dist/layouts/Hotel.vue.d.ts +0 -1
- package/dist/polyfill.cjs +1 -1
- package/dist/polyfill.js +1 -1
- package/dist/polyfill.js.br +0 -0
- package/dist/style.css +1 -1
- package/dist/style.css.br +0 -0
- package/package.json +13 -13
- package/dist/ActionField-54349124.js.br +0 -0
- package/dist/AvailabilitySkeleton-34890eb5.cjs +0 -1
- package/dist/AvailabilitySkeleton-f7c1b363.js.br +0 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-41b83959.cjs +0 -5
- package/dist/DateField.vue_vue_type_style_index_0_lang-c5873e66.js +0 -8411
- package/dist/DateField.vue_vue_type_style_index_0_lang-c5873e66.js.br +0 -0
- package/dist/Field-0b82e3dc.js.br +0 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-001ceb59.js.br +0 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-8525b2cd.cjs +0 -1
- package/dist/SelectField.vue_vue_type_style_index_0_lang-ba987c3e.js.br +0 -0
- package/dist/TextField-cbed3348.js.br +0 -0
- package/dist/ThankYou-a6b0d51e.js.br +0 -0
- package/dist/_-66cf2aa1.js.br +0 -0
- package/dist/event-f2a6108f.cjs +0 -1
- package/dist/event-f820ba4b.js +0 -330
- package/dist/event-f820ba4b.js.br +0 -0
- package/dist/index-b69ec10e.js.br +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-b92d158e.cjs"),g=e.defineStore("applyGiftCard",()=>{const{display:o}=e.useAlertStore(),{bearerToken:d}=e.storeToRefs(e.useUtilityStore()),t=e.ref(0),l=e.ref(""),n=e.ref(""),i=e.ref(""),a=e.ref(!1),r=e.ref(!1);async function s(){l.value!==""?(r.value=!0,await e.axios.get("http://localhost:91/api/gift-card/validate",{params:{giftcardCode:l.value,lang:e.getUserLanguage()},headers:{Authorization:d.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.13"}}).then(p=>{const{valid:c,amount:f,expirationDate:m,productName:y}=p.data;c?(t.value=f,n.value=m,i.value=y,a.value=!0,o({message:e.i18n.t("alert.success.giftCardApplied"),type:"success"})):(a.value=!1,o({message:e.i18n.t("alert.error.giftCardInvalid"),type:"warning"}))}),r.value=!1):o({message:e.i18n.t("alert.error.giftCardEmpty"),type:"error"})}function u(){t.value=0,l.value="",a.value=!1,o({message:e.i18n.t("alert.success.giftCardRemoved"),type:"success"})}return{amount:t,voucher:l,expirationDate:n,productName:i,isValid:a,isLoading:r,apply:s,reset:u}}),v=e.defineComponent({__name:"NumberField",props:{modelValue:{default:0},minValue:{default:0},maxValue:{default:1/0},inputtable:{type:Boolean,default:!0},label:{},placeholder:{},icon:{},iconColor:{},iconType:{default:"fal"},iconPlacement:{},step:{default:1},controls:{type:Boolean,default:!0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},id:{},rounded:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},small:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(o,{emit:d}){const t=d,l=o,n=l.id||e.ranId();function i(a){t("update:modelValue",a)}return e.onMounted(()=>{l.modelValue||i(l.minValue)}),(a,r)=>(e.openBlock(),e.createBlock(e.InputField,{label:a.label,id:e.unref(n),icon:a.icon,"icon-color":a.iconColor,"icon-type":a.iconType,"icon-placement":a.iconPlacement,required:a.required,type:a.small?"fresh-booking-number-picker small":"fresh-booking-number-picker",readonly:a.readonly},{default:e.withCtx(()=>[e.createVNode(e.unref(e.script),{attrs:{id:e.unref(n)},modelValue:a.modelValue,min:a.minValue,max:a.maxValue,step:a.step,inline:a.inline,controls:a.controls,placeholder:a.placeholder,readonly:a.readonly,inputtable:a.inputtable,rounded:a.rounded,disabled:a.disabled,"onUpdate:modelValue":i},null,8,["attrs","modelValue","min","max","step","inline","controls","placeholder","readonly","inputtable","rounded","disabled"])]),_:1},8,["label","id","icon","icon-color","icon-type","icon-placement","required","type","readonly"]))}});exports._sfc_main=v;exports.useApplyGiftCardStore=g;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/_-66cf2aa1.js.br
DELETED
|
Binary file
|
package/dist/event-f2a6108f.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-b92d158e.cjs"),Ce=require("./_-f5fc7dd6.cjs"),_e=require("./NumberField.vue_vue_type_script_setup_true_lang-8525b2cd.cjs"),Fe=e.defineStore("event",()=>{const X=Ce.usePaymentStore(),{voucher:Y}=e.storeToRefs(_e.useApplyGiftCardStore()),{display:g}=e.useAlertStore(),{bearerToken:S}=e.storeToRefs(e.useUtilityStore()),c=e.ref({}),f=e.ref({}),a=e.ref(void 0),u=e.ref(!0),s=e.ref(e.EventModuleState.InitialState),O=e.ref(new Date),A=e.ref(NaN),k=e.ref(1),b=e.ref(NaN),z=e.ref(NaN),P=e.ref(""),w=e.useStorage("freshBookingName","",void 0,{serializer:e.StorageSerializers.string}),M=e.useStorage("freshBookingPhone","",void 0,{serializer:e.StorageSerializers.string}),C=e.useStorage("freshBookingEmail","",void 0,{serializer:e.StorageSerializers.string}),B=e.ref(""),D=e.ref({}),d=e.ref({}),_=e.ref("");function n(t){return t.templateID!==void 0}const Z=e.computed(()=>c.value.currency),ee=e.computed(()=>c.value.maxNumberPerBooking),te=e.computed(()=>c.value.title),ae=e.computed(()=>c.value.subtitle),oe=e.computed(()=>c.value.slideshow),I=e.computed(()=>O.value.toISOString()),ne=e.computed(()=>n(a.value)),F=e.computed(()=>n(a.value)?a.value.numberOfDays:k.value),ue=e.computed(()=>n(a.value)?a.value.packageCount:0),le=e.computed(()=>n(a.value)?a.value.fromDate:""),h=e.computed(()=>f.value.events.find(t=>t.id===b.value)),re=e.computed(()=>h.value?h.value.length:void 0),L=e.computed(()=>n(a.value)?a.value.templateID:0),se=e.computed(()=>f.value.events),ie=e.computed(()=>f.value.templates),ve=e.computed(()=>f.value.events.length>0),ce=e.computed(()=>f.value.templates.length>0),U=e.computed(()=>h.value&&h.value.eventRateType?h.value.eventRateType:e.OctopusEventRateType.None),N=e.computed(()=>{if(!n(a.value))return a.value}),G=e.computed(()=>{if(N.value!==void 0){const t=N.value.find(o=>o.time===P.value);if(t&&t.price)return t.price}return 0}),V=e.computed(()=>{if(n(a.value))return a.value.templateCounts}),de=e.computed(()=>t=>c.value.eventImages.filter(o=>o.eventID===t));function T(t,o,l){let i=0;if(n(a.value)){const r=a.value.templateCounts[l];if(r){const y=r.addons,p=D.value[`${o}.${t}.${l}`]||0;if(p>0){const m=y?.find(E=>E.addonID===t),v=typeof p=="boolean"?1:p;i+=e.getQuantityStrategyPrice(m?.price,m?.quantityStrategy,F.value,r.adultPerRoom)*v}}}else{const r=d.value[t]||0;if(r>0){const y=h.value?.products?.find(p=>p.productID===t);y&&(i+=y.price*r)}}return i}function R(t,o){let l=0;if(n(a.value))for(const i in D.value){const r=i.split(".");parseInt(r[0])===t&&parseInt(r[2])===o&&(l+=T(parseInt(r[1]),t,o))}else for(const i in d.value)l+=T(parseInt(i))*k.value;return l}const q=e.computed(()=>n(a.value)&&a.value.totalPrice||0),pe=e.computed(()=>{if(n(a.value))return a.value.templateCounts===void 0?NaN:a.value.templateCounts.flatMap(t=>t.roomGroupID).reduce((t,o,l)=>t+R(o,l),q.value)||0;{let t=R();return t+=G.value,t}}),me=e.computed(()=>n(a.value)&&a.value.templateCounts!==void 0&&a.value.templateCounts.flatMap(t=>t.weekendFee).reduce((t,o)=>t+o,0)||0),ge=e.computed(()=>n(a.value)&&a.value.templateCounts!==void 0&&a.value.templateCounts.flatMap(t=>t.roomUpgrade).reduce((t,o)=>t+o,0)||0),fe=e.computed(()=>{const t=d.value;let o=0;for(const l in t)o+=Number.isNaN(t[l])?0:t[l];return o>0}),x=e.computed(()=>n(a.value)?!1:Object.keys(d.value).length>0),he=e.computed(()=>!!(w.value!==""&&C.value!==""&&M.value.length>=5&&(!x.value||fe.value)&&(!(!n(a.value)&&U.value!==e.OctopusEventRateType.FullDayEvent)||P.value!=="")));function ye(t){return s.value===e.EventModuleState.ReservationState&&b.value===t&&u.value}const Se=e.computed(()=>!(s.value===e.EventModuleState.InitialState&&u.value)),be=e.computed(()=>!(s.value===e.EventModuleState.AvailabilityState&&u.value)),De=e.computed(()=>a.value!==void 0),Ie=e.computed(()=>s.value===e.EventModuleState.PaymentState&&u.value);async function K(){try{const t=(await e.axios.get("http://localhost:91/api/event/metadata",{params:{language:e.getUserLanguage()},headers:{Authorization:S.value,"Fresh-Booking-Ver":"4.0.13"}})).data;c.value=t,j()}catch{g({message:e.i18n.t("alert.error.couldntFetchMetadata"),type:"warning"})}}async function j(){s.value=e.EventModuleState.AvailabilityState,u.value=!0;try{const t=(await e.axios.get("http://localhost:91/api/event/restaurant-events",{params:{language:e.getUserLanguage(),date:I.value},headers:{Authorization:S.value,"Fresh-Booking-Ver":"4.0.13"}})).data;f.value=t,u.value=!1}catch{g({message:e.i18n.t("alert.error.couldntFetchListings"),type:"warning"})}}async function Ee(t){s.value=e.EventModuleState.ReservationState,u.value=!0;try{const o=(await e.axios.get("http://localhost:91/api/v3/event/get-availability",{params:{language:e.getUserLanguage(),date:I.value,templateId:b.value,numberOfPeople:A.value},headers:{Authorization:S.value,"Fresh-Booking-Ver":"4.0.13"}})).data;o.templateCounts.length===0?g({message:e.i18n.t("alert.error.eventNotAvailable"),type:"warning"}):(a.value=o,t()),u.value=!1}catch{u.value=!1,s.value=e.EventModuleState.AvailabilityState,g({message:e.i18n.t("alert.error.couldntFetchEvent"),type:"warning"})}}async function Pe(t){s.value=e.EventModuleState.ReservationState,u.value=!0;try{const o=(await e.axios.get("http://localhost:91/api/v3/event/get-table-availability",{params:{language:e.getUserLanguage(),date:I.value,numberOfPeople:A.value,eventId:b.value,tableGroupId:z.value},headers:{Authorization:S.value,"Fresh-Booking-Ver":"4.0.13"}})).data;a.value=o,u.value=!1,t()}catch{u.value=!1,s.value=e.EventModuleState.AvailabilityState,g({message:e.i18n.t("alert.error.couldntFetchEvent"),type:"warning"})}}async function Ae(){try{const t=(await e.axios.get("http://localhost:91/api/v3/event/validate-discount-code",{params:{language:e.getUserLanguage(),date:I.value,discountCode:_.value},headers:{Authorization:S.value,"Fresh-Booking-Ver":"4.0.13"}})).data;console.log(t)}catch(t){console.log(t),g({message:e.i18n.t("alert.error.discountCodeValidation"),type:"warning"})}}async function ke(t){s.value=e.EventModuleState.PaymentState,u.value=!0;const o=()=>{u.value=!1,s.value=e.EventModuleState.ReservationState,g({message:e.i18n.t("booking.other.errorMessage"),type:"warning"})};let l,i,r;const y=[];if(n(a.value))V.value?.forEach((v,E)=>{const Q=[];let H=0;for(const J in D.value){const $=J.split("."),W=D.value[J];parseInt($[0])===v.roomGroupID&&parseInt($[2])===E&&W>0&&(Q.push({id:H,addonID:parseInt($[1]),quantity:W}),H++)}y.push({adultPerRoom:v.adultPerRoom,count:v.count,roomGroupID:v.roomGroupID,addons:Q})}),l={templateID:L.value,numberOfDays:k.value,templateCounts:y};else{i=[],r=P.value;for(const v in d.value){const E=d.value[parseInt(v)];E>0&&i.push({id:parseInt(v),quantity:E})}}let p="http://localhost:91/api/v3/event/template-book";const m={date:I.value,name:w.value,email:C.value,phone:M.value,remark:B.value,numberOfPeople:A.value,days:F.value,discountCode:_.value,giftCardCode:Y.value,checkoutUrl:window.location.origin,privacyUrl:window.location.origin};n(a.value)?m.templateGroup=l:(m.time=r,m.eventId=b.value,m.products=i,p="http://localhost:91/api/v3/event/event-book"),await e.axios.post(p,m,{headers:{Authorization:S.value,"Fresh-Booking-Ver":"4.0.13"}}).then(v=>{u.value=!1,X.pay({callback:t,response:v.data})}).catch(()=>o())}function we(t){D.value={},d.value={},P.value="",t()}function Me(){K()}return{metaData:c,listingData:f,tableBasePrice:G,availabilityData:a,isLoading:u,moduleState:s,searchDate:O,numberOfPeople:A,numberOfDays:k,eventId:b,tableGroupId:z,arrivalTime:P,addons:D,products:d,discountCode:_,name:w,phone:M,email:C,remark:B,isTemplateEvent:ne,currency:Z,maxNumberOfPeople:ee,title:te,subtitle:ae,slideshow:oe,date:I,numberOfTotalDays:F,numberOfRooms:ue,fromDate:le,getEventData:h,length:re,templateId:L,getEvents:se,getTemplates:ie,hasEvents:ve,hasTemplates:ce,basePrice:q,totalPrice:pe,getTemplateData:V,getEventTableData:N,roomUpgrade:ge,weekendFee:me,hasProducts:x,eventRateType:U,isReservationFormFilled:he,isMetaDataAvailable:Se,areListingsAvailable:be,isAvailabilityDataAvailable:De,isPaymentLoading:Ie,getEventImages:de,isEventListingLoading:ye,fetchMetaData:K,fetchListings:j,getTemplateAvailability:Ee,getEventAvailability:Pe,validateDiscountCode:Ae,localAddonPrice:T,totalAddonPrice:R,createBooking:ke,reset:we,initialize:Me}});exports.useEventStore=Fe;
|
package/dist/event-f820ba4b.js
DELETED
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import { d as Ge, s as oe, u as Ve, a as Le, r as s, E as v, b as U, c as a, O as le, S as q, g as Ue, e as C, f as N, i as I } from "./SelectField.vue_vue_type_style_index_0_lang-ba987c3e.js";
|
|
2
|
-
import { u as qe } from "./_-66cf2aa1.js";
|
|
3
|
-
import { u as Ke } from "./NumberField.vue_vue_type_script_setup_true_lang-001ceb59.js";
|
|
4
|
-
const Qe = Ge("event", () => {
|
|
5
|
-
const se = qe(), { voucher: ue } = oe(Ke()), { display: h } = Ve(), { bearerToken: S } = oe(Le()), p = s({}), y = s({}), t = s(void 0), l = s(!0), i = s(v.InitialState), K = s(/* @__PURE__ */ new Date()), F = s(NaN), T = s(1), P = s(NaN), x = s(NaN), E = s(""), $ = U("freshBookingName", "", void 0, { serializer: q.string }), O = U("freshBookingPhone", "", void 0, { serializer: q.string }), R = U("freshBookingEmail", "", void 0, { serializer: q.string }), _ = s(""), A = s({}), m = s({}), B = s("");
|
|
6
|
-
function o(e) {
|
|
7
|
-
return e.templateID !== void 0;
|
|
8
|
-
}
|
|
9
|
-
const re = a(() => p.value.currency), ie = a(() => p.value.maxNumberPerBooking), ve = a(() => p.value.title), ce = a(() => p.value.subtitle), de = a(() => p.value.slideshow), k = a(() => K.value.toISOString()), pe = a(() => o(t.value)), z = a(() => o(t.value) ? t.value.numberOfDays : T.value), me = a(() => o(t.value) ? t.value.packageCount : 0), ge = a(() => o(t.value) ? t.value.fromDate : ""), b = a(() => y.value.events.find((e) => e.id === P.value)), fe = a(() => b.value ? b.value.length : void 0), j = a(() => o(t.value) ? t.value.templateID : 0), he = a(() => y.value.events), ye = a(() => y.value.templates), be = a(() => y.value.events.length > 0), De = a(() => y.value.templates.length > 0), Q = a(() => b.value && b.value.eventRateType ? b.value.eventRateType : le.None), M = a(() => {
|
|
10
|
-
if (!o(t.value))
|
|
11
|
-
return t.value;
|
|
12
|
-
}), H = a(() => {
|
|
13
|
-
if (M.value !== void 0) {
|
|
14
|
-
const e = M.value.find(
|
|
15
|
-
(n) => n.time === E.value
|
|
16
|
-
);
|
|
17
|
-
if (e && e.price)
|
|
18
|
-
return e.price;
|
|
19
|
-
}
|
|
20
|
-
return 0;
|
|
21
|
-
}), J = a(() => {
|
|
22
|
-
if (o(t.value))
|
|
23
|
-
return t.value.templateCounts;
|
|
24
|
-
}), Ie = a(() => (e) => p.value.eventImages.filter((n) => n.eventID === e));
|
|
25
|
-
function G(e, n, u) {
|
|
26
|
-
let c = 0;
|
|
27
|
-
if (o(t.value)) {
|
|
28
|
-
const r = t.value.templateCounts[u];
|
|
29
|
-
if (r) {
|
|
30
|
-
const D = r.addons, g = A.value[`${n}.${e}.${u}`] || 0;
|
|
31
|
-
if (g > 0) {
|
|
32
|
-
const f = D?.find((w) => w.addonID === e), d = typeof g == "boolean" ? 1 : g;
|
|
33
|
-
c += Ue(f?.price, f?.quantityStrategy, z.value, r.adultPerRoom) * d;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
const r = m.value[e] || 0;
|
|
38
|
-
if (r > 0) {
|
|
39
|
-
const D = b.value?.products?.find((g) => g.productID === e);
|
|
40
|
-
D && (c += D.price * r);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return c;
|
|
44
|
-
}
|
|
45
|
-
function V(e, n) {
|
|
46
|
-
let u = 0;
|
|
47
|
-
if (o(t.value))
|
|
48
|
-
for (const c in A.value) {
|
|
49
|
-
const r = c.split(".");
|
|
50
|
-
parseInt(r[0]) === e && parseInt(r[2]) === n && (u += G(parseInt(r[1]), e, n));
|
|
51
|
-
}
|
|
52
|
-
else
|
|
53
|
-
for (const c in m.value)
|
|
54
|
-
u += G(parseInt(c)) * T.value;
|
|
55
|
-
return u;
|
|
56
|
-
}
|
|
57
|
-
const W = a(() => o(t.value) && t.value.totalPrice || 0), Se = a(() => {
|
|
58
|
-
if (o(t.value))
|
|
59
|
-
return t.value.templateCounts === void 0 ? NaN : t.value.templateCounts.flatMap((e) => e.roomGroupID).reduce(
|
|
60
|
-
(e, n, u) => e + V(n, u),
|
|
61
|
-
W.value
|
|
62
|
-
) || 0;
|
|
63
|
-
{
|
|
64
|
-
let e = V();
|
|
65
|
-
return e += H.value, e;
|
|
66
|
-
}
|
|
67
|
-
}), Pe = a(() => o(t.value) && t.value.templateCounts !== void 0 && t.value.templateCounts.flatMap((e) => e.weekendFee).reduce((e, n) => e + n, 0) || 0), Ae = a(() => o(t.value) && t.value.templateCounts !== void 0 && t.value.templateCounts.flatMap((e) => e.roomUpgrade).reduce((e, n) => e + n, 0) || 0), ke = a(() => {
|
|
68
|
-
const e = m.value;
|
|
69
|
-
let n = 0;
|
|
70
|
-
for (const u in e)
|
|
71
|
-
n += Number.isNaN(e[u]) ? 0 : e[u];
|
|
72
|
-
return n > 0;
|
|
73
|
-
}), X = a(() => o(t.value) ? !1 : Object.keys(m.value).length > 0), we = a(() => !!($.value !== "" && R.value !== "" && O.value.length >= 5 && (!X.value || ke.value) && (!(!o(t.value) && Q.value !== le.FullDayEvent) || E.value !== "")));
|
|
74
|
-
function Ce(e) {
|
|
75
|
-
return i.value === v.ReservationState && P.value === e && l.value;
|
|
76
|
-
}
|
|
77
|
-
const Ee = a(() => !(i.value === v.InitialState && l.value)), Ne = a(() => !(i.value === v.AvailabilityState && l.value)), Fe = a(() => t.value !== void 0), Te = a(() => i.value === v.PaymentState && l.value);
|
|
78
|
-
async function Y() {
|
|
79
|
-
try {
|
|
80
|
-
const e = (await C.get("http://localhost:91/api/event/metadata", {
|
|
81
|
-
params: {
|
|
82
|
-
language: N()
|
|
83
|
-
},
|
|
84
|
-
headers: {
|
|
85
|
-
Authorization: S.value,
|
|
86
|
-
"Fresh-Booking-Ver": "4.0.13"
|
|
87
|
-
}
|
|
88
|
-
})).data;
|
|
89
|
-
p.value = e, Z();
|
|
90
|
-
} catch {
|
|
91
|
-
h({
|
|
92
|
-
message: I.t("alert.error.couldntFetchMetadata"),
|
|
93
|
-
type: "warning"
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
async function Z() {
|
|
98
|
-
i.value = v.AvailabilityState, l.value = !0;
|
|
99
|
-
try {
|
|
100
|
-
const e = (await C.get("http://localhost:91/api/event/restaurant-events", {
|
|
101
|
-
params: {
|
|
102
|
-
language: N(),
|
|
103
|
-
date: k.value
|
|
104
|
-
},
|
|
105
|
-
headers: {
|
|
106
|
-
Authorization: S.value,
|
|
107
|
-
"Fresh-Booking-Ver": "4.0.13"
|
|
108
|
-
}
|
|
109
|
-
})).data;
|
|
110
|
-
y.value = e, l.value = !1;
|
|
111
|
-
} catch {
|
|
112
|
-
h({
|
|
113
|
-
message: I.t("alert.error.couldntFetchListings"),
|
|
114
|
-
type: "warning"
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
async function $e(e) {
|
|
119
|
-
i.value = v.ReservationState, l.value = !0;
|
|
120
|
-
try {
|
|
121
|
-
const n = (await C.get("http://localhost:91/api/v3/event/get-availability", {
|
|
122
|
-
params: {
|
|
123
|
-
language: N(),
|
|
124
|
-
date: k.value,
|
|
125
|
-
templateId: P.value,
|
|
126
|
-
numberOfPeople: F.value
|
|
127
|
-
},
|
|
128
|
-
headers: {
|
|
129
|
-
Authorization: S.value,
|
|
130
|
-
"Fresh-Booking-Ver": "4.0.13"
|
|
131
|
-
}
|
|
132
|
-
})).data;
|
|
133
|
-
n.templateCounts.length === 0 ? h({
|
|
134
|
-
message: I.t("alert.error.eventNotAvailable"),
|
|
135
|
-
type: "warning"
|
|
136
|
-
}) : (t.value = n, e()), l.value = !1;
|
|
137
|
-
} catch {
|
|
138
|
-
l.value = !1, i.value = v.AvailabilityState, h({
|
|
139
|
-
message: I.t("alert.error.couldntFetchEvent"),
|
|
140
|
-
type: "warning"
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async function Oe(e) {
|
|
145
|
-
i.value = v.ReservationState, l.value = !0;
|
|
146
|
-
try {
|
|
147
|
-
const n = (await C.get("http://localhost:91/api/v3/event/get-table-availability", {
|
|
148
|
-
params: {
|
|
149
|
-
language: N(),
|
|
150
|
-
date: k.value,
|
|
151
|
-
numberOfPeople: F.value,
|
|
152
|
-
eventId: P.value,
|
|
153
|
-
tableGroupId: x.value
|
|
154
|
-
},
|
|
155
|
-
headers: {
|
|
156
|
-
Authorization: S.value,
|
|
157
|
-
"Fresh-Booking-Ver": "4.0.13"
|
|
158
|
-
}
|
|
159
|
-
})).data;
|
|
160
|
-
t.value = n, l.value = !1, e();
|
|
161
|
-
} catch {
|
|
162
|
-
l.value = !1, i.value = v.AvailabilityState, h({
|
|
163
|
-
message: I.t("alert.error.couldntFetchEvent"),
|
|
164
|
-
type: "warning"
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
async function Re() {
|
|
169
|
-
try {
|
|
170
|
-
const e = (await C.get("http://localhost:91/api/v3/event/validate-discount-code", {
|
|
171
|
-
params: {
|
|
172
|
-
language: N(),
|
|
173
|
-
date: k.value,
|
|
174
|
-
discountCode: B.value
|
|
175
|
-
},
|
|
176
|
-
headers: {
|
|
177
|
-
Authorization: S.value,
|
|
178
|
-
"Fresh-Booking-Ver": "4.0.13"
|
|
179
|
-
}
|
|
180
|
-
})).data;
|
|
181
|
-
console.log(e);
|
|
182
|
-
} catch (e) {
|
|
183
|
-
console.log(e), h({
|
|
184
|
-
message: I.t("alert.error.discountCodeValidation"),
|
|
185
|
-
type: "warning"
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
async function Be(e) {
|
|
190
|
-
i.value = v.PaymentState, l.value = !0;
|
|
191
|
-
const n = () => {
|
|
192
|
-
l.value = !1, i.value = v.ReservationState, h({
|
|
193
|
-
message: I.t("booking.other.errorMessage"),
|
|
194
|
-
type: "warning"
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
let u, c, r;
|
|
198
|
-
const D = [];
|
|
199
|
-
if (o(t.value))
|
|
200
|
-
J.value?.forEach((d, w) => {
|
|
201
|
-
const ee = [];
|
|
202
|
-
let te = 0;
|
|
203
|
-
for (const ae in A.value) {
|
|
204
|
-
const L = ae.split("."), ne = A.value[ae];
|
|
205
|
-
parseInt(L[0]) === d.roomGroupID && parseInt(L[2]) === w && ne > 0 && (ee.push({
|
|
206
|
-
id: te,
|
|
207
|
-
addonID: parseInt(L[1]),
|
|
208
|
-
quantity: ne
|
|
209
|
-
}), te++);
|
|
210
|
-
}
|
|
211
|
-
D.push({
|
|
212
|
-
adultPerRoom: d.adultPerRoom,
|
|
213
|
-
count: d.count,
|
|
214
|
-
roomGroupID: d.roomGroupID,
|
|
215
|
-
addons: ee
|
|
216
|
-
});
|
|
217
|
-
}), u = {
|
|
218
|
-
templateID: j.value,
|
|
219
|
-
numberOfDays: T.value,
|
|
220
|
-
templateCounts: D
|
|
221
|
-
};
|
|
222
|
-
else {
|
|
223
|
-
c = [], r = E.value;
|
|
224
|
-
for (const d in m.value) {
|
|
225
|
-
const w = m.value[parseInt(d)];
|
|
226
|
-
w > 0 && c.push({
|
|
227
|
-
id: parseInt(d),
|
|
228
|
-
quantity: w
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
let g = "http://localhost:91/api/v3/event/template-book";
|
|
233
|
-
const f = {
|
|
234
|
-
date: k.value,
|
|
235
|
-
name: $.value,
|
|
236
|
-
email: R.value,
|
|
237
|
-
phone: O.value,
|
|
238
|
-
remark: _.value,
|
|
239
|
-
numberOfPeople: F.value,
|
|
240
|
-
days: z.value,
|
|
241
|
-
discountCode: B.value,
|
|
242
|
-
giftCardCode: ue.value,
|
|
243
|
-
checkoutUrl: window.location.origin,
|
|
244
|
-
privacyUrl: window.location.origin
|
|
245
|
-
};
|
|
246
|
-
o(t.value) ? f.templateGroup = u : (f.time = r, f.eventId = P.value, f.products = c, g = "http://localhost:91/api/v3/event/event-book"), await C.post(g, f, {
|
|
247
|
-
headers: {
|
|
248
|
-
Authorization: S.value,
|
|
249
|
-
"Fresh-Booking-Ver": "4.0.13"
|
|
250
|
-
}
|
|
251
|
-
}).then((d) => {
|
|
252
|
-
l.value = !1, se.pay({
|
|
253
|
-
callback: e,
|
|
254
|
-
response: d.data
|
|
255
|
-
});
|
|
256
|
-
}).catch(() => n());
|
|
257
|
-
}
|
|
258
|
-
function ze(e) {
|
|
259
|
-
A.value = {}, m.value = {}, E.value = "", e();
|
|
260
|
-
}
|
|
261
|
-
function Me() {
|
|
262
|
-
Y();
|
|
263
|
-
}
|
|
264
|
-
return {
|
|
265
|
-
metaData: p,
|
|
266
|
-
listingData: y,
|
|
267
|
-
tableBasePrice: H,
|
|
268
|
-
availabilityData: t,
|
|
269
|
-
isLoading: l,
|
|
270
|
-
moduleState: i,
|
|
271
|
-
searchDate: K,
|
|
272
|
-
numberOfPeople: F,
|
|
273
|
-
numberOfDays: T,
|
|
274
|
-
eventId: P,
|
|
275
|
-
tableGroupId: x,
|
|
276
|
-
arrivalTime: E,
|
|
277
|
-
addons: A,
|
|
278
|
-
products: m,
|
|
279
|
-
discountCode: B,
|
|
280
|
-
name: $,
|
|
281
|
-
phone: O,
|
|
282
|
-
email: R,
|
|
283
|
-
remark: _,
|
|
284
|
-
isTemplateEvent: pe,
|
|
285
|
-
currency: re,
|
|
286
|
-
maxNumberOfPeople: ie,
|
|
287
|
-
title: ve,
|
|
288
|
-
subtitle: ce,
|
|
289
|
-
slideshow: de,
|
|
290
|
-
date: k,
|
|
291
|
-
numberOfTotalDays: z,
|
|
292
|
-
numberOfRooms: me,
|
|
293
|
-
fromDate: ge,
|
|
294
|
-
getEventData: b,
|
|
295
|
-
length: fe,
|
|
296
|
-
templateId: j,
|
|
297
|
-
getEvents: he,
|
|
298
|
-
getTemplates: ye,
|
|
299
|
-
hasEvents: be,
|
|
300
|
-
hasTemplates: De,
|
|
301
|
-
basePrice: W,
|
|
302
|
-
totalPrice: Se,
|
|
303
|
-
getTemplateData: J,
|
|
304
|
-
getEventTableData: M,
|
|
305
|
-
roomUpgrade: Ae,
|
|
306
|
-
weekendFee: Pe,
|
|
307
|
-
hasProducts: X,
|
|
308
|
-
eventRateType: Q,
|
|
309
|
-
isReservationFormFilled: we,
|
|
310
|
-
isMetaDataAvailable: Ee,
|
|
311
|
-
areListingsAvailable: Ne,
|
|
312
|
-
isAvailabilityDataAvailable: Fe,
|
|
313
|
-
isPaymentLoading: Te,
|
|
314
|
-
getEventImages: Ie,
|
|
315
|
-
isEventListingLoading: Ce,
|
|
316
|
-
fetchMetaData: Y,
|
|
317
|
-
fetchListings: Z,
|
|
318
|
-
getTemplateAvailability: $e,
|
|
319
|
-
getEventAvailability: Oe,
|
|
320
|
-
validateDiscountCode: Re,
|
|
321
|
-
localAddonPrice: G,
|
|
322
|
-
totalAddonPrice: V,
|
|
323
|
-
createBooking: Be,
|
|
324
|
-
reset: ze,
|
|
325
|
-
initialize: Me
|
|
326
|
-
};
|
|
327
|
-
});
|
|
328
|
-
export {
|
|
329
|
-
Qe as u
|
|
330
|
-
};
|
|
Binary file
|
|
Binary file
|