File manager - Edit - /home/premiey/www/wp-content/plugins/simply-schedule-appointments/booking-app/dist/static/js/app.js
Back
(function(){var t={6700:function(t,e,n){var i={"./af":2398,"./af.js":2398,"./ar":4207,"./ar-dz":3382,"./ar-dz.js":3382,"./ar-kw":6525,"./ar-kw.js":6525,"./ar-ly":7098,"./ar-ly.js":7098,"./ar-ma":6483,"./ar-ma.js":6483,"./ar-sa":3961,"./ar-sa.js":3961,"./ar-tn":7401,"./ar-tn.js":7401,"./ar.js":4207,"./az":903,"./az.js":903,"./be":1174,"./be.js":1174,"./bg":4615,"./bg.js":4615,"./bm":225,"./bm.js":225,"./bn":9751,"./bn-bd":544,"./bn-bd.js":544,"./bn.js":9751,"./bo":6894,"./bo.js":6894,"./br":8566,"./br.js":8566,"./bs":959,"./bs.js":959,"./ca":2683,"./ca.js":2683,"./cs":4231,"./cs.js":4231,"./cv":999,"./cv.js":999,"./cy":4302,"./cy.js":4302,"./da":3601,"./da.js":3601,"./de":5509,"./de-at":2479,"./de-at.js":2479,"./de-ch":5948,"./de-ch.js":5948,"./de.js":5509,"./dv":9838,"./dv.js":9838,"./el":5113,"./el.js":5113,"./en-au":7377,"./en-au.js":7377,"./en-ca":9626,"./en-ca.js":9626,"./en-gb":5912,"./en-gb.js":5912,"./en-ie":2931,"./en-ie.js":2931,"./en-il":2243,"./en-il.js":2243,"./en-in":9779,"./en-in.js":9779,"./en-nz":9813,"./en-nz.js":9813,"./en-sg":4318,"./en-sg.js":4318,"./eo":4957,"./eo.js":4957,"./es":9243,"./es-do":7409,"./es-do.js":7409,"./es-mx":5188,"./es-mx.js":5188,"./es-us":6927,"./es-us.js":6927,"./es.js":9243,"./et":7731,"./et.js":7731,"./eu":1072,"./eu.js":1072,"./fa":9462,"./fa.js":9462,"./fi":3368,"./fi.js":3368,"./fil":3626,"./fil.js":3626,"./fo":6421,"./fo.js":6421,"./fr":974,"./fr-ca":7780,"./fr-ca.js":7780,"./fr-ch":9719,"./fr-ch.js":9719,"./fr.js":974,"./fy":8373,"./fy.js":8373,"./ga":3861,"./ga.js":3861,"./gd":4896,"./gd.js":4896,"./gl":739,"./gl.js":739,"./gom-deva":6737,"./gom-deva.js":6737,"./gom-latn":1979,"./gom-latn.js":1979,"./gu":2001,"./gu.js":2001,"./he":9671,"./he.js":9671,"./hi":2038,"./hi.js":2038,"./hr":1228,"./hr.js":1228,"./hu":87,"./hu.js":87,"./hy-am":3569,"./hy-am.js":3569,"./id":1977,"./id.js":1977,"./is":6853,"./is.js":6853,"./it":7859,"./it-ch":5626,"./it-ch.js":5626,"./it.js":7859,"./ja":4123,"./ja.js":4123,"./jv":6457,"./jv.js":6457,"./ka":638,"./ka.js":638,"./kk":6823,"./kk.js":6823,"./km":9493,"./km.js":9493,"./kn":1288,"./kn.js":1288,"./ko":9663,"./ko.js":9663,"./ku":805,"./ku.js":805,"./ky":7550,"./ky.js":7550,"./lb":6272,"./lb.js":6272,"./lo":9135,"./lo.js":9135,"./lt":1452,"./lt.js":1452,"./lv":5782,"./lv.js":5782,"./me":2181,"./me.js":2181,"./mi":258,"./mi.js":258,"./mk":5715,"./mk.js":5715,"./ml":538,"./ml.js":538,"./mn":3086,"./mn.js":3086,"./mr":5663,"./mr.js":5663,"./ms":5100,"./ms-my":2663,"./ms-my.js":2663,"./ms.js":5100,"./mt":880,"./mt.js":880,"./my":9099,"./my.js":9099,"./nb":8709,"./nb.js":8709,"./ne":2201,"./ne.js":2201,"./nl":1016,"./nl-be":1681,"./nl-be.js":1681,"./nl.js":1016,"./nn":5330,"./nn.js":5330,"./oc-lnc":7132,"./oc-lnc.js":7132,"./pa-in":251,"./pa-in.js":251,"./pl":3948,"./pl.js":3948,"./pt":9836,"./pt-br":8831,"./pt-br.js":8831,"./pt.js":9836,"./ro":8443,"./ro.js":8443,"./ru":4,"./ru.js":4,"./sd":4510,"./sd.js":4510,"./se":3148,"./se.js":3148,"./si":542,"./si.js":542,"./sk":7637,"./sk.js":7637,"./sl":5852,"./sl.js":5852,"./sq":611,"./sq.js":611,"./sr":242,"./sr-cyrl":302,"./sr-cyrl.js":302,"./sr.js":242,"./ss":1367,"./ss.js":1367,"./sv":2927,"./sv.js":2927,"./sw":5240,"./sw.js":5240,"./ta":2692,"./ta.js":2692,"./te":2132,"./te.js":2132,"./tet":8300,"./tet.js":8300,"./tg":7211,"./tg.js":7211,"./th":4050,"./th.js":4050,"./tk":3849,"./tk.js":3849,"./tl-ph":3964,"./tl-ph.js":3964,"./tlh":3650,"./tlh.js":3650,"./tr":4195,"./tr.js":4195,"./tzl":5529,"./tzl.js":5529,"./tzm":7520,"./tzm-latn":298,"./tzm-latn.js":298,"./tzm.js":7520,"./ug-cn":4134,"./ug-cn.js":4134,"./uk":5456,"./uk.js":5456,"./ur":5679,"./ur.js":5679,"./uz":9277,"./uz-latn":6446,"./uz-latn.js":6446,"./uz.js":9277,"./vi":3992,"./vi.js":3992,"./x-pseudo":8882,"./x-pseudo.js":8882,"./yo":2899,"./yo.js":2899,"./zh-cn":4017,"./zh-cn.js":4017,"./zh-hk":4831,"./zh-hk.js":4831,"./zh-mo":2881,"./zh-mo.js":2881,"./zh-tw":57,"./zh-tw.js":57};function s(t){var e=a(t);return n(e)}function a(t){if(!n.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}s.keys=function(){return Object.keys(i)},s.resolve=a,t.exports=s,s.id=6700},5061:function(t,e,n){"use strict";var i=n(8935),s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("main",{class:t.selectedAppointmentType&&t.selectedAppointmentType.slug?"appointment-type-"+t.selectedAppointmentType.slug:"no-appointment-type",attrs:{id:"app",role:"main"}},[n("div",{staticClass:"app-wrapper"},[n("back-button"),n("transition",{attrs:{name:"fade"}},[t.loading?n("loading",{attrs:{message:t.loadingMessage}}):t.error?[n("div",{staticClass:"app-error"},[n("h3",{staticClass:"md-display-1"},[t._v(t._s(t.errorHeading))]),n("p",[t._v(t._s(t.errorIntro)+" "+t._s(t.errorMessage))])])]:[n("router-view",{ref:"routerView"})]],2),n("md-snackbar",{ref:"connectionError",attrs:{"md-position":"top center"},on:{close:function(e){return t.setConnectionError(!1)}}},[n("span",[t._v(t._s(t.translations.errors.connectionError))])])],1)])},a=[],o=n(4665),r=n(7318),l=n.n(r);const p="YYYY-MM-DD",m="YYYY-MM-DD HH:mm:ss",c={"US/Eastern":"US/Eastern (EST/EDT)","US/Central":"US/Central (CST/CDT)","US/Mountain":"US/Mountain (MST/MDT)","US/Pacific":"US/Pacific (PST/PDT)","US/Arizona":"US/Arizona (MST/Mountain)"},d=["EST","PST","CST","MST","EST5EDT","PST8PDT","CST6CDT","MST7MDT"];var h={filteredTimezones:(t,e)=>t=>t.filter((t=>!d.includes(t))).map((t=>({value:t,label:c[t]||e.formatTimezone(t)}))),appointmentTypeBySlug:(t,e)=>t=>e.visibleAppointmentTypes.find((e=>e.slug===t)),bookingWindow(t,e){if(!e.selectedAppointmentType.title)return;let n=e.selectedAppointmentType,i=l().utc(n.booking_start_date,t.timestampFormat);i=i.isValid()?i:l().utc();let s=l().utc(n.booking_end_date,t.timestampFormat);return s=s.isValid()?s:l().utc().add(1,"year"),{start:i,end:s}},inBookingWindow(t,e){if(!e.bookingWindow)return;if(!e.selectedAppointmentType.booking_start_date&&!e.selectedAppointmentType.booking_end_date)return!0;let n=l().utc();return n.isSameOrAfter(e.bookingWindow.start)&&n.isSameOrBefore(e.bookingWindow.end)},maxDay(t,e){if(e.availabilityWindow)return e.availabilityWindow.end.clone().tz(t.timezone)},minDay(t,e){if(e.availabilityWindow)return e.availabilityWindow.start.clone().tz(t.timezone)},slugify:()=>t=>t.toString().toLowerCase().trim().replace(/&/g,"-and-").replace(/[\s\W-]+/g,"-"),timezoneLocal(){return l().tz.guess()},tzAvailableSlots(t,e){if(!e.selectedAppointmentType.title)return;let n=[];return t.availableSlots.map((i=>{let s=l().utc(i.start_date,m),a=s.clone().add(e.selectedAppointmentType.duration,"minutes"),o=!0;if(e.availabilityWindow&&(o=s.isBetween(e.availabilityWindow.start,e.availabilityWindow.end,void 0,"[]")&&a.isBetween(e.availabilityWindow.start,e.availabilityWindow.end,void 0,"[]")),!o)return;let r=s.tz(t.timezone).format(m),p={start_date:r};Object.prototype.hasOwnProperty.call(i,"capacity_available")&&(p.capacity_available=i.capacity_available),n.push(p)})),n},tzFirstDayChecked(t){if(t.firstDayChecked)return t.firstDayChecked.utc().tz(t.timezone)},tzLastDayChecked(t){if(t.lastDayChecked)return t.lastDayChecked.utc().tz(t.timezone)},urlParams:()=>t=>{t||(t=window.location);let e={},n=document.createElement("a");n.href=t;let i=n.search.substring(1),s=i.split("&");for(var a=0;a<s.length;a++){if(s[a].indexOf("=")<0)continue;let t=s[a].split("=");e[t[0]]=decodeURIComponent(t[1])}return e},windowLoadedMessage:t=>()=>{t.api&&setTimeout((function(){window.parent.postMessage({iframe:"loaded"},t.api.home_url)}),150)},availabilityWindow(t,e){if(!e.selectedAppointmentType.title)return;let n=e.selectedAppointmentType,i=l().utc(n.availability_start_date);i=i.isValid()?i:l().utc();let s=l().utc(n.availability_end_date);s=s.isValid()?s:i.clone().add(2,"years");let a=parseInt(n.min_booking_notice),o=parseInt(n.max_booking_notice);o=o||1051200;let r=a?l().utc().add(a,"minutes"):l().utc(),p=o?l().utc().add(o,"minutes"):l().utc().add(1,"year");return{start:l().max(i,r),end:l().min(s,p)}},afterAvailabilityWindow(t,e){if(!e.availabilityWindow)return;let n=l().utc();return n.isAfter(e.availabilityWindow.end,"day")},formatTimezone:t=>e=>{if(e||(e=t.timezone),!e)return"";let n=c[e]||e.replace(/_/g," "),i=n.indexOf("Etc/GMT+")>-1||n.indexOf("Etc/GMT-")>-1;return i&&(n=n.replace("GMT+","UTC-"),n=n.replace("GMT-","UTC+")),n},selectedAppointmentType(t){let e=t.appointmentTypes.length,n=Object.prototype.hasOwnProperty.call(t.appointment,"appointment_type_id")&&t.appointment.appointment_type_id;return e&&n?t.appointmentTypes.find((e=>e.id===t.appointment.appointment_type_id)):{title:"",slug:""}},displayDuration:t=>e=>{let n=parseInt(e,10),i="minute",s=n;n%10080===0?(s=n/10080,i="week"):n%1440===0?(s=n/1440,i="day"):(n%60===0||n%60===30&&n>120)&&(s=n/60,i="hour");let a="plural";return 1===s&&(a="singular"),s+" "+t.translations.units[i+"_"+a]},localTime(t){if(t.appointment||Object.prototype.hasOwnProperty.call(t.appointment,"start_date"))return l().utc(t.appointment.start_date,m).tz(t.timezone)},displayStartTime(t,e){if(e.localTime&&t.settings.global)return e.localTime.format(t.settings.global.date_format_moment+" "+t.settings.global.time_format_moment)},displayEndTime(t,e){if(!e.localTime||!e.selectedAppointmentType.title)return;let n=e.localTime,i=e.localTime.clone().add(e.selectedAppointmentType.duration,"minutes"),s=!n.isSame(i,"day");return s?i.format(t.settings.global.date_format_moment+" "+t.settings.global.time_format_moment):i.format(t.settings.global.time_format_moment)},displayPrice:t=>(e,n)=>{let i=parseFloat(e);if((i||0===i)&&navigator.languages[0])return new Intl.NumberFormat(navigator.languages[0],{style:"currency",currency:n}).format(i);{let e=t.settings.global.locale.substring(0,5).replace("_","-");return new Intl.NumberFormat(e,{style:"currency",currency:n}).format(i)}},showPaymentUI:t=>e=>{if(t.integration)return!1;if(!t.settings.installed.payments)return!1;if(!Object.prototype.hasOwnProperty.call(t.settings,"payments"))return!1;if(!t.settings.payments.enabled)return!1;if(!t.settings.paypal&&!t.settings.stripe&&!t.settings.paypal.enabled&&!t.settings.stripe.enabled)return!1;if(t.modeEdit||t.modeReschedule)return!1;if(Object.prototype.hasOwnProperty.call(e,"payments")&&Object.prototype.hasOwnProperty.call(e.payments,"payment_methods")){let n=e.payments.payment_methods.filter((e=>!!Object.prototype.hasOwnProperty.call(t.settings,e)&&t.settings[e].enabled));if(!n.length)return!1;if("none"===e.payments.payment_required)return!1}return!!(e.payments&&e.payments.price&&e.payments.currency)},visibleAppointmentTypes(t){return t.appointmentTypes.filter((t=>"delete"!==t.status))},appointmentDuration(t,e){return t.appointment&&Object.prototype.hasOwnProperty.call(t.appointment,"start_date")&&Object.prototype.hasOwnProperty.call(t.appointment,"end_date")&&!t.modeReschedule?l()(t.appointment.end_date).diff(l()(t.appointment.start_date),"minutes"):e.selectedAppointmentType.duration}},u=n(4029),y=n.n(u),f=n(2196),g=n.n(f),_={callAsync({state:t},e){return new Promise((n=>{let i=null;e&&(i={object_type:"appointment",object_id:e}),y().ajax({url:t.api.root+"/async",method:"POST",data:i}).done((()=>{n()}))}))},callAsyncDelayed({state:t},{id:e,delay:n}){if(!g().isEmpty(n))return new Promise((i=>{let s=null;e&&(s={object_type:"appointment",object_id:e}),y().ajax({url:t.api.root+"/async?delay="+n,method:"POST",data:s}).done((()=>{i()}))}))},fetchAPI({commit:t}){return new Promise(((e,n)=>{y().ajax({url:"getApi.php",method:"GET",dataType:"json"}).done((n=>{t("setApi",n.api),e()})).fail(((t,e,i)=>{n(i)}))}))},fetchAppointment({commit:t,state:e},n=""){return new Promise(((i,s)=>{y().ajax({url:e.api.root+"/appointments/"+e.appointment.id,method:"GET",cache:!1,dataType:"json",data:{token:e.appointment.public_token||window.ssa_token,fetch:n},contentType:"application/json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{t("setAppointment",e.data),i()})).fail(((t,e,n)=>{s(n)}))}))},fetchCancelationNote({commit:t,state:e}){return new Promise(((n,i)=>{y().ajax({url:e.api.root+"/appointments/"+e.appointment.id+"/meta",method:"GET",cache:!1,dataType:"json",data:{key:"cancelation_note",token:e.appointment.public_token||window.ssa_token},contentType:"application/json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{g().isEmpty(e.data)||g().isEmpty(e.data.cancelation_note)||t("setCancelationNote",e.data.cancelation_note),n()})).fail(((t,e,n)=>{i(n)}))}))},fetchAppointmentSlots({commit:t,state:e,dispatch:n},i){return new Promise(((s,a)=>{var o=e.appointment.appointment_type_id,r=Object.prototype.hasOwnProperty.call(e.appointment,"id")?e.appointment.id:null;if(r&&(i.excluded_appointment_ids=[r]),i.start_date_min){const t=l()(i.start_date_min).locale("en");i.start_date_min=t.format(p)}if(i.start_date_max){const t=l()(i.start_date_max).locale("en");i.start_date_max=t.format(p)}y().ajax({url:e.api.root+"/appointment_types/"+o+"/availability",method:"GET",dataType:"json",data:i,cache:!1,beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{i&&i.replace&&t("clearAvailableSlots"),t("setAvailableSlots",e.data),n("updateCheckedInfo",i),s()})).fail(((t,e,n)=>{a(n)}))}))},fetchAppointmentTypes({commit:t,state:e}){return new Promise(((n,i)=>{y().ajax({url:e.api.root+"/appointment_types",method:"GET",cache:!1,data:{fetch:{has_sms:!0}},dataType:"json",contentType:"application/json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{t("setAppointmentTypesChecked",!0),t("setAppointmentTypes",e.data),n()})).fail(((t,e,n)=>{i(n)}))}))},fetchGlobalSettings({commit:t,state:e}){return new Promise(((n,i)=>{y().ajax({url:e.api.root+"/settings/global",method:"GET",cache:!1,dataType:"json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{t("setGlobalSettings",e.data),n()})).fail(((t,e,n)=>{i(t,n)}))}))},fetchSettings({commit:t,state:e}){return new Promise(((n,i)=>{y().ajax({url:e.api.root+"/settings",method:"GET",cache:!1,dataType:"json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{t("setSettings",e.data),n()})).fail(((t,e,n)=>{i(t,n)}))}))},fetchTelCountryCode({commit:t,state:e}){if(!e.settings.global.country_code)return new Promise(((e,n,i)=>{y().ajax({url:"//ip2c.org/s",method:"GET"}).done((n=>{let s=(n||"").toString();s&&"1"===s[0]?t("setTelCountryCode",s.substr(2,2)):i("fetchTelCountryCodeSecondTry"),e()})).fail((t=>{i("fetchTelCountryCodeSecondTry"),n(t)}))}));t("setTelCountryCode",e.settings.global.country_code)},fetchTelCountryCodeSecondTry({commit:t}){return new Promise(((e,n)=>{y().ajax({url:"//api.country.is",method:"GET",dataType:"json",contentType:"application/json"}).done((n=>{t("setTelCountryCode",n.country),e()})).fail((t=>{n(t)}))}))},saveAppointment({commit:t,state:e,dispatch:n,getters:i},s){if(Object.prototype.hasOwnProperty.call(s,"public_edit_url")){let t=s.public_edit_url,e=i.urlParams(t),n=e.appointment_token,a=n.substring(0,32);s.token=a}let a=["canceled","abandoned","pending_form"];t("setAppointmentProp",{key:"fetch",value:{add_to_calendar_links:!a.includes(s.status)}}),t("setAppointmentLocale",e.locale);let o=!Object.prototype.hasOwnProperty.call(s,"update_local")||s.update_local,r={},l=["id","token","customer_information","status","start_date","payment_method"];return l.forEach((t=>{Object.prototype.hasOwnProperty.call(s,t)&&(r[t]=s[t])})),new Promise(((i,s)=>{y().ajax({url:e.api.root+"/appointments/"+r.id,method:"POST",dataType:"json",data:JSON.stringify(r),contentType:"application/json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{e.data&&(o&&t("setAppointment",e.data),n("callAsync",e.data.id),"booked"===e.data.status&&n("callAsyncDelayed",{id:e.data.id,delay:"7"}),i()),e.error&&s(e.error)})).fail(((t,e,n)=>{s(n)}))}))},saveNewAppointment({commit:t,getters:e,state:n,dispatch:i}){let s=["canceled","abandoned","pending_form"];t("setAppointmentProp",{key:"fetch",value:{add_to_calendar_links:!s.includes(n.appointment.status)}}),t("setAppointmentLocale",n.locale);const a=window.ssa_booking_url_settings||null;a&&t("setAppointmentProp",{key:"post_information",value:{...a}});const o=e.urlParams(),r=o["booking_post_id"]?"?booking_post_id="+o["booking_post_id"]:"";return new Promise(((e,s)=>{y().ajax({url:n.api.root+"/appointments"+r,method:"POST",dataType:"json",data:JSON.stringify(n.appointment),contentType:"application/json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",n.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",n.api.public_nonce)}}).done((n=>{n.error?s(n.error):(n.data&&(t("setAppointment",n.data),i("callAsync",n.data.id),"booked"===n.data.status&&i("callAsyncDelayed",{id:n.data.id,delay:"7"})),e())})).fail(((t,e,n)=>{s(n)}))}))},savePayment({state:t,getters:e,dispatch:n},i){const s=e.urlParams(),a=s["booking_post_id"]?"?booking_post_id="+s["booking_post_id"]:"";return new Promise(((e,s)=>{y().ajax({url:t.api.root+"/payments"+a,method:"POST",dataType:"json",data:JSON.stringify(i),contentType:"application/json",beforeSend:e=>{e.setRequestHeader("X-WP-Nonce",t.api.nonce),e.setRequestHeader("X-PUBLIC-Nonce",t.api.public_nonce)}}).done((t=>{n("callAsync",t.data.appointment_id),t.data&&"succeeded"===t.data.status?e():t.error?s(t.error):s(t.data.payment_meta.outcome.message)})).fail(((t,e,n)=>{s(n)}))}))},savePaypalPayment({commit:t,state:e,dispatch:n},i){return new Promise(((s,a)=>{y().ajax({url:e.api.root+"/payments",method:"POST",dataType:"json",data:JSON.stringify(i),contentType:"application/json",beforeSend:t=>{t.setRequestHeader("X-WP-Nonce",e.api.nonce),t.setRequestHeader("X-PUBLIC-Nonce",e.api.public_nonce)}}).done((e=>{e.data&&(n("callAsync",e.data.appointment_id),t("setAppointmentProp",{key:"payment_id",value:e.data.id}),t("setAppointmentProp",{key:"purchase_key",value:e.data.purchase_key}),s()),e.error&&a(e.error)})).fail(((t,e,n)=>{a(n)}))}))},createPaymentIntent({state:t,getters:e},n){const i=e.urlParams();return i["booking_post_id"]&&(n.booking_post_id=i["booking_post_id"]),n.appointment_id=t.appointment.id,n.appointment_token=t.appointment.public_token,new Promise(((e,i)=>{y().ajax({url:t.api.root+"/stripe/create",method:"POST",dataType:"json",data:JSON.stringify(n),contentType:"application/json",beforeSend:e=>{e.setRequestHeader("X-WP-Nonce",t.api.nonce),e.setRequestHeader("X-PUBLIC-Nonce",t.api.public_nonce)}}).done((t=>{t.success?e(t.client_secret):i(t.error)})).fail(((t,e,n)=>{i(n)}))}))},updateEmptyAppointment({commit:t}){t("setAppointmentTypeId",null),t("setDateFastForward",!1),t("setTimeFastForward",!1),t("setAppointmentProp",{key:"appointment_type_slug",value:null})},updateAppointmentSlots({commit:t}){t("clearAvailableSlots"),t("setFirstDayChecked",null),t("setLastDayChecked",null)},updateCheckedInfo({commit:t,state:e},n){let i=l()(n.start_date_min,p),s=l()(n.start_date_max,p);if(n.replace)return t("setFirstDayChecked",i),void t("setLastDayChecked",s);!i.isBefore(e.firstDayChecked)&&e.firstDayChecked||t("setFirstDayChecked",i),!s.isAfter(e.lastDayChecked)&&e.lastDayChecked||t("setLastDayChecked",s)}},v={actions:{back:"Go back",editTimezone:"Change the timezone.",forward:"Go forward",saveTimezone:"Save timezone"},general:{loadingInitial:"Loading",loadingTypes:"Getting appointment information",loadingAvailableSlots:"Loading Available Appointments",yourTimezone:"Your timezone:",selectTimezone:"Select a timezone",timezoneMismatch:"You are booking an appointment in timezone:",localTime:"Current local time is:",timezoneGuessWrong:"We're having trouble guessing your timezone. Please check to be sure the timezone is correct.",timezoneChangedWrong:"Please check your timezone. For best results, choose a timezone named for your country or region."},pageTitles:{book:"Enter your contact information",Booked:"Appointment booked",bookingDefault:"Select an appointment type",bookingForm:"Select an appointment type",formConfirm:"Appointment date selected",change:"Modify a booked appointment",date:"Select a date",formType:"Select a date",formDate:"Select a date",loadSelected:"Loading appointment",time:"Select a time",formTime:"Select a time",type:"Select an appointment type",view:"View your appointment"},booking:{booking:"Booking:",appointmentType:"What type of appointment are you booking?",infoHeader:"You are booking: ",confirmHeader:"Thank you! Your appointment is booked: ",when:"When: ",saving:"Saving",processingPayment:{stripe:"Processing payment",paypal:"Pay with PayPal"},paypalMessage:"We'll hold your appointment time for 10 minutes to give you time to complete payment with PayPal",bookingAppointment:"Booking your appointment",calendarSave:"Save to calendar",calendarSaveGoogle:"Google calendar",calendarSaveOther:"Other",dateSelect:"Select a date",timeSelect:"Select a time on",smsOptIn:"Please remind me about this appointment by text message at this number",bookButton:"Book this appointment",updateButton:"Update this appointment",checkAppointment:"Saving your appointment information",available:"Available: ",redirecting:"Please wait while we redirect you"},suggestFirstAvailable:{next:"Next available appointment",confirm:"Confirm Appointment Time",pickAnother:"Or, pick another time"},change:{changeHeader:"Make a change",canceledIndicator:"Canceled:",canceling:"Canceling appointment",cancelConfirm:"Are you sure you want to cancel?",cancelConfirmCancel:"Keep Appointment",cancelConfirmOkay:"Cancel Appointment",cancelationNote:"Cancelation Note",past:"This appointment is in the past. It cannot be edited.",canceled:"This appointment has been canceled",reschedule:"Reschedule",cancel:"Cancel Appointment",edit:"Edit Information",changeTime:"Change selected time",new:"Schedule a new appointment",next:"What would you like to do next?"},errors:{heading:"Uh oh.",intro:"We ran into a problem: ",api:"Error loading API",settings:"Unable to get the settings",appointmentTypes:"Unable to get the available appointment types",noAppointmentTypes:"No appointment types have been set up yet.",requiredField:" is required.",fieldRequired:"Field required.",requiredEmail:"A valid email address is required",requiredPhone:"Please enter a valid phone number",outsideBookingWindow:"This appointment type cannot be booked at this time",noAvailableSlots:"There are no available appointment times",noPastAppointments:"You can't book appointments in the past.",timeTaken:"Sorry, that time was just booked and is no longer available. Please choose another time.",pickNewTime:"Pick a new time",retry:"Retry",bookingFailed:"Sorry, we couldn't save your appointment",connectionError:"Connection lost. We're having trouble communicating"},day:{night:"Night",morning:"Morning",afternoon:"Afternoon",evening:"Evening"},units:{minute_singular:"minute",minute_plural:"minutes",week_singular:"week",week_plural:"weeks",day_singular:"day",day_plural:"days",hour_singular:"hour",hour_plural:"hours"},appointmentTypes:{customer_information:{Name:"Name",Email:"Email",Phone:"Phone",Address:"Address",City:"City",State:"State",Zip:"Zip",Notes:"Notes"}},payments:{price:"Price",loading:"Loading payment method",paymentMethod:"Payment Method",refundPolicy:"Refund Policy",payLater:"Pay Later",canceled:"No payment was processed. Please try again.",stripe:{bookAndPayLabel:"Confirm and Pay",cancel:"Cancel",processing:"Processing your payment..."},paypal:{bookAndPayLabel:"Confirm and Pay"},stripeLabel:"Book",paymentReceived:"Payment Received:",paymentDue:"Payment Due:",paymentFailed:"Unable to process payment. Please try again.",paymentDelayHeader:"Things are taking longer than expected",paypalDelayText:"PayPal is taking a little longer than usual to process your payment. Don't worry - we'll hold your appointment time for you. This usually resolves within a few minutes, or in rare cases, a few hours. Once your payment is processed, you'll receive an email confirmation of this appointment. If you don't receive that, please get in touch.",stripeDelayText:"Stripe is taking a little longer than usual to process your payment. Don't worry - we'll hold your appointment time for you. This usually resolves within a few minutes, or in rare cases, a few hours. Once your payment is processed, you'll receive an email confirmation of this appointment. If you don't receive that, please get in touch."}},b={setApi(t,e){t.api=e},setAppointmentLocale(t,e){i["default"].set(t.appointment,"customer_locale",e)},setConnectionError(t,e){t.connectionError=e},setFirstDayChecked(t,e){t.firstDayChecked=e},setGlobalSettings(t,e){i["default"].set(t.settings,"global",e)},setGoogleRefreshed(t,e){t.googleRefreshed=e},setIntegration(t,e){t.integration=e},setLastDayChecked(t,e){t.lastDayChecked=e},setLocale(t,e){t.locale=e},setPaymentCanceled(t,e){t.paymentCanceled=e},setSettings(t,e){t.settings=e},setSkippedType(t,e){t.skippedType=e},setTelCountryCode(t,e){t.telCountryCode=e},setTranslations(t,e){let n=g().isEmpty(e)?v:e;t.translations=n},setTimezone(t,e){t.timezone=e},setFrozenType(t,e){t.frozenType=e},setAppointmentTypes(t,e){t.appointmentTypes=e},setAppointmentTypesChecked(t,e){t.appointmentTypesChecked=e},setEditMode(t,e){t.modeEdit=e},setRescheduleMode(t,e){t.modeReschedule=e},setTimeConflict(t,e){t.timeConflict=e},setDateFastForward(t,e){t.dateFastForward=e},setTimeFastForward(t,e){t.timeFastForward=e},resetRescheduleAppointment(t){let e=g().cloneDeep(t.appointment),n=["appointment_type_id","appointment_type_slug","customer_information","start_date","customer_timezone","allow_sms"],i=Object.keys(e);i.forEach((t=>{n.includes(t)||delete e[t]})),t.appointment=e},setAppointment(t,e){t.appointment=e},setAppointmentProp(t,e){i["default"].set(t.appointment,e.key,e.value)},setAppointmentTypeId(t,e){i["default"].set(t.appointment,"appointment_type_id",e)},clearAvailableSlots(t){t.availableSlots=[]},setAvailableSlots(t,e){let n=t.availableSlots.concat(e);n=g().uniqBy(n,"start_date"),t.availableSlots=n},setTrackingPageview(t,e){t.trackingPageview=e},setTrackingEvent(t,e){t.trackingEvent=e},setCancelationNote(t,e){t.cancelationNote=e}};i["default"].use(o.ZP);const k={api:void 0,appointment:{},appointmentTypes:[],appointmentTypesChecked:!1,availableSlots:[],connectionError:!1,firstDayChecked:null,frozenType:!0,googleRefreshed:!1,integration:!1,lastDayChecked:null,locale:"en_US",modeEdit:!1,modeReschedule:!1,paymentCanceled:!1,settings:{},skippedType:!1,timeConflict:!1,dateFastForward:!1,telCountryCode:void 0,timeFastForward:!1,timezone:"",trackingEvent:{},trackingPageview:{},translations:{},cancelationNote:null};var T=new o.ZP.Store({state:k,getters:h,actions:_,mutations:b}),w=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-loading"},[n("md-spinner",{staticClass:"app-spinner",attrs:{"md-indeterminate":""}}),n("h3",{staticClass:"md-title"},[t._v(t._s(t.message)+"…")])],1)},A=[],C={name:"loadingElement",props:["message"],data(){return{}}},P=C,S=n(3736),D=(0,S.Z)(P,w,A,!1,null,null,null),z=D.exports,F=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.showBack?n("md-button",{staticClass:"md-fab md-primary md-mini",on:{click:t.handleBack}},[n("md-icon",[t._v("keyboard_backspace")]),n("span",{staticClass:"screen-reader-text"},[t._v(t._s(t.translations.actions.back))])],1):t._e()},E=[],j={name:"backButton",data(){return{momentDateFormat:p,momentTimestampFormat:m,routeData:{bookingDefault:{showBack:!1},bookingForm:{showBack:!1},type:{showBack:!1,backTo:"bookingDefault",action:this.updateEmptyAppointment},formType:{showBack:!1,backTo:"bookingForm",action:this.updateEmptyAppointment},date:{showBack:!1,backTo:"bookingDefault",action:this.updateEmptyAppointment,params:{slug:null,date:null}},formDate:{showBack:!1,backTo:"bookingForm",action:this.updateEmptyAppointment,params:{slug:null,date:null}},time:{showBack:!0,backTo:"date",params:{slug:null,date:null}},formTime:{showBack:!0,backTo:"formDate",params:{slug:null,date:null}},book:{showBack:!0,backTo:"time"}},showBackFrozen:["type","date","formType","formDate"],showDateFastForward:["time","formTime"],showTimeFastForward:["book"],showBackEditMode:["book"],paramsRequired:["date","time","formDate","formTime"]}},mounted(){this.frozenUpdate(this.frozenType),this.dateFastForwardUpdate(this.dateFastForward),this.timeFastForwardUpdate(this.timeFastFoward),this.editModeUpdate(),this.rescheduleModeUpdate()},watch:{frozenType:function(t){this.frozenUpdate(t)},dateFastForward:function(t){this.dateFastForwardUpdate(t)},timeFastForward:function(t){this.timeFastForwardUpdate(t)},modeEdit:function(){this.editModeUpdate()},modeReschedule:function(){this.rescheduleModeUpdate()}},computed:{routeName(){return this.$route.name},showBack(){return!!Object.prototype.hasOwnProperty.call(this.routeData,this.routeName)&&this.routeData[this.routeName].showBack},...(0,o.rn)(["appointment","frozenType","modeEdit","modeReschedule","dateFastForward","timeFastForward","timezone","translations"])},methods:{editModeUpdate(){this.showBackEditMode.forEach((t=>{let e=Object.assign({},this.routeData[t],{showBack:!this.modeEdit});this.$set(this.routeData,t,e)}))},dateFastForwardUpdate(){let t=this.$route.path.includes("integration/form")?"bookingForm":"bookingDefault",e=this.$route.path.includes("integration/form")?"formDate":"date";this.showDateFastForward.forEach((n=>{let i=Object.assign({},this.routeData[n],{showBack:!this.dateFastForward||this.dateFastForward&&!this.frozenType,backTo:this.dateFastForward?t:e,action:this.dateFastForward?this.updateEmptyAppointment:null});this.$set(this.routeData,n,i)}))},timeFastForwardUpdate(){let t,e;this.timeFastForward&&this.dateFastForward&&!this.frozenType?(t="bookingDefault",e=this.updateEmptyAppointment):t=this.dateFastForward?"type":"date",this.showTimeFastForward.forEach((n=>{let i=Object.assign({},this.routeData[n],{showBack:!this.timeFastForward||this.timeFastForward&&!this.dateFastForward||this.timeFastForward&&this.dateFastForward&&!this.frozenType,backTo:t,action:e});this.$set(this.routeData,n,i)}))},frozenUpdate(t){this.showBackFrozen.forEach((e=>{let n=Object.assign({},this.routeData[e],{showBack:!t});this.$set(this.routeData,e,n)}))},handleBack(){if(!Object.prototype.hasOwnProperty.call(this.routeData,this.routeName))return void console.log("routeData not defined");let t=this.routeData[this.routeName];Object.prototype.hasOwnProperty.call(t,"action")&&t.action&&t.action();let e={name:t.backTo};this.setBackParams(t.backTo),Object.prototype.hasOwnProperty.call(this.routeData[t.backTo],"params")&&(e.params=this.routeData[t.backTo].params),this.$router.push(e)},rescheduleModeUpdate(){this.frozenType||this.setFrozenType(this.modeReschedule)},setBackParams(t){let e;switch(t){case"date":e=this.setDateParams();break;case"formDate":e=this.setDateParams();break;case"time":e=this.setTimeParams();break;case"formTime":e=this.setTimeParams();break;default:}this.paramsRequired.forEach((t=>{let n=Object.assign({},this.routeData[t],{params:e});this.$set(this.routeData,t,n)}))},setDateParams(){let t=this.appointment.appointment_type_slug,e=this.$route.params.date;e||this.appointment&&Object.prototype.hasOwnProperty.call(this.appointment,"start_date")&&(e=l().utc(this.appointment.start_date,this.momentTimestampFormat).tz(this.timezone).format(this.momentDateFormat));let n=l()(),i=n.isoWeekday(),s=l()(e,this.momentDateFormat),a=s.isoWeekday(),o=i<=a?s.isoWeekday(i):s.clone().subtract(1,"week").isoWeekday(i);return e=o.format(this.momentDateFormat),{slug:t,date:e}},setTimeParams(){let t=this.appointment.appointment_type_slug,e=l()(this.appointment.start_date,this.momentTimestampFormat).format(this.momentDateFormat);return{slug:t,date:e}},...(0,o.nv)(["updateEmptyAppointment"]),...(0,o.OI)(["setFrozenType"])}},x=j,$=(0,S.Z)(x,F,E,!1,null,null,null),O=$.exports,M={name:"app",store:T,components:{loading:z,BackButton:O},data(){return{loadingMessage:"",loading:!0,error:!1,errorHeading:"",errorIntro:"",errorMessage:"",localApi:window.ssa&&window.ssa.api?window.ssa.api:{},localAppointmentTypes:window.ssa_appointment_types?window.ssa_appointment_types:[],localLocale:window.ssa&&window.ssa.locale?window.ssa.locale:"",localSettings:window.ssa_settings?window.ssa_settings:{},wpTranslations:{},moment:l()}},beforeCreate(){this.wpTranslations=window.ssa_translations?window.ssa_translations:{},this.$store.commit("setTranslations",this.wpTranslations)},beforeMount(){this.listenAppointmentId()},mounted(){this.loadingMessage=this.translations.general.loadingInitial,this.errorHeading=this.translations.errors.heading,this.errorIntro=this.translations.errors.intro,this.init(),this.maybeTrackPageview()},beforeDestroy(){window.removeEventListener("message",this.setAppointmentId)},watch:{connection(t){t&&this.$refs.connectionError.open()},$route(t){t&&this.maybeTrackPageview()}},methods:{init(){if("undefined"===typeof this.api&&!g().isEmpty(this.localApi))return this.setApi(this.localApi),void this.init();if("undefined"===typeof this.api)return this.loading=!0,void this.fetchAPI().then((()=>this.init())).catch((t=>{console.log(t),this.showError(this.translations.errors.api)}));if(g().isEmpty(this.settings)&&!g().isEmpty(this.localSettings)){this.setSettings(this.localSettings);let t=this.localLocale?this.localLocale:this.settings.global.locale;return this.setLocale(t),l().locale(t),void this.init()}return g().isEmpty(this.settings)?(this.loading=!0,this.loadingMessage=this.translations.general.loadingTypes,void this.fetchSettings().then((()=>{this.init();let t=this.localLocale?this.localLocale:this.settings.global.locale;l().locale(t)})).catch((t=>{console.log(t),this.showError(this.translations.errors.settings)}))):this.appointmentTypesChecked||g().isEmpty(this.localAppointmentTypes)?this.appointmentTypesChecked?(!this.urlParams(window.location).type&&this.visibleAppointmentTypes.length>1&&this.setFrozenType(!1),"undefined"===typeof this.$store.state.telCountryCode&&this.$store.dispatch("fetchTelCountryCode"),this.loading=!1,void this.callAsync()):(this.loading=!0,void this.fetchAppointmentTypes().then((()=>{if(this.visibleAppointmentTypes.length){if(this.$route.params.slug||this.urlParams(window.location).type){let t=this.appointmentTypeBySlug(this.$route.params.slug||this.urlParams(window.location).type);this.setAppointmentTypeId(t.id)}this.init()}else this.showError(this.translations.errors.noAppointmentTypes)})).catch((t=>{console.log(t),this.showError(this.translations.errors.appointmentTypes)}))):(this.setAppointmentTypesChecked(!0),this.setAppointmentTypes(this.localAppointmentTypes),void this.init())},listenAppointmentId(){window.addEventListener("message",this.setAppointmentId,!1),this.windowLoadedMessage()},maybeTrackPageview(){if(!this.settings.tracking||!this.settings.tracking.page_tracking)return;let t="/ssa";switch(this.$route.name){case"type":t="/ssa/select-appointment-type";break;case"date":t="/ssa/select-date";break;case"time":t="/ssa/select-time";break;case"book":t="/ssa/booking-form";break;case"Booked":t="/ssa/booked";break;case"change":t="/ssa/modify-appointment";break}let e={ssaType:"page",name:this.$route.name,path:t,url:this.api.home_url+t};this.translations.pageTitles[this.$route.name]&&(e.title=this.translations.pageTitles[this.$route.name]),Object.prototype.hasOwnProperty.call(this.trackingPageview,"url")&&(e.referrer=this.trackingPageview.url),this.setTrackingPageview(e),window.parent.postMessage(this.trackingPageview,this.api.home_url)},setAppointmentId(t){"object"===typeof t.data&&Object.prototype.hasOwnProperty.call(t.data,"ssaAppointmentId")&&t.data.ssaAppointmentId&&this.$router.push(`/integration/form/load-appointment/${t.data.ssaAppointmentId}`)},showError(t){this.loading=!1,this.errorMessage=t,this.error=!0},...(0,o.nv)(["callAsync","fetchAPI","fetchSettings","fetchAppointmentTypes"]),...(0,o.OI)(["setApi","setAppointmentTypeId","setAppointmentTypes","setAppointmentTypesChecked","setConnectionError","setFrozenType","setLocale","setSettings","setTrackingPageview","setTranslations"])},computed:{connection(){return this.connectionError},...(0,o.rn)(["api","appointmentTypesChecked","connectionError","dateFormat","locale","settings","trackingPageview","translations"]),...(0,o.Se)(["appointmentTypeBySlug","selectedAppointmentType","urlParams","visibleAppointmentTypes","windowLoadedMessage"])}},I=M,L=(0,S.Z)(I,s,a,!1,null,null,null),B=L.exports,N=n(2809),R=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"booking booking-default"},[n("transition",{attrs:{name:"fade"}},[t.selectedAppointmentType.title?t._e():n("type-select",{model:{value:t.appointmentType,callback:function(e){t.appointmentType=e},expression:"appointmentType"}})],1)],1)},q=[],W=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"book-type"},[n("div",{staticClass:"booking-header"},[n("h1",{staticClass:"md-title ssa-type-header"},[t._v(t._s(t.translations.booking.appointmentType))])]),t._l(t.visibleAppointmentTypes,(function(e){return n("div",{key:e.id,staticClass:"book-type-single",class:"type-"+e.slug},[n("md-card",{staticClass:"selectable light-green",attrs:{role:"button","md-with-hover":!0,tabindex:"0"},nativeOn:{click:function(n){return t.selectAppointmentType(e.id)},keypress:function(n){return t.handleKeyboardSelect(n,e.id)}}},[n("md-card-header",[n("h2",{staticClass:"md-title"},[t._v(t._s(e.title))]),n("h3",{staticClass:"md-subhead"},[n("span",{staticClass:"appointment-duration"},[t._v(t._s(t.displayDuration(e.duration)))]),t.showPaymentUI(e)?n("span",[n("span",{staticClass:"divider"},[t._v(" - ")]),n("currency-code",{attrs:{price:e.payments.price,currency:e.payments.currency}})],1):t._e()])])],1)],1)}))],2)},U=[];const H={computed:{...(0,o.rn)(["api","settings","trackingEvent"]),...(0,o.Se)(["selectedAppointmentType"])},methods:{emitTrackingEvent(t,e){if(!this.settings.tracking||!this.settings.tracking.event_tracking)return;e||(e=this.selectedAppointmentType.title);let n={ssaType:"event",action:t,appointmentType:e};Object.prototype.hasOwnProperty.call(this.selectedAppointmentType,"payments")&&Object.prototype.hasOwnProperty.call(this.selectedAppointmentType.payments,"currency")&&Object.prototype.hasOwnProperty.call(this.selectedAppointmentType.payments,"price")&&(n.value={currency:this.selectedAppointmentType.payments.currency,price:parseFloat(this.selectedAppointmentType.payments.price)}),this.setTrackingEvent(n),window.parent.postMessage(this.trackingEvent,this.api.home_url)},...(0,o.OI)(["setTrackingEvent"])}};var Z=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"price"},[t._v(" "+t._s(t.displayPrice(t.price,t.currency))+" "),t.isCurrencyCode?n("span",{staticClass:"currency-code"},[t._v(" "+t._s(t.currency)+" ")]):t._e()])},Y=[],G={name:"currencyCode",props:["price","currency"],data(){return{}},computed:{isCurrencyCode(){return!this.displayPrice(this.price,this.currency).includes(this.currency.substring(0,2))},...(0,o.Se)(["displayPrice"])}},X=G,V=(0,S.Z)(X,Z,Y,!1,null,null,null),J=V.exports,K={name:"typeSelect",components:{CurrencyCode:J},mixins:[H],props:["value"],data(){return{moment:l(),momentDateFormat:p}},computed:{...(0,o.rn)(["appointmentTypes","frozenType","settings","translations"]),...(0,o.Se)(["displayDuration","showPaymentUI","timezoneLocal","visibleAppointmentTypes"])},methods:{handleKeyboardSelect(t,e){let n=t.which;32!==n&&13!==n||this.selectAppointmentType(e)},selectAppointmentType(t){if(t){this.detectTimezone(t),this.updateAppointmentSlots(),this.setAppointment({});let e=this.appointmentTypes.find((e=>e.id===t));this.emitTrackingEvent("typeSelected",e.title),this.$emit("input",e)}else this.$emit("input",null)},detectTimezone(t){let e=this.appointmentTypes.find((e=>e.id===t));"locked"===e.timezone_style?this.setTimezone(this.settings.global.timezone_string):this.setTimezone(this.timezoneLocal)},...(0,o.nv)(["updateAppointmentSlots"]),...(0,o.OI)(["setAppointment","setTimezone"])}},Q=K,tt=(0,S.Z)(Q,W,U,!1,null,null,null),et=tt.exports,nt={name:"bookingDefault",components:{TypeSelect:et},data(){return{appointmentTypeId:window.apptTypeId?window.apptTypeId:null,momentDateFormat:p}},beforeMount(){this.appointmentTypeId||1!==this.visibleAppointmentTypes.length||(this.appointmentTypeId=this.visibleAppointmentTypes[0].id,this.setSkippedType(!0),this.$router.replace(`/type/${this.visibleAppointmentTypes[0].slug}`)),this.appointmentTypeId&&(this.setSkippedType(!0),this.setAppointmentTypeId(this.appointmentTypeId)),this.urlParams.type&&(this.setSkippedType(!0),this.$router.replace(`/type/${this.urlParams.type}/select/${l()().format(this.momentDateFormat)}`))},mounted(){},computed:{appointmentType:{get(){return this.appointment.appointment_type_id},set(t){t?(this.setAppointmentTypeId(t.id),this.$router.push(`/type/${t.slug}`)):this.setAppointmentTypeId(null)}},...(0,o.Se)(["selectedAppointmentType","visibleAppointmentTypes","urlParams"]),...(0,o.rn)(["appointment"])},methods:{...(0,o.OI)(["setAppointmentTypeId","setSkippedType"])}},it=nt,st=(0,S.Z)(it,R,q,!1,null,null,null),at=st.exports,ot=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"booking ssa-form-field-container"},[n("transition-group",{attrs:{name:"fade"}},[t.showTypeSelect?n("type-select",{key:"select-type",model:{value:t.appointmentType,callback:function(e){t.appointmentType=e},expression:"appointmentType"}}):[t.$route.path.includes("select")?n("select-header",{key:"select-header"}):t._e(),n("router-view",{key:"router-view"})]],2)],1)},rt=[],lt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"booking-header"},[n("md-layout",{attrs:{"md-gutter":!0,"md-vertical-align":"top"}},[n("md-layout",{attrs:{"md-flex-small":"100","md-column":""}},[n("h1",{staticClass:"md-title ssa-type-header"},[t._v(" "+t._s(t.selectedAppointmentType.title)+" ")]),t.selectedAppointmentType.duration?n("h2",{staticClass:"md-subheading"},[n("span",{staticClass:"appointment-duration"},[t._v(t._s(t.displayDuration(t.selectedAppointmentType.duration)))]),t.showPaymentUI(t.selectedAppointmentType)?n("span",[n("span",{staticClass:"divider"},[t._v("-")]),n("currency-code",{attrs:{price:t.selectedAppointmentType.payments.price,currency:t.selectedAppointmentType.payments.currency}})],1):t._e()]):t._e()]),t.selectedAppointmentType.title?["locked"===t.selectedAppointmentType.timezone_style?n("md-layout",{attrs:{"md-flex-small":"100"}},[n("timezone-locked")],1):n("md-layout",{attrs:{"md-flex-small":"100"}},[n("timezone")],1)]:t._e()],2)],1)},pt=[],mt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"timezone"},[t.editing?[n("md-input-container",{staticClass:"select2-wrapper"},[n("label",{attrs:{for:"timezone"}},[t._v(t._s(t.translations.general.selectTimezone))]),n("select2",{ref:"timezoneSelect",attrs:{name:"timezone",id:"timezone"},model:{value:t.tz,callback:function(e){t.tz=e},expression:"tz"}},t._l(t.filteredTimezones(t.timezones),(function(e){return n("option",{key:e.value,domProps:{value:e.value}},[t._v(t._s(e.label))])})),0)],1),n("md-button",{staticClass:"md-icon-button md-primary",on:{click:t.saveTimezone}},[n("md-icon",{attrs:{focusable:"false"}},[t._v("save")]),n("span",{staticClass:"screen-reader-text"},[t._v(t._s(t.translations.actions.saveTimezone))])],1)]:[n("strong",[t._v(t._s(t.translations.general.yourTimezone)+" ")]),t._v(" "+t._s(t.formatTimezone(t.timezone))+" "),n("md-button",{staticClass:"md-icon-button md-primary",on:{click:t.editTimezone}},[n("md-icon",{attrs:{focusable:"false"}},[t._v("edit")]),n("span",{staticClass:"screen-reader-text"},[t._v(t._s(t.translations.actions.editTimezone))])],1)]],2)},ct=[],dt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("select",{ref:"select2",staticStyle:{width:"100%"}},[t._t("default")],2)},ht=[];n(6243);var ut={name:"select2Dropdown",props:{value:{type:String}},data(){return{container:null}},mounted:function(){var t=this,e=y()(t.$refs.select2);e.select2({dropdownParent:".select2-wrapper"}).val(this.value).trigger("change").on("change",(function(){t.$emit("input",this.value)})).on("select2:open",(function(){y()(".select2-search__field").length&&y()(".select2-search__field")[0].focus()})),this.container=e.parents(".md-input-container"),this.styleContainer(e)},watch:{value:function(t){var e=y()(this.$refs.select2);e.val(t).trigger("change"),this.styleContainer(e)}},beforeDestroy:function(){y()(this.$refs.select2).off().select2("destroy")},methods:{styleContainer:function(){this.value?this.container.addClass("md-has-value"):this.container.removeClass("md-has-value")}}},yt=ut,ft=(0,S.Z)(yt,dt,ht,!1,null,null,null),gt=ft.exports,_t={name:"timezoneSelector",components:{select2:gt},data(){return{moment:l(),editing:!1,timezones:l().tz.names()}},beforeMount(){this.timezone||this.setTimezone(this.timezoneLocal)},computed:{tz:{get(){return this.timezone},set(t){this.setTimezone(t)}},...(0,o.Se)(["timezoneLocal","filteredTimezones","formatTimezone"]),...(0,o.rn)(["timezone","translations"])},methods:{editTimezone(){this.editing=!0,this.$nextTick((()=>{setTimeout((()=>{this.$refs.timezoneSelect.$el.focus()}),0)}))},saveTimezone(){this.editing=!1},submit(){},...(0,o.OI)(["setTimezone"])}},vt=_t,bt=(0,S.Z)(vt,mt,ct,!1,null,null,null),kt=bt.exports,Tt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"timezone-local"},[t.timezoneLocal!==t.timezone?[n("strong",[t._v(t._s(t.translations.general.timezoneMismatch))]),t._v(" "+t._s(t.formatTimezone())+" "),n("div",[n("strong",[t._v(t._s(t.translations.general.localTime))]),t._v(" "+t._s(t.localTime))])]:t._e()],2)},wt=[],At={name:"timezoneLocked",data(){return{moment:l(),localTime:""}},beforeMount(){this.timezone||this.setTimezone(this.settings.global.timezone_string),this.localTime=l().tz(this.timezone).format(this.settings.global.date_format_moment+" "+this.settings.global.time_format_moment)},computed:{...(0,o.rn)(["settings","timezone","translations"]),...(0,o.Se)(["timezoneLocal","formatTimezone"])},methods:{...(0,o.OI)(["setTimezone"])}},Ct=At,Pt=(0,S.Z)(Ct,Tt,wt,!1,null,null,null),St=Pt.exports,Dt={name:"selectHeader",components:{timezone:kt,TimezoneLocked:St,CurrencyCode:J},data(){return{}},computed:{...(0,o.rn)(["appointmentTypes","translations"]),...(0,o.Se)(["displayDuration","selectedAppointmentType","showPaymentUI"])}},zt=Dt,Ft=(0,S.Z)(zt,lt,pt,!1,null,null,null),Et=Ft.exports,jt={name:"form-field",components:{SelectHeader:Et,TypeSelect:et},data(){return{appointmentTypeId:window.apptTypeId?window.apptTypeId:null}},mounted(){this.setIntegration(!0),this.appointmentTypeId||1!==this.visibleAppointmentTypes.length||(this.appointmentTypeId=this.visibleAppointmentTypes[0].id,this.setSkippedType(!0),this.$router.replace(`/integration/form/type/${this.visibleAppointmentTypes[0].slug}`)),this.appointmentTypeId&&(this.setSkippedType(!0),this.setAppointmentTypeId(this.appointmentTypeId)),this.urlParams.type&&(this.setSkippedType(!0),this.$router.replace(`/integration/form/type/${this.urlParams.type}/select/${l()().format(this.dateFormat)}`))},computed:{appointmentType:{get(){return this.appointment.appointment_type_id},set(t){t?(this.setAppointmentTypeId(t.id),this.$router.push(`/integration/form/type/${t.slug}`)):this.setAppointmentTypeId(null)}},showTypeSelect(){return this.selectedAppointmentType&&!this.selectedAppointmentType.title&&"bookingForm"===this.$route.name},...(0,o.Se)(["appointmentTypeBySlug","selectedAppointmentType","urlParams","visibleAppointmentTypes"]),...(0,o.rn)(["appointment","frozenType"])},methods:{...(0,o.nv)(["updateEmptyAppointment"]),...(0,o.OI)(["setAppointmentTypeId","setIntegration","setSkippedType"])}},xt=jt,$t=(0,S.Z)(xt,ot,rt,!1,null,null,null),Ot=$t.exports,Mt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"booking booking-form-integration"},[n("timezone-warning"),n("transition",{attrs:{name:"fade"}},["formDate"===t.$route.name?n("date-select",{key:"date",attrs:{date:t.date,slug:t.slug},on:{updateStartDate:t.handleNewStartDate,skipDate:t.handleSkipDate},model:{value:t.appointmentDate,callback:function(e){t.appointmentDate=e},expression:"appointmentDate"}}):t._e(),"formTime"===t.$route.name?n("time-select",{key:"time",attrs:{date:t.date},on:{selectNewDate:t.handleNewStartDate,skipTime:t.handleSkipTime},model:{value:t.appointmentTime,callback:function(e){t.appointmentTime=e},expression:"appointmentTime"}}):t._e()],1)],1)},It=[],Lt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.timezoneWarning?n("notification",{attrs:{icon:"warning",theme:"amber"}},[t._v(" "+t._s(t.timezoneWarningMessage)+" ")]):t._e()},Bt=[],Nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"notification-box",class:"md-theme-"+t.theme},[t.icon?n("md-icon",{staticClass:"md-primary",attrs:{"md-theme":t.theme}},[t._v(" "+t._s(t.icon)+" ")]):t._e(),n("div",{staticClass:"notification-text md-body-2"},[t._t("default")],2)],1)},Rt=[],qt={name:"notificationBox",props:{icon:String,theme:{type:String,default:"blue"}},data(){return{}}},Wt=qt,Ut=(0,S.Z)(Wt,Nt,Rt,!1,null,null,null),Ht=Ut.exports,Zt={name:"timezoneWarning",components:{Notification:Ht},data(){return{timezoneWarning:!1,timezoneWarningMessage:""}},mounted(){this.timezone&&this.maybeShowWarning(this.timezone)},watch:{timezone(t){t&&this.maybeShowWarning(t)}},computed:{...(0,o.rn)(["timezone","translations"]),...(0,o.Se)(["selectedAppointmentType"])},methods:{maybeShowWarning(t){this.timezoneWarning=(t.includes("GMT")||t.includes("UTC"))&&Object.prototype.hasOwnProperty.call(this.selectedAppointmentType,"timezone_style")&&"locked"!==this.selectedAppointmentType.timezone_style,this.timezoneWarningMessage=this.timezoneWarning?this.translations.general.timezoneGuessWrong:""}}},Yt=Zt,Gt=(0,S.Z)(Yt,Lt,Bt,!1,null,null,null),Xt=Gt.exports,Vt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"appt-select",class:"appt-type-"+t.slug},[n("transition-group",{attrs:{name:"fade"}},[t.loading?n("loading",{key:"loading",attrs:{message:t.translations.general.loadingAvailableSlots}}):t.error?n("booking-error",{key:"bookingError",attrs:{label:t.errorMessage}}):[n("h1",{key:"dateSelect",staticClass:"md-headline date-select-headline"},[t._v(" "+t._s(t.translations.booking.dateSelect)+" ")]),"short"===t.view?n("shortly",{key:"shortly",on:{selectDate:t.selectDate,skipDate:t.handleSkipDate}}):"month"===t.view?n("monthly",{key:"monthly",attrs:{"disable-prev":t.disablePrev,"disable-next":t.disableNext,date:t.date},on:{prev:t.navPrev,next:t.navNext,selectDate:t.selectDate}}):n("weekly",{key:"weekly",attrs:{"disable-prev":t.disablePrev,"disable-next":t.disableNext,date:t.date},on:{prev:t.navPrev,next:t.navNext,selectDate:t.selectDate}})]],2),n("md-snackbar",{ref:"timeConflict",attrs:{"md-position":"top center"}},[n("span",[t._v(t._s(t.translations.errors.timeTaken))])])],1)},Jt=[],Kt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"empty-state"}},[n("div",{staticClass:"empty-state"},[n("div",{staticClass:"empty-state-container"},[t.icon?n("img",{staticClass:"empty-state-image",attrs:{src:t.icon}}):t._e(),t.label?n("h3",{staticClass:"empty-state-label"},[t._v(t._s(t.label))]):t._e(),t.description?n("p",{staticClass:"empty-state-description"},[t._v(t._s(t.description))]):t._e(),t._t("default")],2)])])},Qt=[],te={name:"bookingError",props:["icon","label","description"],data(){return{}}},ee=te,ne=(0,S.Z)(ee,Kt,Qt,!1,null,null,null),ie=ne.exports,se=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"calendar weekly"},[n("div",{staticClass:"prev"},[n("md-button",{staticClass:"md-icon-button",attrs:{disabled:t.disablePrev},on:{click:t.goPrev}},[n("md-icon",[t._v("keyboard_arrow_left")]),n("span",{staticClass:"screen-reader-text"},[t._v(" "+t._s(t.translations.actions.back)+" "+t._s(t.previousWeek)+" ")])],1)],1),n("div",{staticClass:"next"},[n("md-button",{staticClass:"md-icon-button",attrs:{disabled:t.disableNext},on:{click:t.goNext}},[n("md-icon",[t._v("keyboard_arrow_right")]),n("span",{staticClass:"screen-reader-text"},[t._v(" "+t._s(t.translations.actions.forward)+" "+t._s(t.nextWeek)+" ")])],1)],1),n("div",{staticClass:"calendar-days"},t._l(t.days,(function(e,i){return n("day",{key:i,attrs:{day:e},on:{selectDate:t.selectDate}})})),1)])},ae=[],oe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"book-day"},[n("md-whiteframe",{class:{selectable:t.day.hasSlots&&!t.day.passiveDay,disabled:!t.day.hasSlots,passive:t.day.passiveDay},attrs:{"md-tag":"button",disabled:!t.day.hasSlots||t.day.passiveDay,"md-elevation":t.day.hasSlots?2:0},nativeOn:{click:function(e){return t.selectDate(t.day.date,t.day.hasSlots)},keypress:function(e){return t.handleKeyboardSelect(e,t.day.date,t.day.hasSlots)}}},[t.simple?[t.day.passiveDay?t._e():n("div",{staticClass:"md-body-1"},[t._v(" "+t._s(t.day.date.format("D"))+" "),t.day.hasSlots&&!t.day.passiveDay?n("span",{staticClass:"screen-reader-text"},[t._v(t._s(t.day.date.format(t.momentDateFormat)))]):t._e()])]:[n("div",{staticClass:"md-title"},[t._v(t._s(t.day.date.format("ddd")))]),n("div",{staticClass:"md-body-1"},[t._v(t._s(t.day.date.format(t.settings.global.date_format_moment)))])]],2)],1)},re=[],le={name:"dateSelectDay",props:{day:Object,simple:{type:Boolean,default:!1}},data(){return{momentDateFormat:p}},computed:{...(0,o.rn)(["translations","settings"])},methods:{handleKeyboardSelect(t,e,n){let i=t.which;32!==i&&13!==i||this.selectDate(e,n)},selectDate(t,e){e&&this.$emit("selectDate",t.locale("en").format(this.momentDateFormat))}}},pe=le,me=(0,S.Z)(pe,oe,re,!1,null,null,null),ce=me.exports,de={name:"dateSelectWeekly",components:{Day:ce},props:["date","disablePrev","disableNext"],data(){return{moment:l(),momentDateFormat:p}},computed:{firstDay(){return this.date?l()(this.date,this.momentDateFormat):l()()},days(){var t=this.getDates(this.firstDay),e=t.map((t=>{var e={};e.date=t;var n=this.tzAvailableSlots.findIndex((e=>{var n=t.format(this.momentDateFormat),i=e.start_date.substr(0,10);return n===i}));return e.hasSlots=n>=0,e.passiveDay=!1,e}));return e},nextWeek(){return this.firstDay.clone().add(7,"days").format(this.settings.global.date_format_moment)},previousWeek(){return this.firstDay.clone().subtract(7,"days").format(this.settings.global.date_format_moment)},...(0,o.rn)(["appointment","settings","translations"]),...(0,o.Se)(["tzAvailableSlots"])},methods:{goPrev(){this.$emit("prev")},goNext(){this.$emit("next")},getDates(t){var e=t.clone().add(6,"days"),n=[t],i=t.clone();while(i.isBefore(e))i=i.clone().add(1,"day"),n.push(i);return n},selectDate(t){this.$emit("selectDate",t)}}},he=de,ue=(0,S.Z)(he,se,ae,!1,null,null,null),ye=ue.exports,fe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"monthly"},[n("div",{staticClass:"title monthly"},[n("h2",{staticClass:"md-title monthly-title"},[t._v(t._s(this.firstDay.format("MMMM YYYY")))]),n("div",{staticClass:"prev"},[n("md-button",{staticClass:"md-icon-button",attrs:{disabled:t.disablePrev,title:t.previousMonth},on:{click:t.goPrev}},[n("md-icon",[t._v("keyboard_arrow_left")]),n("span",{staticClass:"screen-reader-text"},[t._v(" "+t._s(t.translations.actions.back)+" "+t._s(t.previousMonth)+" } ")])],1)],1),n("div",{staticClass:"next"},[n("md-button",{staticClass:"md-icon-button",attrs:{disabled:t.disableNext,title:t.nextMonth},on:{click:t.goNext}},[n("md-icon",[t._v("keyboard_arrow_right")]),n("span",{staticClass:"screen-reader-text"},[t._v(" "+t._s(t.translations.actions.forward)+" "+t._s(t.nextMonth)+" } ")])],1)],1)]),n("div",{staticClass:"calendar monthly"},[n("div",{staticClass:"calendar-wrap monthly"},[n("ul",{staticClass:"week"},t._l(t.week,(function(e){return n("li",{key:e},[t._v(t._s(e))])})),0),n("div",{staticClass:"calendar-days monthly"},t._l(t.days,(function(e,i){return n("day",{key:i,attrs:{simple:!0,day:e},on:{selectDate:t.selectDate}})})),1)])])])},ge=[],_e={name:"dateSelectMonthly",components:{Day:ce},props:["date","disablePrev","disableNext"],data(){return{moment:l(),momentDateFormat:p}},computed:{firstDay(){return this.date?l()(this.date,this.momentDateFormat):l()()},days(){var t=this.getDates(this.firstDay),e=t.map((t=>{var e={};e.date=t;var n=this.tzAvailableSlots.findIndex((e=>{var n=t.format(this.momentDateFormat),i=e.start_date.substr(0,10);return n===i}));return e.hasSlots=n>=0,e.passiveDay=!t.isSame(this.firstDay,"month"),e}));return e},nextMonth(){return this.firstDay.clone().add(1,"month").format("MMMM YYYY")},previousMonth(){return this.firstDay.clone().subtract(1,"month").format("MMMM YYYY")},startOfWeek(){return parseInt(this.settings.global.start_of_week,10)},week(){let t=l().weekdaysMin(!1);if(this.startOfWeek>0){let e=t.slice(0,this.startOfWeek),n=t.slice(this.startOfWeek);t=[...n,...e]}return t},...(0,o.rn)(["appointment","settings","translations"]),...(0,o.Se)(["tzAvailableSlots"])},methods:{goPrev(){this.$emit("prev")},goNext(){this.$emit("next")},getDates(t){let e=[],n=t.daysInMonth();for(let a=1;a<=n;++a)e.push(l()(t).date(a));let i=l()(t).date(1).day();i=0===i?7:i,i=this.startOfWeek>i?i+7:i;for(let a=0;a<i-this.startOfWeek;a++)e.unshift(l()(t).date(1).subtract(a+1,"days"));let s=7-e.length%7;for(let a=1;a<=s;a++)e.push(l()(t).add(1,"months").date(a));return e},selectDate(t){this.$emit("selectDate",t)}}},ve=_e,be=(0,S.Z)(ve,fe,ge,!1,null,null,null),ke=be.exports,Te=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"calendar shortly"},[n("div",{staticClass:"calendar-days"},t._l(t.days,(function(e,i){return n("day",{key:i,attrs:{day:e},on:{selectDate:t.selectDate}})})),1)])},we=[],Ae={name:"dateSelectShortly",components:{Day:ce},data(){return{moment:l(),momentDateFormat:p}},mounted(){let t=this.getDates();1===t.length&&this.tzAvailableSlots.length&&this.$emit("skipDate",t[0].locale("en").format(this.momentDateFormat))},computed:{days(){let t=this.getDates(),e=t.map((t=>{let e={};e.date=t;let n=this.tzAvailableSlots.findIndex((e=>{let n=t.format(this.momentDateFormat),i=e.start_date.substr(0,10);return n===i}));return e.hasSlots=n>=0,e}));return e},...(0,o.rn)(["appointment","timezone"]),...(0,o.Se)(["availabilityWindow","tzAvailableSlots"])},methods:{getDates(){let t=this.availabilityWindow.start.clone().tz(this.timezone),e=this.availabilityWindow.end.clone().tz(this.timezone).subtract(1,"minute");if(e.isBefore(t))return[];let n=[t];while(t.isBefore(e,"day"))t=t.clone().add(1,"day"),n.push(t);return n},selectDate(t){this.$emit("selectDate",t)}}},Ce=Ae,Pe=(0,S.Z)(Ce,Te,we,!1,null,null,null),Se=Pe.exports,De={name:"dateSelect",mixins:[H],props:["date","value","slug"],components:{Loading:z,BookingError:ie,Weekly:ye,Monthly:ke,Shortly:Se},data(){return{error:!1,errorMessage:"",forwarded:!1,loading:!0,moment:l(),momentDateFormat:p,momentTimestampFormat:m,secondCheck:!1,fetchSlotsArgs:{},fetchDateBoundaries:{start_date_min:null,start_date_max:null}}},beforeMount(){if(Object.prototype.hasOwnProperty.call(this.appointment,"start_date")&&this.appointment.start_date&&(this.setAppointmentProp({key:"start_date",value:""}),this.clearAvailableSlots()),this.inBookingWindow&&(this.visibleLast.isBefore(this.minDay,"day")||this.visibleFirst.isAfter(this.maxDay,"day"))){let t=this.visibleLast.isBefore(this.minDay,"day")?this.minDay.clone():this.maxDay.clone().subtract(this.dayBase-1,"days");return this.jumpToDate(t),void(this.forwarded=this.diff>7)}},mounted(){return this.timeConflict&&this.$nextTick((()=>{this.$refs.timeConflict.open(),this.setTimeConflict(!1)})),this.inBookingWindow?this.afterAvailabilityWindow?(this.loading=!1,this.errorMessage=this.translations.errors.noAvailableSlots,void(this.error=!0)):this.forwarded||this.tzAvailableSlots.length&&!this.modeEdit&&!this.visibleFirst.isBefore(this.tzFirstDayChecked,"day")&&!this.visibleLast.isAfter(this.tzLastDayChecked,"day")?(this.maybeFastForward(),void(this.loading=!1)):(this.fetchSlotsArgs={start_date_min:this.queryFirst.clone().tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.queryLast.clone().tz(this.timezone).utc().format(this.momentDateFormat)},void this.loadAvailableSlots()):(this.loading=!1,this.errorMessage=this.translations.errors.outsideBookingWindow,void(this.error=!0))},watch:{date:function(t){if(t)return(this.visibleFirst.isBefore(this.tzFirstDayChecked,"day")||this.visibleLast.isAfter(this.tzLastDayChecked,"day")&&this.visibleLast.isBefore(this.maxDay,"day"))&&(this.loading=!0),this.visibleLast&&this.triggerNext&&this.tzLastDayChecked&&this.maxDay&&this.visibleLast.isSameOrAfter(this.triggerNext,"day")&&this.tzLastDayChecked.isBefore(this.maxDay,"day")?(this.fetchSlotsArgs={start_date_min:this.tzLastDayChecked.clone().tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.queryLast.clone().tz(this.timezone).utc().format(this.momentDateFormat)},void this.loadAvailableSlots()):this.visibleFirst&&this.triggerPrev&&this.tzFirstDayChecked&&this.minDay&&this.visibleFirst.isSameOrBefore(this.triggerPrev,"day")&&this.tzFirstDayChecked.isAfter(this.minDay,"day")?(this.fetchSlotsArgs={start_date_min:this.queryFirst.clone().tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.tzFirstDayChecked.clone().tz(this.timezone).utc().format(this.momentDateFormat)},void this.loadAvailableSlots()):this.forwarded&&(!this.tzAvailableSlots.length||this.modeEdit||this.visibleFirst.isBefore(this.tzFirstDayChecked,"day")||this.visibleLast.isAfter(this.tzLastDayChecked,"day"))?(this.fetchSlotsArgs={start_date_min:this.queryFirst.clone().tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.queryLast.clone().tz(this.timezone).utc().format(this.momentDateFormat)},(this.modeEdit||this.tzFirstDayChecked&&this.visibleFirst.isBefore(this.tzFirstDayChecked)||this.tzLastDayChecked&&this.visibleLast.isAfter(this.tzLastDayChecked))&&(this.fetchSlotsArgs.refresh=!0),this.loading=!0,void this.loadAvailableSlots()):void 0},loading:function(t,e){t===e||t||this.skippedType||this.windowLoadedMessage()},fetchSlotsArgs:{deep:!0,handler(t){g().isEmpty(t)||g().isEmpty(t.start_date_min)||g().isEmpty(t.start_date_max)||this.updateFetchDatesBoundaries(t.start_date_min,t.start_date_max)}}},computed:{dayBase(){let t=7;return"month"===this.view&&(t=Math.floor(this.visibleFirst.daysInMonth()/4)),t},diff(){return this.minDay&&this.maxDay?l().duration(this.maxDay.diff(this.minDay)).asDays():10},disableNext(){return"short"===this.view||this.next.isSameOrAfter(this.maxDay,"day")},disablePrev(){return"short"===this.view||("month"===this.view?this.prev.isBefore(this.minDay,"month"):this.prev.clone().add(6,"days").isBefore(this.minDay,"day"))},next(){let t=7;return"month"===this.view&&(t=this.visibleFirst.daysInMonth()),this.visibleFirst.clone().add(t,"days")},prev(){let t=7;return"month"===this.view&&(t=this.visibleFirst.clone().subtract(1,"month").daysInMonth()),this.visibleFirst.clone().subtract(t,"days")},queryFirst(){let t=this.disablePrev?this.visibleFirst.clone():this.visibleFirst.clone().subtract(5*this.dayBase,"days"),e=l().max(t,this.minDay);switch(this.view){case"month":e=e.clone().startOf("month");break;case"week":e=this.setWeekStart(e.clone());break;default:e=e.clone()}return e.subtract(1,"day")},queryLast(){let t=this.disableNext?this.visibleLast.clone():this.visibleLast.clone().add(5*this.dayBase,"days");return t=t.isSameOrBefore(this.queryFirst)?this.queryFirst.clone().add(5*this.dayBase,"days"):t,l().min(t,this.maxDay).clone().add(1,"day")},triggerNext(){let t=this.tzLastDayChecked?this.tzLastDayChecked:this.visibleLast;return this.disableNext?this.visibleLast.clone():t.clone().subtract(2*this.dayBase,"days")},triggerPrev(){var t=this.tzFirstDayChecked?this.tzFirstDayChecked:this.visibleFirst;return this.disablePrev?this.visibleFirst.clone():t.clone().add(2*this.dayBase,"days")},view(){let t="week";return this.selectedAppointmentType.booking_layout&&(t=this.selectedAppointmentType.booking_layout),this.diff<8&&(t="short"),t},visibleFirst(){if(!this.date)return l()();switch(this.view){case"month":return l()(this.date,this.momentDateFormat).startOf("month");case"short":return this.minDay.clone();default:return l()(this.date,this.momentDateFormat)}},visibleLast(){switch(this.view){case"month":return this.visibleFirst.clone().endOf("month");case"short":return this.maxDay.clone();default:return this.visibleFirst.clone().add(6,"days")}},...(0,o.Se)(["afterAvailabilityWindow","inBookingWindow","maxDay","minDay","selectedAppointmentType","tzAvailableSlots","tzFirstDayChecked","tzLastDayChecked","windowLoadedMessage"]),...(0,o.rn)(["api","appointment","modeEdit","googleRefreshed","settings","skippedType","timeConflict","timezone","translations"])},methods:{checkAvailableSlots(){if(this.tzAvailableSlots.length)this.loading=!1;else{if(this.secondCheck&&!this.tzAvailableSlots.length||this.tzLastDayChecked&&this.tzLastDayChecked.isSameOrAfter(this.maxDay))return this.loading=!1,this.errorMessage=this.translations.errors.noAvailableSlots,void(this.error=!0);this.loading=!0,this.secondCheck=!0,this.fetchSlotsArgs={start_date_min:this.queryFirst.tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.queryFirst.clone().add(1,"year").tz(this.timezone).utc().format(this.momentDateFormat)},this.loadAvailableSlots()}},handleSkipDate(t){this.$emit("skipDate",t)},jumpToDate(t){let e;e="month"===this.view?t.clone().startOf("month"):this.setWeekStart(t),this.$emit("updateStartDate",e.format(this.momentDateFormat))},loadAvailableSlots(){let t=this.fetchSlotsArgs;g().isEmpty(t)?console.error("Call to loadAvailableSlots when fetchSlotsArgs object is empty"):this.fetchAppointmentSlots(t).then((()=>{this.maybeFastForward(),this.triggerGoogleRefresh(),this.checkAvailableSlots()})).catch((t=>{console.log(t),this.setConnectionError(!0)}))},maybeFastForward(){if(!this.tzAvailableSlots.length)return;let t=l()(this.tzAvailableSlots[0].start_date,this.momentTimestampFormat);t.isAfter(this.visibleLast,"day")&&this.jumpToDate(t)},navNext(){this.$emit("updateStartDate",this.next.format(this.momentDateFormat))},navPrev(){this.$emit("updateStartDate",this.prev.format(this.momentDateFormat))},selectDate(t){this.emitTrackingEvent("dateSelected"),this.$emit("input",t)},setWeekStart(t){let e=l()(),n=e.isoWeekday(),i=t.isoWeekday();return n<=i?t.isoWeekday(n):t.clone().subtract(1,"week").isoWeekday(n)},triggerGoogleRefresh(){this.tzAvailableSlots.length&&(this.googleRefreshed||this.settings.installed.google_calendar&&(this.settings.google_calendar&&!this.settings.google_calendar.enabled||(this.setGoogleRefreshed(!0),this.callAsync().then((()=>{let t={start_date_min:this.fetchDateBoundaries.start_date_min,start_date_max:this.fetchDateBoundaries.start_date_max};if(g().isEmpty(t.start_date_min)||g().isEmpty(t.start_date_max))return void console.error("Call to triggerGoogleRefresh when fetchDateBoundaries object is empty");let e={replace:!0};t&&(e=Object.assign({},t,e)),this.fetchAppointmentSlots(e).then((()=>{this.callAsync()}))})))))},updateFetchDatesBoundaries(t,e){(!this.fetchDateBoundaries.start_date_min||t<this.fetchDateBoundaries.start_date_min)&&(this.fetchDateBoundaries.start_date_min=t),(!this.fetchDateBoundaries.start_date_max||e>this.fetchDateBoundaries.start_date_max)&&(this.fetchDateBoundaries.start_date_max=e)},...(0,o.nv)(["callAsync","fetchAppointmentSlots"]),...(0,o.OI)(["clearAvailableSlots","setConnectionError","setGoogleRefreshed","setAppointmentProp","setTimeConflict"])}},ze=De,Fe=(0,S.Z)(ze,Vt,Jt,!1,null,null,null),Ee=Fe.exports,je=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"time-select",class:"appt-type-"+t.slug},[t.loading?n("loading",{key:"loading",attrs:{message:t.translations.general.loadingAvailableSlots}}):[n("h1",{staticClass:"md-headline time-select-headline"},[t._v(t._s(t.translations.booking.timeSelect)+" "+t._s(t.momentDateLocalized.format(t.settings.global.date_format_moment)))]),n("md-layout",{attrs:{"md-align":"center"}},[t.nightSlots.length?n("time-select-list",{attrs:{list:t.nightSlots,icon:"night",title:t.translations.day.night},on:{selectTime:t.selectTime}}):t._e(),t.morningSlots.length?n("time-select-list",{attrs:{list:t.morningSlots,icon:"morning",title:t.translations.day.morning},on:{selectTime:t.selectTime}}):t._e(),t.afternoonSlots.length?n("time-select-list",{attrs:{list:t.afternoonSlots,icon:"afternoon",title:t.translations.day.afternoon},on:{selectTime:t.selectTime}}):t._e(),t.eveningSlots.length?n("time-select-list",{attrs:{list:t.eveningSlots,icon:"evening",title:t.translations.day.evening},on:{selectTime:t.selectTime}}):t._e()],1)]],2)},xe=[],$e=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("md-layout",{staticClass:"md-column-center",attrs:{"md-column":"","md-flex":"25","md-flex-xsmall":"50"}},[n("icon",["afternoon"===t.icon?n("afternoon"):"evening"===t.icon?n("evening"):"morning"===t.icon?n("morning"):n("night")],1),n("h2",{staticClass:"md-subheading"},[t._v(" "+t._s(t.title)+" ")]),n("ul",{staticClass:"time-listing"},t._l(t.list,(function(e,i){return n("li",{key:i},[n("md-button",{staticClass:"md-dense md-raised time-select",on:{click:function(n){return t.selectTime(e.start_date)}}},[t._v(" "+t._s(t.moment(e.start_date).format(t.settings.global.time_format_moment))+" "),t.showLockedTimezone?n("span",{staticClass:"locked-timezone"},[t._v(" "+t._s(t.tzAbbr)+" ")]):t._e()]),e.hasOwnProperty("capacity_available")?n("span",{staticClass:"time-slot-capacity"},[t._v(" "+t._s(t.translations.booking.available)+" "+t._s(e.capacity_available)+" ")]):t._e()],1)})),0)],1)},Oe=[],Me=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{staticClass:"time-listing-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,viewBox:"0 0 100 100",role:"presentation"}},[n("g",{staticClass:"icon-path"},[t._t("default")],2)])},Ie=[],Le={name:"iconBlock",props:{width:{type:[Number,String],default:100},height:{type:[Number,String],default:100}}},Be=Le,Ne=(0,S.Z)(Be,Me,Ie,!1,null,null,null),Re=Ne.exports,qe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("path",{attrs:{d:"M50 26c1.104 0 2-.896 2-2V12.006 12c0-1.103-.895-2-2-2s-2.002.897-2.002 2v12c0 1.105.897 2 2 2zM26 50c0-1.104-.895-2-2-2H12.003 12c-1.104 0-2 .895-2 2s.896 2 2 2h12c1.105 0 2-.895 2-2zM88 48H76.05h-.005c-1.104 0-2 .895-2 2s.896 2 2 2H88c1.105 0 2-.895 2-2 0-1.104-.895-2-2-2zM50.002 73.91c-1.105 0-2 .896-2 2V88c0 1.103.895 2 2 2s2-.897 2-2V75.91c0-1.104-.897-2-2-2zM69.796 33.03l8.483-8.482c0-.002.002-.002.002-.003.78-.78.78-2.046 0-2.828-.78-.78-2.046-.78-2.827 0L66.97 30.2c-.78.783-.78 2.048 0 2.83.78.78 2.047.78 2.826 0zM30.2 33.03c.78.78 2.046.78 2.827 0 .78-.782.78-2.047 0-2.83l-8.48-8.48-.004-.003c-.78-.78-2.047-.782-2.828 0-.78.78-.78 2.047 0 2.828L30.2 33.03zM69.832 67.004l-.002-.002c-.78-.78-2.046-.78-2.827 0-.78.783-.78 2.05 0 2.83l8.452 8.452c.782.782 2.048.782 2.83 0 .78-.78.78-2.046 0-2.828l-8.453-8.452zM30.264 66.908l-8.545 8.544-.005.004c-.78.78-.78 2.047 0 2.828.783.78 2.047.78 2.828 0l8.55-8.546c.78-.78.78-2.047 0-2.828-.78-.783-2.048-.783-2.83-.002zM50.125 30.003V30h-.248v.003C38.88 30.07 30 38.986 30 50c0 11.012 8.88 19.93 19.877 19.996V70h.248v-.004C61.123 69.93 70.003 61.014 70.003 50s-8.88-19.93-19.878-19.997zm-.105 35.995h-.035c-8.836-.01-15.982-7.16-15.982-15.998 0-8.837 7.146-15.99 15.98-16h.036C58.853 34.01 66 41.164 66 50c0 8.838-7.146 15.988-15.98 15.998z"}})},We=[],Ue={name:"iconAfternoon"},He=Ue,Ze=(0,S.Z)(He,qe,We,!1,null,null,null),Ye=Ze.exports,Ge=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("g",[n("path",{attrs:{d:"M97.5 75.71v-.052h-95v.053c-1.38 0-2.5 1.12-2.5 2.5s1.12 2.5 2.5 2.5h95c1.38 0 2.5-1.118 2.5-2.5s-1.12-2.5-2.5-2.5zM49.998 38.082c1.38 0 2.498-1.12 2.498-2.498V20.597c0-.002.003-.003.003-.005 0-1.38-1.122-2.5-2.5-2.5-1.383 0-2.502 1.12-2.502 2.5v14.993c0 1.378 1.12 2.497 2.5 2.497zM2.52 70.566h14.993c1.38 0 2.5-1.117 2.5-2.498s-1.12-2.5-2.5-2.5H2.52c-1.378 0-2.498 1.12-2.498 2.5s1.12 2.498 2.5 2.498zM82.54 65.568c-1.38 0-2.5 1.12-2.5 2.5s1.12 2.498 2.5 2.498h14.937c1.382 0 2.498-1.117 2.498-2.498 0-1.38-1.116-2.5-2.498-2.5H82.54zM74.732 46.863l10.6-10.596.002-.004c.977-.975.977-2.557 0-3.533-.975-.976-2.557-.976-3.532 0L71.2 43.33c-.976.978-.976 2.56 0 3.533.977.978 2.558.978 3.532 0zM25.262 46.863c.975.978 2.556.978 3.533 0 .975-.975.975-2.556 0-3.532L18.197 32.735l-.003-.004c-.977-.976-2.558-.977-3.533 0-.977.977-.975 2.558 0 3.533l10.602 10.6zM25.135 70.566h5.047c-.104-.822-.172-1.65-.172-2.498 0-11.043 8.93-19.98 19.97-19.99h.042c11.037.012 19.97 8.947 19.97 19.99 0 .848-.07 1.676-.173 2.498h5.046c.08-.822.123-1.656.123-2.498 0-13.762-11.095-24.902-24.836-24.984v-.005h-.312v.004c-13.738.082-24.83 11.225-24.83 24.984 0 .842.04 1.676.123 2.498z"}}),n("path",{attrs:{d:"M48.015 73.65v.002h.004c.007.01.018.014.025.023.11.107.227.203.354.29.06.04.124.066.188.102.08.044.157.093.242.128.08.033.162.05.242.074.076.022.148.05.225.065.232.045.467.048.703.027.71.062 1.44-.168 1.98-.71l7.062-7.065.004-.002c.977-.977.977-2.56 0-3.535s-2.56-.975-3.533 0l-3.23 3.23V51.894c0-1.38-1.118-2.498-2.5-2.498-1.378 0-2.497 1.12-2.497 2.498v13.96l-2.803-2.804c-.977-.976-2.557-.976-3.533 0-.975.978-.976 2.558 0 3.536l7.065 7.064z"}})])},Xe=[],Ve={name:"iconEvening"},Je=Ve,Ke=(0,S.Z)(Je,Ge,Xe,!1,null,null,null),Qe=Ke.exports,tn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("g",[n("path",{attrs:{d:"M97.5 75.71v-.052h-95v.053c-1.38 0-2.5 1.12-2.5 2.5s1.12 2.5 2.5 2.5h95c1.38 0 2.5-1.118 2.5-2.5s-1.12-2.5-2.5-2.5zM49.998 38.082c1.38 0 2.5-1.12 2.5-2.5V20.598l.002-.005c0-1.38-1.12-2.5-2.5-2.5s-2.5 1.12-2.5 2.5v14.992c0 1.38 1.118 2.498 2.498 2.498zM2.522 70.566h14.992c1.38 0 2.5-1.117 2.5-2.498s-1.12-2.5-2.5-2.5H2.527h-.005c-1.38 0-2.5 1.12-2.5 2.5s1.12 2.498 2.5 2.498zM82.54 65.568c-1.38 0-2.5 1.12-2.5 2.5s1.12 2.498 2.5 2.498h14.937c1.382 0 2.498-1.117 2.498-2.498 0-1.38-1.116-2.5-2.498-2.5H82.54zM74.732 46.864l10.6-10.597c0-.002.002-.002.002-.003.977-.975.977-2.557 0-3.534-.975-.975-2.557-.975-3.532 0L71.2 43.33c-.976.978-.976 2.558 0 3.534.977.977 2.558.977 3.532 0zM25.262 46.864c.975.977 2.556.977 3.533 0 .975-.976.976-2.556 0-3.533L18.198 32.735l-.003-.004c-.977-.975-2.558-.977-3.533 0-.977.977-.976 2.558 0 3.534l10.6 10.6zM25.135 70.566h5.047c-.103-.822-.17-1.65-.17-2.498 0-11.043 8.928-19.978 19.968-19.99h.042c11.038.012 19.97 8.947 19.97 19.99 0 .848-.07 1.676-.173 2.498h5.046c.08-.822.123-1.656.123-2.498 0-13.762-11.095-24.902-24.836-24.985v-.004h-.31v.003c-13.74.083-24.832 11.225-24.832 24.985 0 .842.04 1.676.123 2.498z"}}),n("path",{attrs:{d:"M51.985 50.122v-.002h-.004c-.007-.01-.018-.014-.025-.023-.11-.107-.227-.204-.354-.29-.06-.04-.124-.067-.188-.103-.08-.044-.157-.092-.242-.127-.08-.033-.162-.05-.243-.075-.076-.023-.148-.052-.224-.066-.233-.046-.467-.048-.703-.028-.71-.062-1.44.168-1.98.71l-7.063 7.065-.004.002c-.977.977-.977 2.56 0 3.535.977.977 2.56.975 3.534 0l3.228-3.23v14.386c0 1.38 1.12 2.498 2.5 2.498s2.5-1.12 2.5-2.498V57.918l2.802 2.803c.977.978 2.557.978 3.533 0 .975-.976.976-2.556 0-3.534l-7.065-7.064z"}})])},en=[],nn={name:"iconMorning"},sn=nn,an=(0,S.Z)(sn,tn,en,!1,null,null,null),on=an.exports,rn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("path",{attrs:{d:"M74.3 72.11c-.16-.69-.685-1.193-1.32-1.373-.105-.018-.207-.04-.312-.06-.223-.043-.445-.082-.667-.13-9.597-2.084-17.62-9.493-19.998-19.704h.002c-2.377-10.208 1.544-20.395 9.23-26.506.207-.166.424-.324.64-.483.005-.006.014-.012.02-.018.584-.432.885-1.18.71-1.93-.16-.687-.678-1.188-1.306-1.37-.126-.024-.254-.044-.38-.066-.204-.037-.408-.078-.614-.11-3.656-.573-7.48-.482-11.31.393v-.004l-.323.075.002.004C32.63 24.664 22.692 40.71 26.442 56.8l.004.006c3.748 16.087 19.752 26.09 35.837 22.444v.004l.15-.034.027-.008.013-.003c.01-.004.02-.005.03-.008l.104-.023v-.005c3.82-.91 7.294-2.518 10.322-4.647.212-.15.42-.307.627-.463l.044-.03c.575-.432.875-1.177.7-1.924zM61.76 75.53l-.002-.006-.175.04C47.46 78.838 33.378 70.07 30.088 55.95l.004-.002c-3.277-14.07 5.407-28.106 19.43-31.477l.002.004.185-.043c2.208-.513 4.416-.734 6.58-.684-7.028 7.08-10.365 17.502-7.932 27.947l.005.006c2.433 10.444 10.034 18.318 19.47 21.562-1.883.983-3.915 1.754-6.072 2.268z"}})},ln=[],pn={name:"iconNight"},mn=pn,cn=(0,S.Z)(mn,rn,ln,!1,null,null,null),dn=cn.exports,hn={name:"timeList",props:["list","title","icon"],components:{Icon:Re,Afternoon:Ye,Evening:Qe,Morning:on,Night:dn},data(){return{moment:l(),momentTimestampFormat:m,tzAbbr:""}},mounted(){var t=l()().format("x");this.tzAbbr=l().tz.zone(this.timezone).abbr(t)},computed:{showLockedTimezone(){var t="locked"===this.selectedAppointmentType.timezone_style,e=this.timezone!==this.timezoneLocal;return!(!t||!e)},...(0,o.rn)(["api","settings","timezone","translations"]),...(0,o.Se)(["selectedAppointmentType","timezoneLocal"])},methods:{selectTime(t){const e=l().tz(t,this.momentTimestampFormat,this.timezone);this.$emit("selectTime",e)}}},un=hn,yn=(0,S.Z)(un,$e,Oe,!1,null,"577cbdbc",null),fn=yn.exports,gn={name:"timeSelect",mixins:[H],props:["date"],components:{TimeSelectList:fn,Loading:z},data(){return{loading:!1,moment:l(),momentDateFormat:p,momentTimestampFormat:m}},mounted(){if(this.maybeSkipTimeSelection(),!this.tzAvailableSlots.length)return this.loading=!0,void this.maybeLoadAvailableSlots();this.loading=!1,this.windowLoadedMessage()},computed:{timeSlots(){return this.tzAvailableSlots.filter((t=>{var e=l()(t.start_date,this.momentTimestampFormat);return this.momentDate.isSame(e,"day")}))},nightSlots(){return this.timeSlots.filter((t=>{var e=l()(t.start_date,this.momentTimestampFormat).locale("en").format("HH");return e>=0&&e<6}))},morningSlots(){return this.timeSlots.filter((t=>{var e=l()(t.start_date,this.momentTimestampFormat).locale("en").format("HH");return e>=6&&e<12}))},afternoonSlots(){return this.timeSlots.filter((t=>{var e=l()(t.start_date,this.momentTimestampFormat).locale("en").format("HH");return e>=12&&e<18}))},eveningSlots(){return this.timeSlots.filter((t=>{var e=l()(t.start_date,this.momentTimestampFormat).locale("en").format("HH");return e>=18&&e<24}))},momentDate(){return l()(this.date,"YYYY-MM-DD").locale("en")},momentDateLocalized(){return l()(this.date,"YYYY-MM-DD")},slug(){return this.$route.params&&this.$route.params.slug?this.$route.params.slug:"unknown"},...(0,o.rn)(["settings","timezone","translations"]),...(0,o.Se)(["maxDay","minDay","selectedAppointmentType","tzAvailableSlots","windowLoadedMessage"])},methods:{loadAvailableSlots(){this.fetchAppointmentSlots({start_date_min:this.momentDate.clone().subtract(1,"day").tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.momentDate.clone().add(1,"day").tz(this.timezone).utc().format(this.momentDateFormat)}).then((()=>{this.tzAvailableSlots.length?(this.loading=!1,this.windowLoadedMessage()):this.$emit("selectNewDate",l()().format(this.momentDateFormat))})).catch((t=>{console.log(t)}))},maybeLoadAvailableSlots(){(this.momentDate.isBefore(this.minDay,"day")||this.momentDate.isAfter(this.maxDay,"day"))&&this.$emit("selectNewDate",l()().format(this.momentDateFormat)),this.loadAvailableSlots()},maybeSkipTimeSelection(){let t=this.selectedAppointmentType;if(Object.prototype.hasOwnProperty.call(t,"availability_type")&&"start_times"===t.availability_type){let e=this.momentDate.clone().locale("en").format("dddd");1===t.availability[e].length&&this.$emit("skipTime",this.timeSlots[0]["start_date"])}},selectTime(t){this.emitTrackingEvent("timeSelected"),this.$emit("input",t)},...(0,o.nv)(["fetchAppointmentSlots"])}},_n=gn,vn=(0,S.Z)(_n,je,xe,!1,null,null,null),bn=vn.exports,kn={name:"formType",props:["slug","date"],components:{TimezoneWarning:Xt,DateSelect:Ee,TimeSelect:bn},data(){return{appointmentStartDate:null,momentDateFormat:p,momentTimestampFormat:m}},mounted(){if(this.detectAppointmentTypeId(),!this.date){let t=l()().format(this.momentDateFormat);this.$router.replace(`/integration/form/type/${this.slug}/select/${t}`)}},computed:{appointmentDate:{get(){return this.appointmentStartDate},set(t){this.appointmentStartDate=t,t&&this.$router.push(`/integration/form/type/${this.slug}/select/${t}/time/`)}},appointmentTime:{get(){return null},set(t){t&&(this.addTimeToAppt(t),this.$router.push("/integration/form/confirmed"))}},...(0,o.Se)(["visibleAppointmentTypes"]),...(0,o.rn)(["appointment","timezone","translations"])},methods:{addTimeToAppt(t){var e=l().tz(t,this.momentTimestampFormat,this.timezone).utc().format(this.momentTimestampFormat);this.setAppointmentProp({key:"start_date",value:e}),this.setAppointmentProp({key:"customer_timezone",value:this.timezone})},detectAppointmentTypeId(t){t=t||this.slug;var e=this.visibleAppointmentTypes.find((e=>e.slug===t));e&&(this.setAppointmentTypeId(e.id),this.setAppointmentProp({key:"appointment_type_slug",value:t}))},handleNewStartDate(t){this.$router.replace(`/integration/form/type/${this.slug}/select/${t}`)},handleSkipDate(t){this.setDateFastForward(!0),this.appointmentDate=t,this.$router.replace(`/integration/form/type/${this.appointment.appointment_type_slug}/select/${t}/time/`)},handleSkipTime(t){this.setTimeFastForward(!0),this.addTimeToAppt(t),this.$router.push("/integration/form/confirmed")},...(0,o.OI)(["setAppointmentTypeId","setAppointmentProp","setDateFastForward","setTimeFastForward"])}},Tn=kn,wn=(0,S.Z)(Tn,Mt,It,!1,null,null,null),An=wn.exports,Cn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"confirm booking-form-integration"},[t.saving?n("loading",{attrs:{message:t.savingMessage}}):t.error?n("booking-error",{attrs:{label:t.translations.errors.heading,description:t.errorMesssage}},[n("md-button",{staticClass:"md-raised md-primary",on:{click:t.pickNewTime}},[t._v(" "+t._s(t.translations.errors.pickNewTime)+" ")])],1):[n("p",{staticClass:"md-title",staticStyle:{"margin-bottom":"0"}},[t._v(" "+t._s(t.selectedAppointmentType.title)+" ")]),n("appointment-start-end"),"pending_form"===this.appointment.status?n("md-button",{staticClass:"md-raised md-primary",staticStyle:{"margin-left":"0"},on:{click:t.editAppointment}},[t._v(" "+t._s(t.translations.change.changeTime)+" ")]):t._e()]],2)},Pn=[],Sn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("p",{staticClass:"md-subhead"},[n("span",{staticClass:"appointment-start-time"},[n("span",{staticClass:"appointment-start-d"},[t._v(" "+t._s(t.localTime.format(t.settings.global.date_format_moment))+" ")]),n("span",{staticClass:"appointment-start-t"},[t._v(" "+t._s(t.localTime.format(t.settings.global.time_format_moment))+" ")])]),n("span",{staticClass:"appointment-time-divider"},[t._v("-")]),n("span",{staticClass:"appointment-end-time"},[t.differentEndDate?n("span",{staticClass:"appointment-end-d"},[t._v(" "+t._s(t.endDate.format(t.settings.global.date_format_moment))+" ")]):t._e(),n("span",{staticClass:"appointment-end-t"},[t._v(" "+t._s(t.endDate.format(t.settings.global.time_format_moment))+" ")])]),n("span",{staticClass:"small appointment-timezone"},[t._v(" "+t._s(t.formatTimezone())+" ")])])},Dn=[],zn={name:"appointmentStartEnd",data(){return{moment:l()}},computed:{differentEndDate(){let t=this.localTime;return!t.isSame(this.endDate,"day")},endDate(){return this.localTime.clone().add(this.appointmentDuration,"minutes")},...(0,o.rn)(["settings"]),...(0,o.Se)(["formatTimezone","localTime","appointmentDuration"])}},Fn=zn,En=(0,S.Z)(Fn,Sn,Dn,!1,null,null,null),jn=En.exports,xn={name:"formConfirm",components:{Loading:z,AppointmentStartEnd:jn},data(){return{error:!1,errorMessage:"",fetchArgs:{},momentDateFormat:p,saving:!0,savingMessage:"",timeUnavailable:!1}},beforeMount(){(g().isEmpty(this.appointment)||g().isEmpty(this.selectedAppointmentType.title))&&this.$router.replace("/integration/form")},mounted(){this.setEditMode(!1),this.savingMessage=this.translations.booking.saving,this.handleSaveAppointment(),this.resetAvailabilityCache()},computed:{...(0,o.Se)(["minDay","selectedAppointmentType"]),...(0,o.rn)(["api","appointment","frozenType","timeConflict","timezone","translations"])},methods:{editAppointment(){this.setAppointmentProp({key:"status",value:"abandoned"}),window.parent.postMessage({ssaType:"appointment",id:null},this.api.home_url),this.frozenType?this.$router.push({path:`/integration/form/type/${this.selectedAppointmentType.slug}`}):(this.setAppointmentTypeId(null),this.$router.push("/integration/form")),this.handleClearAppointment()},handleBookingError(t){console.log(t),t.message?(this.errorMessage=t.message,"appointment_unavailable"===t.code&&(this.timeUnavailable=!0,this.setTimeConflict(!0)),this.resetRescheduleAppointment(),this.$router.push({path:`/integration/form/type/${this.selectedAppointmentType.slug}`})):this.errorMessage=this.translations.errors.intro+t,this.error=!0},handleClearAppointment(){this.setAppointmentProp({key:"update_local",value:!1}),this.saveAppointment(this.appointment).then((()=>{let t={};this.frozenType&&(t.appointment_type_id=this.appointment.appointment_type_id),this.setAppointment(t)})).catch((t=>{console.log(t)}))},handleSaveAppointment(){Object.prototype.hasOwnProperty.call(this.appointment,"id")?this.saveAppointment(this.appointment).then((()=>{this.saving=!1,window.parent.postMessage({ssaType:"appointment",id:this.appointment.id,start_date:this.appointment.start_date},this.api.home_url)})).catch((t=>{console.log(t),this.saving=!1,this.error=!0,this.errorMessage=this.translations.errors.bookingFailed})):(this.setAppointmentProp({key:"status",value:"pending_form"}),this.saveNewAppointment().then((()=>{this.saving=!1,window.parent.postMessage({ssaType:"appointment",id:this.appointment.id,start_date:this.appointment.start_date},this.api.home_url)})).catch((t=>{this.handleBookingError(t)})))},pickNewTime(){this.saving=!0,this.savingMessage=this.translations.general.loadingAvailableSlots,this.updateAppointmentSlots(),this.refreshArgs(),this.callAsync().then((()=>{this.fetchAppointmentSlots(this.fetchArgs).then((()=>{this.saving=!1,this.$router.push({path:`/integration/form/type/${this.selectedAppointmentType.slug}`})})).catch((t=>{console.log(t),this.saving=!1,this.setConnectionError(!0)}))}))},refreshArgs(){let t=l().utc(),e=l().utc(this.appointment.start_date,this.momentDateFormat).startOf("day"),n=e.clone().subtract(15,"days").startOf("day"),i=l().max(t,n),s=i.clone().add(30,"days");this.fetchArgs={start_date_min:i.format(this.momentDateFormat),start_date_max:s.format(this.momentDateFormat)}},resetAvailabilityCache(){let t="month"===this.selectedAppointmentType.booking_layout?75:55;this.fetchAppointmentSlots({start_date_min:this.minDay.clone().tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.minDay.clone().add(t,"days").tz(this.timezone).utc().format(this.momentDateFormat)}).then((()=>{})).catch((t=>{console.log(t)}))},...(0,o.nv)(["callAsync","fetchAppointmentSlots","saveAppointment","saveNewAppointment","updateAppointmentSlots"]),...(0,o.OI)(["resetRescheduleAppointment","setAppointment","setAppointmentTypeId","setAppointmentProp","setConnectionError","setEditMode","setTimeConflict"])}},$n=xn,On=(0,S.Z)($n,Cn,Pn,!1,null,null,null),Mn=On.exports,In=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("loading")},Ln=[],Bn={name:"loadSelected",components:{Loading:z},props:["id"],data(){return{}},mounted(){this.setAppointmentProp({key:"id",value:this.id}),this.fetchAppointment().then((()=>{"pending_form"===this.appointment.status||"booked"===this.appointment.status?this.showConfirmation():this.returnToSelect()})).catch((t=>{console.log(t),this.returnToSelect()}))},computed:{...(0,o.rn)(["appointment","frozenType","timezone"])},methods:{returnToSelect(){"abandoned"===this.appointment.status&&window.parent.postMessage({ssaType:"appointment",id:null}),this.frozenType?this.$router.push("/integration/form/type/"):this.$router.push("/integration/form")},showConfirmation(){this.timezone||this.setTimezone(this.appointment.customer_timezone),this.$router.push("/integration/form/confirmed")},...(0,o.nv)(["fetchAppointment"]),...(0,o.OI)(["setAppointmentProp","setTimezone"])}},Nn=Bn,Rn=(0,S.Z)(Nn,In,Ln,!1,null,null,null),qn=Rn.exports,Wn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"booking"},[n("select-header"),n("timezone-warning"),n("transition",{attrs:{name:"fade"}},["date"===t.$route.name?n("date-select",{key:"date",attrs:{date:t.date,slug:t.slug},on:{updateStartDate:t.handleNewStartDate,skipDate:t.handleSkipDate},model:{value:t.appointmentDate,callback:function(e){t.appointmentDate=e},expression:"appointmentDate"}}):t._e(),"time"===t.$route.name?n("time-select",{key:"time",attrs:{date:t.date},on:{selectNewDate:t.handleNewStartDate,skipTime:t.handleSkipTime},model:{value:t.appointmentTime,callback:function(e){t.appointmentTime=e},expression:"appointmentTime"}}):t._e()],1)],1)},Un=[],Hn={name:"typeSelect",props:["slug","date"],components:{SelectHeader:Et,TimezoneWarning:Xt,DateSelect:Ee,TimeSelect:bn},data(){return{appointmentStartDate:null,momentDateFormat:p,momentTimestampFormat:m}},mounted(){if(this.detectAppointmentTypeId(),!this.date){let t=l()().locale("en").format(this.momentDateFormat);this.$router.replace(`/type/${this.slug}/select/${t}`)}},computed:{appointmentDate:{get(){return this.appointmentStartDate},set(t){this.appointmentStartDate=t,t&&this.$router.push(`/type/${this.slug}/select/${t}/time/`)}},appointmentTime:{get(){return null},set(t){t&&(this.addTimeToAppt(t),this.$router.push("/book"))}},...(0,o.rn)(["appointment","timezone","translations"]),...(0,o.Se)(["visibleAppointmentTypes"])},methods:{addTimeToAppt(t){var e=l().tz(t,this.momentTimestampFormat,this.timezone).utc().locale("en").format(this.momentTimestampFormat);this.setAppointmentProp({key:"start_date",value:e}),this.setAppointmentProp({key:"customer_timezone",value:this.timezone})},detectAppointmentTypeId(t){t=t||this.slug;var e=this.visibleAppointmentTypes.find((e=>e.slug===t));e&&(this.setAppointmentTypeId(e.id),this.setAppointmentProp({key:"appointment_type_slug",value:t}))},handleNewStartDate(t){this.$router.replace(`/type/${this.slug}/select/${t}`)},handleSkipDate(t){this.setDateFastForward(!0),this.appointmentDate=t,this.$router.replace(`/type/${this.appointment.appointment_type_slug}/select/${t}/time/`)},handleSkipTime(t){this.setTimeFastForward(!0),this.addTimeToAppt(t),this.$router.push("/book")},...(0,o.OI)(["setAppointmentTypeId","setAppointmentProp","setDateFastForward","setTimeFastForward"])}},Zn=Hn,Yn=(0,S.Z)(Zn,Wn,Un,!1,null,null,null),Gn=Yn.exports,Xn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"confirm"},[t.saving?n("loading",{attrs:{message:t.savingMessage}}):t.error?n("booking-error",{attrs:{label:t.translations.errors.heading,description:t.errorMessage}},[n("md-button",{staticClass:"md-raised md-primary",on:{click:t.pickNewTime}},[t._v(t._s(t.translations.errors.pickNewTime))])],1):[n("md-card",[n("md-card-header",[n("md-card-header-text",[n("h1",{staticClass:"md-title"},[t._v(" "+t._s(t.translations.booking.infoHeader)+" "+t._s(t.selectedAppointmentType.title)+" ")]),n("appointment-start-end")],1)],1),n("md-card-content",[t.selectedAppointmentType.instructions?n("p",{staticClass:"md-subheading"},[t._v(t._s(t.selectedAppointmentType.instructions))]):t._e(),t.processing?n("payment-processing",{attrs:{message:t.processingMessage}}):[n("form",{attrs:{novalidate:""},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.saveFields.apply(null,arguments)}}},[t.settings.installed.license?n("customer-information-plus",{on:{validate:t.maybeCheckRequired,validatePhone:t.checkPhone}}):n("customer-information-basic",{on:{validate:t.maybeCheckRequired,validatePhone:t.checkPhone}})],1),t.showPaymentUI(t.selectedAppointmentType)?n("payment-options",{ref:"_paymentOptions"}):t._e(),t.modeEdit&&parseFloat(t.appointment.payment_received)?n("p",[n("strong",[t._v(t._s(t.translations.payments.paymentReceived))]),t.appointment.payment_received?[n("currency-code",{attrs:{price:t.appointment.payment_received,currency:t.selectedAppointmentType.payments.currency}})]:t._e()],2):t._e()]],2),n("md-card-actions",[t.modeEdit?n("md-button",{staticClass:"md-raised md-primary",on:{click:t.bookAppointment}},[t._v(t._s(t.translations.booking.updateButton)+" ")]):t.showPaymentUI(t.selectedAppointmentType)&&"stripe"===t.appointment.payment_method?n("stripe",{attrs:{valid:t.valid,processing:t.processing},on:{validate:t.checkRequired,paymentSuccessful:t.handleSuccessfulPayment,paymentFailed:t.handleFailedPayment,processPayment:t.checkPayment,checkAppointment:t.checkAppointment,appointmentSaved:t.stopProcessing,bookingError:t.handleBookingError}}):t.showPaymentUI(t.selectedAppointmentType)&&"paypal"===t.appointment.payment_method?n("paypal",{attrs:{valid:t.valid,processing:t.processing},on:{validate:t.checkRequired,savePayment:t.showSaving,processPayment:t.checkPayment,checkAppointment:t.checkAppointment,appointmentSaved:t.stopProcessing,bookingError:t.handleBookingError}}):n("md-button",{staticClass:"md-raised md-primary",on:{click:t.bookAppointment}},[t._v(t._s(t.translations.booking.bookButton))])],1)],1),n("md-snackbar",{ref:"bookingError",attrs:{"md-position":"top center"}},[n("span",[t._v(t._s(t.translations.errors.bookingFailed))]),n("md-button",{staticClass:"md-primary",on:{click:function(e){return t.$refs.bookingError.close()}}},[t._v(t._s(t.translations.errors.retry))])],1),n("md-snackbar",{ref:"paymentError",attrs:{"md-position":"top center"}},[n("span",[t._v(t._s(t.paymentError))])]),n("md-snackbar",{ref:"paymentCanceled",attrs:{"md-position":"top center"}},[n("span",[t._v(t._s(t.translations.payments.canceled))])])]],2)},Vn=[],Jn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"basic"},t._l(t.fields,(function(e,i){return n("md-input-container",{key:i,class:{"md-input-invalid":e.error,"vue-tel-input-container":"Phone"===e.field}},[n("md-icon",[t._v(t._s(e.icon))]),n("label",{attrs:{for:t.slugify(e.field)}},[t._v(" "+t._s(t.translations.appointmentTypes.customer_information[e.field])+" ")]),"notes"===e.field?n("md-textarea",{attrs:{id:t.slugify(e.field),required:e.required,name:t.slugify(e.field),"aria-describedby":!!e.error&&t.slugify(e.field)+"-error"},on:{blur:t.validate},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}}):"Phone"===e.field?n("telephone",{attrs:{placeholder:"",name:t.slugify(e.field),required:e.required,"input-options":{"aria-describedby":t.slugify(e.field)+"-error "+t.slugify(e.field)+"-helper",id:t.slugify(e.field)}},on:{validate:function(n){return t.checkPhone(e.field,e.required,n)}},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}}):n("md-input",{attrs:{id:t.slugify(e.field),required:e.required,"aria-describedby":!!e.error&&t.slugify(e.field)+"-error"},on:{blur:t.validate},nativeOn:{keyup:function(n){return t.checkEmail(e)}},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}}),e.error?n("span",{staticClass:"md-error",attrs:{id:t.slugify(e.field)+"-error"}},["Email"===e.field?[t._v(" "+t._s(t.translations.errors.requiredEmail)+" ")]:"Phone"===e.field?[t._v(" "+t._s(t.translations.errors.requiredPhone)+" ")]:[t._v(" "+t._s(t.translations.appointmentTypes.customer_information[e.field])+" "+t._s(t.translations.errors.requiredField)+" ")]],2):t._e()],1)})),1)},Kn=[],Qn=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("vue-tel-input",{ref:"telephone",attrs:{"input-options":t.inputOptions,"dropdown-options":t.dropdownOptions,value:t.value,"auto-default-country":!1,"default-country":t.telCountryCode,mode:"international"},on:{input:t.handleInput,validate:t.validate}})},ti=[],ei={name:"vue-telephone",props:{value:{type:String},placeholder:{type:String,default:"Enter a phone number"},disabled:{type:Boolean,default:!1},id:{type:String,default:""},required:{type:Boolean,default:!1},name:{type:String,default:"telephone"},dropdownOptions:{type:Object,default(){return{disabled:!1,showDialCodeInList:!0,showDialCodeInSelection:!1,showFlags:!0,showSearchBox:!1,tabindex:0,width:"390px"}}},inputOptions:{type:Object,default:()=>({})}},data(){return{container:null,input:null,valid:!0}},mounted(){this.input=this.$refs.telephone.$el.querySelector("input"),this.container=y()(this.input).parents(".md-input-container"),this.styleContainer(),this.input.addEventListener("focus",this.toggleFocus),this.input.addEventListener("blur",this.toggleFocus)},updated(){this.styleContainer()},beforeDestroy(){this.input.removeEventListener("blur",this.toggleFocus),this.input.removeEventListener("focus",this.toggleFocus)},computed:{...(0,o.rn)(["settings","telCountryCode"])},methods:{handleInput(t){this.$emit("input",t),this.$nextTick((()=>{this.styleContainer()}))},styleContainer(){this.value?y()(this.container).addClass("md-has-value"):y()(this.container).removeClass("md-has-value"),this.required&&y()(this.container).addClass("md-input-required")},toggleFocus(t){"focus"===t.type?y()(this.container).addClass("md-input-focused"):y()(this.container).removeClass("md-input-focused"),this.$nextTick((()=>{this.styleContainer()}))},validate(t){this.required?this.valid=!t.number||t.valid:this.valid=!(!t.number||0!==t.number.length)||t.valid,this.$emit("validate",this.valid)}}},ni=ei,ii=(0,S.Z)(ni,Qn,ti,!1,null,"6f28a5cc",null),si=ii.exports,ai={name:"customerInformationBasic",components:{Telephone:si},data(){return{information:{},wpAccountInfo:window.ssa_customer_information_defaults?window.ssa_customer_information_defaults:null}},watch:{information:{handler(){this.setAppointmentProp({key:"customer_information",value:this.information})},deep:!0}},beforeMount(){this.modeEdit?this.information=g().cloneDeep(this.appointment.customer_information):(this.selectedAppointmentType.title&&this.fields.forEach((t=>{let e="";this.appointment.customer_information&&Object.prototype.hasOwnProperty.call(this.appointment.customer_information,t.field)&&(e=this.appointment.customer_information[t.field]),this.$set(this.information,t.field,e)})),this.wpAccountInfo&&Object.keys(this.wpAccountInfo).map((t=>{Object.prototype.hasOwnProperty.call(this.information,t)&&!this.information[t]&&this.$set(this.information,t,this.wpAccountInfo[t])})),this.setAppointmentProp({key:"customer_information",value:this.information}))},computed:{fields(){return this.selectedAppointmentType.customer_information.filter((t=>t.display))},...(0,o.Se)(["selectedAppointmentType","slugify"]),...(0,o.rn)(["translations","appointment","modeEdit"])},methods:{checkEmail(t){"Email"===t.field&&t.error&&this.$emit("validate")},checkPhone(t,e,n){let i={field:t,valid:!!n};e||this.information[t]||(i.valid=!0),this.$emit("validatePhone",i)},validate(){this.$emit("validate")},...(0,o.OI)(["setAppointmentProp"])}},oi=ai,ri=(0,S.Z)(oi,Jn,Kn,!1,null,null,null),li=ri.exports,pi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"plus"},[t._l(t.selectedAppointmentType.custom_customer_information,(function(e,i){return n("div",{key:i,class:"field-"+t.slugify(e.field)+"-"+i},["single-text"===e.type||"multi-text"===e.type?n("md-input-container",{class:{"md-input-invalid":e.error,"md-input-long-label":e.field.length>50}},[n("md-icon",[t._v(t._s(e.icon))]),n("label",{attrs:{for:t.slugify(e.field)}},[t._v(" "+t._s(t.translations.appointmentTypes.customer_information[e.field]?t.translations.appointmentTypes.customer_information[e.field]:e.field)+" ")]),"single-text"===e.type?n("md-input",{attrs:{id:t.slugify(e.field),"aria-describedby":t.slugify(e.field)+"-error",required:e.required},on:{blur:t.validate},nativeOn:{keyup:function(n){return t.checkEmail(e)}},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}}):n("md-textarea",{attrs:{id:t.slugify(e.field),"aria-describedby":t.slugify(e.field)+"-error",required:e.required},on:{blur:t.validate},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}}),e.error?n("span",{staticClass:"md-error",attrs:{id:t.slugify(e.field)+"-error"}},["Email"===e.field?[t._v(" "+t._s(t.translations.errors.requiredEmail)+" ")]:[t._v(" "+t._s(t.translations.appointmentTypes.customer_information[e.field]?t.translations.appointmentTypes.customer_information[e.field]:e.field)+" "+t._s(t.translations.errors.requiredField)+" ")]],2):e.instructions?n("span",{staticClass:"md-helper-text",domProps:{innerHTML:t._s(e.instructions)}}):t._e()],1):t._e(),"phone"===e.type?[n("md-input-container",{staticClass:"vue-tel-input-container",class:{"md-input-invalid":e.error}},[n("md-icon",[t._v(t._s(e.icon))]),n("label",{attrs:{for:t.slugify(e.field)}},[t._v(t._s(e.field))]),n("telephone",{attrs:{placeholder:"",name:t.slugify(e.field),"input-options":{"aria-describedby":t.slugify(e.field)+"-error "+t.slugify(e.field)+"-helper",id:t.slugify(e.field)},required:e.required},on:{validate:function(n){return t.checkPhone(e.field,e.required,n)}},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}}),e.error?n("span",{staticClass:"md-error",attrs:{id:t.slugify(e.field)+"-error"}},[t._v(" "+t._s(t.translations.errors.requiredPhone)+" ")]):e.instructions?n("span",{staticClass:"md-helper-text",attrs:{id:t.slugify(e.field)+"-helper"},domProps:{innerHTML:t._s(e.instructions)}}):t._e()],1),t.selectedAppointmentType.has_sms&&t.firstPhoneIndex===i?n("md-checkbox",{staticClass:"md-primary",staticStyle:{"margin-top":"0","margin-left":"36px"},attrs:{id:"allow-sms",name:"allow-sms"},model:{value:t.allow_sms,callback:function(e){t.allow_sms=e},expression:"allow_sms"}},[t._v(" "+t._s(t.translations.booking.smsOptIn)+" ")]):t._e()]:t._e(),"checkboxes"===e.type||"radios"===e.type?n("fieldset",[n("legend",{staticClass:"md-subheading"},[n("md-icon",[t._v(t._s(e.icon))]),t._v(" "+t._s(e.field)+" "),e.required?n("span",{staticClass:"required"},[t._v("*")]):t._e()],1),e.error?n("p",{staticClass:"error-message"},[t._v(t._s(e.field)+" "+t._s(t.translations.errors.requiredField))]):e.instructions?n("p",{staticClass:"helper-message",domProps:{innerHTML:t._s(e.instructions)}}):t._e(),n("md-list",t._l(e.values,(function(s,a){return n("md-list-item",{key:a},["checkboxes"===e.type?n("md-checkbox",{staticClass:"md-primary",attrs:{id:t.slugify(e.field)+"-"+a,name:t.slugify(e.field),"md-value":s},on:{change:t.validate},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}},[t._v(t._s(s))]):t._e(),"radios"===e.type?n("md-radio",{staticClass:"md-primary",attrs:{id:t.slugify(e.field)+"-"+a,name:"field-"+i,"md-value":s},on:{change:t.validate},model:{value:t.information[e.field],callback:function(n){t.$set(t.information,e.field,n)},expression:"information[field.field]"}},[t._v(t._s(s))]):t._e()],1)})),1)],1):t._e()],2)})),t.settings.installed.mailchimp&&t.settings.mailchimp.enabled&&t.selectedAppointmentType.mailchimp.optin_list?n("md-checkbox",{staticClass:"md-primary",attrs:{"md-value":t.selectedAppointmentType.mailchimp.optin_list,name:"mailchimp-optin",id:"mailchimp-optin"},model:{value:t.mailchimp_list_id,callback:function(e){t.mailchimp_list_id=e},expression:"mailchimp_list_id"}},[t._v(" "+t._s(t.selectedAppointmentType.mailchimp.optin_text)+" ")]):t._e()],2)},mi=[];const ci=t=>{let e=typeof t;switch(e){case"string":{let e=parseInt(t,10);return isNaN(e)?"true"===t:Boolean(e)}case"number":return Boolean(t);case"boolean":return t;default:return!!t}};var di={name:"customerInformationPlus",components:{Telephone:si},data(){return{information:{},wpAccountInfo:window.ssa_customer_information_defaults?window.ssa_customer_information_defaults:null}},watch:{information:{handler(){this.setAppointmentProp({key:"customer_information",value:this.information})},deep:!0}},beforeMount(){this.selectedAppointmentType.title&&this.selectedAppointmentType.custom_customer_information.forEach((t=>{let e="checkboxes"===t.type?[]:"";this.appointment.customer_information&&Object.prototype.hasOwnProperty.call(this.appointment.customer_information,t.field)&&(e=this.appointment.customer_information[t.field]),this.$set(this.information,t.field,e)})),this.wpAccountInfo&&Object.keys(this.wpAccountInfo).map((t=>{Object.prototype.hasOwnProperty.call(this.information,t)&&!this.information[t]&&this.$set(this.information,t,this.wpAccountInfo[t])})),this.setAppointmentProp({key:"customer_information",value:this.information})},mounted(){Object.prototype.hasOwnProperty.call(this.settings,"sms")&&!1===ci(this.settings.sms.opt_in)&&this.setAppointmentProp({key:"allow_sms",value:!0})},computed:{mailchimp_list_id:{get(){return this.appointment.mailchimp_list_id},set(t){this.setAppointmentProp({key:"mailchimp_list_id",value:t})}},allow_sms:{get(){return this.appointment.allow_sms},set(t){this.setAppointmentProp({key:"allow_sms",value:t})}},firstPhoneIndex(){if(!this.selectedAppointmentType.has_sms)return-1;let t=this.selectedAppointmentType.custom_customer_information;return t.findIndex((t=>"phone"===t.type))},...(0,o.Se)(["selectedAppointmentType","slugify"]),...(0,o.rn)(["translations","appointment","settings"])},methods:{checkEmail(t){"Email"===t.field&&t.error&&this.$emit("validate")},checkPhone(t,e,n){let i={field:t,valid:n};e||this.information[t]||(i.valid=!0),this.$emit("validatePhone",i)},validate(){this.$emit("validate")},...(0,o.OI)(["setAppointmentProp"])}},hi=di,ui=(0,S.Z)(hi,pi,mi,!1,null,"2d7e7d47",null),yi=ui.exports,fi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",["stripe"===t.payment_method?n("loading",{attrs:{message:t.message}}):n("empty",{attrs:{label:t.message,description:t.translations.booking.paypalMessage}},[n("md-spinner",{staticClass:"app-spinner",attrs:{"md-indeterminate":""}})],1)],1)},gi=[],_i={name:"paymentProcessing",components:{Loading:z,Empty:ie},props:["message"],data(){return{}},computed:{payment_method(){return this.appointment.payment_method.toLowerCase()},...(0,o.rn)(["appointment","translations"])}},vi=_i,bi=(0,S.Z)(vi,fi,gi,!1,null,null,null),ki=bi.exports,Ti=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"payment-options"},[n("div",{staticClass:"price-row"},[n("div",{staticClass:"label"},[t._v(t._s(t.translations.payments.price))]),n("div",{staticClass:"value"},[n("currency-code",{attrs:{price:t.selectedAppointmentType.payments.price,currency:t.selectedAppointmentType.payments.currency}})],1)]),n("div",{staticClass:"price-row"},[n("div",{staticClass:"label"},[t._v(t._s(t.translations.payments.paymentMethod))]),n("div",{staticClass:"value"},[n("fieldset",[n("legend",{staticClass:"screen-reader-text"},[t._v(t._s(t.translations.payments.paymentMethod))]),n("ul",{staticClass:"check-list"},[t._l(t.enabled_payment_methods,(function(e,i){return n("li",{key:e},[n("md-radio",{attrs:{id:"payment_method_"+i,name:"payment_method","md-value":e},model:{value:t.payment_method,callback:function(e){t.payment_method=e},expression:"payment_method"}},[t._v(t._s(t.settings[e].title))])],1)})),"optional"===t.selectedAppointmentType.payments.payment_required?n("li",[n("md-radio",{attrs:{id:"pay_later",name:"payment_method","md-value":"pay_later"},model:{value:t.payment_method,callback:function(e){t.payment_method=e},expression:"payment_method"}},[t._v(" "+t._s(t.translations.payments.payLater)+" ")])],1):t._e()],2),n("p",{staticClass:"payment-description"},[t._v(t._s(t.payment_method_description))])])])]),t.selectedAppointmentType.payments.refund_policy?n("div",{staticClass:"price-row"},[n("div",{staticClass:"label"},[t._v(t._s(t.translations.payments.refundPolicy))]),n("div",{staticClass:"value"},[n("span",[t._v(" "+t._s(t.selectedAppointmentType.payments.refund_policy)+" ")]),t.refundPolicyRequired?n("div",[n("md-checkbox",{staticClass:"md-primary",class:{"policy-box_error":t.displayPolicyRequiredError},attrs:{id:"refund_policy_required",name:"refund_policy_required","aria-required":"true","aria-describedby":"refund-policy-error"},model:{value:t.isRefundPolicyChecked,callback:function(e){t.isRefundPolicyChecked=e},expression:"isRefundPolicyChecked"}},[t._v(" "+t._s(t.selectedAppointmentType.payments.refund_policy_checkbox_label+"*")+" ")]),t.displayPolicyRequiredError?n("p",{staticClass:"policy-box_error-message",attrs:{id:"refund-policy-error"}},[t._v(" "+t._s(t.translations.errors.fieldRequired)+" ")]):t._e()],1):t._e()])]):t._e()])},wi=[],Ai={name:"paymentOptions",components:{CurrencyCode:J},data(){return{valid:!0,displayPolicyRequiredError:!1,isRefundPolicyChecked:!1}},mounted(){this.setAppointmentProp({key:"payment_method",value:this.appointment.payment_method?this.appointment.payment_method:this.enabled_payment_methods[0]})},computed:{payment_method:{get(){return this.appointment.payment_method},set(t){this.setAppointmentProp({key:"payment_method",value:t})}},payment_method_description(){let t=this.appointment.payment_method;if(t)return this.settings?.[t]?.description},enabled_payment_methods(){return this.selectedAppointmentType.payments.payment_methods.filter((t=>this.settings[t].enabled))},refundPolicyRequired(){return!!this.selectedAppointmentType.payments?.refund_policy_required&&ci(this.selectedAppointmentType.payments.refund_policy_required)},...(0,o.rn)(["appointment","settings","translations"]),...(0,o.Se)(["selectedAppointmentType"])},methods:{validate(){return this.refundPolicyRequired&&(this.valid=this.isRefundPolicyChecked,this.displayPolicyRequiredError=!this.valid),this.valid},...(0,o.OI)(["setAppointmentProp"])}},Ci=Ai,Pi=(0,S.Z)(Ci,Ti,wi,!1,null,"8a80acf0",null),Si=Pi.exports,Di=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("md-button",{staticClass:"md-primary md-raised",attrs:{disabled:t.processing},on:{click:t.checkFields}},[t._v(" "+t._s(t.translations.payments.stripe.bookAndPayLabel)+" ")]),n("md-dialog",{ref:"paymentForm",staticClass:"ssa-stripe-dialog"},[t.loading?n("loading",{staticClass:"ssa-stripe-loading",attrs:{message:t.loadingMessage}}):t._e(),n("form",{staticClass:"ssa-stripe-form",class:{hidden:t.loading},on:{submit:function(e){return e.preventDefault(),t.validateThenProcessPayment.apply(null,arguments)}}},[n("img",{staticClass:"ssa-stripe-logo",attrs:{src:t.stripe_image_url}}),n("md-dialog-title",[t._v(t._s(t.stripe_description))]),n("md-dialog-content",[t.error?n("notification",{attrs:{icon:"error",theme:"red"}},[t._v(" "+t._s(t.error)+" ")]):t._e(),n("div",{attrs:{id:"ssa-stripe-payment"}})],1),n("md-dialog-actions",{staticClass:"ssa-stripe-actions"},[n("md-button",{staticClass:"ssa-stripe-cancel-btn",on:{click:t.closeHandler}},[t._v(t._s(t.translations.payments.stripe.cancel))]),n("md-button",{staticClass:"ssa-stripe-confirm-btn md-primary md-raised",attrs:{type:"submit"}},[t._v(t._s(t.translations.payments.stripeLabel))])],1)],1)],1)],1)},zi=[],Fi={name:"paymentStripe",components:{Notification:Ht,Loading:z},props:{valid:Boolean,processing:Boolean},data(){return{token:"",paymentEl:null,stripe:null,elements:null,error:null,secret:null,loading:!1,loaded:!1,confirming:!1}},mounted(){this.stripe=window.Stripe(this.publishable_key),window.addEventListener("popstate",this.closeHandler)},beforeDestroy(){this.paymentEl&&this.paymentEl.destroy(),window.removeEventListener("popstate",this.closeHandler)},computed:{publishable_key(){return this.settings.stripe.test_mode_enabled?this.settings.stripe.test_publishable_key:this.settings.stripe.publishable_key},stripe_image_url(){return this.api.site_icon_url?this.api.site_icon_url:this.api.booking_static_url+"/images/payments/stripe.png"},stripe_name(){return this.settings.global.company_name},stripe_description(){return this.selectedAppointmentType.title+" "+this.displayStartTime+" "+this.formatTimezone()},stripe_price(){return"JPY"===this.selectedAppointmentType.payments.currency?this.selectedAppointmentType.payments.price:100*this.selectedAppointmentType.payments.price},stripe_currency(){return this.selectedAppointmentType.payments.currency},loadingMessage(){return this.confirming?this.translations.payments.stripe.processing:this.translations.payments.loading},...(0,o.rn)(["api","appointment","settings","translations"]),...(0,o.Se)(["selectedAppointmentType","displayStartTime","formatTimezone"])},methods:{openHandler(){this.$refs.paymentForm.open(),this.$nextTick((()=>{this.initializePaymentForm()}))},bookAppointment(){let t=Object.prototype.hasOwnProperty.call(this.appointment,"id")&&this.appointment.id;t?this.saveAppointment(this.appointment):this.saveNewAppointment()},checkAppointment(){let t=Object.prototype.hasOwnProperty.call(this.appointment,"id")&&this.appointment.id;this.$emit("checkAppointment"),t?this.saveAppointment(this.appointment).then((()=>{this.$emit("appointmentSaved"),this.openHandler()})).catch((t=>{console.log(t),this.$emit("bookingError",t)})):this.saveNewAppointment().then((()=>{this.$emit("appointmentSaved"),this.openHandler()})).catch((t=>{console.log(t),this.$emit("bookingError",t)}))},checkFields(t){this.$emit("validate"),this.$nextTick((()=>{this.valid&&(this.checkAppointment(),t.preventDefault())}))},closeHandler(){this.$refs.paymentForm.close()},initializePaymentForm(){this.loading=!0,this.createPaymentIntent({receipt_email:this.appointment.customer_information.Email,price:this.stripe_price,currency:this.stripe_currency,description:this.stripe_description,name:this.stripe_name}).then((t=>{this.secret=t,this.elements=this.stripe.elements({clientSecret:t}),this.paymentEl=this.elements.create("payment"),this.loading=!1,this.$nextTick((()=>{this.paymentEl.mount("#ssa-stripe-payment")}))}))},validateThenProcessPayment(){this.elements.submit().then((t=>{t.error||this.processPayment()}))},processPayment(){this.loading=!0,this.confirming=!0,this.error=null,this.stripe.confirmPayment({elements:this.elements,confirmParams:{return_url:this.stripe_return_url()},redirect:"if_required"}).then((t=>{if(t.error)"card_error"===t.error.type||"validation_error"===t.error.type?this.error=t.error.message:this.error=this.translations.payments.paymentFailed,this.savePayment({appointment_id:this.appointment.id,appointment_token:this.appointment.public_token,gateway:"stripe",gateway_payload:t}),this.checkPayment(t.error?.payment_intent);else{const e=t.paymentIntent;this.closeHandler(),this.checkPayment(e)}this.loading=!1,this.confirming=!1}))},checkPayment(t){switch(t?.status){case"succeeded":case"processing":this.$emit("processPayment"),this.savePayment({appointment_id:this.appointment.id,appointment_token:this.appointment.public_token,gateway:"stripe",gateway_payload:t}).then((()=>{this.$emit("paymentSuccessful")})).catch((t=>{this.$emit("paymentFailed",t)}));break;case"requires_payment_method":this.$emit("paymentFailed","Your payment was not successful, please try again");break;default:this.$emit("paymentFailed","Something went wrong.");break}},stripe_return_url(){if(!this.appointment.public_edit_url)return"";let t=new URL(window.top.location.href);return window.ssa_embed_settings&&window.ssa_embed_settings.redirect_url&&(t=new URL(window.ssa_embed_settings.redirect_url)),t.searchParams.append("appointment_token",this.appointment.public_token+this.appointment.id),t.href.includes("wp-admin")&&(t=new URL(this.appointment.public_edit_url)),t.searchParams.append("stripe_payment",1),t["href"]},...(0,o.nv)(["saveNewAppointment","saveAppointment","savePayment","createPaymentIntent"])}},Ei=Fi,ji=(0,S.Z)(Ei,Di,zi,!1,null,null,null),xi=ji.exports,$i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{ref:"paypal_form",attrs:{action:t.paypal_form_url,novalidate:"",method:"post",target:"_parent"},on:{submit:function(e){return e.stopPropagation(),e.preventDefault(),t.validate.apply(null,arguments)}}},[n("input",{attrs:{type:"hidden",name:"SOLUTIONTYPE",value:"Sole"}}),n("input",{attrs:{type:"hidden",name:"cmd",value:"_xclick"}}),n("input",{attrs:{type:"hidden",name:"upload",value:"1"}}),n("input",{attrs:{type:"hidden",name:"business"},domProps:{value:t.settings.paypal.email}}),n("input",{attrs:{type:"hidden",name:"currency_code"},domProps:{value:t.paypal_currency}}),n("input",{attrs:{type:"hidden",name:"item_name"},domProps:{value:t.paypal_item_name}}),n("input",{attrs:{type:"hidden",name:"amount"},domProps:{value:t.paypal_price}}),n("input",{attrs:{type:"hidden",name:"item_number"},domProps:{value:t.appointment.id}}),n("input",{attrs:{type:"hidden",name:"custom"},domProps:{value:"ssa_"+t.appointment.payment_id}}),n("input",{attrs:{type:"hidden",name:"return"},domProps:{value:t.paypal_success_return_url}}),n("input",{attrs:{type:"hidden",name:"cancel_return"},domProps:{value:t.paypal_cancel_return_url}}),n("input",{attrs:{type:"hidden",name:"notify_url"},domProps:{value:t.settings.paypal.ipn_url}}),n("input",{attrs:{type:"hidden",name:"email"},domProps:{value:t.appointment.customer_information.Email}}),n("input",{attrs:{type:"hidden",name:"invoice"},domProps:{value:t.appointment.purchase_key}}),n("md-button",{staticClass:"md-primary md-raised",attrs:{type:"submit"}},[t._v(" "+t._s(t.translations.payments.paypal.bookAndPayLabel)+" ")])],1)},Oi=[],Mi={name:"paymentPaypal",props:{valid:Boolean,processing:Boolean},data(){return{}},computed:{paypal_item_name(){return this.selectedAppointmentType.title+" "+this.displayStartTime+" "+this.formatTimezone()},paypal_price(){return this.selectedAppointmentType.payments.price},paypal_currency(){return this.selectedAppointmentType.payments.currency},paypal_form_url(){return this.settings.paypal.sandbox_enabled?"https://www.sandbox.paypal.com/cgi-bin/webscr":"https://www.paypal.com/cgi-bin/webscr"},paypal_success_return_url(){if(!this.appointment.public_edit_url)return;let t=new URL(window.top.location.href);return window.ssa_embed_settings&&window.ssa_embed_settings.redirect_url&&(t=new URL(window.ssa_embed_settings.redirect_url)),t.searchParams.append("appointment_token",this.appointment.public_token+this.appointment.id),t.href.includes("wp-admin")&&(t=new URL(this.appointment.public_edit_url)),t.searchParams.append("paypal_success",1),t.searchParams.append("paypal_payment",1),t},paypal_cancel_return_url(){if(!this.appointment.public_edit_url)return;let t=new URL(this.appointment.public_edit_url);return t.searchParams.append("paypal_cancel",1),t},...(0,o.rn)(["appointment","settings","translations"]),...(0,o.Se)(["selectedAppointmentType","displayStartTime","formatTimezone"])},methods:{validate(){this.$emit("validate"),this.$nextTick((()=>{this.valid&&this.checkAppointment()}))},checkAppointment(){let t=Object.prototype.hasOwnProperty.call(this.appointment,"id")&&this.appointment.id;this.$emit("checkAppointment"),t?this.saveAppointment(this.appointment).then((()=>{this.$emit("appointmentSaved"),this.sendPayment()})).catch((t=>{console.log(t),this.$emit("bookingError",t)})):this.saveNewAppointment().then((()=>{this.$emit("appointmentSaved"),this.sendPayment()})).catch((t=>{console.log(t),this.$emit("bookingError",t)}))},sendPayment(){this.$emit("processPayment"),this.savePaypalPayment({appointment_id:this.appointment.id,appointment_token:this.appointment.public_token,gateway:"paypal"}).then((()=>{this.$nextTick((()=>{this.$refs["paypal_form"].submit()}))})).catch((t=>{this.$emit("paymentFailed",t)}))},...(0,o.nv)(["saveNewAppointment","savePaypalPayment","saveAppointment"])}},Ii=Mi,Li=(0,S.Z)(Ii,$i,Oi,!1,null,null,null),Bi=Li.exports,Ni={name:"customerInformation",mixins:[H],components:{Loading:z,CustomerInformationBasic:li,CustomerInformationPlus:yi,BookingError:ie,PaymentOptions:Si,Stripe:xi,Paypal:Bi,PaymentProcessing:ki,AppointmentStartEnd:jn,CurrencyCode:J},data(){return{error:!1,errorMessage:"",fetchArgs:{},momentDateFormat:p,paymentError:"",processing:!1,processingMessage:"",saving:!1,savingMessage:"",timeUnavailable:!1,valid:!0}},beforeMount(){if(g().isEmpty(this.appointment)||g().isEmpty(this.selectedAppointmentType.title))return this.saving=!0,void this.$router.replace("/")},mounted(){this.fetchAndCheckSlots(),this.showCanceledPayment(),this.windowLoadedMessage()},computed:{payment_method(){return this.appointment.payment_method.toLowerCase()},showBack(){return!(this.modeEdit&&!this.modeReschedule||this.processing||this.saving)},...(0,o.rn)(["appointment","availableSlots","modeEdit","firstDayChecked","paymentCanceled","modeReschedule","settings","translations"]),...(0,o.Se)(["selectedAppointmentType","showPaymentUI","windowLoadedMessage"])},methods:{checkIfStillAvailable(){if(this.modeEdit||"pending_payment"===this.appointment.status)return;let t=this.availableSlots.findIndex((t=>t.start_date===this.appointment.start_date));t<0&&(this.pickNewTime(),this.setTimeConflict(!0))},checkAppointment(){this.processingMessage=this.translations.booking.checkAppointment,this.processing=!0},checkPayment(){this.processingMessage=this.translations.booking.processingPayment[this.payment_method],this.processing=!0},checkPhone(t){let e=this.settings.installed.license?"custom_customer_information":"customer_information",n=t.field,i=this.selectedAppointmentType[e].findIndex((t=>t.field===n)),s=this.selectedAppointmentType[e][i];this.$set(this.selectedAppointmentType[e],i,Object.assign({},s,{validPhone:t.valid,error:!t.valid}))},checkRequired(){this.valid=!0;let t=this.settings.installed.license?"custom_customer_information":"customer_information";this.selectedAppointmentType[t].forEach(((e,n)=>{let i=this.appointment.customer_information[e.field];if("string"===typeof i&&(i=i.trim()),e.required||"true"===e.required){let s=!0;"Email"===e.field&&(s=this.validateEmail(i));let a=!0;if(Object.prototype.hasOwnProperty.call(e,"validPhone")&&("phone"===e.type||!Object.prototype.hasOwnProperty.call(e,"type")&&"Phone"===e.field)){let t=e.validPhone;a=t&&i}i&&i.length&&s&&a?this.$set(this.selectedAppointmentType[t],n,Object.assign({},e,{error:!1})):(this.valid=!1,this.$set(this.selectedAppointmentType[t],n,Object.assign({},e,{error:!0})))}else if("phone"===e.type){if(!i)return void this.$set(this.selectedAppointmentType[t],n,Object.assign({},e,{error:!1}));Object.prototype.hasOwnProperty.call(e,"validPhone")&&!e.validPhone&&(this.valid=!1,this.$set(this.selectedAppointmentType[t],n,Object.assign({},e,{error:!0})))}if(this.showPaymentUI(this.selectedAppointmentType)&&this.$refs._paymentOptions){let t=this.$refs._paymentOptions.validate();t||(this.valid=t)}})),this.valid&&this.appointment.payment_method&&this.emitTrackingEvent("paymentInitiated")},fetchAndCheckSlots(){g().isEmpty(this.appointment)||g().isEmpty(this.selectedAppointmentType.title)||(this.refreshArgs(),this.callAsync().then((()=>{this.fetchAppointmentSlots(this.fetchArgs).then((()=>{this.checkIfStillAvailable(),this.callAsync()})).catch((t=>{console.log(t),this.setConnectionError(!0),setTimeout((()=>{this.fetchAppointmentSlots(this.fetchArgs)}),8e3)}))})))},handleBookingError(t){console.log(t),t.message?(this.errorMessage=t.message,"appointment_unavailable"===t.code&&(this.timeUnavailable=!0,this.resetRescheduleAppointment())):this.errorMessage=this.translations.errors.intro+t,this.saving=!1,this.error=!0},handleFailedPayment(t){this.fetchAppointment().then((()=>{this.processing=!1,this.paymentError="failed"===t?this.translations.payments.paymentFailed:t,this.$refs.paymentError.open()})).catch((t=>{console.log(t),this.setConnectionError(!0),setTimeout((()=>{this.fetchAppointment()}),8e3)}))},handleSuccessfulPayment(){this.processingMessage=this.translations.booking.bookingAppointment,this.fetchAppointment({add_to_calendar_links:!0}).then((()=>{this.processing=!1,this.emitTrackingEvent("bookingCompleted"),"booked"===this.appointment.status&&this.$router.push("/booked")})).catch((t=>{console.log(t),this.setConnectionError(!0),setTimeout((()=>{this.fetchAppointment({add_to_calendar_links:!0})}),8e3)}))},maybeCheckRequired(){this.valid||this.checkRequired()},pickNewTime(){this.saving=!0,this.savingMessage=this.translations.general.loadingAvailableSlots,this.updateAppointmentSlots(),this.callAsync().then((()=>{this.appointment.start_date&&this.fetchAppointmentSlots(this.refreshArgs).then((()=>{this.saving=!1,this.$router.push({path:`/type/${this.selectedAppointmentType.slug}`})})).catch((t=>{console.log(t),this.saving=!1,this.setConnectionError(!0)}))}))},refreshArgs(){let t=l().utc(),e=l().utc(this.appointment.start_date,this.momentDateFormat).startOf("day").locale("en"),n=e.clone().subtract(15,"days").startOf("day").locale("en"),i=l().max(t,n).locale("en"),s=i.clone().add(30,"days");this.fetchArgs={start_date_min:i.format(this.momentDateFormat),start_date_max:s.format(this.momentDateFormat)}},rescheduleAppointment(){let t={id:this.appointment.id,status:"canceled",public_edit_url:this.appointment.public_edit_url,update_local:!1},e=g().cloneDeep(this.appointment);this.resetRescheduleAppointment(),this.setAppointmentProp({key:"rescheduled_from_appointment_id",value:t.id}),this.saveNewAppointment().then((()=>{this.saveAppointment(t,!0).then((()=>{this.emitTrackingEvent("bookingRescheduled"),this.$router.push("/booked")})).catch((t=>{console.log(t),this.setConnectionError(!0),setTimeout((()=>{this.saveNewAppointment()}),8e3)}))})).catch((t=>{this.handleBookingError(t),this.setAppointment(e)}))},bookAppointment(){let t=Object.prototype.hasOwnProperty.call(this.appointment,"id")&&this.appointment.id;this.checkRequired(),this.valid?(this.savingMessage=this.translations.booking.saving,this.saving=!0,this.modeReschedule?this.rescheduleAppointment():this.modeEdit||t?this.updateExistingAppointment():this.saveNewAppointment().then((()=>{this.emitTrackingEvent("bookingCompleted"),this.$router.push("/booked")})).catch((t=>{this.handleBookingError(t)}))):this.handleErrorFocus()},handleErrorFocus(){this.$nextTick((()=>{let t=document.querySelector(".md-input-invalid");if(!t)return;let e=t.querySelector("input, textarea");e&&e.focus()}))},showCanceledPayment(){this.paymentCanceled&&this.$nextTick((()=>{this.$refs["paymentCanceled"].open()}))},showSaving(){this.saving=!0},stopProcessing(){this.processing=!1},updateExistingAppointment(){this.saveAppointment(this.appointment).then((()=>{this.emitTrackingEvent("bookingEdited"),this.$router.push("/booked")})).catch((t=>{console.log(t),this.saving=!1,this.$refs.bookingError.open()}))},validateEmail(t){let e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(t)},...(0,o.nv)(["callAsync","saveNewAppointment","fetchAppointment","fetchAppointmentSlots","saveAppointment","updateAppointmentSlots"]),...(0,o.OI)(["resetRescheduleAppointment","setAppointment","setConnectionError","setAppointmentProp","setTimeConflict"])}},Ri=Ni,qi=(0,S.Z)(Ri,Xn,Vn,!1,null,"4dd8ff94",null),Wi=qi.exports,Ui=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"confirm cust-info"},[t.redirecting?t._e():n("md-card",[t.loading?t._e():n("md-card-header",[n("md-card-header-text",[n("h1",{staticClass:"md-title"},[t._v(" "+t._s(t.translations.booking.confirmHeader)+" "+t._s(t.selectedAppointmentType.title)+" ")]),n("appointment-start-end")],1)],1),n("md-card-content",[t.loading?n("loading",{attrs:{message:t.translations.change.canceling}}):[t.selectedAppointmentType.instructions?n("p",{staticClass:"md-subheading"},[t._v(t._s(t.selectedAppointmentType.instructions))]):t._e(),t._l(t.availableCustomerInformation,(function(e,i,s){return n("p",{key:i,class:"field-"+t.slugify(i)+"-"+s},[n("strong",[t._v(" "+t._s(t.translations.appointmentTypes.customer_information[i]?t.translations.appointmentTypes.customer_information[i]:i)+": ")]),"string"===typeof e?n("span",{domProps:{innerHTML:t._s(e)}}):[t._v(" "+t._s(e.join(", "))+" ")]],2)})),t.showPaymentUI(t.selectedAppointmentType)?[parseFloat(t.appointment.payment_received)?n("p",[n("strong",[t._v(t._s(t.translations.payments.paymentReceived))]),n("currency-code",{attrs:{price:t.appointment.payment_received,currency:t.selectedAppointmentType.payments.currency}})],1):t._e(),parseFloat(t.appointment.payment_received)||"optional"!=t.selectedAppointmentType.payments.payment_required?t._e():n("p",[n("strong",[t._v(t._s(t.translations.payments.paymentDue))]),n("currency-code",{attrs:{price:t.selectedAppointmentType.payments.price,currency:t.selectedAppointmentType.payments.currency}})],1),t.showRefundPolicy?n("p",[n("strong",[t._v(t._s(t.translations.payments.refundPolicy)+":")]),t._v(" "+t._s(t.selectedAppointmentType.payments.refund_policy)+" ")]):t._e()]:t._e(),t.showCalendarButton?n("md-menu",{attrs:{"md-align-trigger":""}},[n("md-button",{staticClass:"calendar-save md-raised md-primary",attrs:{"md-menu-trigger":""}},[t._v(" "+t._s(t.translations.booking.calendarSave)+" ")]),n("md-menu-content",[Object.prototype.hasOwnProperty.call(t.appointment,"gcal")?n("md-menu-item",[n("md-button",{staticClass:"menu-link",attrs:{href:t.appointment.gcal.customer,target:"_blank"}},[t._v(" "+t._s(t.translations.booking.calendarSaveGoogle)+" ")])],1):t._e(),Object.prototype.hasOwnProperty.call(t.appointment,"ics")?n("md-menu-item",[n("md-button",{staticClass:"menu-link",attrs:{href:t.appointmentIcs,download:""}},[t._v(" "+t._s(t.translations.booking.calendarSaveOther)+" ")])],1):t._e()],1)],1):t._e()]],2),n("md-card-actions",{staticClass:"confirmation-actions"},[n("appointment-actions",{attrs:{loading:t.loading,headline:!0},on:{cancelStart:t.showLoading,cancelComplete:t.confirmCancelation}})],1)],1),t.redirecting?n("loading",{attrs:{message:t.translations.booking.redirecting}}):t._e()],1)},Hi=[],Zi=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"appointment-actions",class:{hasHeadline:t.headline}},[t.loading?t._e():[t.headline?n("h2",{staticClass:"md-subheading"},[t._v(t._s(t.translations.change.next))]):t._e(),t.editable?[n("md-button",{staticClass:"appointment-edit-button",on:{click:t.edit}},[n("span",[t._v(t._s(t.translations.change.edit))])]),t.canReschedule?n("md-button",{staticClass:"appointment-reschedule-button",on:{click:t.reschedule}},[n("span",[t._v(t._s(t.translations.change.reschedule))])]):t._e(),n("md-button",{staticClass:"appointment-cancel-button",on:{click:t.confirmCancel}},[n("span",[t._v(t._s(t.translations.change.cancel))])])]:t._e(),t.showNew?n("md-button",{staticClass:"appointment-book-new-button",on:{click:t.scheduleNew}},[n("span",[t._v(t._s(t.translations.change.new))])]):t._e()],n("md-dialog",{ref:"confirmCancel"},[n("md-dialog-title",[t._v(t._s(t.translations.change.cancelConfirm))]),n("md-dialog-content",[n("p",[t._v(t._s(t.selectedAppointmentType.title))]),n("appointment-start-end")],1),n("md-dialog-actions",[n("md-button",{on:{click:t.cancelCancel}},[t._v(t._s(t.translations.change.cancelConfirmCancel))]),n("md-button",{on:{click:t.cancelAppt}},[t._v(t._s(t.translations.change.cancelConfirmOkay))])],1)],1)],2)},Yi=[],Gi={name:"appointmentActions",components:{AppointmentStartEnd:jn},mixins:[H],props:{headline:{type:Boolean,default:!1},past:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},data(){return{moment:l()}},computed:{editable(){return!Object.prototype.hasOwnProperty.call(this.appointment,"status")||"canceled"!==this.appointment.status&&!this.past},showNew(){return!this.isAppointmentTypeDeleted&&(!(!this.modeEdit||!this.past)||(!this.modeEdit||!this.editable))},canReschedule(){return!this.isAppointmentTypeDeleted},isAppointmentTypeDeleted(){if(Object.prototype.hasOwnProperty.call(this.selectedAppointmentType,"status"))return"delete"===this.selectedAppointmentType.status},...(0,o.rn)(["appointment","translations","timezone","frozenType","modeEdit"]),...(0,o.Se)(["selectedAppointmentType"])},methods:{scheduleNew(){this.setEditMode(!1),this.setRescheduleMode(!1),this.resetRescheduleAppointment(),this.frozenType?this.$router.push({path:`/type/${this.selectedAppointmentType.slug}`}):(this.setAppointmentProp({key:"appointment_type_id",value:null}),this.$router.push({path:"/"}))},reschedule(){this.setEditMode(!0),this.setRescheduleMode(!0),this.$router.push({path:`/type/${this.selectedAppointmentType.slug}`})},confirmCancel(){this.$refs["confirmCancel"].open()},cancelCancel(){this.$refs["confirmCancel"].close()},cancelAppt(){this.$refs["confirmCancel"].close(),this.$emit("cancelStart");let t={id:this.appointment.id,status:"canceled",public_edit_url:this.appointment.public_edit_url};this.saveAppointment(t).then((()=>{this.emitTrackingEvent("bookingCanceled"),this.$emit("cancelComplete"),this.$refs["confirmCancel"].close()}))},edit(){this.setEditMode(!0),this.setRescheduleMode(!1),this.$router.push("/book")},...(0,o.OI)(["setAppointmentProp","setEditMode","setRescheduleMode","resetRescheduleAppointment"]),...(0,o.nv)(["saveAppointment"])}},Xi=Gi,Vi=(0,S.Z)(Xi,Zi,Yi,!1,null,null,null),Ji=Vi.exports,Ki={name:"bookedConfirmation",components:{Loading:z,AppointmentActions:Ji,AppointmentStartEnd:jn,CurrencyCode:J},data(){return{redirecting:!1,loading:!1,momentDateFormat:p}},beforeMount(){(g().isEmpty(this.appointment)||g().isEmpty(this.selectedAppointmentType.title))&&this.$router.replace("/")},mounted(){if(this.setEditMode(!1),this.setRescheduleMode(!1),this.resetAvailabilityCache(),this.windowLoadedMessage(),window.ssa_embed_settings&&window.ssa_embed_settings.redirect_url){this.redirecting=!0;const t=window.ssa_embed_settings.redirect_url.concat("?appointment_token=",this.appointment.public_token,this.appointment.id);window.top.location.href=t}},computed:{showCalendarButton(){return!(!Object.prototype.hasOwnProperty.call(this.appointment,"gcal")&&!Object.prototype.hasOwnProperty.call(this.appointment,"ics"))},appointmentIcs(){return Object.prototype.hasOwnProperty.call(this.appointment,"ics")?this.appointment.ics.customer+"?token="+this.appointment.public_token:null},availableCustomerInformation(){if(!this.appointment)return[];let t={};return Object.keys(this.appointment.customer_information).forEach((e=>{this.appointment.customer_information[e]?.length&&(t[e]=this.appointment.customer_information[e])})),t},showRefundPolicy(){const t=this.selectedAppointmentType.payments?.refund_policy,e=this.selectedAppointmentType.payments?.refund_policy_display_screen;return t&&(!e?.length||e.includes("confirmationScreen"))},...(0,o.rn)(["timezone","translations","appointment"]),...(0,o.Se)(["selectedAppointmentType","showPaymentUI","slugify","minDay","urlParams","windowLoadedMessage"])},methods:{confirmCancelation(){this.loading=!1,this.windowLoadedMessage();let t=this.urlParams(this.appointment.public_edit_url),e=t.appointment_token;this.$router.push({path:"/change/"+e})},resetAvailabilityCache(){let t="month"===this.selectedAppointmentType.booking_layout?75:55;this.fetchAppointmentSlots({start_date_min:this.minDay.clone().tz(this.timezone).utc().format(this.momentDateFormat),start_date_max:this.minDay.clone().add(t,"days").tz(this.timezone).utc().format(this.momentDateFormat)}).then((()=>{})).catch((t=>{console.log(t)}))},showLoading(){this.loading=!0},...(0,o.OI)(["setEditMode","setRescheduleMode"]),...(0,o.nv)(["fetchAppointmentSlots"])}},Qi=Ki,ts=(0,S.Z)(Qi,Ui,Hi,!1,null,"3be6d2ff",null),es=ts.exports,ns=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"change cust-info"},[n("md-card",{staticClass:"edit-appt",class:{canceled:"canceled"===t.appointment.status}},[t.loading?t._e():n("md-card-header",[n("md-card-header-text",[n("h1",{staticClass:"md-title"},["canceled"===t.appointment.status?n("span",{staticClass:"indicator"},[t._v(" "+t._s(t.translations.change.canceledIndicator)+" ")]):t._e(),n("span",{staticClass:"appt-title"},[t._v(t._s(t.selectedAppointmentType.title))])]),n("appointment-start-end")],1)],1),n("md-card-content",[t.ipnDelay?n("div",{staticClass:"foxy-banner"},[n("div",{staticClass:"banner-icon"},[n("md-icon",{staticClass:"md-primary md-size-2x",attrs:{"md-theme":"orange"}},[t._v("warning")])],1),n("div",{staticClass:"banner-text"},[n("h2",{staticClass:"md-title"},[t._v(t._s(t.translations.payments.paymentDelayHeader))]),n("p",[t._v(t._s(t.translations.payments[t.paymentProvider+"DelayText"]))])])]):t._e(),t.loading?n("loading",{attrs:{message:t.translations.general.loadingTypes}}):[t.cancelationNote?n("p",[n("strong",[t._v(" "+t._s(t.translations.change.cancelationNote)+": ")]),t._v(" "+t._s(t.cancelationNote)+" ")]):t._e(),t._l(t.availableCustomerInformation,(function(e,i){return n("p",{key:i},[n("strong",[t._v(" "+t._s(t.translations.appointmentTypes.customer_information[i]?t.translations.appointmentTypes.customer_information[i]:i)+": ")]),"string"===typeof e?n("span",{domProps:{innerHTML:t._s(e)}}):[t._v(t._s(e.join(", ")))]],2)})),t.showRefundPolicy?n("p",[n("strong",[t._v(t._s(t.translations.payments.refundPolicy)+": ")]),t._v(" "+t._s(t.selectedAppointmentType.payments.refund_policy)+" ")]):t._e(),t.showCalendarButton?n("md-menu",{attrs:{"md-align-trigger":""}},[n("md-button",{staticClass:"calendar-save md-raised md-primary",attrs:{"md-menu-trigger":""}},[t._v(" "+t._s(t.translations.booking.calendarSave)+" ")]),n("md-menu-content",[Object.prototype.hasOwnProperty.call(t.appointment,"gcal")?n("md-menu-item",[n("md-button",{staticClass:"menu-link",attrs:{href:t.appointment.gcal.customer,target:"_blank"}},[t._v(" "+t._s(t.translations.booking.calendarSaveGoogle)+" ")])],1):t._e(),Object.prototype.hasOwnProperty.call(t.appointment,"ics")?n("md-menu-item",[n("md-button",{staticClass:"menu-link",attrs:{href:t.appointmentIcs,download:""}},[t._v(" "+t._s(t.translations.booking.calendarSaveOther)+" ")])],1):t._e()],1)],1):t._e()]],2),t.showActions?n("md-card-actions",{staticClass:"cancellation-actions",attrs:{loading:t.loading}},[n("appointment-actions",{attrs:{past:t.past},on:{cancelComplete:t.confirmCancelation,cancelStart:t.showLoading}})],1):t._e()],1),n("md-snackbar",{ref:"pastsnackbar",attrs:{"md-position":"bottom center","md-duration":5e3}},[n("span",[t._v(t._s(t.translations.change.past))])]),n("md-snackbar",{ref:"canceledsnackbar",attrs:{"md-position":"bottom center","md-duration":5e3}},[n("span",[t._v(t._s(t.translations.change.canceled))])])],1)},is=[],ss={name:"appointmentChange",mixins:[H],props:["token","view"],components:{Loading:z,AppointmentActions:Ji,AppointmentStartEnd:jn},data(){return{ipnChecks:0,ipnDelay:!1,loading:!0,moment:l(),momentTimestampFormat:m}},beforeMount(){if(this.setEditMode("confirm_payment"!==this.view&&"canceled_payment"!==this.view),this.timezone||this.setTimezone(this.timezoneLocal),this.token)if(this.token.length>32){let t=this.token.substring(0,32),e=this.token.substring(32);this.setAppointmentProp({key:"id",value:e}),this.setAppointmentProp({key:"public_token",value:t})}else this.setAppointmentProp({key:"id",value:this.token})},mounted(){this.fetchAppointment({add_to_calendar_links:!0}).then((()=>{this.ipnChecks++,"confirm_payment"!==this.view?"canceled_payment"!==this.view?(this.selectedAppointmentType.id?("locked"===this.selectedAppointmentType.timezone_style&&this.setTimezone(this.settings.global.timezone_string),this.loading=!1):this.fetchAppointmentTypes().then((()=>{"locked"===this.selectedAppointmentType.timezone_style&&this.setTimezone(this.settings.global.timezone_string),this.loading=!1})),this.past?this.$nextTick((()=>{this.$refs.pastsnackbar.open()})):"canceled"===this.appointment.status&&(this.fetchCancelationNote(),this.$nextTick((()=>{this.$refs.canceledsnackbar.open()})))):this.handleCancelPaymentView():this.handleConfirmPaymentView()}))},computed:{appointmentIcs(){return Object.prototype.hasOwnProperty.call(this.appointment,"ics")?this.appointment.ics.customer+"?token="+this.appointment.public_token:null},showCalendarButton(){return!(!Object.prototype.hasOwnProperty.call(this.appointment,"gcal")&&!Object.prototype.hasOwnProperty.call(this.appointment,"ics"))},past(){if(!Object.prototype.hasOwnProperty.call(this.appointment,"start_date"))return!1;let t=l().utc(this.appointment.start_date,this.momentTimestampFormat),e=l().utc();return!!t.isBefore(e)},showActions(){return!this.view||"confirm_payment"!==this.view&&"canceled_payment"!==this.view},availableCustomerInformation(){if(!this.appointment)return[];let t={};return Object.keys(this.appointment.customer_information).forEach((e=>{this.appointment.customer_information[e]?.length&&(t[e]=this.appointment.customer_information[e])})),t},paymentProvider(){let t=this.urlParams().payment_provider;return t||"paypal"},showRefundPolicy(){const t=this.selectedAppointmentType.payments?.refund_policy,e=this.selectedAppointmentType.payments?.refund_policy_display_screen;return t&&e?.length&&e.includes("editRescheduleScreen")},...(0,o.rn)(["appointment","translations","timezone","cancelationNote"]),...(0,o.Se)(["urlParams","timezoneLocal","selectedAppointmentType"])},methods:{confirmPayment(){this.ipnChecks<4?setTimeout((()=>{this.fetchAppointment().then((()=>{this.ipnChecks++,this.handleConfirmPaymentView()}))}),5e3):(this.loading=!1,this.ipnDelay=!0,setTimeout((()=>{this.fetchAppointment().then((()=>{this.ipnChecks++,this.handleConfirmPaymentView()}))}),6e4))},confirmAppointment(){this.emitTrackingEvent("bookingCompleted"),this.$router.push("/booked")},confirmCancelation(){this.loading=!1},handleCancelPaymentView(){this.setPaymentCanceled(!0),this.$router.push("/book")},handleConfirmPaymentView(){switch(this.appointment.status){case"booked":this.confirmAppointment();break;case"pending_payment":this.confirmPayment();break;case"abandoned":this.rebookAppointment();break}},rebookAppointment(){this.resetRescheduleAppointment(),this.$router.push({path:`/type/${this.selectedAppointmentType.slug}`})},showLoading(){this.loading=!0},...(0,o.OI)(["resetRescheduleAppointment","setPaymentCanceled","setAppointmentProp","setEditMode","setTimezone"]),...(0,o.nv)(["fetchAppointment","fetchAppointmentTypes","fetchCancelationNote"])}},as=ss,os=(0,S.Z)(as,ns,is,!1,null,null,null),rs=os.exports;i["default"].use(N.Z);const ls=new N.Z({routes:[{path:"/",name:"bookingDefault",component:at},{path:"/type/:slug",name:"type",component:Gn,props:!0,children:[{path:"select/:date",name:"date",component:Gn,props:!0,children:[{path:"time",name:"time",component:Gn,props:!0}]}]},{path:"/integration/form",name:"bookingForm",component:Ot,children:[{path:"type/:slug",name:"formType",component:An,props:!0,children:[{path:"select/:date",name:"formDate",component:An,props:!0,children:[{path:"time",name:"formTime",component:An,props:!0}]}]},{path:"load-appointment/:id",name:"loadSelected",component:qn,props:!0},{path:"confirmed",name:"formConfirm",component:Mn}]},{path:"/book",name:"book",component:Wi},{path:"/booked",name:"Booked",component:es},{path:"/change/:token?",name:"change",component:rs,props:!0,children:[{path:"view/:view",name:"view",component:rs,props:!0}]}]});ls.beforeEach(((t,e,n)=>{let i=T.state.modeEdit,s=T.state.appointment.status,a=T.state.modeReschedule,o=T.state.appointment&&Object.prototype.hasOwnProperty.call(T.state.appointment,"id")?T.state.appointment.id:null,r=["date","time","book","type"],l=t.name;r.indexOf(l)>=0&&!i&&!a&&o&&"booked"===s?n("/booked"):n(),T.state.translations.pageTitles&&(document.title=T.state.translations.pageTitles[t.name])}));var ps=ls,ms=n(5822),cs=n.n(ms),ds=n(7495),hs=n.n(ds);i["default"].config.productionTip=!1,i["default"].use(hs()),i["default"].use(cs()),i["default"].material.registerTheme({default:{primary:{color:"light-green",hue:700},accent:{color:"deep-orange",hue:800},warn:"red"},reverse:{primary:{color:"deep-orange",hue:800},accent:{color:"light-green",hue:700}},amber:{primary:"amber"}}),i["default"].config.productionTip=!1,new i["default"]({store:T,router:ps,render:t=>t(B)}).$mount("#ssa-booking-app")}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var a=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.m=t,function(){var t=[];n.O=function(e,i,s,a){if(!i){var o=1/0;for(m=0;m<t.length;m++){i=t[m][0],s=t[m][1],a=t[m][2];for(var r=!0,l=0;l<i.length;l++)(!1&a||o>=a)&&Object.keys(n.O).every((function(t){return n.O[t](i[l])}))?i.splice(l--,1):(r=!1,a<o&&(o=a));if(r){t.splice(m--,1);var p=s();void 0!==p&&(e=p)}}return e}a=a||0;for(var m=t.length;m>0&&t[m-1][2]>a;m--)t[m]=t[m-1];t[m]=[i,s,a]}}(),function(){n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,{a:e}),e}}(),function(){n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}}(),function(){n.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t}}(),function(){var t={143:0};n.O.j=function(e){return 0===t[e]};var e=function(e,i){var s,a,o=i[0],r=i[1],l=i[2],p=0;if(o.some((function(e){return 0!==t[e]}))){for(s in r)n.o(r,s)&&(n.m[s]=r[s]);if(l)var m=l(n)}for(e&&e(i);p<o.length;p++)a=o[p],n.o(t,a)&&t[a]&&t[a][0](),t[a]=0;return n.O(m)},i=self["webpackChunkbooking_app"]=self["webpackChunkbooking_app"]||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))}();var i=n.O(void 0,[998],(function(){return n(5061)}));i=n.O(i)})(); //# sourceMappingURL=app.js.map
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings