import{d as le,O as se,r as X,e as b,c as u,b as n,t as c,f as e,l as h,k as R,g as E,L as q,n as $,a as s,K as ge,i as Le,u as xe,A as he,o as pe,j as ne,y as K,q as oe,w as Ve,a0 as Te,B as G,T as Re,a4 as be,F as Ce,G as _e,a6 as $e,s as Be,x as Pe,a5 as Ae,h as Ye}from"./entry.c7bd9184.js";import{u as Ee}from"./composables.d321635f.js";import{_ as He,j as f,z as Oe,a0 as ie,r as fe,V as Ie}from"./index.d5ca8227.js";import{T as je,U as qe,z as Ue,f as Ne,V as Ze,W as re,X as We}from"./TextElement.vue_vue_type_style_index_0_lang.1bc33d6b.js";import{_ as Ge,C as Se}from"./FormComponent.vue_vue_type_style_index_0_lang.b526ae86.js";import{_ as Ke,a as Xe,L as Je,l as Qe,u as et,t as tt}from"./advancedFormat.33580737.js";const at={class:"p-b booking-info--duration"},nt=n("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n("path",{d:"M15.9808 1.26923C15.9808 1.96995 15.8816 2.65084 15.6833 3.3119C15.485 3.97296 15.1842 4.59766 14.7809 5.186C14.576 5.48347 14.3612 5.75451 14.1364 5.9991C13.9117 6.24369 13.6737 6.46514 13.4225 6.66346C13.1713 6.86178 12.9002 7.05018 12.6094 7.22867C12.3185 7.40715 12.0144 7.56911 11.6971 7.71454C11.4525 7.82692 11.2608 7.97897 11.122 8.17067C10.9832 8.36238 10.9105 8.60036 10.9038 8.88461C10.9038 9.16226 10.9733 9.39693 11.1121 9.58864C11.2509 9.78035 11.4459 9.9357 11.6971 10.0547C12.021 10.2067 12.3251 10.3687 12.6094 10.5406C12.8936 10.7124 13.1614 10.8975 13.4126 11.0959C13.6638 11.2942 13.905 11.5189 14.1364 11.7701C14.3678 12.0213 14.5826 12.2924 14.7809 12.5832C15.1776 13.165 15.4751 13.7864 15.6734 14.4474C15.8717 15.1085 15.9742 15.7927 15.9808 16.5H17.25V17.7692H0.75V16.5H2.01923C2.01923 15.7993 2.11839 15.1184 2.31671 14.4573C2.51502 13.7963 2.81581 13.1716 3.21905 12.5832C3.43059 12.2725 3.64874 11.9982 3.8735 11.7602C4.09826 11.5222 4.33293 11.3008 4.57752 11.0959C4.82212 10.8909 5.08984 10.7091 5.38071 10.5505C5.67157 10.3918 5.97897 10.2299 6.30288 10.0646C6.54086 9.95222 6.73257 9.79688 6.878 9.59856C7.02344 9.40024 7.09615 9.16226 7.09615 8.88461C7.09615 8.60697 7.02674 8.3723 6.88792 8.18059C6.7491 7.98888 6.55409 7.83353 6.30288 7.71454C5.97897 7.5625 5.67488 7.40054 5.39062 7.22867C5.10637 7.05679 4.83864 6.87169 4.58744 6.67338C4.33624 6.47506 4.09495 6.2503 3.86358 5.9991C3.63221 5.7479 3.41737 5.47686 3.21905 5.186C2.82242 4.60427 2.52494 3.98287 2.32662 3.32181C2.12831 2.66076 2.02584 1.97656 2.01923 1.26923H0.75V0H17.25V1.26923H15.9808ZM9.63461 8.88461C9.63461 8.34255 9.77674 7.8732 10.061 7.47656C10.3453 7.07993 10.7254 6.76593 11.2013 6.53455C11.393 6.44201 11.5781 6.35276 11.7566 6.26683C11.9351 6.18089 12.1103 6.07181 12.2822 5.9396C12.6656 5.67518 13.006 5.37109 13.3035 5.02734C13.601 4.68359 13.8555 4.3101 14.067 3.90685C14.2785 3.50361 14.4372 3.08053 14.543 2.63762C14.6487 2.19471 14.7049 1.73858 14.7115 1.26923H3.28846C3.28846 1.73197 3.34135 2.1848 3.44712 2.6277C3.55288 3.07061 3.71154 3.49369 3.92308 3.89693C4.13462 4.30018 4.38912 4.67368 4.6866 5.01743C4.98407 5.36118 5.32782 5.66857 5.71785 5.9396C5.88972 6.0652 6.0649 6.17097 6.24339 6.25691C6.42188 6.34285 6.60697 6.4354 6.79868 6.53455C7.27464 6.76593 7.65475 7.07993 7.939 7.47656C8.22326 7.8732 8.36538 8.34255 8.36538 8.88461C8.36538 9.42668 8.22326 9.89603 7.939 10.2927C7.65475 10.6893 7.27464 11.0033 6.79868 11.2347C6.60697 11.3272 6.42188 11.4165 6.24339 11.5024C6.0649 11.5883 5.88972 11.6974 5.71785 11.8296C5.33443 12.0941 4.99399 12.3981 4.69651 12.7419C4.39904 13.0856 4.14453 13.4591 3.93299 13.8624C3.72145 14.2656 3.5628 14.6887 3.45703 15.1316C3.35126 15.5745 3.29507 16.0306 3.28846 16.5H14.7115C14.7115 16.0373 14.6587 15.5844 14.5529 15.1415C14.4471 14.6986 14.2885 14.2755 14.0769 13.8723C13.8654 13.4691 13.6109 13.0956 13.3134 12.7518C13.0159 12.4081 12.6722 12.1007 12.2822 11.8296C12.1103 11.704 11.9351 11.5983 11.7566 11.5123C11.5781 11.4264 11.393 11.3338 11.2013 11.2347C10.7254 11.0033 10.3453 10.6893 10.061 10.2927C9.77674 9.89603 9.63461 9.42668 9.63461 8.88461Z",fill:"#B1B7BE"})],-1),it={class:"booking-info-label"},ot={class:"booking-info-value"},rt={key:0,class:"p-b booking-info--datetime"},lt=n("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",class:"bi bi-calendar",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"fill-rule":"evenodd",d:"M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1zm1-3a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2H2z"}),n("path",{"fill-rule":"evenodd",d:"M3.5 0a.5.5 0 0 1 .5.5V1a.5.5 0 0 1-1 0V.5a.5.5 0 0 1 .5-.5zm9 0a.5.5 0 0 1 .5.5V1a.5.5 0 0 1-1 0V.5a.5.5 0 0 1 .5-.5z"})],-1),st={class:"booking-info-label"},ct={class:"booking-info-value text-capitalize"},dt={class:"p-b booking-info--datetime"},ut=n("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",class:"bi bi-calendar",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"fill-rule":"evenodd",d:"M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1zm1-3a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2H2z"}),n("path",{"fill-rule":"evenodd",d:"M3.5 0a.5.5 0 0 1 .5.5V1a.5.5 0 0 1-1 0V.5a.5.5 0 0 1 .5-.5zm9 0a.5.5 0 0 1 .5.5V1a.5.5 0 0 1-1 0V.5a.5.5 0 0 1 .5-.5z"})],-1),mt={class:"booking-info-label"},ft={key:0},vt={key:1,class:"booking-info-value text-capitalize"},gt={key:0},ht={key:2,class:"booking-info-value"},pt={key:3},bt=["onClick"],Ct={style:{cursor:"pointer","text-decoration":"underline",color:"#178af6"}},_t={class:"pointer"},St={key:1,class:"p-b booking-info--location"},wt=n("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",class:"bi bi-geo-alt",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"fill-rule":"evenodd",d:"M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"})],-1),yt={class:"booking-info-label"},kt={class:"booking-info-value"},Dt={key:2,class:"p-b booking-info--timezone"},zt=n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-arrow-repeat",viewBox:"0 0 16 16"},[n("path",{d:"M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41zm-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9z"}),n("path",{"fill-rule":"evenodd",d:"M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5.002 5.002 0 0 0 8 3zM3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9H3.1z"})],-1),Ft={class:"booking-info-label"},Mt={class:"booking-info-value"},Lt={class:"p-b booking-info--timezone"},xt=n("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",class:"bi bi-globe2",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"fill-rule":"evenodd",d:"M1.018 7.5h2.49c.037-1.07.189-2.087.437-3.008a9.124 9.124 0 0 1-1.565-.667A6.964 6.964 0 0 0 1.018 7.5zM3.05 3.049c.362.184.763.349 1.198.49.142-.384.304-.744.481-1.078a6.7 6.7 0 0 1 .597-.933A7.01 7.01 0 0 0 3.051 3.05zM8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm-.5 1.077c-.67.204-1.335.82-1.887 1.855-.143.268-.276.56-.395.872.705.157 1.473.257 2.282.287V1.077zm0 4.014c-.91-.03-1.783-.145-2.591-.332a12.344 12.344 0 0 0-.4 2.741H7.5V5.091zm1 2.409V5.091c.91-.03 1.783-.145 2.591-.332.223.827.364 1.754.4 2.741H8.5zm-1 1H4.51c.035.987.176 1.914.399 2.741A13.596 13.596 0 0 1 7.5 10.91V8.5zm1 2.409V8.5h2.99a12.343 12.343 0 0 1-.399 2.741A13.596 13.596 0 0 0 8.5 10.91zm-1 1c-.81.03-1.577.13-2.282.287.12.312.252.604.395.872.552 1.035 1.218 1.65 1.887 1.855V11.91zm-2.173 2.563a6.695 6.695 0 0 1-.597-.933 8.857 8.857 0 0 1-.481-1.078 8.356 8.356 0 0 0-1.198.49 7.01 7.01 0 0 0 2.276 1.52zM2.38 12.175c.47-.258.995-.482 1.565-.667A13.36 13.36 0 0 1 3.508 8.5h-2.49a6.964 6.964 0 0 0 1.362 3.675zm8.293 2.297a7.01 7.01 0 0 0 2.275-1.521 8.353 8.353 0 0 0-1.197-.49 8.859 8.859 0 0 1-.481 1.078 6.688 6.688 0 0 1-.597.933zm.11-2.276A12.63 12.63 0 0 0 8.5 11.91v3.014c.67-.204 1.335-.82 1.887-1.855.143-.268.276-.56.395-.872zm1.272-.688c.57.185 1.095.409 1.565.667A6.964 6.964 0 0 0 14.982 8.5h-2.49a13.355 13.355 0 0 1-.437 3.008zm.437-4.008h2.49a6.963 6.963 0 0 0-1.362-3.675c-.47.258-.995.482-1.565.667.248.92.4 1.938.437 3.008zm-.74-3.96a8.854 8.854 0 0 0-.482-1.079 6.692 6.692 0 0 0-.597-.933c.857.355 1.63.875 2.275 1.521a8.368 8.368 0 0 1-1.197.49zm-.97.264c-.705.157-1.473.257-2.282.287V1.077c.67.204 1.335.82 1.887 1.855.143.268.276.56.395.872z"})],-1),Vt={class:"booking-info-label"},Tt={key:0,class:"booking-info-value"},ve=le({__name:"CalendarBookingInfo",props:{selectedTimezone:{type:Object},dynamicHourFormat:{type:String},appointmentDateFormat:{type:String},calendar:{type:Object},calendarEvent:{type:Object,required:!1},selectedSlot:{type:Object},slotDuration:{type:Number},horizontal:{type:Boolean,default:!1},disableContactTimezone:{type:Boolean,default:!1},locationAddress:{type:String,required:!1},recurringRule:{type:String,required:!1},recurringSlots:{type:Array,required:!1,default:()=>[]},isRecurringLoading:{type:Boolean,default:!1},recurringObject:{type:Object,default:()=>{}}},setup(o){const w=o,{t:r}=se(),d=X(),C=()=>{d.value.showPopup()};b(()=>w.calendarEvent?f(w.calendarEvent.start_time).format("ddd, ll"):void 0);const V=b(()=>Array.isArray(w.recurringSlots)&&w.recurringSlots.length),y=b(()=>V.value&&w.recurringSlots.filter(D=>!D.isUnavailable).length),_=b(()=>w.calendarEvent?`${f(w.calendarEvent.start_time).format("ddd, ll")} [
${f(w.calendarEvent.start_time).format(w.dynamicHourFormat)} -
${f(w.calendarEvent.end_time).format(w.dynamicHourFormat)}
]`:void 0);return(D,B)=>(s(),u("div",{class:$([{"--horizontal":o.horizontal},"appointment_widgets--booking-info"])},[n("div",at,[n("label",null,[nt,n("span",it,c(e(r)("DURATION")),1)]),n("div",ot,c(o.slotDuration)+" Mins",1)]),o.calendarEvent?(s(),u("div",rt,[n("label",null,[lt,n("span",st,c(e(r)("OLD"))+" "+c(e(r)("DATEANDTIME")),1)]),n("div",ct,c(e(_)),1)])):h("",!0),n("div",dt,[n("label",null,[ut,n("span",mt,c(e(r)("DATEANDTIME")),1)]),!o.isRecurringLoading&&e(V)?(s(),u("div",ft,c(e(y))+"/"+c(o.recurringObject.count)+" occurrences will be booked ",1)):h("",!0),o.appointmentDateFormat?(s(),u("div",vt,[R(c(o.appointmentDateFormat)+" ",1),o.selectedSlot?(s(),u("span",gt," [ "+c(o.selectedSlot.format(o.dynamicHourFormat))+" - "+c(o.selectedSlot.clone().add(o.slotDuration,"m").format(o.dynamicHourFormat))+" ] ",1)):h("",!0)])):(s(),u("div",ht,"-")),o.isRecurringLoading?(s(),u("div",pt,[E(He,{loading:!0,color:"#178AF6",size:"25px"})])):e(V)?(s(),u("div",{key:4,onClick:q(C,["stop","prevent"])},[n("div",Ct,[n("span",_t," +"+c(e(y)-1)+" more ",1)]),E(Ke,{ref_key:"recurringModalRef",ref:d,recurringSlots:o.recurringSlots,recurrenceCount:o.recurringObject.count},null,8,["recurringSlots","recurrenceCount"])],8,bt)):h("",!0)]),o.locationAddress&&o.locationAddress.toLowerCase()!=="generating gmeet link"?(s(),u("div",St,[n("label",null,[wt,n("span",yt,c(e(r)("location")),1)]),n("div",kt,c(o.locationAddress),1)])):h("",!0),o.recurringRule?(s(),u("div",Dt,[n("label",null,[zt,n("span",Ft,c(e(r)("REPEATS")),1)]),n("div",Mt,c(o.recurringRule),1)])):h("",!0),n("div",Lt,[n("label",null,[xt,n("span",Vt,c(e(r)("timezone")),1)]),o.selectedTimezone?(s(),u("div",Tt,c(o.selectedTimezone.label),1)):h("",!0)])],2))}}),Rt={class:"appointment_widgets--info"},$t={class:"appointment_widgets--service-info"},Bt={class:"provider-branding"},Pt=["textContent"],At=["textContent"],Yt={key:0},Et={key:0,class:"form-builder--item"},Ht={class:"h5"},Ot={key:1},It={key:1,class:"widgets-step-1"},jt={class:"widgets-date-timezone-wrapper"},qt={key:0,class:"label-select-date"},Ut={key:1,class:"label-select-date"},Nt={class:"widgets-date-block"},Zt={key:0},Wt=n("svg",{width:"18",height:"16",viewBox:"0 0 18 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[n("path",{d:"M17 8.00012L9.62684 15.3733L8.92165 14.6681L15.0881 8.50159H1V7.49865H15.0881L8.92165 1.33214L9.62684 0.626953L17 8.00012Z",fill:"currentColor",stroke:"#178AF6","stroke-width":"0.5"})],-1),Gt={key:1,class:"datepick-info"},Kt={class:"loader"},Xt={class:"widgets-timezone-picker"},Jt=n("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",class:"bi bi-globe2",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"fill-rule":"evenodd",d:"M1.018 7.5h2.49c.037-1.07.189-2.087.437-3.008a9.124 9.124 0 0 1-1.565-.667A6.964 6.964 0 0 0 1.018 7.5zM3.05 3.049c.362.184.763.349 1.198.49.142-.384.304-.744.481-1.078a6.7 6.7 0 0 1 .597-.933A7.01 7.01 0 0 0 3.051 3.05zM8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm-.5 1.077c-.67.204-1.335.82-1.887 1.855-.143.268-.276.56-.395.872.705.157 1.473.257 2.282.287V1.077zm0 4.014c-.91-.03-1.783-.145-2.591-.332a12.344 12.344 0 0 0-.4 2.741H7.5V5.091zm1 2.409V5.091c.91-.03 1.783-.145 2.591-.332.223.827.364 1.754.4 2.741H8.5zm-1 1H4.51c.035.987.176 1.914.399 2.741A13.596 13.596 0 0 1 7.5 10.91V8.5zm1 2.409V8.5h2.99a12.343 12.343 0 0 1-.399 2.741A13.596 13.596 0 0 0 8.5 10.91zm-1 1c-.81.03-1.577.13-2.282.287.12.312.252.604.395.872.552 1.035 1.218 1.65 1.887 1.855V11.91zm-2.173 2.563a6.695 6.695 0 0 1-.597-.933 8.857 8.857 0 0 1-.481-1.078 8.356 8.356 0 0 0-1.198.49 7.01 7.01 0 0 0 2.276 1.52zM2.38 12.175c.47-.258.995-.482 1.565-.667A13.36 13.36 0 0 1 3.508 8.5h-2.49a6.964 6.964 0 0 0 1.362 3.675zm8.293 2.297a7.01 7.01 0 0 0 2.275-1.521 8.353 8.353 0 0 0-1.197-.49 8.859 8.859 0 0 1-.481 1.078 6.688 6.688 0 0 1-.597.933zm.11-2.276A12.63 12.63 0 0 0 8.5 11.91v3.014c.67-.204 1.335-.82 1.887-1.855.143-.268.276-.56.395-.872zm1.272-.688c.57.185 1.095.409 1.565.667A6.964 6.964 0 0 0 14.982 8.5h-2.49a13.355 13.355 0 0 1-.437 3.008zm.437-4.008h2.49a6.963 6.963 0 0 0-1.362-3.675c-.47.258-.995.482-1.565.667.248.92.4 1.938.437 3.008zm-.74-3.96a8.854 8.854 0 0 0-.482-1.079 6.692 6.692 0 0 0-.597-.933c.857.355 1.63.875 2.275 1.521a8.368 8.368 0 0 1-1.197.49zm-.97.264c-.705.157-1.473.257-2.282.287V1.077c.67.204 1.335.82 1.887 1.855.143.268.276.56.395.872z"})],-1),Qt={class:"option__desc"},ea={class:"option__title"},ta={class:"option_sub_title"},aa={key:0,class:"widgets-slot-block"},na={class:"widgets-time-slots"},ia=["onClick"],oa={key:2},ra={key:0,class:"text-info"},la=["textContent"],sa={key:0,class:"cal-row widgets-action-buttons"},ca={class:"col-md-4"},da=["disabled"],ua=n("svg",{width:"24",height:"22",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n("path",{d:"M24 12H4.59375L12.4922 19.8984L10.8047 21.5977L0 10.8047L10.8047 0L12.4922 1.69922L4.59375 9.59766H24V12Z",fill:"var(--appointment_widgets-primary-color)"})],-1),ma={class:"col-md-8 widgets-action"},fa={key:0},va=["disabled","textContent"],ga={key:1},ha=["disabled","textContent"],pa=["disabled","textContent"],ba={key:1,class:"appointment_widgets--booking appointment_widgets--confirmation"},Ca=n("div",{class:"widgets-confirmation-icon text-center"},[n("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n("circle",{opacity:"0.09",cx:"48",cy:"48",r:"48",fill:"#8CC767"}),n("path",{d:"M65 32.3333V65H30V32.3333H37V30H39.3333V32.3333H55.6667V30H58V32.3333H65ZM32.3333 34.6667V39.3333H62.6667V34.6667H58V37H55.6667V34.6667H39.3333V37H37V34.6667H32.3333ZM62.6667 62.6667V41.6667H32.3333V62.6667H62.6667ZM54.6458 48.6667L50.2526 52.112L52.0938 57.8542L47.5 54.263L42.9062 57.8542L44.7474 52.112L40.3542 48.6667H45.8594L47.5 43.5625L49.1406 48.6667H54.6458Z",fill:"#8CC767"})])],-1),_a={class:"confirmation-message"},Sa={key:0,class:"confirmation-invite-text"},wa={key:1,class:"hl_events-buttons"},ya=["href"],ka={xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"22",height:"22",viewBox:"0 0 48 48",style:{fill:"#000000"}},Da=be('',1),za=[Da],Fa={class:"calendar-button__text"},Ma=["href"],La={xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"22",height:"22",viewBox:"0 0 48 48",style:{fill:"#000000"}},xa=be('',1),Va=[xa],Ta={class:"calendar-button__text"},Ra=le({__name:"CalendarService",props:{calendarProvider:{type:Object,required:!1,default:()=>({})},calendarService:{type:Object,required:!1,default:()=>({})},calenderTimezone:{type:String,required:!0},isForSpecificService:{type:Boolean,required:!1,default:!1},calendarEvent:{type:Object,required:!1},calendarEventId:{type:String,required:!1},isForCancellation:{type:Boolean,required:!1,default:!1},isForReschedule:{type:Boolean,default:!1},isMobileVersion:{type:Boolean,default:!1},isTabletVersion:{type:Boolean,default:!1},redirect:{type:Boolean,default:!0},use24hFormat:{type:Boolean,default:!1},funnelPreview:{type:Boolean,default:!1},pageUrl:{type:String,default:void 0},baseReferrrer:{type:String,default:void 0},urlParams:{type:Object,default:void 0},stickyContactData:{type:Object,default:void 0},stickyContactFingerprint:{type:String,default:void 0}},emits:["clear-calendar-service","on-submit","moveToNextMonth"],setup(o,{emit:w}){const r=o;f.extend(Xe),f.extend(Je),f.extend(Qe),f.extend(et),f.extend(tt);const{t:d,locale:C}=se(),V=ge(),y=Le().public,{$bus:_}=xe(),D=X("en"),B=X(),i=b(()=>!!r.calendarService.recurringRule),H=b(()=>(!r.isForSpecificService||t.currentCalendarStep!==1||r.isMobileVersion&&t.appointmentDate)&&!t.isBackButtonDisabled),O=b(()=>!r.isMobileVersion||t.currentCalendarStep!==1&&t.appointmentDate),J=b(()=>re(r.calendarService.description,{length:240})),U=b(()=>{D.value;const l=[...f.weekdaysShort()];return l.push(l.shift()),l}),I=b(()=>(D.value,f.months())),M=b(()=>(D.value,r.calendarProvider&&r.calendarProvider.disableContactTimezone)),z=b(()=>{var a;return D.value,M.value?r.calenderTimezone:(a=t.selectedTimezone)==null?void 0:a.value}),N=b(()=>f(t.appointmentDate).tz(z.value)),j=b(()=>(D.value,f(t.appointmentDate).format("ddd, ll")));b(()=>r.calendarEvent?f(r.calendarEvent.start_time).format("ddd, ll"):void 0);const L=b(()=>(D.value,r.use24hFormat?"HH:mm":"hh:mm A")),Z=b(()=>t.filterTimezone?t.availableTimezones.filter(a=>a.label.toLowerCase().includes(t.filterTimezone.toLowerCase())):t.availableTimezones),W=b(()=>We(t.daySlots,f(t.appointmentDate).format("YYYY-MM-DD")+".slots",[]).map(a=>f(a).tz(z.value))),p=b(()=>r.calendarProvider&&r.calendarProvider.startDayOfWeek),g=b(()=>[{tag:"first_name",label:d("first_name"),active:!1,placeholder:d("first_name"),type:"text",required:!0},{placeholder:d("last_name"),type:"text",required:!0,tag:"last_name",label:d("last_name"),active:!1},{placeholder:d("phone"),type:"text",required:!0,tag:"phone",label:d("phone"),active:!1},{active:!1,type:"email",required:!0,placeholder:d("email"),tag:"email",label:d("email")},{active:!1,type:"textarea",required:!1,placeholder:d("anything_youd_like_to_know_before_appointment"),tag:"calendar_notes",label:d("additional_information")},{label:"Button",tag:"button",type:"submit",placeholder:"Button"}]),k=b(()=>r.calendarService?r.calendarService.pixel_id:null),v=f.tz.guess(),t=he({timezone:v,calendarStartingDate:f().tz(v).format("YYYY-M-D"),appointmentDate:void 0,calendarRange:{from:f().tz(v).format("YYYY-M-D")},availableTimezones:[],selectedTimezone:void 0,filterTimezone:"",formData:void 0,appointmentId:void 0,seqCall:0,isLoading:!1,isFetchingSlots:!1,isBackButtonDisabled:!1,isNextMonthDisabled:!1,submissionError:"",daySlots:{},availableTimes:[],showNoDates:!1,selectedSlot:null,showRecurringSlots:!1,recurringSlots:[],loadingRecurringSlots:!1,currentCalendarStep:1,cancellationNote:"",isCancelled:!1,showFullDecsription:!1,locationAddress:void 0,formThankyouMessage:void 0});if(r.calendarService.allow_booking_for_unit&&r.calendarService.allow_booking_for){const a=f().tz(t.timezone).add(r.calendarService.allow_booking_for,r.calendarService.allow_booking_for_unit).endOf("day");t.calendarRange.to=f(a).tz(f.tz.guess(),!0).format("YYYY-M-D")}r.calendarService.allow_booking_after_unit&&r.calendarService.allow_booking_after_unit!=="hours"&&r.calendarService.allow_booking_after&&(t.calendarRange.from=f().tz(t.timezone).add(r.calendarService.allow_booking_after,r.calendarService.allow_booking_after_unit).startOf("day").format("YYYY-M-D")),pe(async()=>{C.value!=="en"&&(window.dayjs=f,await Oe(`unpkg.com/dayjs@1.8.21/locale/${C.value}.js`,()=>{f.locale(C.value),D.value=C.value})),P(),Q(),M.value&&ee(!0,!0),!r.funnelPreview&&k.value!==void 0&&k.value!==""&&ne(()=>{Ue(k.value)}),ne(()=>{if(r.calendarService&&r.calendarService.code_block){const a=document.createRange();a.setStart(document.head,0),document.body.appendChild(a.createContextualFragment(r.calendarService.code_block))}})}),K(()=>t.selectedTimezone,()=>{ee(!0,r.isMobileVersion===!1)}),K(()=>t.appointmentDate,a=>{a&&(t.selectedSlot=void 0)}),K(()=>t.selectedSlot,a=>{try{if(i.value&&a){t.showRecurringSlots=!0;const l=new Date(a).getTime();ce(l,t.selectedTimezone.value)}else t.showRecurringSlots=!1,t.recurringSlots=[]}catch(l){console.error(l),t.showRecurringSlots=!1,t.recurringSlots=[]}});async function ce(a,l){t.loadingRecurringSlots=!0;const S=await Se.getRecurringSlots(r.calendarService.id,{selectedSlot:a,timezone:l});t.recurringSlots=S.map(m=>{const F=f(m.slot).format("ddd, ll"),T=f(m.slot).tz(l),x=T.format(L.value),Y=T.clone().add(r.calendarService.slot_duration,"m").format(L.value);return{text:`${F} [ ${x} - ${Y} ]`,isUnavailable:m.status!=="AVAILABLE"}}),t.loadingRecurringSlots=!1}function P(){ie.includes(t.timezone)||ie.push(t.timezone),t.availableTimezones=je(ie.map(a=>{const l=f().tz(a);return{label:`GMT${l.format("Z")} ${a} (${l.format("z")})`,sortFormat:l.format("z"),value:a,currentTime:l.format(L.value),utcOffset:l.utcOffset()}}),"utcOffset"),t.selectedTimezone=t.availableTimezones.find(a=>a.value===(M.value?r.calenderTimezone:t.timezone))}async function Q(){if(r.calendarService&&!r.calendarService.form_id)t.formData=A();else{const a=await $fetch(y.newBaseURL+"/form/"+r.calendarService.form_id),l=a.form.fields;if(l.length>0){l[l.length-1],a.form.button={background:"#188bf6",color:"#fff",border:{border:0,padding:15,radius:4}};const m=l.find(F=>F.type==="submit")?1:0;r.calendarService.stripe&&l.splice(l.length-m,0,{tag:"payment",label:"Payment",active:!1,placeholder:"",type:"payment",required:!0})}a.form.style.marginTop="10px",a.form.width="auto",t.formData=a}}function A(){const a={},l=g.value;return a.form=[],r.calendarService.stripe&&l.push({tag:"payment",label:d("payment"),active:!1,placeholder:"",type:"payment",required:!0}),a.form={width:"550",formLabelVisible:!0,fbPixelId:"",layout:!0,customStyle:"",stickyContact:!!r.calendarService.sticky_contact,fields:l,align:"center"},a.country=r.calendarProvider.country,a.locationId=r.calendarService.location_id,a}function de({month:a,year:l}){t.calendarStartingDate=`${l}-${a+1}-1`,t.selectedSlot=void 0,ee(!0,!0)}function we(a){t.isNextMonthDisabled=a}async function ee(a=!1,l=!1){t.isLoading=!0,t.isFetchingSlots=!0,a&&(t.daySlots={}),t.showNoDates=!1,t.seqCall++;const S=t.seqCall,m=f(t.calendarStartingDate,"YYYY-M-D"),F=m.clone().startOf("month"),T=m.clone().endOf("month"),x=await $fetch(y.newBaseURL+"/appointment/free-slots",{params:{calendar_id:r.calendarService.id,startDate:F.valueOf(),endDate:T.valueOf(),timezone:z.value,user_id:V.query.user_id}});if(S!==t.seqCall)return;t.daySlots={...t.daySlots,...x},t.availableTimes=Object.keys(x).map(me=>f(me).format("YYYY-M-D"));const Y=Object.keys(x);l&&Y.length>0?f(Y[0],"YYYY-M-D").isSame(f(t.calendarStartingDate,"YYYY-M-D"),"month")&&(r.isMobileVersion||(t.appointmentDate=Object.keys(x)[0])):Y.length===0&&(t.showNoDates=!0),t.isLoading=!1,t.isFetchingSlots=!1}function te(a){return a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()}function ye(a){var F,T,x;let{to:l,from:S}=t.calendarRange,m=a;try{if(l&&(l=(F=f(l,"YYYY-M-D"))==null?void 0:F.tz(z.value)),S=(x=(T=f(S,"YYYY-M-D"))==null?void 0:T.tz(z.value))==null?void 0:x.hour(0),a=f(te(a),"YYYY-M-D").tz(z.value,!0),l&&(a==null?void 0:a.isAfter(l))||S&&(a==null?void 0:a.isBefore(S)))return!0}catch{if(l&&new Date(te(a))>new Date(l)||S&&new Date(te(a))0?!t.availableTimes.includes(m.getFullYear()+"-"+(m.getMonth()+1)+"-"+m.getDate()):!0}function ke(){t.currentCalendarStep===1?r.isMobileVersion&&t.appointmentDate?(t.selectedSlot=void 0,t.appointmentDate=void 0):w("clear-calendar-service"):t.currentCalendarStep--}function ae(){t.currentCalendarStep===1?r.isForReschedule?De():t.currentCalendarStep++:t.currentCalendarStep===2&&_.$emit("submitCalendarForm",{isRecurring:i.value})}async function De(){t.isLoading=!0,await $fetch(y.baseUrl+"/appointment",{method:"POST",body:{event_id:r.calendarEventId,selected_slot:t.selectedSlot,timezone:z.value,calendar_id:r.calendarService.id}}),t.appointmentId=r.calendarEventId,t.currentCalendarStep=3,t.isLoading=!1}function ze(a){ne(()=>{Ne("track","Schedule",(a==null?void 0:a.fbEventId)||"")});const l=V.query.redirect||void 0;if(window.parent.postMessage(["msgsndr-booking-complete",{fingerprint:a.fingerprint,calendarId:r.calendarService.id}],"*"),l==="false"||l===!1||r.redirect===!1){w("on-submit",a);return}const S=a.calendarThankYouUrl||r.calendarService.form_submit_type==="RedirectURL"&&r.calendarService.form_submit_redirect_url;if(S){let m=fe(S,a.cookiePayload);m||(m=fe(a.calendarThankYouUrl,a.cookiePayload)),window.top.location.href=m}else t.formThankyouMessage=Ie(r.calendarService.form_submit_thanks_message,a.cookiePayload),t.appointmentId=a.id,t.locationAddress=a.event_address,t.currentCalendarStep++}function Fe(a){a&&a.error&&(t.submissionError=a.error),t.isBackButtonDisabled=!1}async function Me(){t.isLoading=!0,await $fetch(y.baseUrl+`/appointment/${r.calendarEventId}/cancel`,{method:"POST",body:{reason:t.cancellationNote}}),t.isCancelled=!0,t.isLoading=!1}function ue(a){t.showFullDecsription&&(!a||!r.isTabletVersion&&!r.isMobileVersion)&&(t.showFullDecsription=!1)}return b(()=>{var a,l;return((a=r.calendarService)==null?void 0:a.stripe)&&Object((l=r.calendarService)==null?void 0:l.stripe).hasOwnProperty("amount")}).value&&Ee({script:[{src:"https://js.stripe.com/v3/",async:!0,type:"text/javascript"}]}),(a,l)=>{var S;return e(t).currentCalendarStep!==3?(s(),u("div",{key:0,class:"appointment_widgets--booking",onClick:l[8]||(l[8]=m=>ue(!0))},[n("div",{class:$(["cal-row appointment_widgets--container",{"has-action-buttons":o.isForCancellation||e(H)||e(O)}])},[n("div",Rt,[n("div",$t,[n("div",Bt,[n("h6",{class:"provider-name",textContent:c(((S=o.calendarProvider)==null?void 0:S.calendar_provider_name)||"")},null,8,Pt)]),n("h4",{class:"widgets--service-name",textContent:c(o.calendarService.name)},null,8,At),n("p",{class:$(["widgets--service-description",{"show-more":e(t).showFullDecsription}])},[R(c(e(t).showFullDecsription?o.calendarService.description:e(J))+" ",1),o.calendarService&&o.calendarService.description&&o.calendarService.description.length>240&&!e(t).showFullDecsription?(s(),u("span",{key:0,class:"pointer",onClick:l[0]||(l[0]=q(m=>e(t).showFullDecsription=!0,["stop","prevent"]))},c(e(d)("more")),1)):o.calendarService&&o.calendarService.description&&o.calendarService.description.length>240?(s(),u("span",{key:1,class:"pointer",onClick:l[1]||(l[1]=q(m=>ue(!1),["stop","prevent"]))},c(e(d)("less")),1)):h("",!0)],2)]),o.isForCancellation?h("",!0):(s(),oe(ve,{key:0,calendarEvent:o.calendarEvent,selectedTimezone:e(t).selectedTimezone,disableContactTimezone:e(M),appointmentDateFormat:e(j),selectedSlot:e(t).selectedSlot,slotDuration:o.calendarService.slot_duration,dynamicHourFormat:e(L),locationAddress:e(t).locationAddress,recurringRule:o.calendarService.recurringRule,recurringSlots:e(t).recurringSlots,isRecurringLoading:e(t).loadingRecurringSlots,recurringObject:o.calendarService.recurring},null,8,["calendarEvent","selectedTimezone","disableContactTimezone","appointmentDateFormat","selectedSlot","slotDuration","dynamicHourFormat","locationAddress","recurringRule","recurringSlots","isRecurringLoading","recurringObject"]))]),n("div",{class:$([{"selected-date":e(t).appointmentDate&&!e(t).isLoading},{"step-form":e(t).currentCalendarStep===2},"appointment_widgets--steps"])},[o.isForCancellation?(s(),u("div",Yt,[e(t).isCancelled?(s(),u("h5",Ot,c(e(d)("your_appointment_has_been_cancelled")),1)):(s(),u("div",Et,[n("label",Ht,c(e(d)("cancellation_reason")),1),Ve(n("textarea",{"onUpdate:modelValue":l[2]||(l[2]=m=>e(t).cancellationNote=m),class:"form-control",rows:"5",style:{resize:"none"}},null,512),[[Te,e(t).cancellationNote]])]))])):e(t).currentCalendarStep===1?(s(),u("div",It,[n("div",jt,[o.isMobileVersion?(s(),u("h4",qt,c(e(t).appointmentDate?e(d)("choose_time_slot"):e(d)("select_a_date")),1)):(s(),u("h4",Ut,c(e(d)("select_a_date_and_time")),1)),n("div",Nt,[E(qe,{ref_key:"datePickerRef",ref:B,modelValue:e(t).appointmentDate,"onUpdate:modelValue":l[3]||(l[3]=m=>e(t).appointmentDate=m),format:"YYYY-MM-DD",displayFormat:"YYYY-MM-DD",hasInputElement:!1,isDateDisabled:ye,disablePeriodControl:!0,calendarRange:e(t).calendarRange,placeholder:e(d)("date_of_birth"),joinNextPreviousArrow:!0,onChangedMonth:de,onChangedYear:de,onDisableNextMonth:we,weekdays:e(U),months:e(I),nextMonthCaption:e(d)("next_month"),prevMonthCaption:e(d)("previous_month"),class:"date-picker-calendar",startDayOfWeek:e(p)},null,8,["modelValue","calendarRange","placeholder","weekdays","months","nextMonthCaption","prevMonthCaption","startDayOfWeek"]),!e(t).isLoading&&e(t).showNoDates?(s(),u("div",{key:0,onClick:l[5]||(l[5]=m=>e(B).incrementMonth()),class:"datepick-info"},[e(N)?(s(),u("div",Zt,[R(c(e(d)("no_slot_available_this_month"))+" ",1),e(t).isNextMonthDisabled?h("",!0):(s(),u("a",{key:0,onClick:l[4]||(l[4]=m=>a.$emit("moveToNextMonth",1))},[R(c(e(d)("go_to_next_month"))+" ",1),Wt]))])):h("",!0)])):h("",!0),e(t).isFetchingSlots?(s(),u("div",Gt,[n("div",Kt,c(e(d)("finding_open_available_slots")),1)])):h("",!0),n("div",Xt,[e(M)?h("",!0):(s(),oe(e(Ze),{key:0,modelValue:e(t).selectedTimezone,"onUpdate:modelValue":l[6]||(l[6]=m=>e(t).selectedTimezone=m),closeOnSelect:!0,allowEmpty:!1,"show-labels":!1,options:e(Z),label:"label",placeholder:e(d)("type_here_to_search_timezone"),class:"multi_select_calendar"},{singleLabel:G(m=>[Jt,R(" "+c(m.option.label),1)]),option:G(m=>[n("div",Qt,[n("span",ea,c(m.option.label),1),n("span",ta,c(m.option.currentTime),1)])]),noResult:G(()=>[R(c(e(d)("no_timezone_found")),1)]),_:1},8,["modelValue","options","placeholder"]))])])]),E(Re,{name:o.isMobileVersion?"":"fade"},{default:G(()=>[e(t).appointmentDate&&!e(t).isLoading?(s(),u("div",aa,[n("ul",na,[(s(!0),u(Ce,null,_e(e(W),(m,F)=>(s(),u("li",{class:$(["widgets-time-slot",{actived:e(t).selectedSlot&&e(t).selectedSlot.valueOf()===m.valueOf()}]),key:F,onClick:T=>e(t).selectedSlot=m},[n("span",null,c(m.format(e(L))),1),o.isMobileVersion?(s(),u("button",{key:0,class:"btn",onClick:ae},c(e(d)("select_time")),1)):h("",!0)],10,ia))),128))])])):h("",!0)]),_:1},8,["name"])])):e(t).currentCalendarStep===2?(s(),u("div",oa,[o.calendarService.form_id?h("",!0):(s(),u("h4",ra,c(e(d)("enter_your_information")),1)),e(t).submissionError?(s(),u("div",{key:1,textContent:c(e(t).submissionError),class:"error appointment-error"},null,8,la)):h("",!0),E(Ge,{timezone:e(z),formId:o.calendarService.form_id,formData:e(t).formData,calendar:o.calendarService,selectedSlot:e(t).selectedSlot,onStep:ze,onProcessError:Fe,onDisableBackOnSubmit:l[7]||(l[7]=m=>e(t).isBackButtonDisabled=!0),calendarEventId:o.calendarEventId,forCalendarV3:!0,class:"hl_widget-step2",funnelPreview:o.funnelPreview,pageUrl:o.pageUrl,urlParams:o.urlParams,baseReferrrer:o.baseReferrrer,stickyContactData:o.stickyContactData,stickyContactFingerprint:o.stickyContactFingerprint},null,8,["timezone","formId","formData","calendar","selectedSlot","calendarEventId","funnelPreview","pageUrl","urlParams","baseReferrrer","stickyContactData","stickyContactFingerprint"])])):h("",!0)],2)],2),o.isForCancellation||e(H)||e(O)?(s(),u("footer",sa,[n("div",ca,[e(H)?(s(),u("a",{key:0,onClick:ke,class:"action-back-link",disabled:e(t).isBackButtonDisabled},[ua,R(" "+c(e(d)("back")),1)],8,da)):h("",!0)]),n("div",ma,[o.isForCancellation?(s(),u("div",fa,[e(t).isCancelled?h("",!0):(s(),u("button",{key:0,class:"btn",onClick:Me,disabled:!e(t).cancellationNote||e(t).isLoading,textContent:c(e(t).isLoading?e(d)("cancelling"):e(d)("cancel_appointment"))},null,8,va))])):o.isForReschedule?(s(),u("div",ga,[n("button",{class:"btn",onClick:ae,disabled:!e(t).selectedSlot||e(t).isLoading,textContent:c(e(t).isLoading?e(d)("rescheduling"):e(d)("Reschedule"))},null,8,ha)])):e(O)?(s(),u("button",{key:2,class:"btn btn-schedule",onClick:ae,disabled:!e(t).selectedSlot||e(t).isBackButtonDisabled||e(t).isLoading||e(t).loadingRecurringSlots,textContent:c(e(t).currentCalendarStep===1?e(t).isLoading||e(t).loadingRecurringSlots?e(t).isLoading?e(d)("fetching_slots"):e(d)("fetching_recurring_slots"):e(d)("continue"):e(t).isBackButtonDisabled?e(d)("scheduling"):e(d)("schedule_meeting"))},null,8,pa)):h("",!0)])])):h("",!0)])):(s(),u("div",ba,[n("div",null,[Ca,n("h5",_a,c(o.isForReschedule?e(d)("your_meeting_has_been_rescheduled"):e(d)("your_meeting_has_been_scheduled")),1),e(t).formThankyouMessage?(s(),u("p",Sa,c(e(t).formThankyouMessage)+" ",1)):h("",!0),E(ve,{calendarEvent:o.calendarEvent,disableContactTimezone:e(M),selectedTimezone:e(t).selectedTimezone,appointmentDateFormat:e(j),selectedSlot:e(t).selectedSlot,slotDuration:o.calendarService.slot_duration,dynamicHourFormat:e(L),horizontal:!0,locationAddress:e(t).locationAddress,recurringRule:o.calendarService.recurringRule,recurringSlots:e(t).recurringSlots,isRecurringLoading:e(t).loadingRecurringSlots,recurringObject:o.calendarService.recurring},null,8,["calendarEvent","disableContactTimezone","selectedTimezone","appointmentDateFormat","selectedSlot","slotDuration","dynamicHourFormat","locationAddress","recurringRule","recurringSlots","isRecurringLoading","recurringObject"]),e(t).appointmentId?(s(),u("div",wa,[n("a",{href:e(y).baseUrl+`/google/calendar/add-event/${e(t).appointmentId}`,class:"calendar-button",target:"_blank"},[(s(),u("svg",ka,za)),n("span",Fa,c(e(d)("add_to_google_calendar")),1)],8,ya),n("a",{href:e(y).baseUrl+`/google/calendar/get-ics/${e(t).appointmentId}`,class:"calendar-button",target:"_blank"},[(s(),u("svg",La,Va)),n("span",Ta,c(e(d)("add_to_outlook_ical")),1)],8,Ma)])):h("",!0)])]))}}}),$a={class:"appointment_widgets--branding"},Ba=["textContent"],Pa={class:"appointment_widgets--services"},Aa=["onMouseover","onClick"],Ya=["textContent"],Ea=["textContent"],Za=le({__name:"CalendarComponentv3",props:["calendarData","directWidget","redirect","funnelPreview","pageUrl","baseReferrrer","urlParams","stickyContactData","stickyContactFingerprint"],emits:["on-submit"],async setup(o,{emit:w}){var N,j,L,Z,W;let r,d;const C=o,V={"#D50000":"rgb(213, 0, 0)","#E67C73":"rgb(230, 124, 115)","#F4511E":"rgb(244, 81, 30)","#F6BF26":"rgb(246, 191, 38)","#33B679":"rgb(51, 182, 121)","#0B8043":"rgb(11, 128, 67)","#039BE5":"rgb(3, 155, 229)","#3F51B5":"rgb(63, 81, 181)","#7986CB":"rgb(121, 134, 203)","#8E24AA":"rgb(142, 36, 170)","#616161":"rgb(97, 97, 97)"},{locale:y}=se(),_=ge(),D=$e(),B=X(),i=he({services:[],activeService:void 0,calendarServiceSlug:void 0,calendarServiceId:void 0,showFullDecsription:!1,isMobileVersion:!1,isTabletVersion:!1,isForSpecificService:!1,isForCancellation:!1,isForReschedule:!1,calendarEvent:void 0,use24hFormat:!1,responsiveClass:"appointment_widgets-lg",calendarProvider:{},eventId:"",timezone:""});K(()=>i.calendarServiceSlug,p=>{if(C.directWidget&&!i.isForSpecificService){const g=Object.assign({},_.params),k=Object.assign({},_.query);g.service=p,D.push({params:g,query:k})}});const H=b(()=>i.services?i.services.find(p=>{var g;return((g=p.slug)==null?void 0:g.toLowerCase())===i.calendarServiceSlug||p.id===i.calendarServiceSlug}):void 0),O=b(()=>i.calendarProvider&&i.calendarProvider.calendar_provider_description?re(i.calendarProvider.calendar_provider_description,{length:330}):"");if(C.calendarData){i.calendarProvider=C.calendarData.calendarProvider,i.timezone=C.calendarData.timezone,i.eventId=C.calendarData.eventId;const p=_.name==="booking-slug"||_.name==="widget-bookings-slug"||_.name==="widget-booking-slug-slug"||_.name==="widget-booking-id"||_.name==="appointment-service"||_.name==="cancel-appointment"||C.funnelPreview&&!((N=C==null?void 0:C.calendarData)!=null&&N.isTeamSelected),g=i.eventId&&_.path.endsWith("cancel"),k=i.eventId&&!g;i.isForSpecificService=p,i.isForCancellation=g,i.isForReschedule=k,i.calendarEvent=C.calendarData.calendarEvent,i.services=([r,d]=Be(async()=>Promise.all(C.calendarData.services.map(async v=>{if(v.event_color||(v.event_color="#8E24AA"),v.enable_recurring){const{booking_option:t,booking_overlap_default_status:ce,...P}=v.recurring,Q={freq:P.freq,count:P.count,interval:P.interval||1,monthDays:P.month_days,weekDays:P.week_days};try{const A=await Se.generateRRuleText(Q);v.recurringRule=(A[0].toUpperCase()+A.slice(1)).replace("time","occurrence")}catch(A){console.error(A),v.recurringRule="-"}}return v.lightColor=V[v.event_color].replace(")",", 0.50)"),v.shortDescription=re(v.description,{length:70}),v}))),r=await r,d(),r),i.use24hFormat=_.query.use24hFormat!==void 0||i.calendarProvider.use24hFormat,_.query.lang?(y.value=_.query.lang,f.locale(_.query.lang)):y.value!==((j=i.calendarProvider)==null?void 0:j.language)&&(y.value=((L=i.calendarProvider)==null?void 0:L.language)||"en",f.locale(y.value)),p?i.services&&i.services.length>0&&(i.calendarServiceSlug=(Z=i.services[0].slug)==null?void 0:Z.toLowerCase()):i.calendarServiceSlug=(W=_.params.service)==null?void 0:W.toLowerCase()}pe(()=>{M(),I(),window.addEventListener("resize",I)}),Pe(()=>{window.removeEventListener("resize",I)});function J(p){return[...p].sort((g,k)=>g.order&&k.order?g.order-k.order:k.date_added._seconds-g.date_added._seconds)}function U(p){i.showFullDecsription&&(!p||!i.isTabletVersion&&!i.isMobileVersion)&&(i.showFullDecsription=!1)}function I(){{const p=B.value;p.clientWidth<726?i.isMobileVersion=!0:p.clientWidth<982?(i.isTabletVersion=!0,i.isMobileVersion=!1):(i.isTabletVersion=!1,i.isMobileVersion=!1),p.clientWidth>=1128?i.responsiveClass="appointment_widgets-xl":p.clientWidth>=982?i.responsiveClass="appointment_widgets-lg":p.clientWidth>=726?i.responsiveClass="appointment_widgets-md":i.responsiveClass="appointment_widgets-sm"}}function M(){if(C.directWidget)return;const p=B.value;if(!!p){const g=parseInt(p.scrollHeight);window.parent.postMessage(["highlevel.setHeight",{height:g>500?g+50:560,id:"msgsndr-calendar"}],"*")}}function z(p){w("on-submit",p)}return Ae(()=>{M()}),(p,g)=>{var k;return s(),u("div",{id:"appointment_widgets",class:$(["hl-app",e(i).responsiveClass]),ref_key:"hlWidget",ref:B},[n("div",{class:$(["appointment_widgets--inner",{"direct-widget":o.directWidget!=!1}])},[!e(i).isForSpecificService&&!e(i).calendarServiceSlug&&e(i).calendarProvider?(s(),u("div",{key:0,class:"container appointment_service--list",onClick:g[3]||(g[3]=v=>U(!0))},[n("div",$a,[n("h3",{class:"branding-name",textContent:c(e(i).calendarProvider.calendar_provider_name)},null,8,Ba),n("div",{class:$(["branding-detail",{"show-more":e(i).showFullDecsription}])},[R(c(e(i).showFullDecsription?e(i).calendarProvider.calendar_provider_description:e(O))+" ",1),e(i).calendarProvider&&e(i).calendarProvider.calendar_provider_description&&e(i).calendarProvider.calendar_provider_description.length>230&&!e(i).showFullDecsription?(s(),u("span",{key:0,class:"pointer",onClick:g[0]||(g[0]=q(v=>e(i).showFullDecsription=!0,["stop","prevent"]))},"more...")):e(i).calendarProvider&&e(i).calendarProvider.description&&e(i).calendarProvider.description.length>230?(s(),u("span",{key:1,class:"pointer",onClick:g[1]||(g[1]=q(v=>U(!1),["stop","prevent"]))},"less")):h("",!0)],2)]),n("div",Pa,[(s(!0),u(Ce,null,_e(J(e(i).services),v=>(s(),u("div",{class:"appointment_widgets--service-col",key:v.id},[n("div",{class:"appointment_widgets--service",style:Ye({borderLeftColor:e(i).activeService===v.id?v.event_color:v.lightColor,borderTopColor:e(i).activeService===v.id?v.event_color:""}),onMouseover:t=>e(i).activeService=v.id,onMouseout:g[2]||(g[2]=t=>e(i).activeService=null),onClick:t=>e(i).calendarServiceSlug=v.slug||v.id},[n("h3",{class:"appointment_service--name",textContent:c(v.name)},null,8,Ya),n("p",{textContent:c(v.shortDescription)},null,8,Ea)],44,Aa)]))),128))])])):(s(),oe(Ra,{key:1,isForSpecificService:e(i).isForSpecificService,calendarEvent:e(i).calendarEvent,calendarProvider:e(i).calendarProvider,calendarService:e(H),calenderTimezone:(k=e(i).calendarProvider)==null?void 0:k.timezone,calendarEventId:e(i).eventId,isForCancellation:e(i).isForCancellation,isForReschedule:e(i).isForReschedule,isMobileVersion:e(i).isMobileVersion,isTabletVersion:e(i).isTabletVersion,use24hFormat:e(i).use24hFormat,redirect:o.redirect,funnelPreview:o.funnelPreview,pageUrl:o.pageUrl,urlParams:o.urlParams,baseReferrrer:o.baseReferrrer,stickyContactData:o.stickyContactData,stickyContactFingerprint:o.stickyContactFingerprint,onClearCalendarService:g[4]||(g[4]=v=>e(i).calendarServiceSlug=void 0),onOnSubmit:z},null,8,["isForSpecificService","calendarEvent","calendarProvider","calendarService","calenderTimezone","calendarEventId","isForCancellation","isForReschedule","isMobileVersion","isTabletVersion","use24hFormat","redirect","funnelPreview","pageUrl","urlParams","baseReferrrer","stickyContactData","stickyContactFingerprint"]))],2)],2)}}});export{Za as _};