PageSourceSearch

https://stcdn.leadconnectorhq.com/_preview/BCTmLNXs.js

js leadconnectorhq.com collected 2026-10-01 07:41:51 UTC 104,340 bytes, 10 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./PhoneElement.CqrgXvy-.css","./TextBoxListElement.BbmoZcvv.css","./RatingElement.BNAg3U6O.css","./useUploadSubmitDisable.DpGolzH4.css","./EmailElement.DP0Ck0Xs.css","./HeadingElement.DR4pIBhF.css","./CaptchaElement.Ub75Cm5P.css","./MonetaryElement.BRMpKduQ.css","./PictureChoiceElement.BSqlQBhg.css","./CheckBoxElement.DT7KCjIJ.css","./TermsAndConditionsElement.BxLPH8H1.css","./RadioOptionElement.BX1yTEcV.css","./OptionElement.BqgLznve.css","./DatePick.CgU1guwP.css","./DateElement.BQW2Sofv.css","./AuthorizeNetPaymentElement.CzbIxpAk.css","./ghl-payment-element.B8fA3rJs.css","./FormSurveyPayment.BA2QkhDE.css","./vue-multiselect.B5exX717.css","./FileUploadElement.1UgDw_xY.css","./SignatureElement.DeR-O3Sf.css","./FormSurveyAddressElement.EX39aLc-.css","./TextAreaElement.CLLI-KzT.css","./authorizeNet.goKbu3C6.css","./AddGuest.Cs2ljbPB.css","./app.DVqQD2Si.css","./AddGuestOld.BYkUrJkc.css","./OrderConfirmation.D1Jw5vHX.css","./ThanksMessage.CXpMzjpn.css","./RazorPayErrorPopup.BmAiZy8Q.css","./CalendarPaymentPage.BbbO58xR.css"])))=>i.map(i=>d[i]);
2import{c_ as Y,eE as Xn,c$ as Za,d0 as er,c3 as bo,af as tr,r as p,A as Zn,cw as So,eW as or,C as yt,fw as Ta,fx as ka,eG as ei,fy as ti,fz as Io,eH as zt,p as oi,cW as Me,f as ar,fA as ai,cY as gt,a1 as ri,c as k,e as Da,db as ni,dE as ii,cq as we,u as si,$ as li,Z as di,cC as ui,f4 as mi,a as Aa,Y as Ue,fm as ci,a3 as fi,D as ct,fn as mo,L as pi,eB as yi,f5 as gi,x as hi,y as Se,I as vi,el as _i,w as co,f7 as Va,cX as Rt,a$ as bi,M as F,N as Ie,ah as o,ao as T,ag as Fe,aA as fe,aF as Si,a5 as re,ai as ze,dF as ge,aJ as La,aK as Ii,e1 as q,e0 as Fi,h as Ci,fB as ft,f8 as Ra,eF as Ei,l as Oa,f9 as fo,fo as Pi,cJ as N,aU as x,cs as wi,V as Ti}from"./Czd9XnOY.js";import{a as ki,f as Di,b as Ai,c as Vi,g as Li,i as Ri,S as Oi,_ as Ui,d as zi}from"./Zor3l5MU.js";import{_ as Mi}from"./CiHicUOY.js";import Ni from"./DcWETIxz.js";import xi from"./DkWY7KNh.js";import{h as rr,a as Bi,r as qi,_ as Hi}from"./e7kDfFDe.js";import Wi from"./D25S_EPb.js";import{u as $i,_ as Gi}from"./6LhTGb4e.js";/* empty css        */import{c as Ot}from"./D1OHNg6k.js";import{i as ji,f as Ua}from"./LMNLYufG.js";import{s as Fo,e as Mt,a as Co,g as za,b as nr,ac as Yi,aa as Ma,i as po,ad as Ut,ag as Ki,f as Qi,am as yo,ae as Ji,al as Xi,ar as Zi,ao as es,an as ts,af as os,ap as as,C as Na}from"./D2kFVVdL.js";import{u as rs,c as ns,o as is,s as ss,i as ls,h as ds,b as us,j as xa,k as ms,l as cs,n as fs,d as ps,e as ys,a as Ba,g as gs,f as hs,m as vs}from"./DyzusnvZ.js";import{a as _s,u as bs,r as Ss}from"./BnOT4ZEB.js";import{u as Is,f as et,q as qa,c as Fs,e as Cs,g as Es,a as Ps,d as Ha,b as ws}from"./G-CFBxWp.js";import{P as Ts,g as Wa,G as $a,E as oe,J as ir,O as ht,A as ks,h as go,N as Ga,Q as Ds,R as As}from"./CgckR3XQ.js";import{L as sr,l as lr}from"./Bj4bmbxF.js";import{P as Nt}from"./ubaDBVG5.js";import{a as dr}from"./jSa5xWPX.js";import{r as Eo}from"./BPzZT6qn.js";import{A as ho}from"./DRNKrJGC.js";import{F as he,a as Vs,g as Ls}from"./ByvA4E7P.js";import Rs from"./D93RmGd0.js";import{l as Os,g as ja,G as Ya}from"./BwGSCNKy.js";import{s as Us}from"./B_sB1hos.js";import"./DFFyfcYC.js";import{u as zs}from"./46BuY3JG.js";import{c as Ka}from"./YUlAboDm.js";const xe={EMAIL:"email",PHONE:"phone",EMAIL_AND_PHONE:"email_phone"},Ms=r=>{if(!r||r.guest_type==="count_only")return xe.EMAIL;const n=r.guest_collection_mode;return Object.values(xe).includes(n)?n:xe.EMAIL},ur=r=>r===xe.EMAIL||r===xe.EMAIL_AND_PHONE,wo=r=>r===xe.PHONE||r===xe.EMAIL_AND_PHONE,Id=()=>({name:"",email:"",phone:""}),Fd=(r,n)=>r.name===""||ur(n)&&r.email===""||wo(n)&&(r.phone??"")==="",Qa=(r,n)=>{const l=(r??"").trim();if(!l)return l;try{const d=typeof window<"u"?window?.libphonenumber?.parsePhoneNumberFromString(l,n):void 0;return!d||!d.isValid()||rr(l,d.nationalNumber)?l:d.number}catch{return l}},Po=(r,n,l)=>{const d=Qa(r,l),v=Qa(n,l);return!d||!v?!1:d===v},Cd=(r,n,l)=>r?l&&r===l?!0:(n??[]).filter(d=>d?.email===r).length>1:!1,Ed=(r,n,l,d)=>(r??"").trim()?Po(r,l,d)?!0:(n??[]).filter(v=>Po(r,v?.phone,d)).length>1:!1,Ns=(r,n)=>
2(r??[]).map(l=>{const d={name:(l?.name??"").trim()},v=(l?.email??"").trim(),_=(l?.phone??"").trim();return ur(n)&&v&&(d.email=v),wo(n)&&_&&(d.phone=_),d});Y.extend(Za);Y.extend(er);const xs=["timezone","tz"];function Bs(r,n){return!n||typeof n!="object"?r:{...n,...r}}function qs(r){for(const n of xs){const l=r[n],d=Array.isArray(l)?l[0]:l;if(typeof d=="string"&&d.length>0)return d}}function Hs(r){try{return Y.tz("2020-01-01",r).isValid()}catch{return!1}}function Ws(r){return Xn.includes(r)&&Hs(r)}function $s(r,n,l={}){if(l.disableContactTimezone&&l.calendarTimezone)return l.calendarTimezone;const d=qs(r);return d&&Ws(d)?d:n}function Gs(r,n){r.timezone=n,r.calendarStartingDate=Y().tz(n).format("YYYY-M-D"),r.calendarRange={from:Y().tz(n).format("YYYY-M-D"),to:r.calendarRange?.to??""}}function js(r,n){const l=Bs(n.query,n.urlParams),d=$s(l,n.fallback,{disableContactTimezone:n.disableContactTimezone,calendarTimezone:n.calendarTimezone});return Gs(r,d),d}Y.extend(dr);Y.extend(sr);Y.extend(lr);Y.extend(Za);Y.extend(er);const vo=Y.tz.guess(),Ys=["payment_intent","payment_intent_client_secret","redirect_status","sourceId","transactionId","altId","altType","setup_intent","setup_intent_client_secret"],Pd=r=>["payment_intent","payment_intent_client_secret","redirect_status","setup_intent","setup_intent_client_secret"].some(n=>r[n]),wd=(r,n)=>r||(n?oi(n):null)||{};function Ks(r,n){if(!r||!n||typeof n!="object")return r;const l=n.contact&&typeof n.contact=="object"?{...n,...n.contact}:n,d={id:l.id??l.customer_id,contact_id:l.id??l.customer_id,customer_id:l.id??l.customer_id,name:l.name??l.full_name,email:l.email??l.email_lower_case,phone:l.phone,first_name:l.first_name,last_name:l.last_name};try{const v=ai(r),_=r.startsWith("//"),A=!v&&!_&&r.startsWith("/"),c=v?new URL(r):_?new URL(`https:${r}`):new URL(r,"https://calendar-redirect.local");let w=!1;for(const[O,vt]of Object.entries(d)){if(!vt||!c.searchParams.has(O))continue;const _t=c.searchParams.get(O);(_t===""||_t===null)&&(c.searchParams.set(O,vt),w=!0)}return w?v?c.href:_?`//${c.host}${c.pathname}${c.search}${c.hash}`:`${A?c.pathname:c.pathname.slice(1)}${c.search}${c.hash}`:r}catch{return r}}const Td=(r,n)=>{const l=Me(r,n);return Ks(l,n)};function Ja(r){const n=r,l=n?.response?.msg||n?.data?.message||n?.data?.msg||n?.response?.data?.message||n?.response?.data?.msg||n?.response?._data?.message||n?.response?._data?.msg||n?.message||"";return Array.isArray(l)?l.join(", "):typeof l=="string"?l:""}class kd{state=bo({});newBaseUrl="";t=tr().t;newCardPaymentElementRef=p();constructor(){const n=ar();this.newBaseUrl=n.public.newBaseURL,this.newCardPaymentElementRef=p(),this.state=bo({prev:!1,isInitialFetch:!0,timezone:vo,calendarStartingDate:Y().tz(vo).format("YYYY-M-D"),appointmentDate:void 0,calendarRange:{from:Y().tz(vo).format("YYYY-M-D"),to:""},availableTimezones:[],selectedTimezone:void 0,selectedStaffMember:void 0,filterTimezone:"",formData:void 0,appointmentId:void 0,recurrenceId:void 0,appointmentIds:[],seqCall:0,isComponentLoading:!0,isLoading:!1,isFetchingSlots:!1,isBackButtonDisabled:!1,isSubmitting:!1,isNextMonthDisabled:!1,submissionError:"",paymentProcessingError:"",daySlots:{},availableTimes:[],showNoDates:!1,selectedSlot:null,selectedDurationMinutes:void 0,emptyDurationsForMonth:{},showRecurringSlots:!1,recurringSlots:[],loadingRecurringSlots:!1,isRecurringSlotLoaded:!1,currentCalendarStep:0,isFormFirst:!1,cancellationNote:"",isCancelled:!1,showFullDescription:!1,locationAddress:void 0,formThankyouMessage:void 0,guests:[],guestCountDetail:[],guestCount:void 0,terms_and_conditions:null,widgetConfiguration:void 0,calendar:{},showCalendarDetails:!0,showAllBookingDetails:!1,isRescheduling:!1,showFullThankYouMessage:!1,isForReschedule:!1,isMobileVersion:!1,isTabletVersion:!1,isForSpecificService:!1,calendarProvider:{},calenderTimezone:"",use24hFormat:!1,contact:void 0,contact_id:void 0,isRecurring:!1,showLoadingScreen:!1,isPaymentProcessing:!1,isPaymentInitiated:!1,paymentRes:void 0,isPaymentEnabled:!1,stepInfo:{},formSubmissionData:{},fetchFreeSlots:!0,showDatePicker:!0,isPaymentWindowExpire:!1,uniqueId:Zn(),autoNavigate:!1,shouldPayUsingPaymentElement:!0,paymentStatus:Ts.PENDING,setAutomatically:!1,meetingLocationId:void 0,bookerMeetingLocation:void 0,isSameContact:void 0,paymentSessionTimeoutSeconds:600,formattedAppointmentDate:void 0,isCustomPaymentProvider:!1,bookedSlot:void 0,isCustomPaymentProviderLoaded:!1,startSessionExpireTimer:!1,traceId:"",paymentSessionId:void 0,urlParam
2s:{},pageUrl:"",event:{},events:[],popup:!1,startDayOfWeek:1,disableContactTimezone:!1,serverError:"",noEventFound:!1,noCalendarError:!1,notes:"",thanksMsg:"",allLocationData:[],timezoneChangeState:!1,AMVisibleSlot:4,PMVisibleSlot:4,creatingAppointment:!1,calendarId:"",usePaymentElementInClassicWidget:!1,isProcessingRedirectPayment:!1,stepStartTime:0,analyticsSessionId:"",orderId:void 0,coupon:void 0,paymentEvent:{},isPaypalEnabled:!1,giftCardsSummary:[]})}getResolvedBookingSource(n="booking_widget"){return Eo(So().query,n)}setCustomState(n){["prev","isInitialFetch","timezone","calendarStartingDate","appointmentDate","calendarRange","availableTimezones","selectedTimezone","selectedStaffMember","filterTimezone","formData","appointmentId","recurrenceId","appointmentIds","seqCall","isComponentLoading","isLoading","isFetchingSlots","isBackButtonDisabled","isNextMonthDisabled","submissionError","paymentProcessingError","daySlots","availableTimes","showNoDates","selectedSlot","showRecurringSlots","recurringSlots","loadingRecurringSlots","currentCalendarStep","isFormFirst","cancellationNote","isCancelled","showFullDescription","locationAddress","guests","guestCountDetail","terms_and_conditions","widgetConfiguration","calendar","showCalendarDetails","showAllBookingDetails","isRescheduling","showFullThankYouMessage","isForReschedule","isMobileVersion","isTabletVersion","isForSpecificService","calendarProvider","calenderTimezone","use24hFormat","contact","contact_id","isRecurring","showLoadingScreen","isPaymentProcessing","isPaymentInitiated","isPaymentEnabled","stepInfo","formSubmissionData","fetchFreeSlots","showDatePicker","isPaymentWindowExpire","uniqueId","autoNavigate","shouldPayUsingPaymentElement","paymentStatus","setAutomatically","paymentSessionTimeoutSeconds","formattedAppointmentDate","isCustomPaymentProvider","bookedSlot","isCustomPaymentProviderLoaded","startSessionExpireTimer","traceId","paymentSessionId","isRecurringSlotLoaded","pageUrl","urlParams","event","events","popup","startDayOfWeek","disableContactTimezone","serverError","noEventFound","noCalendarError","notes","thanksMsg","allLocationData","timezoneChangeState","AMVisibleSlot","PMVisibleSlot","creatingAppointment","calendarId","usePaymentElementInClassicWidget","isSubmitting","analyticsSessionId","coupon","orderId","isPaypalEnabled","paymentEvent","giftCardsSummary","selectedDurationMinutes"].forEach(d=>{n[d]!==void 0&&(this.state[d]=n[d])})}resetSelectedSlot(){this.state.paymentSessionId||(this.state.selectedSlot=void 0)}setCalendarBookingState(n){this.state.calendar=n.calendarService,this.state.isForReschedule=n.isForReschedule,this.state.isMobileVersion=n.isMobileVersion,this.state.isTabletVersion=n.isTabletVersion,this.state.use24hFormat=n.use24hFormat,this.state.isForSpecificService=n.isForSpecificService,this.state.calendarProvider=n.calendarProvider,this.state.calenderTimezone=n.calenderTimezone,this.state.isRecurring=!!n?.calendarService?.recurringRule;const l=n.calendarService?.widget_config;l&&(this.state.widgetConfiguration={...l?.primarySettings,default:l?.default??!0});const d=Wa(n?.queryParams);d&&(this.state.widgetConfiguration=d);const v=l?.pageOrder?.find(A=>A.kind==="form");!n.isForReschedule&&(n.queryParams.isFormFirst==="true"||v?.position===0)?(this.state.isFormFirst=!0,this.setCurrentStep($a.FORM)):this.setCurrentStep($a.CALENDAR),n.queryParams?.shouldPayUsingPaymentElement&&(this.state.shouldPayUsingPaymentElement=n.queryParams?.shouldPayUsingPaymentElement==="true"),n.queryParams?.paymentSessionTimeoutSeconds&&(this.state.paymentSessionTimeoutSeconds=Number(n.queryParams?.paymentSessionTimeoutSeconds));const _=Wa(n.queryParams);this.state.isPaymentEnabled=this.state.calendar?.stripe&&Object(this.state.calendar.stripe).hasOwnProperty("amount"),this.state.isCustomPaymentProvider=this.state.calendar?.stripe?.paymentProvider==="custom-provider",_&&(n.widgetConfiguration=_),this.state.urlParams=n.urlParams,this.state.pageUrl=n.pageUrl,this.state.isPaypalEnabled=n.calendarService?.isPayPalEnabled||!1,js(this.state,{query:n.queryParams??{}
2,urlParams:n.urlParams,fallback:this.state.timezone,disableContactTimezone:n.calendarService?.disableContactTimezone,calendarTimezone:n.calenderTimezone})}setFormSubmissionData(n){this.state.contact?.id===n.contact.id&&(this.state.isSameContact=!0),this.state.contact=n.contact,this.state.contact_id=n?.fingerprint||n?.contact?.fingerprint||n?.contact?.id,this.state.guests=n?.formData?.guests||[],this.state.guestCount=n?.formData?.guestCount,this.state.terms_and_conditions=n?.formData?.terms_and_conditions,this.state.formSubmissionData={...n}}setCalendarBookingStateForConfirmationPage(n){this.state.isRecurring?(this.state.recurrenceId=n.appointment.recurrenceId,this.state.appointmentIds=n.ids):this.state.appointmentId=n.appointment.id,this.state.locationAddress=n.event_address,this.state.bookedSlot=this.state.selectedSlot?.format(),this.state.traceId=n?.traceId,this.state.orderId=n?.appointment?.order_id||n?.orderId,this.state.isPaymentEnabled&&oe.appointmentBookingLogs(this.state.traceId,{eventId:this.state.appointmentId,message:"appointment_booked"})}setCurrentStep(n){this.state.currentCalendarStep=n}resetCalendarState(){this.state.showLoadingScreen=!1,this.state.isBackButtonDisabled=!1,this.state.appointmentId=void 0,this.state.recurrenceId=void 0,this.state.appointmentIds=[],this.state.locationAddress=void 0,this.state.formSubmissionData={},this.state.stepInfo={},this.state.contact=void 0,this.state.contact_id=void 0,this.state.guests=[],this.state.guestCount=void 0,this.state.terms_and_conditions=null,this.state.isPaymentWindowExpire=!1,this.state.selectedStaffMember=void 0,this.state.selectedSlot=void 0,this.state.isPaymentProcessing=!1,this.state.serverError="",this.state.coupon=void 0}async cancelCurrentAppointment(){try{await oe.cancelEvent(this.state.appointmentId,this.state.cancellationNote||"Payment is failed",this.getResolvedBookingSource())}catch{}}setMeetingLocationId(n){this.state.meetingLocationId=n}setBookerMeetingLocation(n){this.state.bookerMeetingLocation=n}setStepInfo(n){this.state.stepInfo={...this.state.stepInfo,event_address:n?.address||n?.eventAddress}}async handleSubmit(n){const l=!!this.state?.calendar?.recurringRule,d=this.state.formSubmissionData?.formData||{};if(this.state.calendar){d.location_id=this.state.calendar.location_id,d.calendar_id=this.state.calendar.id,d.selected_slot=this.state.selectedSlot?.format(),d.selected_timezone=this.state.selectedTimezone?.value;const c=ir(this.state.calendar,this.state.selectedDurationMinutes);c&&(d.selectedDuration=c)}if(d.form_submission_id=this.state.formSubmissionData?.submissionId,this.state.guests.length?d.guests=this.state.guests:this.state.guestCountDetail&&(d.guestCount=this.state.guestCount),this.state.contact&&(d.contact={id:this.state.contact?.id},this.state.contact?.timezone!==d.selected_timezone&&(d.contact.timezone=d.selected_timezone),d.contact_id=or(this.state.calendar.location_id),d.terms_and_conditions=this.state?.terms_and_conditions,d.guests=this.state?.guests,d.guestCount=this.state.guestCount,d.form_submission_id=this.state.formSubmissionData?.submissionId,(this.state.contact?.isNew||this.state.isSameContact)&&(d.is_new_contact=!0),d.skip_form_submit=!0),this.state.calendar?.enable_same_user_assignment&&this.state.contact?.assigned_to&&!this.state.calendar?.enable_staff_selection){const c=this.state.contact?.assigned_to,w=this.state.calendar?.team_members.findIndex(a=>a.user_id===c);d.user_id=w>-1?c:null}if(this.state?.selectedStaffMember?.value!==-1&&(d.user_id=this.state?.selectedStaffMember?.value),d.source=this.getResolvedBookingSource(),this.state.calendar&&n.isNewCalendarWidgetEnabled){const c=document.getElementById("appointment-widgets-booking--revamp");c&&c.scrollIntoView({behavior:"smooth"})}let v=new FormData,_={};_.source=this.getResolvedBookingSource();const A=Object.keys(d);for(const c of A)if(d[c]instanceof File)v.append(c,d[c]);else if(d[c]?.files){const w=Object.values(d[c].files);w.length&&await Promise.all(w.map(a=>{v.append(c,a)}))}else(d[c]||d[c]===0)&&(_[c]=d[c]);if(this.state.meetingLocationId&&(_.meetingLocationId=this.state.meetingLocationId),this.state.bookerMeetingLocation&&(_.bookerMeetingLocation=this.state.bookerMeetingLocation),this.state.coupon&&(_.coupon={code:this.state.coupon.couponCode,chargeNow:this.state.coupon.chargeNow}),this.state.showLoadingScreen=!0,l)try{_.source=this.getResolvedBookingSource(),_.channel="private_api";const c=await oe.createRecurringEvents(ei(_));let w={};c.ids&&c.ids.length&&(w=await this.handleRecurringEventData(c),this.setCalendarBookingStateForConfirmationPage({appointment:{recurrenceId:c.recurrenceId,order_id:c.orderId},event_address:c.eventAddress,traceId:c.traceId}),this.state.appointmentIds=c.ids),this.state.stepInfo={...this.state.stepInfo,...ti(c),...Object.keys(w).length?{cookiePayload:w}:{}},this.state.showLoadingScreen=!1,ht()}catch(c){this.state.showLoadingScreen=!1;const w=Ja(c),a=c?.response?.status===502?w||"Something went wrong with your payment. Try again.":w||this.t("unable_to_schedule_appointment");return this.processFormError({error:a}),{error:c}}else{this.state.isPaymentEnabled&&(_.paymentMeta={status:"pending"}),v.set("formData",JSON.stringify(_));try{let c={};const w=await oe.createOrUpdateAppointment(null,v);this.setCalendarBookingStateForConfirmationPage(w),this.state.showLoadingScreen=!1,this.state.stepInfo={...this.state.stepInfo,...w},w&&(c=await yt(w?.contact,!0),c={...c,appointment:w?.appointment},Ta({locationId:this.state.calendar.location_id,cookiePayload:c,fingerprint:ka(w?.fingerprint??w?.sessionFingerprint),source:"CalendarServiceHelper.createOrUpdateAppointment"}),this.state.stepInfo={...this.state.stepInfo,cookiePayload:c}),Fo({sessionId:w?.sessionId||null,locationId:this.state.calendar.location_id});const a=w?.sessionFingerprint;return a&&Mt(this.state.calendar.location_id,a),ht(),w}catch(c){this.state.showLoadingScreen=!1;const w=Ja(c),a=c?.response?.status===502?w||"Something went wrong with your payment. Try again.":w||this.t("unable_to_schedule_appointment");return this.processFormError({error:a}),{error:c}}}}async handleRecurringEventData(n){let l=n.fingerprint;n.sessionFingerprint;let d={};try{if(d=await yt(n.contact,!0),this.state.calendar){const v=Io(n.appointment??(n.recurrenceId?{recurrenceId:n.recurrenceId,...n.orderId?{order_id:n.orderId}:{}}:void 0));d=zt({...d,...v?{appointment:v}:{},...n.contact||{}})}return Ta({locationId:this.state.calendar.location_id,cookiePayload:d,fingerprint:ka(l),source:"CalendarServiceHelper.handleRecurringEventData"}),d}catch(v){const _=window,A={formData:n,eventId:n.ids.join(","),error:v?.stack,isUserSessionLoad:window.userSessionAttribution,logs:_.ConsoleSubscriber?_.ConsoleSubscriber.getErrors():[]};throw oe.appointmentBookingLogs(this.state.traceId,A),v}}processFormError(n){n&&n.error&&(this.state.submissionError=n.error),this.state.isBackButtonDisabled=!1}async updateAppointment(){const n={event_id:this.state.appointmentId,source:this.getResolvedBookingSource()};this.state.isPaymentEnabled&&(n.payment_meta={status:"completed"}),this.state.calendar&&(n.location_id=this.state.calendar.location_id,n.calendar_id=this.state.calendar.id,n.eventData=this.state.contact?.formData);let l=new FormData;
2l.set("formData",JSON.stringify(n));try{await oe.createOrUpdateAppointment(null,l)}catch{}}async invalidateAppointment(){const{appointmentId:n,calendar:l,isRecurring:d,appointmentIds:v}=this.state;try{const _={event_id:n,calendar_id:l?.id,location_id:l?.location_id,appointment_status:"invalid",to_notify:!1};let A;return d?A=await Promise.all(v.map(c=>(_.event_id=c,oe.createOrUpdateAppointment(_)))):A=await oe.createOrUpdateAppointment(_),A}catch{}}async updatePaymentDetailInEvent(){if(oe.appointmentBookingLogs(this.state.traceId,{eventId:this.state.appointmentId,message:"payment_update_started"}),!!this.state.isPaymentEnabled){try{const n={eventId:this.state.appointmentId,source:this.getResolvedBookingSource()};if(this.state.isPaymentEnabled&&(n.paymentMeta={status:"completed",transactionId:this.state.paymentRes?.transactionId,orderId:this.state.calendar?.feature_flags?.couponsEnabled?this.state.orderId:void 0,...this.state.isRecurring?{recurrenceCount:this.state.recurringSlots.length||1,recurringPaymentType:this.state.calendar.stripe.recurring_appointments_payment_type}:{}}),this.state.calendar){n.locationId=this.state.calendar.location_id,n.calendarId=this.state.calendar.id,n.eventData=this.state.formSubmissionData?.formData?.eventData,n.meetingLocationId=this.state.meetingLocationId,n.bookerMeetingLocation=this.state.bookerMeetingLocation,n.chargeId=this.state.paymentRes?.chargeId,n.formId=this.state.calendar.form_id,n.formSubmissionId=this.state.formSubmissionData?.submissionId;const v=Co(this.state.calendar.location_id),_=za(this.state.calendar.location_id);n.sessionFingerprint=_,n.sessionId=v,(this.state.contact?.isNew||this.state.isSameContact)&&(n.isNewContact=!0)}let l;if(this.state.isRecurring){const v=this.state.formSubmissionData?.ids||[];l=(await oe.updatePaymentDetailForRecurringAppointments(this.state.recurrenceId,n))[0]}else l=await oe.updatePaymentDetail(this.state.appointmentId,n);this.setStepInfo(l);const d=l?.sessionFingerprint;d&&Mt(this.state.calendar.location_id,d)}catch(n){oe.appointmentBookingLogs(this.state.traceId,{eventId:this.state.appointmentId,message:"payment_update_failed",error:n})}ks(this.state.calendar.id)}}async verifyRedirectPayment(n,l){So();const d=n.payment_intent,v=n.transactionId,_=n.setup_intent,A=n.redirect_status;if(d){this.state.showLoadingScreen=!0;const c=await this.verifyRedirectedPayment(d,_,l,v);if(this.state.showLoadingScreen=!1,c)return"success"}else if(_&&A==="succeeded")return"success";return this.state.paymentProcessingError=this.t("payment_process_error"),"failed"}async verifyRedirectedPayment(n,l,d,v){try{const _=this.state.calendar?.location_id;let A;if(v){const c={altId:_,altType:"location",transactionId:v};A=await Nt.verifyGenernalPayment(c)}if(d){const c={altId:_,altType:"location",orderId:d,paymentIntentId:n,setupIntentId:l,isAuth:!!l,attribution:{eventData:nr(),sessionId:Co(_),sessionFingerprint:za(_)}};A=await Nt.verifyStripePayment(c)}if(A.success)return A;throw new Error(A.message)}catch{return this.state.paymentProcessingError=this.t("payment_process_error"),this.state.isBackButtonDisabled=!1,!1}}isAppointmentBookedAndPaymentFailed(){return this.state?.appointmentId&&this.state?.paymentProcessingError}}const Ne={REDIRECT:"1",DISPLAY_MESSAGE:"2"},Qs="You do not qualify for this booking.",pt=(r,n)=>{if(!(!r||typeof r!="object"))return r[n]},Js=r=>r?.type==="displayCustomMessage"||r?.type==="disqualifyLead"&&r?.disqualifyAction==="showCustomMessage",Xs=r=>r?.type==="redirectToUrl"||r?.type==="disqualifyLead"&&r?.disqualifyAction==="openUrl",Xa=r=>r?.some(n=>{const l=n?.outcome;return l?.type==="disqualifyLead"||l?.type==="redirectToUrl"||l?.type==="displayCustomMessage"})??!1,Zs=({isCalendar:r,onlySubmitForm:n,disqualified:l})=>!!(r&&!n&&!l),el=({isCalendar:r,isCalendarService:n,disqualified:l})=>!!(l&&(r||n)),mr=({confirmationType:r,useCustomFormRules:n})=>n===!0||r==="CustomForm",tl=({isCalendar:r,formSubmitType:n,useCustomFormRules:l})=>!r||mr({confirmationType:n,useCustomFormRules:l}),ol=r=>r?Js(r)?{actionType:Ne.DISPLAY_MESSAGE,thankyouText:r.value,mobileThankyouText:r.value,outcomeType:r.type,disqualified:r.type==="disqualifyLead"}:Xs(r)?{actionType:Ne.REDIRECT,redirectUrl:r.value,redirect_url:r.value,outcomeType:r.type,disqualified:r.type==="disqualifyLead"}:null:null,al=(r,n)=>{if(!r)return null;const l=!!n;return{actionType:r.actionType,redirect_url:r.redirect_url,redirectUrl:r.redirectUrl,thankyouText:r.thankyouText,mobileThankyouText:l?void 0:r.mobileThankyouText,outcomeType:n??void 0,outcome_type:n??void 0}},cr=r=>r?{actionType:String(r.actionType??""),redirectUrl:r.redirect_url||r.redirectUrl||"",thankyouText:r.thankyouText||"",mobileThankyouText:r.mobileThankyouText||"",outcomeType:r.outcomeType||r.outcome_type||""}:null,Dd=r=>{const n=pt(r,"formSubmissionData"),l=pt(n,"formData");return cr(pt(r,"formConfirmation")||pt(n,"formAction")||pt(l,"formAction"))},Ad=(r,n,l=!1,d)=>{const v=cr(r),_=l?v?.mobileThankyouText||v?.thankyouText:v?.thankyouText||v?.mobileThankyouText,A=v?.outcomeType==="displayCustomMessage",c=d?.allowDefaultDisplayMessage===!0&&v?.actionType===Ne.DISPLAY_MESSAGE;return!v||!A&&!c||!_?.trim()?null:gt(_,n||{})},rl=(r,n=!1)=>r?n?{...r,bgColor:r.mobileBgColor||r.bgColor,fontWeight:r.mobileFontWeight??r.fontWeight,padding:r.mobilePadding??r.padding,margin:r.mobileMargin??r.margin}:{...r}:{},nl=({formAction:r,outcomeType:n,cookiePayload:l,submitMessageStyle:d,isMobile:v,fallbackMessage:_=Qs})=>{const A=v&&!n&&r?.mobileThankyouText||r?.thankyouText;return{message:A?gt(A,l||{}):_,style:rl(d,v)}};function il(r,n){r.formFieldsValue&&Object.assign(n.state.formFieldsValue,Yi(n.formFields.value,r.formFieldsValue))}function sl(r,n){r.formFieldsValue&&n.formFields.value.forEach(l=>{(l.type==="phone"||l.tag==="phone")&&r.formFieldsValue[l.tag]&&(n.state.phoneCountryIncluded[l.tag]=r.formFieldsValue[l.tag],n.customFieldPhoneNumberUpdate({tag:l.tag}))})}function ll(r,n){if(!r.formFieldsValue?.country||!n.countryList)return;const l=r.formFieldsValue.country,d=n.countryList?.[l];d&&n.updateFormattedCountry(d)}function dl(r,n){il(r,n),sl(r,n),ll(r,n)}const _o=(r,n,l)=>{try{let d=Object.keys(r.errors).filter(c=>r.errors[c]);if(d.length===0&&r.validationError.captcha&&(d=["captcha"]),d.length===0)return;const v=d[0];if(v==="captcha"){const c=document.querySelector("[data-sitekey]")||document.querySelector(".g-recaptcha")||document.querySelector('[id*="captcha"]')||document.querySelector(".recaptcha-container");c&&c.scrollIntoView({behavior:"smooth",block:"start"});return}if(v==="payment"){const c=document.querySelector(".payment-block");c&&c.scrollIntoView({behavior:"smooth",block:"start"});return}if(v==="address"){const c=document.querySelector(".address-wrapper")||document.querySelector('[data-field-name="address"]')||document.querySelector('input[placeholder*="address" i]')||document.querySelector('input[placeholder*="search" i]');if(c){c.scrollIntoView({behavior:"smooth",block:"start"});const w=c.querySelector("input, textarea, select");w&&setTimeout(()=>{w.focus()},500)}return}const _=n.findIndex(c=>c.tag===v);let A=null;if(_!==-1){const c=`el_${l}_${v}_${_}`;A=document.getElementById(c)}if(!A){const c=document.querySelectorAll(`[id^="el_${l}_${v}_"]`);c.length>0&&(A=c[0])}if(A||(A=document.getElementById(v)||document.querySelector(`[name="${v}"]`)||document.querySelector(`[data-q="${v}"]`)||document.querySelector(`[data-field-tag="${v}"]`)),A){A.scrollIntoView({behavior:"smooth",block:"start"});const c=A.querySelector("input, textarea, select");c&&setTimeout(()=>{c.focus()},500)}}catch{}},ul=N(()=>x(()=>import("./D2YvfBZE.js"),[],import.meta.url).then(r=>r.default||r)),ml=N(()=>x(()=>import("./BGcFCwAY.js"),[],import.meta.url).then(r=>r.default||r)),cl=N(()=>x(()=>import("./BWyRS2zw.js"),__vite__mapDeps([0]),import.meta.url).then(r=>r.default||r)),fl=N(()=>x(()=>import("./CCrrziC0.js"),__vite__mapDeps([1]),import.meta.url).then(r=>r.default||r)),pl=N(()=>x(()=>import("./DrVAFl3x.js"),__vite__mapDeps([2]),import.meta.url).then(r=>r.default||r)),yl=N(()=>x(()=>import("./D5H4golS.js"),__vite__mapDeps([0,3,4]),import.meta.url).then(r=>r.default||r)),gl=N(()=>x(()=>import("./Du7ZqmG5.js"),__vite__mapDeps([5]),import.meta.url).then(r=>r.default||r)),hl=N(()=>x(()=>import("./D5XiAtfM.js"),[],import.meta.url).then(r=>r.default||r)),vl=N(()=>x(()=>import("./Cza_ILeN.js"),__vite__mapDeps([6]),import.meta.url).then(r=>r.default||r)),_l=N(()=>x(()=>import("./Ci51myra.js"),__vite__mapDeps([3,7]),import.meta.url).then(r=>r.default||r)),bl=N(()=>x(()=>import("./CppwFZuW.js"),__vite__mapDeps([8]),import.meta.url).then(r=>r.default||r)),Sl=N(()=>x(()=>import("./B4DbPFCY.js"),__vite__mapDeps([9]),import.meta.url).then(r=>r.default||r)),Il=N(()=>x(()=>import("./6FsGZV8D.js"),__vite__mapDeps([10]),import.meta.url).then(r=>r.default||r)),Fl=N(()=>x(()=>import("./CAAkQLL9.js"),__vite__mapDeps([11]),import.meta.url).then(r=>r.default||r)),Cl=N(()=>x(()=>
2import("./BxdHp4HL.js"),__vite__mapDeps([1]),import.meta.url).then(r=>r.default||r)),El=N(()=>x(()=>import("./CAUO1U-o.js"),__vite__mapDeps([12]),import.meta.url).then(r=>r.default||r)),Pl=N(()=>x(()=>import("./CIUjVdv5.js"),__vite__mapDeps([13,3,14]),import.meta.url).then(r=>r.default||r)),wl=N(()=>x(()=>import("./CxE5ENjg.js"),[],import.meta.url).then(r=>r.default||r)),Tl=N(()=>x(()=>import("./CGa_Q60c.js"),__vite__mapDeps([15]),import.meta.url).then(r=>r.default||r)),kl=N(()=>x(()=>import("./DMdhUJ8n.js"),__vite__mapDeps([16,3,17,18]),import.meta.url).then(r=>r.default||r)),Dl=N(()=>x(()=>import("./CAXNGfwW.js"),__vite__mapDeps([19]),import.meta.url).then(r=>r.default||r)),Al=N(()=>x(()=>import("./wo50wctu.js"),__vite__mapDeps([3,20]),import.meta.url).then(r=>r.default||r)),Vl=N(()=>x(()=>import("./DxeWs9tC.js"),__vite__mapDeps([0,21]),import.meta.url).then(r=>r.default||r)),Ll=N(()=>x(()=>import("./CDBUIdyF.js"),[],import.meta.url).then(r=>r.default||r)),Rl=N(()=>x(()=>import("./BayvVTbC.js"),__vite__mapDeps([3,0,1,22,12,23,24,25]),import.meta.url).then(r=>r.default||r)),Ol=N(()=>x(()=>import("./DDAJWW4N.js"),__vite__mapDeps([3,0,1,22,12,23,26,25]),import.meta.url).then(r=>r.default||r)),Ul=N(()=>x(()=>import("./pcN3w600.js"),__vite__mapDeps([27]),import.meta.url).then(r=>r.default||r)),zl=N(()=>x(()=>import("./DEzxADgk.js"),__vite__mapDeps([28]),import.meta.url).then(r=>r.default||r)),Ml=N(()=>x(()=>import("./DmT6KH9c.js"),__vite__mapDeps([16,29,30]),import.meta.url).then(r=>r.default||r)),Nl={key:1,ref:"hl-app",class:"hl-app"},xl={class:"image-layout-top-fixed"},Bl=["id","onFocusin","onClick","onFocus"],ql={key:1},Hl={key:2,class:"col-sm-12 col-12"},Wl={class:"loader-container"},$l=ri({__name:"FormComponent",props:{formId:{type:String,default:void 0},scheduleFullPage:{type:Boolean,default:!1},formData:{type:Object||Array,required:!0},calendar:{type:Object,default:void 0},selectedSlot:{type:Object,default:void 0},selectedDurationMinutes:{type:Number,default:void 0},timezone:{type:String,default:void 0},event:{type:Object,default:void 0},error:{type:String,default:void 0},redirect:{type:Boolean,default:!0},funnelPreview:{type:Boolean,default:!1},extra:{type:Object,default:()=>({})},formElementClass:{type:String,required:!1},calendarEventId:{type:String,required:!1},forCalendarV3:{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},iFrameId:{type:String,default:void 0},guests:{type:Array,default:()=>[]},guestCountDetail:{type:Object,default:()=>({})},seatsPerSlotData:{type:Object,default:()=>({availableSeats:0,enableGuestSeating:!1})},calendarConfirmationButtonText:{type:String,default:void 0},isNewCalendarWidgetEnabled:{type:Boolean,default:!1},formSubmissionInstruction:{type:Object,default:()=>({onlySubmitForm:!1,isRecurring:!1,shouldPayUsingPaymentElement:!1,totalRecurringBookings:1,confirmationType:void 0})},calendarMeetingLocationDetails:{type:Object,default:()=>({meetingLocationId:void 0,bookerMeetingLocation:void 0,validateMeetingLocation:void 0})},calendarServiceHelper:{type:Object,default:()=>({})},locale:{type:String,default:"en"},isCalendarService:{type:Boolean,default:!1}},emits:["step","processError","disableBackOnSubmit","onSubmit","onFormSubmitCallback","onProcessCalendarPayment","onFormDisqualified"],async setup(r,{expose:n,emit:l}){let d,v;Y.extend(lr),Y.extend(dr),Y.extend(sr);const{t:_}=tr(),{addHeaderFromCookieForReferer:A}=Ci(),{redirectAction:c}=zs(),w=ar(),a=r;ki({hasPhoneField:Di(a?.formData?.form)});const O=So();let vt={},_t={},fr={},pr=p(!0),yr={},gr=p(!1),C=p([]),hr={},vr={},_r={},To=p(""),bt=p(!1),H=p(!0),br={},ko=p(!1),Sr={},Ir={},ue=p(!1),U=p("");const Do=p(!1),{isUploading:Fr,onUploadingStateChange:Cr}=Ai(),St=k(()=>!!(Do.value||Fr.value)),Te=t=>{Do.value=t};let xt=p("US"),It=p(),ke=p("");p("");let Ft=p(""),Er=p([]),De=p(!1),Bt=p(),ne=p({}),qt=p(!0),ve=p(""),Ce=p(),_e=p(),Ct=p(),Ht=p(),Wt=p(),K=p(),pe=p(),Et=p(),Pr={},$t=p(),z=p([]),Gt=p(!1);const Ao=p(!1);p("");const tt=p(),e=bo({phoneCountryIncluded:vt,phoneCountryCode:fr,formattedPhone:_t,form:yr,formStyle:hr,buttonStyle:vr,company:br,formFieldsValue:Sr,validationError:Ir,fieldStyle:_r,errors:Pr});function Vo(t){C.value=Xi(t,e.form?.conditionalLogic)}const Be=p(!1),Lo=p(!1),Pt=(t,i)=>Ps(t||void 0,U.value,i,e.formFieldsValue,e.phoneCountryIncluded,K.value,_e.value).then(s=>{s&&(e.formFieldsValue=s.formFieldsValue,e.phoneCountryIncluded=s.phoneCountryIncluded,K.value=s.formattedCountry)}).catch(s=>{}),me=Vi(a.formId||"","form",a.formData);let ot=null;const wr=()=>{ot&&clearTimeout(ot),ot=setTimeout(async()=>{me.isEnabled.value&&a.formId&&!Be.value&&await me.saveProgress(e.formFieldsValue)},500)},jt=p(),Yt=p(),Kt=p(),wt=p(),Qt=p({}),Ro=p(),qe=p(),at=p(),Jt=p(),Ae=p(),rt=p(),Oo=p(),Q=p({paymentType:he.DONATION,orderId:void 0}),Uo=p({}),nt=p(!1),Ee=p([]),He=p({}),it=p(!!(O.query.payment_intent||O.query.setup_intent)),Ve=p({}),We=p([]),Tt=p(),$e=p(!1),Ge=p(),{isMobile:ye,syncIsMobileFromVie
2wport:Tr}=rs(),zo=()=>{Tr(),ao()},kr=Da(),Xt=p(typeof window<"u"?window.innerWidth:0),ie=k(()=>!!(kr.value?.mobileDevice||ni()||ii()||Xt.value>0&&Xt.value<we.MOBILE_VIEW_WIDTH)),Mo=p([]),{getFormStyle:Dr,setFormStyle:Ar,getFormWidth:No,hasCustomMarginTop:Vr,getMarginStyle:Lr}=Is(),{authorizeNetDispatchData:Rr,setAuthorizeNetErrorResponse:Zt,authorizeNetErrorResponse:Or,authorizeNetCardNumberError:xo,authorizeNetCardExpiryError:Bo,authorizeNetCardCVCError:qo,setAuthorizeNetCardNumberError:Ho,setAuthorizeNetExpiryError:Wo,setAuthorizeNetCVCError:$o,clearAuthorizeNetNewCardFormErrors:Ur}=$i(),Go=p(0),eo=p(null),zr=k(()=>e.form.payment.liveModeOn?w.public.STRIPE_DEFAULT_CONFIGURATION_LIVE_FORM:w.public.STRIPE_DEFAULT_CONFIGURATION_TEST_FORM),st=()=>{Ge.value=void 0,$e.value=!1},Mr=t=>{Ge.value=t},jo=(t,i=!1)=>i&&t==="submit"?!1:fo.indexOf(t)>=0,Nr={bgColor:"E9ECEFFF",labelColor:e?.fieldStyle?.labelColor||"",placeholderColor:"",border:"",width:"",padding:{top:15,bottom:15,left:20,right:20},shadow:""},xr=t=>{Ae.value=t,e.formFieldsValue.payment=e.form?.payment?.currency.symbol+t},Yo=()=>{a.formId&&sessionStorage.setItem(`formData-${a.formId}`,JSON.stringify({phoneCountryIncluded:e.phoneCountryIncluded,formattedCountry:K.value,formFieldsValue:e.formFieldsValue,formFields:C.value,productPurchased:Q.value,productPurchasedList:Ee.value,productSummary:He.value,paymentAmount:Ae.value,submissionId:rt.value}))},Br=t=>{Ve.value=t,We.value=t.items.map(i=>({...i,id:i._id,amount:i.price.amount,bumpProduct:!!i.bumpProduct,funnel:ae.value.funnelId,step:ae.value.stepId,locationId:ae.value.locationId,max:t.max,couponCode:t.coupon?.code})),Q.value.orderId=t._id,Q.value.paymentType=he.PRODUCT,Q.value.amount=t.amount,Q.value.currency=t.currency,Q.value.isRecurringDonation=t?.meta?.isRecurringDonation,Yo()},qr=t=>{e.formFieldsValue.emailVerified=t},Ko=t=>{e.formFieldsValue.phoneVerified=t},to=t=>{Array.isArray(e.formFieldsValue.tokens)||(e.formFieldsValue.tokens=[]),e.formFieldsValue.tokens.push(t)},Hr=()=>{if(a.calendar&&e.form.fullScreenMode)return{padding:"20px !important"};if(e.form.fullScreenMode)return{padding:"0px !important"}},Wr=k(()=>({...Lr(),...Hr()||{}})),$r=(t,i)=>{if(e.form.layout===we.ONE_COLUMN)return ft.FULL_WIDTH;const s=e.form.layout===we.TWO_COLUMN||e.form.layout===!0,y=jo(t.type),u=ut(i);return s&&!y&&u?t?.fieldWidthPercentage<=50||!a.formId?`menu-field-wrap col-sm-6 col-6 ${ft.HALF_WIDTH}`:ft.FULL_WIDTH:e.form.layout===we.SINGLE_LINE?`menu-field-wrap ${ft.FULL_WIDTH}`:ft.FULL_WIDTH},Gr=(t,i)=>{if(!(!jo(t.type,!1)||e.form.layout===we.SINGLE_LINE&&t.type==="submit"))return"";const y=t.fullwidth?100:Number(t.fieldWidthPercentage);if(!t.fullwidth&&!Number.isFinite(y))return"";const u=y>=100?0:(100-y)/100,P=t.fullwidth?"100%":`calc(${y}% - var(--form-column-gap) * ${u})`;return`
3    @media screen and (min-width: 1025px) {
4      #el_${a.formId}_${t.tag}_${i} {
5        max-width: ${P};
6        width: ${P};
7        flex: 0 0 ${P};
8      }
9    }
10  `},jr=t=>({marginBottom:Yr(t)}),Yr=t=>t.hidden?0:e.form?.style?.hasOwnProperty("fieldSpacing")?e.form.style.fieldSpacing+"px":"16px",Kr=()=>e.form.layout===we.ONE_COLUMN?os(e.form.fieldStyle.labelWidth):"",Qo=p(""),oo=t=>{z.value.push(t)},Jo=p(""),Xo=()=>{const t=a.funnelPreview?`.${a.formElementClass} #form-builder`:"html, body";Jo.value=zi(t,e.form?.style)},ao=()=>{"style"in e.form&&(Ar({...e?.form?.style,padding:ye.value&&e?.form?.style?.mobilePadding||e?.form?.style?.padding,margin:ye.value&&e?.form?.style?.mobileMargin||e?.form?.style?.margin},e?.form?.width),tt.value=ye.value&&a?.formData?.form?.mobileFieldCSS||a?.formData?.form?.fieldCSS,tt.value&&!po()&&a.formElementClass&&(tt.value=tt.value.replace(/#_builder-form/g,`.${a.formElementClass} #_builder-form`)),ko.value=e.form?.style?.ac_branding??e.form?.style?.acBranding,Xo())},Qr=async()=>{const{locationId:t,form:i,country:s,companyId:y,recurringProductId:u}=a.formData;if(!t||!i)return;e.form=Ka(i),e.form?.style&&(e.form.style.mobileBgImageDeleted=e.form.style.mobileBgImageDeleted??!1),e.form.recurringProductId=u,Ft.value=e.form?.fbPixelId,U.value=t,xt.value=s,De.value="stickyContact"in e.form?e.form?.stickyContact:!1;const P=a.formElementClass?`.${a.formElementClass}${Ra}`:Ra;"layout"in e.form&&(bt.value=[!0,we.TWO_COLUMN,we.SINGLE_LINE].includes(e.form?.layout)),e.form?.fieldStyle?.labelAlignment&&(Qo.value=Kr()),"fields"in e.form&&Vo([...e.form?.fields]),"style"in e.form&&ao();const m=(e.form.formAction?.headerImageSrc?.trim().length??0)>0||(e.form.formAction?.mobileHeaderImageSrc?.trim().length??0)>0;e.form.showImage=e.form.showImage??!!m,e.form.desktopImageLayout=e.form.desktopImageLayout||ge.TOP_FIXED,e.form.mobileImageLayout=e.form.mobileImageLayout||ge.HEADER,e.form.imageFieldSpacing=e.form.imageFieldSpacing??24,e.form.imageCornerRadius=e.form.imageCornerRadius??0,"button"in e.form&&(e.buttonStyle={bgColor:e.form?.button?.background,color:e.form?.button?.color,border:e.form?.button?.border?.border||0,borderColor:e.form?.button?.border?.color||Ei,radius:e.form?.button?.border?.radius,padding:e.form?.button?.border?.padding}),e.form?.style?.color&&(Bt.value=`${P}label{ color:${Oa(e.form?.style?.color)} }`),e.form?.fieldStyle?.labelColor&&(Bt.value=`${P}label{ color:${Oa(e.form.fieldStyle.labelColor)} }`),"fieldStyle"in e.form?e.fieldStyle={bgColor:e?.form?.fieldStyle?.bgColor,labelColor:e?.form?.fieldStyle?.labelColor,labelFontFamily:e?.form?.fieldStyle?.labelFontFamily,placeholderColor:e?.form?.fieldStyle?.placeholderColor,border:e?.form?.fieldStyle?.border,width:e?.form?.fieldStyle?.width,padding:e?.form?.fieldStyle?.padding,shadow:e?.form?.fieldStyle?.shadow}:e.fieldStyle=Nr,"customStyle"in e.form&&e.form?.customStyle?.length>0&&(To.value=e.form.customStyle.replace(".form-element","")),"company"in e.form&&(e.company=e.form?.company),"formLabelVisible"in e.form&&(H.value=e.form?.formLabelVisible);let g=a.calendar?void 0:e.form?.payment;if(e.form?.payment?.paymentType&&(Q.value.paymentType=e.form.payment.paymentType),!g&&a.calendar?.stripe&&(a.calendar?.stripe?.amount==0||a.calendar?.stripe?.currency)){const S={...a.calendar.stripe},L=a.formSubmissionInstruction;S.amount=go(L?.isRecurring,L?.totalRecurringBookings,S,a.calendar.enable_charge_guests,a.guests?.length||a.guestCountDetail.count),delete S.deposit,delete S.depositType,g=S}g&&(Ce.value={default_payment_provider:g.paymentProvider,publishable_key:g.publishable_key,account_id:g.account_id,amount:(parseFloat(g.amount)*100).toFixed(2),name:g.amount?"Pay to processed":"Verify your card",description:g.charge_description,currency:g.currency}),e.form?.address&&(_e.value=e.form?.address),pr.value=!1,e.form?.payment?.paymentType==="product"&&e.form?.payment?.products.length>0&&await Jr(),e.form?.payment?.paymentType==="donation"&&e.form?.payment?.recurringDonation?.isRecurringDonationEnabled&&e.form.recurringProductId&&(Uo.value=await Ls(e.form.recurringProductId,a.formData.locationId))},ae=Da(),G=l,{$bus:Pe}=si(),le=p([]),lt=p([]),Zo=p(!1),Jr=async()=>{const t=e.form.payment.products.map(s=>s.productId),i=await Nt.getPublicProducts({locationId:a.formData.locationId,productIds:t,includeNonStoreProducts:!0});if(Zo.value=!0,lt.value=e.form.payment.products.map(s=>{let y={};
10return i.products.forEach(u=>{s.productId===u._id&&(y=u)}),y={...y,...s,quantity:1},y}).filter(s=>s._id!==void 0),e.form.payment?.bumpSettings?.enableBump){const s=e.form.payment.bumpProducts.map(u=>u.priceId),y=await Nt.getSelectedProductPrices({locationId:a.formData.locationId,ids:s?.join(",")});Mo.value=y}},J=k(()=>{const t={showImage:e.form.showImage,desktopImageLayout:e.form.desktopImageLayout,mobileImageLayout:e.form.mobileImageLayout};return ns(t,ie)}),ea=k(()=>{const t={imageFocusPoint:e.form.imageFocusPoint};return is(t)}),je=k(()=>{const t={showImage:e.form.showImage,headerImageSrc:e.form.formAction?.headerImageSrc,mobileHeaderImageSrc:e.form.formAction?.mobileHeaderImageSrc,mobileHeaderImageSrcDeleted:e.form.formAction?.mobileHeaderImageSrcDeleted};return ss(t,ie)}),Xr=k(()=>{if(ue.value)return!1;const t=ls(J.value),i=ne.value&&ne.value.action==="submit-form";return je.value&&t&&!i&&!!kt.value}),Zr=k(()=>{const t={imageFieldSpacing:e.form.imageFieldSpacing};return ds(J.value,t)}),ta=k(()=>je.value&&us(J.value)&&!ie.value?xa():xa()),en=k(()=>ms(J.value,e.form?.style)),tn=k(()=>cs(J.value,e.form?.style)),on=k(()=>je.value?fs(J.value,e.form?.style,ie):{}),kt=k(()=>{const t={headerImageSrc:e.form.formAction?.headerImageSrc,mobileHeaderImageSrc:e.form.formAction?.mobileHeaderImageSrc,mobileHeaderImageSrcDeleted:e.form.formAction?.mobileHeaderImageSrcDeleted};return ps(t,ie)});k(()=>{const t=ye.value&&e.form?.style?.mobilePadding||e.form?.style?.padding,i=t?.top||0,s=t?.left||0;return{marginTop:`-${i}px`,marginLeft:`-${s}px`}}),k(()=>{const t=ye.value&&e.form?.style?.mobilePadding||e.form?.style?.padding,i=t?.top||0,s=t?.left||0;return{marginTop:`-${i}px`,marginLeft:`${s}px`}});const dt=k(()=>je.value?ys(J.value):""),oa=k(()=>!e.formFieldsValue||!Object.keys(e.formFieldsValue).length?!0:e.form?.fields.some(t=>{if(t.hidden||!t.required||!t.tag||t.tag==="locationConfiguration")return!1;const i=e.formFieldsValue[t.tag],s=e.phoneCountryCode[t.tag];if(!i)return!0;const y=t.type==="email"||typeof t?.fieldKey=="string"&&t.fieldKey.toLowerCase().endsWith(".email")||typeof t?.hiddenFieldQueryKey=="string"&&t.hiddenFieldQueryKey.toLowerCase().includes("email")||typeof t?.label=="string"&&t.label.toLowerCase().includes("email"),u=t.tag==="phone";return y?!di(i):u?!li(i,s):t.tag==="terms_and_conditions"?!i:!1})),aa=k(()=>({email:e.formFieldsValue?.email||"",phone:ke.value||e.formFieldsValue?.phone||"",full_name:[e.formFieldsValue?.first_name,e.formFieldsValue?.last_name].filter(Boolean).join(" ")||e.formFieldsValue?.full_name||""}));n({hasInvalidFormInputs:oa,formContactPreview:aa}),[d,v]=ui(()=>Qr()),await d,v();const an=k(()=>{const t=a.calendarServiceHelper?.state;return!t?.isFormFirst&&(!t?.isCustomPaymentProvider||a.calendarServiceHelper?.state?.usePaymentElementInClassicWidget)&&t?.isPaymentEnabled&&Ye.value&&(t?.isRecurring&&t?.isRecurringSlotLoaded||!t?.isRecurring)}),ra=k(()=>C.value.find(t=>t.type==="submit")),na=k(()=>a.calendar&&a.calendar.enable_guests),ia=k(()=>a.calendar&&a.calendar.enable_mandatory_guest_type),sa=k(()=>a.calendar&&a.calendar.enable_guests&&a.calendar.guest_type==="count_only"),Dt=k(()=>Ms(a.calendar)),la=k(()=>Ce.value?.default_payment_provider==="stripe"),da=k(()=>Ce.value?.default_payment_provider==="authorize-net"),rn=k(()=>{if(!a.calendar?.stripe)return 0;const t={...a.calendar.stripe},i=a.formSubmissionInstruction;return Number(go(i?.isRecurring,i?.totalRecurringBookings,t,a.calendar.enable_charge_guests,a.guests?.length||a.guestCountDetail?.count||0,Number(a.calendarServiceHelper?.state?.coupon?.discountAmount)||0))||0}),Ye=k(()=>!a.calendar?.stripe||a.calendar.stripe.payment_collection_type==="card_on_file"?!0:rn.value>0),nn=k(()=>mi.find(t=>t.code===xt.value)),Ke=k(()=>It.value||xt.value),ua=k(()=>Object.values(Ot));k(()=>(a?.calendar?.calendar_type==="round_robin"||a?.calendar?.calendar_type==="service_booking"||a?.calendar?.calendar_type==="personal")&&a?.calendar?.team_members?.length===1?a?.calendar.team_members[0].location_configurations:a?.calendar?.calendar_type==="event"?a?.calendar?.location_configurations:null),k(()=>e.formStyle.border==="0"?"form-top-padding":"");const sn=(t,i)=>{nt.value=t.length>0,Ee.value=t,He.value=i,t.length?e.formFieldsValue.payment=(wi(Ee.value[0]?.currency)||"$")+i.summary.total:(e.formFieldsValue.payment="",Q.value={paymentType:e.form?.payment?.paymentType??void 0,orderId:void 0},We.value=[],Ve.value={})},ln=t=>{Tt.value=t},ma=k(()=>C.value.filter(t=>t.hiddenFieldQueryKey==="payment")?.[0]?.hidden?!1:e.form?.payment?.paymentType===he.PRODUCT?e.form?.payment?.required&&e.form?.payment?.products?.length||nt.value:e.form?.payment?.required||Ae.value),dn=_s(()=>tt.value);Aa({style:[{innerHTML:()=>Jo.value},{innerHTML:()=>dn.value},{innerHTML:()=>Bt.value},{innerHTML:()=>To.value}],meta:[{name:"apple-mobile-web-app-capable",content:"yes"},{name:"viewport",content:"minimum-scale=1.0, width=device-width, maximum-scale=1, user-scalable=no"}]}),bs(()=>Ss(e.form));let ca=!1;const fa=p("");C.value.filter(t=>
10!Ma(a.formData?.form?.fields,t)).forEach((t,i)=>{fa.value+=Gr(t,i)}),Aa({style:[{innerHTML:()=>Qo.value},{innerHTML:()=>fa.value}]}),C.value.forEach((t,i)=>{if(t.type==="textbox_list"){const s={};t.picklistOptions.forEach(y=>{s[y.id]=y.prefillValue}),e.formFieldsValue[t.tag]=s}else t.type==="source"?e.formFieldsValue[t.tag]=t.value:t.type==="checkbox"&&!(e.formFieldsValue[t.tag]instanceof Array)?e.formFieldsValue[t.tag]=[]:t.type==="submit"&&(ca=!0,a.calendar&&(t.label&&t.label.toLowerCase()==="button"||t.label.trim().length<=0)&&(t.label=a.calendarConfirmationButtonText?a.calendarConfirmationButtonText:_(a.forCalendarV3?"schedule_meeting":"book_appointment")))}),ca||C.value.push({label:a.calendarConfirmationButtonText?a.calendarConfirmationButtonText:a.calendar?_(a.forCalendarV3?"schedule_meeting":"book_appointment"):_("submit"),tag:"button",palceholder:"button",type:"submit"}),C.value.length>0&&C.value.forEach((t,i)=>{if(t.type==="html"&&t&&"html"in t){const s=t.html.replace(/[‘’]/g,"'").replace(/[""]/g,'"');Er.value.push({scriptString:s,index:i})}}
10),ve.value=Math.random().toString(36).slice(2),a.urlParams&&et(a.urlParams,O,e.phoneCountryIncluded,K.value,e.formFieldsValue,C.value,_e.value).then(t=>{Je(t,{categorizeVisibility:!0})});const pa=p(Date.now()),ya=p(!1),ro=async(t,i)=>{try{if(O.query.notrack)return;if(!ya.value){ya.value=!0;let s=i?.id||i?.tag||i?.label,y=i?.type;if(i?.tag==="group_address"&&t?.target){const P=t.target.name||t.target.getAttribute("data-field-name");P&&(s=P,y="address_field")}const u=Ba(pa.value);mo({fingerprint:Ut(a?.formData?.locationId),eventType:"form-start-conversion",mediumId:a.formId,medium:"form",locationId:a.formData.locationId,name:a.formData.name,fieldId:s,firstFocusAt:Date.now(),focusedFieldId:s,focusedFieldType:y,focusedLoadDuration:u.loadTime}).catch(P=>{})}}catch{}},no=()=>{typeof window<"u"&&(Xt.value=window.innerWidth),zo()};Ue(ye,()=>{"style"in e.form&&ao()});const At=ci(a.formId,a.formData?.form?.formSchedule);fi(async()=>{if(At.blocked)return;zo(),Bi(),no(),window.addEventListener("resize",no),setTimeout(()=>{et(a.urlParams,O,e.phoneCountryIncluded,K.value,e.formFieldsValue,C.value,_e.value).then(u=>{Je(u)})},po()?1e3:100),a.calendar&&Pe.$on("submitCalendarForm",Re),a.isCalendarService&&Pe.$on("submitCalendarServiceForm",Re);try{await Os()}catch{}!a.funnelPreview&&Ft.value!==void 0&&Ft.value!==""&&ct(()=>{ji(Ft.value,e.form.pageViewEvent)}),Mn(),me.isEnabled.value&&a.formId&&!a.calendar&&!a.isCalendarService&&await me.checkHasProgress()&&(await me.checkIsFormUpdated()?await me.clearProgress():Be.value=!0);const t=O.query.payment_intent,i=O.query.transactionId;i&&(Oo.value=i),t&&!a.calendar?.id&&!a.isCalendarService&&(it.value=!0,await qa(t,a.formId||"",i)?await Ea():(sessionStorage.removeItem(`submissionResponse-${a.formId}`),sessionStorage.removeItem(`formOrderResponse-${a.formId}`)),it.value=!1);const s=O.query.setup_intent;if(s&&!a.calendar?.id&&!a.isCalendarService&&(it.value=!0,await qa(t,a.formId||"",i,s)?await Ea():(sessionStorage.removeItem(`submissionResponse-${a.formId}`),sessionStorage.removeItem(`formOrderResponse-${a.formId}`)),it.value=!1),De.value&&(le.value=C.value.map(u=>u.tag),Pt(void 0,le.value)),O.query.hasOwnProperty("sticky_contact_help")&&O.query.sticky_contact_help,ct(()=>{if(gr.value=!0,!O.query.notrack){const u=Ba(pa.value);mo({fingerprint:Ut(a?.formData?.locationId),eventType:"form-load-time",mediumId:a.formId,medium:"form",locationId:a.formData.locationId,name:a.formData.name,timeSpent:u.loadTime,startTimestamp:u.startTimestamp,endTimestamp:u.endTimestamp,totalBlockingTime:u.totalBlockingTime,firstContentfulPaint:u.firstContentfulPaint,timeToInteractive:u.timeToInteractive,networkType:u.networkType,cacheStatus:u.cacheStatus,cdnStatus:u.cdnStatus,pageSizeKB:u.pageSizeKB}).catch(P=>{})}}),a.calendar&&a.locale!=="en"&&a.locale!=="en_US"){window.dayjs=Y;const u=Ga(a.locale);await pi(`unpkg.com/[email protected]/locale/${u}.js`,()=>{Y.locale(u)})}if(a.stickyContactData&&De.value&&!Be.value&&(le.value||(le.value=C.value.map(u=>u.tag)),Pt(a.stickyContactData,le.value)),Gt.value=!0,Go.value=new Date().getTime(),setTimeout(()=>{lo(),Ia(e.formFieldsValue),Ao.value=!0},100),!O.query.notrack)try{let u=Ut(a?.formData?.locationId);if(!u)return;const P=await mo({fingerprint:u,eventType:"form-view",mediumId:a.formId,medium:"form",locationId:a.formData.locationId,name:a.formData.name}),m=Ue(P,g=>{g?.fingerprint&&u!==g.fingerprint&&(u=g.fingerprint),m()})}catch{}const y=JSON.parse(localStorage.getItem("_ud")||"{}");if(ae.value.formAction==="thankYouPage"&&e.form.formAction.actionType===Ne.DISPLAY_MESSAGE){ue.value=!0;const u=ie.value&&e.form.formAction.mobileThankyouText||e.form.formAction.thankyouText,P=u?gt(u,y):"Thanks for submiting details, Will get back to you soon!",m=e.form.submitMessageStyle||{},g=e.form.style||{},S=Li(g);ne.value={action:"submit-form",message:P,style:ie.value?{...m,bgColor:m.mobileBgColor||m.bgColor,fontWeight:m.mobileFontWeight??m.fontWeight,padding:m.mobilePadding||m.padding,margin:m.mobileMargin||m.margin,bgImage:S,mobileBgImage:S}:{...m,bgImage:g.bgImage,mobileBgImage:S},isFormPosted:ue.value,height:a.formData?.form?.height}}if(ae.value.formAction==="orderConfirmationPage"&&e.form.formAction.actionType==="3"){const u=JSON.parse(sessionStorage.getItem(`formData-${a.formId}`)||"null");u&&(Q.value=u.productPurchased,Ee.value=u.productPurchasedList,He.value=u.productSummary,Tt.value=u.couponCode,Q.value&&Ee.value.length&&(ue.value=!0,ne.value={action:"order",style:{width:e.form.width,style:e.form.style,fieldStyle:e.form.fieldStyle},productPurchased:Ee.value.map(P=>(lt.value.forEach(m=>{m._id===P.productId&&(P.showImage=m.showImage,P.showDescription=m.showDescription)}),P)),orderId:Q.value.orderId,productSummary:He.value,couponCode:Tt.value,contact:y}))}}),yi(()=>{z.value=[]}),Ue(()=>[e.form?.style?.bgImage,e.form?.style?.mobileBgImage,e.form?.style?.mobileBgImageDeleted,a.funnelPreview,a.formElementClass],()=>{Xo()}),Ue(()=>
10a.urlParams,(t,i)=>{a.urlParams&&et(a.urlParams,O,e.phoneCountryIncluded,K.value,e.formFieldsValue,C.value,_e.value).then(s=>{Je(s)})}),Ue(()=>a.stickyContactData,(t,i)=>{a.stickyContactData&&De.value&&!Lo.value&&(le.value||(le.value=C.value.map(s=>s.tag)),Pt(a.stickyContactData,le.value))}),p({});let io=!1;Ue(()=>e.formFieldsValue,()=>{if(!io){io=!0;try{Le(e.formFieldsValue,!0),Ia(e.formFieldsValue),wr()}finally{ct(()=>{io=!1})}}},{deep:!0}),Ue(()=>[a.guestCountDetail?.count,a.guests],()=>{const t=a.calendarServiceHelper?.state;t&&(t.guestCount=a.guestCountDetail?.count||0,t.guests=a.guests||[])},{deep:!0});const ga=t=>{It.value=t},un=t=>{e.formFieldsValue.captchaToken=void 0,e.validationError=t},mn=t=>{Ct.value=t},cn=t=>{Ht.value=t},fn=(t,i,s)=>{jt.value=t&&t.length?t.replace(/\s/g,""):null,i&&i.length&&i.includes("/")&&(i=i.split("/"),Yt.value=i[0],Kt.value=i[1]),wt.value=s},pn=t=>{pe.value=t},X=t=>{const{tag:i,value:s}=t;e.formFieldsValue[i]=s},ha=t=>{const{tag:i,value:s}=t;e.phoneCountryIncluded[i]=s},va=t=>{const{tag:i,value:s}=t;e.phoneCountryCode[i]=s},_a=t=>{const{tag:i,value:s}=t;e.formattedPhone[i]=s},so=t=>{K.value=t,Ha(e.formFieldsValue,K.value),Le({...e.formFieldsValue,country:t},!0)},yn=t=>{Et.value=t},W=t=>{const{tag:i,error:s}=t;e.errors[i]=s,gn(t),hn(t),ba()},gn=t=>{const{tag:i,error:s}=t;if(i=="email"&&a.guests.length>=1){const y=[e.formFieldsValue[i]];a.guests.forEach(u=>{y.includes(u.email)?(u.emailError="Email IDs must be unique for guests.",u.invalidEmail=!0):(u.emailError="",u.invalidEmail=!1),y.push(u.email)})}},hn=t=>{const{tag:i}=t;if(i=="phone"&&a.guests.length>=1&&wo(Dt.value)){const s=Ke.value||"US",y=[e.formFieldsValue[i]];a.guests.forEach(u=>{y.some(P=>Po(P,u.phone,s))?(u.phoneError=_("guest_phone_unique_error"),u.invalidPhone=!0):(u.phoneError="",u.invalidPhone=!1),y.push(u.phone)})}},vn=t=>{$t.value=t,e.formFieldsValue.captchaToken=t},_n=t=>{const{date:i,item:s}=t;e.formFieldsValue[s.tag]=i},Qe=t=>{const i=e.phoneCountryIncluded[t.tag],s=e.phoneCountryCode[t.tag];e.formFieldsValue[t.tag]=i,t.tag==="phone"&&(ke.value=e.formFieldsValue[t.tag]);try{const y=window?.libphonenumber?.parsePhoneNumberFromString(i,s);if(!y){e.phoneCountryIncluded[t.tag]=i,e.formattedPhone[t.tag]=i;return}const u=y.isValid(),P=u&&rr(i,y.nationalNumber);t.tag==="phone"&&(ke.value=u&&!P?y.number:i),e.phoneCountryIncluded[t.tag]=u&&!P?y.number:i,e.phoneCountryCode[t.tag]=qi(y.country,s),e.formattedPhone[t.tag]=u&&!P?y.formatNational():i}catch{e.phoneCountryIncluded[t.tag]=i,e.formattedPhone[t.tag]=i}},bn=()=>{for(const t in e.phoneCountryIncluded)e.phoneCountryIncluded[t]&&Qe({tag:t})},Je=(t,i)=>{e.phoneCountryIncluded=t.phoneCountryIncluded,e.formFieldsValue=t.formFieldsValue,K.value=t.formattedCountry,C.value=t.formFields,bn(),i?.categorizeVisibility&&setTimeout(()=>lo(),1e3)},Sn=()=>{let t=!1,i=0;return C.value.map(s=>{s.type==="cascade_dropdown"&&s.required&&e.formFieldsValue[s.tag]===void 0?(qt.value=!1,t=!0):e.formFieldsValue[s.tag]!==void 0&&s.type==="cascade_dropdown"&&(e.formFieldsValue[s.tag].forEach(function(u){for(const P in u)u[P]===""&&i++}),i>0?(qt.value=!1,t=!0):qt.value=!0)}),t},In=async t=>{const i=z.value.map(y=>{if(y?.validate)return y.validate(t)});return await Promise.all(i),await ba()},Fn=async()=>{let t=!1;const i=z.value.map(s=>{s?.item?.type==="captcha"&&(t=!0)});return await Promise.all(i),t},ba=async()=>{const t=Object.values(e.errors);let i=!1;return await Promise.all(t.map(s=>{s&&(i=!0)})),i},ut=t=>t===C.value.length-1||fo.indexOf(C.value[t+1]?.type)>=0?Sa(t):!0,Sa=t=>Cn(t)%2===0,Cn=t=>{let i=0;for(let s=t;s>=0;s--)if(fo.indexOf(C.value[s].type)===-1)C.value[s]?.fieldWidthPercentage!==100&&(i+=1);else return i;return i},En=t=>{e.formFieldsValue[t.tag]=Na(""),Le(e.formFieldsValue,!0)},Pn=t=>{const{item:i,event:s}=t;e.formFieldsValue[i.tag]=Na(s?.target?.value)},wn=t=>{for(const i of C.value)if(i.hiddenFieldQueryKey===t&&(i.Id||i.id))return i.Id||i.id;return null},Le=(t,i=!1)=>{const s={...t};if(K.value&&i&&(s.country=K.value),s?.phone&&i){const m=window?.libphonenumber?.parsePhoneNumberFromString(t.phone,e.phoneCountryCode.phone)?.number;m&&(s.phone=m)}try{const m=Array.isArray(C.value)?C.value:[],g=Zi(m,e.formFieldsValue);Object.assign(s,g)}catch{}if(!e.form?.conditionalLogic||!e.form.conditionalLogic?.length)return;const y=new Set,u=new Set,P=e.form?.conditionalLogic?.filter(m=>i?m?.outcome?.type==="showHideFields":m.conditions!==null&&m?.outcome?.type!=="showHideFields");for(let m=0;m<P.length;m++){const g=P[m];let S=g.conditionalOperation==="and";const L={...s};for(let E=0;E<g.conditions.length;E++){let{selectedField:M,selectedOperation:D,inputValue:h,dateFormat:ee}=g.conditions[E];const se=g.conditions[E].selectedField;M==="country"&&!i&&Ot[L[M]]&&(L[M]=Ot[L[M]]);const de=wn(M);de!==null&&(M=de);const Z=L[M],I=es(D,se,Z,h,C.value,ee);if(g.conditionalOperation==="and"&&!I){S=!1;break}if((g.conditionalOperation==="or"||g.conditionalOperation==="then")&&I){S=!0;break}}if(g.outcome?.type==="showHideFields"&&i&&S){const{hideType:E,value:M}=g.outcome,D=Array.isArray(M)?M:[M],h=ee=>as(C.value,ee);D.forEach(ee=>{const se=ts(ee,h);E.includes("Show")?y.add(se):E.includes("Hide")&&u.add(se)})}if(S){const E=ol(g.outcome);if(E&&(e.form.formAction.actionType=E.actionType,E.thankyouText!==void 0&&(e.form.formAction.thankyouText=E.thankyouText),E.mobileThankyouText!==void 0&&(e.form.formAction.mobileThankyouText=E.mobileThankyouText),E.redirectUrl!==void 0&&(e.form.formAction.redirectUrl=E.redirectUrl,e.form.formAction.redirect_url=E.redirect_url),e.form.formActionOutcomeType=E.outcomeType),E?.disqualified&&(e.form.disqualified=!0),!i)break}else(e.form?.payment?.required||Ae.value||nt.value)&&!C.value?.find(E=>E.hiddenFieldQueryKey==="payment")?.hidden&&(e.form.formAction.actionType=a.formData.form.formAction.actionType,e.form.formAction.thankyouText=a.formData.form.formAction.thankyouText,e.form.formAction.redirectUrl=a.formData.form.formAction.redirectUrl,e.form.disqualified=void 0)}y.forEach(m=>u.delete(m)),eo.value&&(C.value=eo.value),C.value=C.value.map(m=>{if(y.has(m.hiddenFieldQueryKey)){const g=a.formData.form.fields.find(S=>S.hiddenFieldQueryKey===m.hiddenFieldQueryKey);return{...m,hidden:!1,hiddenFieldValue:g?.hiddenFieldValue||"",required:g?.required||!1}}else if(u.has(m.hiddenFieldQueryKey))return{...m,hidden:!0,required:!1};return m}),setTimeout(()=>
10{et(a.urlParams,O,e.phoneCountryIncluded,K.value,e.formFieldsValue,C.value,_e.value,!0).then(m=>{Je(m)})},1e3)},Ia=t=>{Fs(e.form,C.value,t).forEach(({hiddenFieldQueryKey:s,result:y})=>{e.formFieldsValue[s]=y})},Tn=()=>al(e.form?.formAction,e.form?.formActionOutcomeType),kn=()=>mr({confirmationType:a.calendar?.form_submit_type||a.formSubmissionInstruction?.confirmationType,useCustomFormRules:a.formSubmissionInstruction?.useCustomFormRules}),Xe=t=>{if(!kn())return t;const i=Tn();return i?{...t,formConfirmation:i}:t},Fa=async t=>{if(!a.calendar&&!a.isCalendarService||!e.form?.formAction)return!1;ht();const i=await yt(t,!0);if(a.redirect===!1)return!0;if(String(e.form.formAction.actionType)===Ne.REDIRECT&&!e.form.isLeadGenVideo){const y=Me(e.form.formAction.redirect_url||e.form.formAction.redirectUrl,i);return Rt(y),!0}if(("redirect_url"in e.form&&e.form.redirect_url!==""||"redirectUrl"in e.form&&e.form.redirectUrl!=="")&&!e.form.isLeadGenVideo){const y=Me(e.form.redirect_url||e.form.redirectUrl,i);return Rt(y),!0}ue.value=!0;const s=nl({formAction:e.form.formAction,outcomeType:e.form.formActionOutcomeType,cookiePayload:i,submitMessageStyle:e.form.submitMessageStyle,isMobile:ie.value});return ne.value={action:"submit-form",message:s.message,style:s.style,isFormPosted:!0,height:a.formData?.form?.height},G("onFormDisqualified",s),!0},lo=()=>{setTimeout(()=>Le(e.formFieldsValue,!0),0),Vo(C.value),eo.value=Ka(C.value)};lo();const Dn=async()=>{const t=Ha(e.formFieldsValue,K.value);return(await ws(O,C.value,t.formFieldsValue)).formFieldsValue},Re=async(t,i)=>{let s=a.formSubmissionInstruction;if(s.isRecurring=s?.isRecurring??a.calendar?.enable_recurring,pe.value){Ze(pe.value);return}for(let L in e.phoneCountryIncluded)e.phoneCountryIncluded[L]&&Qe({tag:L});if(await Cs(e.formFieldsValue)>gi){alert("The total size of the attached files cannot be more that 50MB"),Ze(!0);return}e.validationError={};const u=await In(i);let P=!0;if(a.calendarMeetingLocationDetails?.validateMeetingLocation&&(P=a.calendarMeetingLocationDetails?.validateMeetingLocation()),u||Sn()||!P){Ze(u),setTimeout(()=>{_o(e,C.value,a.formId)},100);return}if(await Fn()&&(Et.value===void 0||Et.value==="0")){e.validationError.captcha="Invalid Captcha",Ze(!0),setTimeout(()=>{_o(e,C.value,a.formId)},100);return}e.formFieldsValue=await Dn();const g=Ki(C.value,e.formFieldsValue,{getErrorMessage:L=>_(L.errorKey,{label:L.label}),reportError:(L,E)=>{e.errors[L.fieldId]=E}});if(!g){await Ze(!0),setTimeout(()=>{_o(e,C.value,a.formId)},100),G("disableBackOnSubmit",{disable:!1}),St.value=!1;return}let S;if(G("disableBackOnSubmit",{disable:!0}),Te(!0),pe.value="",!a.calendarServiceHelper?.state?.isFormFirst&&!a.calendarServiceHelper?.state?.isCustomPaymentProvider&&a.calendarServiceHelper?.state?.isPaymentEnabled&&Ye.value&&!await a.calendarServiceHelper?.newCardPaymentElementRef.value.validatePayment())return G("disableBackOnSubmit",{disable:!1}),Te(!1),Ze(!0),setTimeout(()=>{const E=document.querySelector(".payment-block");E&&E.scrollIntoView({behavior:"smooth",block:"center"})},100),!1;if(!s?.onlySubmitForm&&!s?.shouldPayUsingPaymentElement){if(la.value&&Ce.value&&!Wt.value&&Ye.value){S={};try{const L=s.isRecurring,E=s.totalRecurringBookings,{client_secret:M}=await $fetch(w.public.serverBaseUrl+"/appointment/setup-intent",{method:"POST",body:{locationId:a.formData.locationId,calendarId:a.calendar.id}});if(!M)throw pe.value="Something went wrong while processing your payment, please try again.",new Error("clientSecret missing");let D,h;if(e.formFieldsValue.first_name&&(h=e.formFieldsValue.first_name.trim()),e.formFieldsValue.full_name&&(h=e.formFieldsValue.full_name.trim()),D=await Ct.value.confirmCardSetup(M,{payment_method:{card:Ht.value,billing_details:h?{name:h}:{}}},{handleActions:!1}),D.error)throw pe.value=D.error.message,D.error;{const ee={...e.formFieldsValue,...g};if(De.value){let Z;if(typeof Storage<"u")try{Z=hi(U.value)}catch{}Z||(Z=Se(U.value).value||Se("msgsndr_id").value),Z&&(ee.contact_id=Z)}ke.value&&(ee.phone=ke.value);const se={location_id:U.value,calendar_id:a.calendar.id,payment_method_id:D.setupIntent.payment_method,setup_intent_status:D.setupIntent.status,customer_data:ee,...L?{totalRecurringBookings:E}:{}},de=await $fetch(w.public.serverBaseUrl+"/appointment/setup-stripe-customer-and-payment-intent",{method:"POST",body:se});if(de.status==="requires_action"){const Z=await Ct.value.handleCardAction(de.client_secret);
10if(Z.error)throw pe.value=Z.error.message,Z.error;S.payment_intent_id=Z.paymentIntent.id}else S.payment_intent_id=de.id;S.stripe_customer_id=de.stripe_customer_id}}catch{return pe.value||(pe.value="Something went wrong while processing your payment, please try again."),G("disableBackOnSubmit",{disable:!1}),Te(!1),!1}}else if(da.value&&Ce.value&&Ye.value){S={};let L=!1;if(jt.value||(Ho(!0),L=!0),(!Yt.value||!Kt.value)&&(Wo(!0),L=!0),wt.value||($o(!0),L=!0),L||xo.value||Bo.value||qo.value)return;Zt(""),Ur();try{const{publishable_key:E,account_id:M}=Ce.value,D={authData:{clientKey:E,apiLoginID:M},cardData:{cardNumber:jt.value,month:Yt.value,year:Kt.value,cardCode:wt.value}};S={opaqueData:(await Rr(D))?.opaqueData,cardCode:wt.value}}catch(E){if(E.type==="authorizeNetServerError"){Zt(E?.response?.messages?.message?.[0]?.text);return}Zt(E?.message||"Something went wrong!")}}}await Rn(S,s,g,t,i),G("disableBackOnSubmit",{disable:!0})},An=t=>{const i={};for(const s in t)t.hasOwnProperty(s)&&(i[s.replace(/(\_\w)/g,function(y){return y[1].toUpperCase()})]=t[s]);return i},Vn=a.formId===ae.value.webinarProperties?.formId,Ln=ae.value.webinarSession?.sessionEnd&&Y(ae.value.webinarSession.sessionEnd).isAfter(Y()),Vt=Vn&&Ln?ae.value.webinarSession:null,Rn=async(t,i,s,y,u)=>{const P=Se("msgsndr_id").value,m={...e.formFieldsValue,...s};if(a.formId&&(m.formId=a.formId),m.location_id=U.value,ke.value&&(m.phone=ke.value),De.value){let I;if(a.stickyContactFingerprint&&(I=a.stickyContactFingerprint),!I&&typeof Storage<"u")try{I=or(U.value)}catch{}I||(I=Se(U.value).value||P),I&&(m.contact_id=I)}
10const g=O.query.contact_id||a.urlParams?.contact_id;if(g&&(m.query_contact_id=g),at.value=null,a.calendar?.form_submit_type?a.calendar.form_submit_type==="RedirectURL"&&(at.value=a.calendar.form_submit_redirect_url||a.calendar.thank_you_url):a.calendar?.thank_you_url?.trim()?.length>0&&(at.value=a.calendar?.thank_you_url),a.event?m.event_id=O.query.event_id:a.calendarEventId&&(m.event_id=a.calendarEventId),a.guests.length?m.guests=Ns(a.guests,Dt.value):a.guestCountDetail.count&&(m.guestCount=a.guestCountDetail.count),a.calendar&&(m.calendar_id=a.calendar.id,!i?.onlySubmitForm)){m.selected_slot=a.selectedSlot?.format(),m.selected_timezone=a.timezone;const I=ir(a.calendar,a.selectedDurationMinutes);I&&(m.selectedDuration=I),a.calendarMeetingLocationDetails.meetingLocationId&&(m.meeting_location_id=a.calendarMeetingLocationDetails.meetingLocationId),a.calendarMeetingLocationDetails.bookerMeetingLocation&&(m.booker_meeting_location=a.calendarMeetingLocationDetails.bookerMeetingLocation)}i?.onlySubmitForm||(Wt.value?m.stripeToken=Wt.value:t&&(m.stripePaymentResult=t));const S=Co(m.locationId);S&&(m.sessionId=S),(a.calendar||a.isCalendarService)&&Ds(a.calendar?.id||U.value,m),qe.value=Qi(),m.eventData={...nr(a.pageUrl,a.baseReferrrer),fbEventId:qe.value};const L=Ut(m.locationId);if(L&&(m.sessionFingerprint=L),a.funnelPreview){let{domain:I,page_url:R}=O.query;I||(I=window.location.hostname,R=window.location.pathname),m.funneEventData={event_type:"optin",domain_name:I,page_url:R,funnel_id:ae.value.funnelId,page_id:ae.value.funnelPageId,funnel_step_id:ae.value.stepId},Vt?._id&&(m.funneEventData.webinar_session_id=Vt._id)}$t.value&&(m.captchaToken=$t.value);let E=w.public.REST_API_URLS+`/forms/submit?formId=${a.formId}&locationId=${U.value}`;const M=tl({isCalendar:!!(a.calendar||a.isCalendarService),formSubmitType:a.calendar?.form_submit_type||a.formSubmissionInstruction?.confirmationType,useCustomFormRules:a.formSubmissionInstruction?.useCustomFormRules});if(a.calendar){if(a.isNewCalendarWidgetEnabled){const R=a.formElementClass?"booking-"+a.formElementClass:"calendar-"+a.calendar?.id,te=document.querySelector(`.${R}`);te&&te.scrollIntoView({behavior:"smooth"})}const I=Xa(e.form?.conditionalLogic);a.formId&&M&&I&&Le(yo(m,e.formFieldsValue,s)),!i.onlySubmitForm&&!(M&&e.form?.disqualified)&&(E=w.public.newBaseURL+"/appointment"),Bn(m)}let D=new FormData,h={};Object.keys(m).forEach(async I=>{if(m[I]instanceof File)D.append(I,m[I]);else if(m[I]?.files){const R=Object.values(m[I].files);R.length&&await Promise.all(R.map(te=>{D.append(I,te)}))}else(m[I]||m[I]===0)&&(h[I]=m[I])}),O.query.user_id&&(h.user_id=O.query.user_id);const se=Se("am_id").value,de=Se("sam_id").value,Z=Se("am_fingerprint").value;if(se&&(h.amId=se),Z&&(h.amFingerprint=Z),de&&(h.samId=de),a.calendar){if(h.eventData.medium=ho.Calendar,h.eventData.mediumId=h?.calendar_id,a.formId){let I=C.value.filter(R=>R.type==="date");
10h.dateFieldDetails=I}}else h.eventData.medium=a.isCalendarService?ho.Calendar:ho.Form,h.eventData.mediumId=a.isCalendarService?U.value:h?.formId;if(e.form.isLeadGenVideo&&(h.internalSource={type:"hosted_video"}),e.form.enableTimezone!==!1&&(h.Timezone=`${vi()} ${_i()}`),rt.value&&(h.submissionId=rt.value),Qt.value&&(h.paymentContactId=Qt.value),(Ae.value||nt.value)&&(h.paymentStatus="Pending"),i?.shouldPayUsingPaymentElement&&(h.payment_meta={status:"pending"}),O.query.notrack||(h.timeSpent=(new Date().getTime()-Go.value)/1e3),C.value?.find(I=>I.hiddenFieldQueryKey==="payment")?.hidden&&(delete h.payment,delete h.paymentStatus,delete h.paymentContactId),i.onlySubmitForm&&(h.internalSource={type:"calendar",id:a.calendar?.id},h.source=a.calendar?.name||a.calendar?.id,h.calendar_name=a.calendar?.name,a.calendar?.stripe&&(a.calendar?.stripe?.amount==0||a.calendar?.stripe?.currency))){const I={...a.calendar.stripe};h.payment=go(i?.isRecurring??!1,i?.totalRecurringBookings??1,I,a.calendar.enable_charge_guests,a.guests?.length||a.guestCountDetail.count,a.calendarServiceHelper?.state?.coupon?.discountAmount||0)}if(i.onlySubmitForm||!i?.isRecurring){const I=Xa(e.form?.conditionalLogic);!a.calendar&&!a.isCalendarService?Le(yo(m,e.formFieldsValue,s)):a.formId&&M&&I&&Le(yo(m,e.formFieldsValue,s)),a.isCalendarService&&(h.internalSource={type:"calendar",id:U.value},h.source=Eo(O.query,"service_booking")),a.calendar&&a.calendarServiceHelper.state?.coupon&&(h.coupon={code:a.calendarServiceHelper.state?.coupon?.couponCode,chargeNow:a.calendarServiceHelper.state?.coupon?.chargeNow}),h.disqualified=M?e.form.disqualified:void 0;const R=el({isCalendar:!!a.calendar,isCalendarService:a.isCalendarService,disqualified:!!h.disqualified});if((a.calendar||R)&&e.form?.formAction&&(h.formAction={actionType:e.form.formAction.actionType,redirect_url:e.form.formAction.redirect_url,redirectUrl:e.form.formAction.redirectUrl,thankyouText:e.form.formAction.thankyouText,mobileThankyouText:e.form.formAction.mobileThankyouText}),D.set("formData",JSON.stringify(h)),D.append("locationId",U.value),a.formId&&D.append("formId",a.formId),Ge.value&&D.append("captchaToken",Ge.value),D.append("captchaV3",await ja(Ya.LEADGEN_FORM_SUBMIT)),a.isCalendarService&&!R){G("onFormSubmitCallback",Xe({formSubmissionData:h,formData:D,isError:!1}));return}const te={},B=Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone;B&&(te.timezone=B),A(te),(Zs({isCalendar:!!a.calendar,onlySubmitForm:i.onlySubmitForm,disqualified:!!h.disqualified})?oe.createOrUpdateAppointment(null,D):$fetch(E,{method:"POST",body:D,headers:te})).then(async $=>{if(st(),Jt.value=$,Qt.value=$.contactId,rt.value=$.submissionId,sessionStorage.setItem(`submissionResponse-${a.formId}`,JSON.stringify(Jt.value)),Yo(),!(R&&await Fa($.contact))){if(!a.calendar&&ma.value)await Ro.value.processPayment($.contactId,$.fingerprint,$.contact,y,u);else{await uo($),i.onlySubmitForm||($.formData=h),ht();const j=Xe({formSubmissionData:$});G("onFormSubmitCallback",j)}Vt?._id&&Us(ae.value.funnelId,{...Vt,fingerprint:$.fingerprint})}}).catch($=>{if([429].includes($.status)?$e.value=!0:st(),Te(!1),G("onFormSubmitCallback",a.isCalendarService?{isLoading:!1}:{loadingScreen:{showLoadingScreen:!1}}),a.calendar){let j="";$?.response?.status===502?j=$?.response?._data?.message||$?.response?.data?.msg||"Something went wrong with your payment. Please try again.":(j=$?.response?._data?.message||$?.response?.data?.msg||_("unable_to_schedule_appointment"),j=j||"unable_to_schedule_appointment"),G("processError",{error:j})}})}else try{h.source=a.calendar?.name,h.channel="private_api",h.calendar_name=a.calendar?.name,h.internalSource={type:"calendar",id:a.calendar?.id},h.disqualified=M?e.form.disqualified:void 0,a.calendar&&e.form?.formAction&&(h.formAction={actionType:e.form.formAction.actionType,redirect_url:e.form.formAction.redirect_url,redirectUrl:e.form.formAction.redirectUrl,thankyouText:e.form.formAction.thankyouText,mobileThankyouText:e.form.formAction.mobileThankyouText}),D.set("formData",JSON.stringify(h)),D.append("locationId",U.value),a.calendar?.id&&D.append("calendarId",a.calendar?.id),Ge.value&&D.append("captchaToken",Ge.value),D.append("captchaV3",await ja(Ya.LEADGEN_FORM_SUBMIT));const I={};$fetch(w.public.REST_API_URLS+"/forms/submit",{method:"POST",body:D,headers:I,params:{formId:a.formId,locationId:U.value}}).then(async R=>{if(st(),a.calendar&&h.disqualified&&await Fa(R.contact))return;const te={...h,contact:{id:R.contact?.id},source:Eo(O.query,"booking_widget"),formSubmissionId:R?.submissionId,isNewContact:R?.contact.
10isNew,skipFormSubmit:!0,...a.calendar&&a.calendarServiceHelper.state?.coupon&&{coupon:{code:a.calendarServiceHelper.state?.coupon?.couponCode,chargeNow:a.calendarServiceHelper.state?.coupon?.chargeNow}}};a.calendarServiceHelper?.setCustomState?.({showLoadingScreen:!0}),Object.keys(a.calendarServiceHelper).length>0&&a.calendarServiceHelper?.setFormSubmissionData(R);const B=await oe.createRecurringEvents(An(te));if(B.ids&&B.ids.length){let mt,be=B.fingerprint,$=B.sessionFingerprint,j={};try{a.calendar&&(mt=e.formFieldsValue,be=B?.fingerprint||B?.contact?.fingerprint||B.contactId);const ce="_ud";if(j=await yt(B.contact,!0),j=zt({...j,...B.contact||{}}),a.calendar){const Lt=Io(B.appointment??(B.recurrenceId?{recurrenceId:B.recurrenceId}:void 0));j=zt({...j,...Lt?{appointment:Lt}:{},...B.contact||{}})}co(ce,JSON.stringify(j)),Va(U.value,be),window.parent.postMessage(["set-sticky-contacts",ce,JSON.stringify(j),U.value,be],"*"),window.parent.postMessage(["set-sticky-contacts",`embedded_iframe_${a.iFrameId}`,a.iFrameId,U.value,be],"*"),a.event||(Fo({sessionId:B.sessionId||null,locationId:U.value}),$&&!a.calendarServiceHelper?.state?.isPaymentEnabled&&Mt(U.value,$)),a.calendarServiceHelper?.setCustomState?.({showLoadingScreen:!1}),G("onSubmit",{fingerprint:be}),B.formData=h,B.appointment={recurrenceId:B.recurrenceId},ht();const Oe=Xe({formSubmissionData:B});G("onFormSubmitCallback",Oe)}catch(ce){const Oe={formData:mt||B,eventId:B.ids.join(","),error:ce.stack,isUserSessionLoad:window.userSessionAttribution,logs:window.ConsoleSubscriber?window.ConsoleSubscriber.getErrors():[]};oe.appointmentBookingLogs(a.calendarServiceHelper?.state?.traceId,Oe),a.calendarServiceHelper?.setCustomState?.({showLoadingScreen:!1,isBackButtonDisabled:!1})}if(a.calendar||ct(()=>{Ua("track",e.form.formSubmissionEvent,qe.value)}),a.calendar){const ce={contactId:B.contactId,calendarThankYouUrl:at.value,ids:B.ids,fingerprint:be,event_address:B.eventAddress||"",cookiePayload:j,fbEventId:qe.value};G("step",Xe(ce));return}if(a.redirect===!1)return;if("formAction"in e.form&&String(e.form.formAction.actionType)===Ne.REDIRECT)window.top.location.href=Me(e.form.formAction.redirect_url||e.form.formAction.redirectUrl,j);else if("redirect_url"in e.form&&e.form.redirect_url!==""||"redirectUrl"in e.form&&e.form.redirectUrl!=="")window.top.location.href=Me(e.form.redirect_url||e.form.redirectUrl,j);else{ue.value=!0;const ce=ie.value&&e.form.formAction.mobileThankyouText||e.form.formAction.thankyouText,Oe=ce?gt(ce,j):"Thanks for submiting details, Will get back to you soon!";ne.value={action:"submit-form",message:Oe,style:ie.value?{...e.form.submitMessageStyle,bgColor:e.form.submitMessageStyle?.mobileBgColor||e.form.submitMessageStyle?.bgColor,fontWeight:e.form.submitMessageStyle?.mobileFontWeight??e.form.submitMessageStyle?.fontWeight,padding:e.form.submitMessageStyle?.mobilePadding||e.form.submitMessageStyle?.padding,margin:e.form.submitMessageStyle?.mobileMargin||e.form.submitMessageStyle?.margin}:{...e.form.submitMessageStyle},isFormPosted:ue.value,height:a.formData?.form?.height},e.form.isLeadGenVideo&&Pe.$emit("video-lead-popup-submitted",e.form.videoId)}e.form.isLeadGenVideo&&Pe.$emit("video-lead-popup-submitted",e.form.videoId)}else throw _("unable_to_schedule_appointment")}).catch(R=>{[429].includes(R.status)?$e.value=!0:st(),a.calendarServiceHelper?.setCustomState({showLoadingScreen:!1});let te="";R?.response?.status===502?te=R?.response?.data?.msg||"Something went wrong with your payment. Please try again.":te=R?.response?.data?.msg||_("unable_to_schedule_appointment"),G("processError",{error:te})})}catch(I){if([429].includes(I.status)?$e.value=!0:st(),a.calendarServiceHelper?.setCustomState({showLoadingScreen:!1}),a.calendar){let R="";I?.response?.status===502?R=I?.response?.data?.msg||"Something went wrong with your payment. Please try again.":R=I?.response?.data?.msg||_("unable_to_schedule_appointment"),G("processError",{error:R})}}},On=async()=>{if(!a.formId)return;const t=await me.loadProgress();t&&(dl(t,{state:e,formFields:C,countryList:Ot,updateFormattedCountry:so,customFieldPhoneNumberUpdate:Qe}),Lo.value=!0,Be.value=!1)},Un=async()=>
10{if(!a.formId)return;await me.clearProgress(),Be.value=!1,e.formFieldsValue={},De.value&&(le.value||(le.value=C.value.map(i=>i.tag)),await Pt(a.stickyContactData,le.value));const t=await et(a.urlParams,O,e.phoneCountryIncluded,K.value,e.formFieldsValue,C.value,_e.value);Je(t)},uo=async(t,i)=>{me.isEnabled.value&&a.formId&&await me.clearProgress();const s=Se("msgsndr_id").value;if(t.status||t.id){let y=t.formData,u=t.fingerprint,P=t.sessionFingerprint,m={};if(s!==u){const g=Se("msgsndr_id",{path:"/",maxAge:31536e3});g.value=u}try{a.calendar&&(y=e.formFieldsValue,u=t?.fingerprint||t?.contact?.fingerprint||t.contactId);const g="_ud";if(m=await yt(t.contact,!0),a.calendar){const S=t?.appointment,L=Ga(a.locale),M=a.calendarServiceHelper?.state?.use24hFormat??a.calendar?.calendar?.use24hFormat??!1?"ddd, MMM DD, YYYY HH:mm":"llll",D=(h,ee)=>Y(h).locale(L).format(ee);if(S){const h={...S,only_end_date:D(S.only_end_date,"dddd, ll"),only_start_date:D(S.only_start_date,"dddd, ll"),start_time:D(S.start_time,M),end_time:D(S.end_time,M)},ee=!!(S.recurrenceId||S.recurrence_id||t?.recurrenceId||t?.ids?.length);if(m={...m,appointment:h,...t?.contact},ee){const se=Io(h);m=zt({...m,...se?{appointment:se}:{}})}}}co(g,JSON.stringify(m)),Va(U.value,u),window.parent.postMessage(["set-sticky-contacts",g,JSON.stringify(m),U.value,u],"*"),window.parent.postMessage(["set-sticky-contacts",`embedded_iframe_${a.iFrameId}`,a.iFrameId,U.value,u],"*"),a.event||(Fo({sessionId:t.sessionId||null,locationId:U.value}),P&&Mt(U.value,P)),G("onSubmit",{fingerprint:u})}catch(g){const S={formData:y||t,eventId:t.id,error:g.stack,isUserSessionLoad:window.userSessionAttribution,logs:window.ConsoleSubscriber?window.ConsoleSubscriber.getErrors():[]};oe.appointmentBookingLogs(a.calendarServiceHelper?.state?.traceId,S)}if(a.calendar||ct(()=>{Ua("track",e.form.formSubmissionEvent,qe.value)}),a.calendar){const g={contactId:t.contactId,calendarThankYouUrl:at.value,id:t.id,fingerprint:u,event_address:t.event_address,cookiePayload:m,fbEventId:qe.value};G("step",Xe(g));return}if(a.isCalendarService){const g={contactId:t.contactId,id:t.id,fingerprint:u,event_address:t.event_address,cookiePayload:m};G("step",Xe(g));return}if(a.funnelPreview&&We.value.length>0&&a.redirect===!1)try{a.extra,t.contact;const g=await Vs(a.formData.locationId,e.form.id,We.value,Ve.value?.coupon?.code,"form",!0);We.value.forEach(E=>{E.newPrice=g?.products?.find(M=>M.priceId===E._id)?.itemSubtotalWithDiscount,E.showNewPrice=E.newPrice!==E.amount*E.qty});const S={products:We.value||[],tax:Ve.value?.taxSummary||[],total:Ve.value?.amount||0,manualPaymentMethodId:i?.data?.manualPaymentMethodId,orderIds:Ve.value?._id?[Ve.value._id]:[]},L=Es(t.contact);await c(a.extra,ae,S,L,!1,"","form")}catch{}if(a.redirect===!1)return;if("formAction"in e.form&&String(e.form.formAction.actionType)===Ne.REDIRECT&&!e.form.isLeadGenVideo){const g=Me(e.form.formAction.redirect_url||e.form.formAction.redirectUrl,m);Rt(g)}else if(("redirect_url"in e.form&&e.form.redirect_url!==""||"redirectUrl"in e.form&&e.form.redirectUrl!=="")&&!e.form.isLeadGenVideo){const g=Me(e.form.redirect_url||e.form.redirectUrl,m);Rt(g)}else if("formAction"in e.form&&parseInt(e?.form?.formAction?.actionType)==3&&(ma.value||Q.value?.orderId))ue.value=!0,ne.value={action:"order",style:{width:e.form.width,style:e.form.style,fieldStyle:e.form.fieldStyle},productPurchased:Ee.value.map(g=>(lt.value.forEach(S=>{S._id===g.productId&&(g.showImage=S.showImage,g.showDescription=S.showDescription)}),g)),paymentType:Q.value.paymentType||he.DONATION,isRecurringDonation:Q.value.isRecurringDonation,orderId:Q.value.orderId,donationAmount:e.formFieldsValue.payment,productSummary:He.value,couponCode:Tt.value,contact:t.contact};else{ue.value=!0;const g=ie.value&&e.form.formAction.mobileThankyouText||e.form.formAction.thankyouText,S=g?gt(g,m):"Thanks for submiting details, Will get back to you soon!";ne.value={action:"submit-form",message:S,style:ie.value?{...e.form.submitMessageStyle,bgColor:e.form.submitMessageStyle?.mobileBgColor||e.form.submitMessageStyle?.bgColor,fontWeight:e.form.submitMessageStyle?.mobileFontWeight??e.form.submitMessageStyle?.fontWeight,padding:e.form.submitMessageStyle?.mobilePadding||e.form.submitMessageStyle?.padding,margin:e.form.submitMessageStyle?.mobileMargin||e.form.submitMessageStyle?.margin}:{...e.form.submitMessageStyle},isFormPosted:ue.value,height:a.formData?.form?.height},e.form.isLeadGenVideo&&Pe.$emit("video-lead-popup-submitted",e.form.videoId)}e.form.isLeadGenVideo&&Pe.$emit("video-lead-popup-submitted",e.form.videoId)}},zn=async t=>{if(t.type==="error")t.message&&(e.form.payment.required||Ae.value||nt.value)&&(Te(!1),W({tag:"payment",error:t.message}));else if(t.type==="pre_process")a.funnelPreview&&Ti(ae.value.funnelId,{products:[],tax:[],total:0},"v2"),await Re(t.data,t.provider);else if(t.type==="success"){a.funnelPreview&&co("pmc_id",zr.value),sessionStorage.removeItem(`formOrderResponse-${a.formId}`);const i={submissionId:rt.value,orderId:Q.value.orderId,paymentType:Q.value?.paymentType===he.PRODUCT?he.PRODUCT:he.DONATION,locationId:U.value,formId:a.formId,transactionId:["authorize-net","nmi","square","mercado-pago"].includes(t.provider)?t.data?.transactionId:t.data.data?.transactionId};await Ca(i,Jt.value,t)}},Ca=async(t,i,s)=>{try{await Pi.patchSubmission(t),uo(i,s)}catch{uo(i,s)}},Ea=async()=>{const t=sessionStorage.getItem(`formData-${a.formId}`);if(t){const s=JSON.parse(t);
10et(a.urlParams,O,s.phoneCountryIncluded,s.formattedCountry,s.formFieldsValue,s.formFields,_e.value).then(y=>{Je(y,{categorizeVisibility:!0})})}const i=sessionStorage.getItem(`submissionResponse-${a.formId}`);if(t&&i){const s=JSON.parse(t),y=JSON.parse(i),u={submissionId:s.submissionId,orderId:s.productPurchased.orderId,paymentType:s.productPurchased?.paymentType===he.PRODUCT?he.PRODUCT:he.DONATION,locationId:U.value,formId:a.formId,transactionId:Oo.value??O.query.transactionId??"51651414"};Q.value=s.productPurchased,Ee.value=s.productPurchasedList,He.value=s.productSummary,Ae.value=s.paymentAmount,await Ca(u,y)}},Mn=()=>{!a.calendar&&!a.isCalendarService||(le.value=C.value.map(t=>t.tag),setTimeout(()=>{As(a.calendar?.id||U.value,le.value,e.formFieldsValue,e.phoneCountryIncluded,K.value).then(t=>{if(t){e.formFieldsValue=t.formFieldsValue,e.phoneCountryIncluded=t.phoneCountryIncluded,K.value=t.formattedCountry;for(let i in e.phoneCountryIncluded)e.phoneCountryIncluded[i]&&Qe({tag:i})}}).catch(t=>{})},po()?1005:100))},Nn=async t=>{t.type==="error"&&t?.message&&(G("disableBackOnSubmit",{disable:!1}),Te(!1)),G("onProcessCalendarPayment",{...t,component:"FormComponent"})},xn=()=>{Te(!1)},Bn=t=>{[...Ys,"payment_session_id","calendarElementClass"].forEach(s=>{delete t?.eventData?.url_params[s]})};bi(()=>{window.removeEventListener("resize",no),Pe.$off("submitCalendarForm",Re),Pe.$off("submitCalendarServiceForm",Re),ot&&clearTimeout(ot)});function Ze(t){a?.calendarServiceHelper?.setCustomState?.({isSubmitting:!1,error:t}),a.isCalendarService&&G("onFormSubmitCallback",{isError:!0})}const Pa=k(()=>(ye.value&&e.form?.style?.mobilePadding||e.form?.style?.padding)?.extraPaddingComputingProcessed===!0),qn=k(()=>{const t=Dr(),i={showImage:e.form.showImage,headerImageSrc:e.form.formAction?.headerImageSrc,mobileHeaderImageSrc:e.form.formAction?.mobileHeaderImageSrc,mobileHeaderImageSrcDeleted:e.form.formAction?.mobileHeaderImageSrcDeleted,imageFocusPoint:e.form.imageFocusPoint};return gs(J.value,i,e.form?.style,t,ie)}),Hn=k(()=>{const t={imageFieldSpacing:e.form.imageFieldSpacing};return hs(J.value,t,e.form?.style,ie)});return(t,i)=>{const s=Ui,y=ul,u=Mi,P=ml,m=cl,g=fl,S=pl,L=yl,E=gl,M=Ni,D=xi,h=hl,ee=Hi,se=vl,de=_l,Z=bl,I=Sl,R=Il,te=Fl,B=Cl,mt=El,be=Wi,$=Pl,j=wl,ce=Tl,Oe=kl,Lt=Dl,Wn=Al,wa=Gi,$n=Vl,Gn=Ll,jn=Rl,Yn=Ol,Kn=Ul,Qn=zl,Jn=Ml;return F(),Ie(La,null,[o(At).blocked?(F(),T(s,{key:0,state:o(At).state,appearance:o(At).appearance,company:r.formData?.form?.company,"full-page":r.scheduleFullPage,"calendar-embed":!!r.calendar},null,8,["state","appearance","company","full-page","calendar-embed"])):(F(),Ie("div",Nl,[Fe("section",{id:"form-builder",class:ze(["hl_form-builder--main",[o(e).form.fullScreenMode?"hl_form-builder--main-full":"",o(Vr)?"hl_form-builder--main--custom-margin":""]]),style:fe(o(Wr))},[o(Xr)?(F(),Ie("div",{key:0,class:"image-layout-container",style:fe({maxWidth:o(No)+"px"})},[Fe("div",xl,[Si(y,{url:o(kt),alt:"banner",class:"w-full h-auto",style:fe({borderRadius:o(en)})},null,8,["url","style"])])],4)):re("",!0),Fe("div",{style:fe({maxWidth:o(No)+"px",width:"100%",marginLeft:"auto",marginRight:"auto",marginBottom:o(e).form.fullScreenMode?"0 !important":""}),class:"ghl-form-wrap"},[o(ue)?re("",!0):(F(),Ie("div",{key:0,id:"_builder-form",style:fe(o(qn)),name:"builder-form",class:ze(["form-builder--wrap",o(e).form.fullScreenMode?"form-builder--wrap-full":""])},[Fe("div",{class:ze(["flex items-center",o(dt)]),style:fe({gap:o(Zr)})},[o(J)!==o(ge).TOP_FIXED&&o(J)!==o(ge).BACKGROUND&&o(J)!==o(ge).HEADER&&o(je)?(F(),Ie("div",{key:0,class:"image-side",style:fe(o(dt)==="image-layout-left-fixed"||o(dt)==="image-layout-right-fixed"?{width:o(ta),backgroundImage:`url(${o(kt)})`,backgroundSize:"cover",backgroundPosition:`${o(ea).x}% ${o(ea).y}%`,backgroundRepeat:"no-repeat",height:"-webkit-fill-available",borderRadius:o(tn),...o(on)}:{width:o(ta)})},[!(o(dt)==="image-layout-left-fixed"||o(dt)==="image-layout-right-fixed")&&o(J)!==o(ge).TOP_FIXED&&o(J)!==o(ge).BACKGROUND?(F(),T(y,{key:0,url:o(kt),alt:"banner",class:"w-full h-auto",style:fe({borderRadius:o(vs)(o(J))?`${o(e).form.imageCornerRadius??0}px`:"0px"})},null,8,["url","style"])):re("",!0)],4)):re("",!0),Fe("div",{class:"form-side",style:fe(o(Hn))},[Fe("div",{class:ze([o(bt)?"builder-inline apply-gutter":"flex-col",o(H)?"":"extra-top-padding","row fields-container",o(Pa)?"remove-extra-padding":""])},[(F(!0),Ie(La,null,Ii(o(C).filter(f=>!o(Ma)(a.formData?.form?.fields,f)),(f,V)=>(F(),Ie("div",{key:V,id:"el_"+a.formId+"_"+f.tag+"_"+V,style:fe(jr(f)),class:ze([[$r(f,V),o(bt)?"menu-field-wrap":"",{calendar_notes:f.tag==="calendar_notes"},{location_picker:f.tag==="locationConfiguration"},{"payment-block":f.type==="payment"}],"form-field-wrapper"]),onFocusin:b=>ro(b,f),onClick:b=>ro(b,f),onFocus:b=>ro(b,f)},[Fe("div",{class:ze([V%2==0?"f-even":"f-odd","form-field-container"])},[f.type==="text"?(F(),T(u,{key:0,kind:"form","is-mobile":o(ye).value,item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"phone-country-included":o(e).phoneCountryIncluded,"phone-country-code":o(e).phoneCountryCode,"location-country":o(Ke),"form-fields-value":o(e).formFieldsValue,"formatted-
vendor: 5,392 bytes, line 10
10phone":o(e).formattedPhone,"phone-country-derived":o(It),errors:o(e).errors,"layout-type":o(e).form.layout,"check-full-width-position":ut(V),"font-size":o(e)?.form?.fieldStyle?.placeholderFontSize,locationId:a?.formData?.locationId,"medium-id":r.formId,onVerifyPhone:Ko,onUpdateToken:to,onUpdatePhoneCountryDerived:ga,onCustomFieldPhoneNumberUpdate:Qe,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,onUpdatePhoneCountryIncluded:ha,onUpdatePhoneCountryCode:va,onUpdateFormattedPhone:_a,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["is-mobile","item","form-label-visible","form-label-alignment","phone-country-included","phone-country-code","location-country","form-fields-value","formatted-phone","phone-country-derived","errors","layout-type","check-full-width-position","font-size","locationId","medium-id"])):f.type==="url"?(F(),T(P,{key:1,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","errors"])):f.type==="phone"?(F(),T(m,{key:2,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"phone-country-included":o(e).phoneCountryIncluded,"phone-country-code":o(e).phoneCountryCode,"location-country":o(Ke),"form-fields-value":o(e).formFieldsValue,"phone-country-derived":o(It),"formatted-phone":o(e).formattedPhone,errors:o(e).errors,"layout-type":o(e).form.layout,"check-full-width-position":ut(V),"font-size":o(e)?.form?.fieldStyle?.placeholderFontSize,locationId:a?.formData?.locationId,"medium-id":r.formId,onVerifyPhone:Ko,onUpdateToken:to,onAddOrUpdateError:W,onUpdatePhoneCountryDerived:ga,onCustomFieldPhoneNumberUpdate:Qe,onUpdateFormFieldsValue:X,onUpdatePhoneCountryIncluded:ha,onUpdatePhoneCountryCode:va,onUpdateFormattedPhone:_a,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","phone-country-included","phone-country-code","location-country","form-fields-value","phone-country-derived","formatted-phone","errors","layout-type","check-full-width-position","font-size","locationId","medium-id"])):f.type==="number"||f.type==="numerical"||f.dataType==="SCORE"?(F(),T(g,{key:3,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","errors"])):f.type==="rating"?(F(),T(S,{key:4,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,errors:o(e).errors,"layout-type":o(e).form.layout,"check-full-width-position":ut(V),"font-size":o(e)?.form?.fieldStyle?.placeholderFontSize,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","errors","layout-type","check-full-width-position","font-size"])):f.type==="email"?(F(),T(L,{key:5,kind:"form","medium-id":r.formId,item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,errors:o(e).errors,"layout-type":o(e).form.layout,"check-full-width-position":ut(V),"font-size":o(e)?.form?.fieldStyle?.placeholderFontSize,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,onVerifyEmail:qr,onUpdateToken:to,locationId:a?.formData?.locationId,ref_for:!0,ref:b=>{o(z)[V]=b},form:o(e).form},null,8,["medium-id","item","form-label-visible","form-label-alignment","form-fields-value","errors","layout-type","check-full-width-position","font-size","locationId","form"])):re("",!0),f.type==="h1"?(F(),T(E,{key:6,"is-mobile":o(ye).value,item:o(q)(f)},null,8,["is-mobile","item"])):f.type==="textbox_list"?(F(),T(M,{key:7,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,"local-tag-id":o(ve),errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","local-tag-id","errors"])):f.type==="textarea"||f.type=="large_text"?(F(),T(D,{key:8,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","errors"])):f.type==="img"&&"url"in f?(F(),T(h,{key:9,kind:"form",item:o(q)(f),ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item"])):f.type==="html"&&o(Gt)&&o(Ao)?(F(),T(ee,{key:10,item:o(q)(f),localTagId:o(ve)+V,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","localTagId"])):f.type==="captcha"?(F(),T(se,{key:11,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"captcha-input-value":o(Et),"local-tag-id":o(ve),"validation-error":o(e).validationError,onUpdateValidationError:un,onUp
10dateIsCaptchaVerified:yn,onUpdateCaptchaToken:vn,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","captcha-input-value","local-tag-id","validation-error"])):f.type==="monetory"?(F(),T(de,{key:12,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,"locale-currency":o(nn),errors:o(e).errors,onAddOrUpdateError:W,primaryColor:o(e)?.form?.fieldStyle?.primaryColor,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b},form:o(e).form},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","locale-currency","errors","primaryColor","form"])):o(Ji)(f)?(F(),T(Z,{key:13,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,layout:o(e).form.layout,"local-tag-id":o(ve),errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","layout","local-tag-id","errors"])):f.type==="checkbox"?(F(),T(I,{key:14,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,layout:o(e).form.layout,"local-tag-id":o(ve),errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","layout","local-tag-id","errors"])):f.type==="terms_and_conditions"?(F(),T(R,{key:15,kind:"form","is-mobile":o(ye).value,item:o(q)(f),"form-label-visible":o(H),labelFontFamily:o(e).fieldStyle.labelFontFamily,"form-fields-value":o(e).formFieldsValue,"local-tag-id":o(ve),errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["is-mobile","item","form-label-visible","labelFontFamily","form-fields-value","local-tag-id","errors"])):f.type==="radio"&&f.picklistOptions&&!o(Ri)(f)?(F(),T(te,{key:16,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,"local-tag-id":o(ve),errors:o(e).errors,layout:o(e).form.layout,onAddOrUpdateError:W,onResetFieldsValue:En,onSetRadioValue:Pn,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","local-tag-id","errors","layout"])):f.type==="radio"&&f.picklistOptionsImage?(F(),T(B,{key:17,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,layout:o(e).form.layout,"local-tag-id":o(ve),errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","layout","local-tag-id","errors"])):f.type==="select"&&f.tag==o(Fi).COUNTRY?(F(),T(mt,{key:18,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"formatted-country":o(K),countries:o(ua),errors:o(e).errors,onUpdateFormattedCountry:so,onAddOrUpdateError:W,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-label-alignment","formatted-country","countries","errors"])):f.type==="single_options"||f.type==="multiple_options"?(F(),T(be,{key:19,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-fields-value":o(e).formFieldsValue,"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,errors:o(e).errors,onAddOrUpdateError:W,onUpdateFormFieldsValue:X,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["item","form-label-visible","form-fields-value","form-label-alignment","errors"])):f.type==="date"?(F(),T($,{key:20,kind:"form",item:o(q)(f),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"form-fields-value":o(e).formFieldsValue,errors:o(e).errors,ref_for:!0,ref:b=>{o(z)[V]=b},onDateSelected:_n,onAddOrUpdateError:W,form:o(e).form,onUpdateFormFieldsValue:X,startDayOfWeek:0},null,8,["item","form-label-visible","form-label-alignment","form-fields-value","errors","form"])):f.type==="payment"&&o(la)&&o(Ye)?(F(),T(j,{key:21,calendar:r.calendar,payment:o(Ce),stripe:o(Ct),card:o(Ht),"card-error-msg":o(pe),onUpdateStripe:mn,onUp
10dateCard:cn,onUpdateCardErrorMsg:pn,ref_for:!0,ref:b=>{o(z)[V]=b}},null,8,["calendar","payment","stripe","card","card-error-msg"])):f.type==="payment"&&o(da)&&o(Ye)&&o(Gt)?(F(),T(ce,{key:22,kind:"form",calendar:r.calendar,payment:o(Ce),setAuthorizeNetNewCardDetails:fn,authorizeNetCardNumberError:o(xo),authorizeNetCardExpiryError:o(Bo),authorizeNetCardCVCError:o(qo),setAuthorizeNetCardNumberError:o(Ho),setAuthorizeNetExpiryError:o(Wo),setAuthorizeNetCVCError:o($o),authorizeNetErrorResponse:o(Or)},null,8,["calendar","payment","authorizeNetCardNumberError","authorizeNetCardExpiryError","authorizeNetCardCVCError","setAuthorizeNetCardNumberError","setAuthorizeNetExpiryError","setAuthorizeNetCVCError","authorizeNetErrorResponse"])):!r.calendar&&f.type==="payment"&&(o(e).form?.payment?.paymentType==="product"&&o(Zo)&&o(lt).length>0||o(e).form?.payment?.paymentType!=="product")?(F(),T(Oe,{key:23,kind:"form","funnel-preview":r.funnelPreview,item:o(q)(f),payment:o(e).form.payment,products:o(lt),"bump-products":o(Mo),style:fe(o(e).form.fieldStyle),"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,locationId:o(U),"form-id":r.formId,recurringDonationProduct:o(Uo),isPaymentInProcessing:o(St),"form-name":r.formData.name,errors:o(e).errors,formItems:o(e).form,formValues:o(e).formFieldsValue,"phone-country-code":o(e).phoneCountryCode,"location-country":o(Ke),onOnPaymentCallback:zn,onAddOrUpdateError:W,onPaymentAmount:xr,onProductOrder:Br,onOnOrderApiFail:xn,onProductSelected:sn,onCouponCode:ln,ref_for:!0,ref:b=>{o(z)[V]=b,Ro.value=b},form:o(e).form},null,8,["funnel-preview","item","payment","products","bump-products","style","form-label-visible","form-label-alignment","locationId","form-id","recurringDonationProduct","isPaymentInProcessing","form-name","errors","formItems","formValues","phone-country-code","location-country","form"])):f.type==="file_upload"?(F(),T(Lt,{key:24,kind:"form",item:o(q)(f),"form-fields-value":o(e).formFieldsValue,"form-label-visible":o(H),"location-id":o(U),"form-id":r.formId,"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,errors:o(e).errors,onUpdateFormFieldsValue:X,onAddOrUpdateError:W,onUploading:o(Cr),ref_for:!0,ref:b=>{o(z)[V]=b},form:o(e).form},null,8,["item","form-fields-value","form-label-visible","location-id","form-id","form-label-alignment","errors","onUploading","form"])):f.type==="signature"?(F(),T(Wn,{key:25,kind:"form",item:o(q)(f),"form-fields-value":o(e).formFieldsValue,"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,ref_for:!0,ref:b=>{o(z)[V]=b},errors:o(e).errors,onUpdateFormFieldsValue:X,onAddOrUpdateError:W,form:o(e).form},null,8,["item","form-fields-value","form-label-visible","form-label-alignment","errors","form"])):f.type==="submit"&&(o($e)||!o(na))?(F(),T(wa,{key:26,item:o(q)(f),"show-recaptcha":o($e),layout:o(e).form.layout,"form-label-visible":o(e).form.formLabelVisible,"button-style":o(e).buttonStyle,calendar:r.calendar,"form-submit-disable":o(St),onClick:Re,"onUpdate:recaptchaToken":Mr,ref_for:!0,ref:b=>{o(z)[V]=b},errors:o(e).errors},null,8,["item","show-recaptcha","layout","form-label-visible","button-style","calendar","form-submit-disable","errors"])):f.tag==="group_address"?(F(),T($n,{key:27,kind:"form",item:o(q)(f),"form-fields-value":o(e).formFieldsValue,"form-label-visible":o(H),"form-label-alignment":o(e).form?.fieldStyle?.labelAlignment,"formatted-country":o(K),countries:o(ua),ref_for:!0,ref:b=>{o(z)[V]=b},errors:o(e).errors,onUpdateFormFieldsValue:X,onUpdateFormattedCountry:so,onAddOrUpdateError:W,addressData:o(_e),fieldSpacing:o(e)?.form?.style?.fieldSpacing,fieldStyle:o(e).fieldStyle,locationId:a?.formData?.locationId,companyId:a?.formData?.companyId,fields:o(C),id:r.formId,source:"forms"},null,8,["item","form-fields-value","form-label-visible","form-label-alignment","formatted-country","countries","errors","addressData","fieldSpacing","fieldStyle","locationId","companyId","fields","id"])):re("",!0)],2)],46,Bl))),128))],2),r.formData!=null&&o(ko)?(F(),T(Gn,{key:0,company:o(e).company},null,8,["company"])):re("",!0)],4),!o(je)||o(J)===o(ge).BACKGROUND||o(J)===o(ge).TOP_FIXED||o(J)===o(ge).HEADER?(F(),Ie("div",ql,[Fe("div",{class:ze([o(bt)?"builder-inline":"flex-col",o(H)?"":"extra-top-padding","row fields-container",o(Pa)?"remove-extra-padding":""])},null,2)])):re("",!0),o(na)?(F(),Ie("div",Hl,[r.isNewCalendarWidgetEnabled?(F(),T(jn,{key:0,guests:r.guests,"guest-count-detail":r.guestCountDetail,"collect-guest-count":o(sa),"is-mandatory-guest-enabled":o(ia),"guest-collection-mode":o(Dt),"location-country":o(Ke),"seats-per-slot-data":a.seatsPerSlotData,"form-fields-value":o(e).formFieldsValue,ref:f=>oo(f),onAddOrUpdateError:W}
10,null,8,["guests","guest-count-detail","collect-guest-count","is-mandatory-guest-enabled","guest-collection-mode","location-country","seats-per-slot-data","form-fields-value"])):(F(),T(Yn,{key:1,guests:r.guests,"guest-count-detail":r.guestCountDetail,"collect-guest-count":o(sa),"is-mandatory-guest-enabled":o(ia),"guest-collection-mode":o(Dt),"location-country":o(Ke),"seats-per-slot-data":a.seatsPerSlotData,"form-fields-value":o(e).formFieldsValue,ref:f=>oo(f),onAddOrUpdateError:W},null,8,["guests","guest-count-detail","collect-guest-count","is-mandatory-guest-enabled","guest-collection-mode","location-country","seats-per-slot-data","form-fields-value"])),o(ra)?(F(),T(wa,{key:2,item:o(ra),"button-style":o(e).buttonStyle,calendar:r.calendar,"form-submit-disable":o(St),onClick:Re,ref:f=>oo(f),errors:o(e).errors,class:"menu-field-wrap col-sm-12 col-12 calendar_notes mt-20"},null,8,["item","button-style","calendar","form-submit-disable","errors"])):re("",!0)])):re("",!0)],6)],6)),o(ne)&&o(ne).action==="order"?(F(),T(Kn,{key:1,id:"order-confirmation",payload:o(ne)},null,8,["payload"])):re("",!0),o(ne)&&o(ne).action==="submit-form"?(F(),T(Qn,{key:2,id:"_builder-form",payload:o(ne)},null,8,["payload"])):re("",!0),o(an)?(F(),T(Jn,{key:3,ref:r.calendarServiceHelper.newCardPaymentElementRef,state:r.calendarServiceHelper.state,showSessionExpire:!1,hasInvalidFormInputs:o(oa),formContactPreview:o(aa),onOnPaymentCallback:Nn,onUpdateState:i[0]||(i[0]=f=>r.calendarServiceHelper.setCustomState(f))},null,8,["state","hasInvalidFormInputs","formContactPreview"])):re("",!0)],4)],6),Fe("div",Wl,[r.calendar?(F(),T(Rs,{key:0,loading:o(it)&&!r.calendarServiceHelper?.state?.isPaymentEnabled,color:"#188bf6",size:"30px"},null,8,["loading"])):re("",!0)])],512)),o(me).isEnabled?(F(),T(Oi,{key:2,show:o(Be),onStartOver:Un,onContinue:On,form:o(e).form,kind:"form",mediumId:a.formId,locationId:a.formData?.locationId,name:a.formData?.name},null,8,["show","form","mediumId","locationId","name"])):re("",!0)],64)}}}),Gl=Object.assign($l,{__name:"PreviewElementsFormBuilderFormComponent"}),Vd=Object.freeze(Object.defineProperty({__proto__:null,default:Gl},Symbol.toStringTag,{value:"Module"}));export{kd as C,Qs as D,Ne as F,xe as G,Gl as _,el as a,al as b,nl as c,ur as d,wo as e,Id as f,Ad as g,Xa as h,Pd as i,Fd as j,Cd as k,Ed as l,Qa as m,cr as n,js as o,wd as p,Td as q,Dd as r,mr as s,Ys as t,tl as u,Ms as v,Zs as w,Ns as x,Po as y,Vd as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.