1import{h as D,c as z,j as a}from"./styledComponents-n4UW4kpA.js";import{b as G}from"./FormHelpText-4ln6uI_r.js";import{a as w}from"./react-C3MRYTMn.js";import{a as H,u as k}from"./redux-DEt5ekS8.js";import{F as W,c as B}from"./FormField-BzoiG7mG.js";import{c as U,m as _,v as K,q as Q,r as X}from"./index-Dbx1gyta.js";import{F as Z,a as J}from"./FormCheckbox-CakGujzw.js";import{F as Y,W as ee}from"./FormWizard-D8LvthqE.js";import{F as te,a as ae,b as le}from"./FormGroup-BOm6V0xO.js";import{F as oe,f as ce,l as ne,I as ie,i as re,o as se,x as de,E as me,r as ue}from"./FormPrivacyPolicy-CBrZlB1T.js";import{G as he}from"./GoogleRecaptcha-CbN7g8WU.js";import"./Icon-CkZJfHnP.js";import"./buttons.styles-ClYbUcfj.js";import"./polished.esm-CYsXSD1d.js";import"./index-g6qz2-ej.js";import"./brandTextCheck-BtVFi4-W.js";import"./Text-DGc87esK.js";import"./urlHelpers-szXc1bAB.js";import"./regexHelpers-CqioRAZN.js";import"./withClientOnly-SlO7kxqu.js";const be=D.div.withConfig({displayName:"StaffEnquiryFormstyles__StyledStaffEnquiryFormOverlay",componentId:"sc-1dd3aba-0"})(["background-color:",";box-sizing:border-box;display:block;margin:0 auto;padding:0 0%;width:100%;",""],o=>o.theme.colours.background.a,({theme:o})=>z(["","{"," display:block;}"],_(o.breakpoints.a),U(10,12,0,0))),P=ee,j=W,xe=Y,je=oe,ve=he,c=ae,ye=le,i=te,$=Z,M=J,pe=o=>{var v,d,y,m,p,F,f,g;const{showCaptcha:e}=o,l={};if(o.form)return l.firstName=ce(((v=o.form.firstName)==null?void 0:v.errorText)||""),l.lastName=ne(((d=o.form.lastName)==null?void 0:d.errorText)||""),l.enquiry=ie(((y=o.form.enquiry)==null?void 0:y.errorText)||""),l.contactMethod=re(((m=o.form.contactMethod)==null?void 0:m.errorText)||""),l.emailAddress=se(((p=o.form.emailAddress)==null?void 0:p.errorText)||"",!0),l.telephone=de(((F=o.form.telephone)==null?void 0:F.errorText)||"",!0),l.callbackTime=me(((f=o.form.callbackTime)==null?void 0:f.errorText)||"",!0),e&&(l.recaptcha=ue(((g=o.form.recaptcha)==null?void 0:g.errorText)||"")),B().shape(l)},Oe=o=>{const{form:e,stepOne:l,stepTwo:v,toggleModal:d,showCaptcha:y,staffId:m,url:p=window.location.href}=o,F=H(),f=k(t=>{var r,s,n,u;return((s=(r=t.page.pageData.context.content)==null?void 0:r.HostMapping)==null?void 0:s.siteId)||((u=(n=t.page.pageData.context.content)==null?void 0:n.hostMapping)==null?void 0:u.siteId)}),g=k(t=>t.page.pageData.context.content.partner),I=k(t=>t.page.pageData.context),[T,E]=w.useState(!1),[L,V]=w.useState({}),R=t=>{F(K(t))},O=t=>{const r=o.isPartner?0:m,s=o.isPartner?m:0;Q.post(`${e.endpoint}/${r}?partnerId=${s}`,{...t,siteId:f,siteName:g,url:p,context:I},{headers:X("U0pQOlBhcnRuZXI=","application/json")}).then(()=>{E(!0)}).catch(n=>{n.response&&V(n.response.data)})};return a.jsx(be,{children:T?a.jsx(xe,{stepThree:v,onClickCallback:d}):a.jsx(P,{initialValues:{firstName:"",lastName:"",clientId:"",existingClient:"no",subject:["other"],enquiry:"",recaptcha:"",contactMethod:[],emailAddress:"",telephone:"",callbackTime:[]},onSubmit:t=>O(t),updateActiveStep:R,toggleModal:d,form:e,staffEnquiryForm:!0,children:a.jsx(P.Page,{validate:pe(o),...l,formError:L,formSubmitted:T,buttonNext:l==null?void 0:l.buttonNextLabel,buttonPrev:l==null?void 0:l.buttonPrevLabel,children:t=>{var r,s,n,u,N,q,S,C,A;return a.jsxs(a.Fragment,{children:[a.jsxs(i,{children:[((r=e==null?void 0:e.firstName)==null?void 0:r.label)&&a.jsx(c,{column:50,children:a.jsx(j,{name:"firstName",component:"input",label:e.firstName.label,type:"text",error:t.errors.firstName,touched:t.touched.firstName,value:t.values.firstName})}),((s=e==null?void 0:e.lastName)==null?void 0:s.label)&&a.jsx(c,{column:50,children:a.jsx(j,{name:"lastName",component:"input",label:e.lastName.label,type:"text",error:t.errors.lastName,touched:t.touched.lastName,value:t.values.lastName})})]}),((n=e==null?void 0:e.contactMethod)==null?void 0:n.label)&&a.jsxs(a.Fragment,{children:[a.jsx(c,{children:a.jsx(i,{children:a.jsx(G,{name:"contactMethod",render:h=>{var b,x;return a.jsxs($,{error:t.errors.contactMethod,touched:t.touched.contactMethod,value:t.values.contactMethod,label:e.contactMethod.label,id:"contactMethod",helpText:e.contactMethod.helpText,children:[((b=e==null?void 0:e.contactMethod)==null?void 0:b.emailOptionLabel)&&a.jsx(M,{values:t.values.contactMethod,arrayHelpers:h,group:"contactMethod",inputValue:"email",label:e.contactMethod.emailOptionLabel,isGrey:!0}),((x=e==null?void 0:e.contactMethod)==null?void 0:x.telephoneOptionLabel)&&a.jsx(M,{values:t.values.contactMethod,arrayHelpers:h,group:"contactMethod",inputValue:"telephone",label:e.contactMethod.telephoneOptionLabel,isGrey:!0})]})}})})}),a.jsxs(ye,{isVisible:!!(t.values.contactMethod.includes("email")||t.values.contactMethod.includes("telephone")),children:[((u=e==null?void 0:e.emailAddress)==null?void 0:u.label)&&t.values.contactMethod.includes("email")&&a.jsx(i,{children:a.jsx(c,{isHidden:!t.values.contactMethod.includes("email"),column:
150,children:a.jsx(j,{name:"emailAddress",component:"input",label:e.emailAddress.label,type:"text",error:t.errors.emailAddress,touched:t.touched.emailAddress,value:t.values.emailAddress})})}),((N=e==null?void 0:e.telephone)==null?void 0:N.label)&&t.values.contactMethod.includes("telephone")&&a.jsxs(a.Fragment,{children:[a.jsx(i,{children:a.jsx(c,{isHidden:!t.values.contactMethod.includes("telephone"),column:50,children:a.jsx(j,{name:"telephone",component:"input",label:e.telephone.label,type:"text",error:t.errors.telephone,touched:t.touched.telephone,value:t.values.telephone})})}),a.jsx(i,{children:a.jsx(c,{isHidden:!t.values.contactMethod.includes("telephone"),children:a.jsx(G,{name:"callbackTime",render:h=>{var b,x;return a.jsxs($,{error:t.errors.callbackTime,touched:t.touched.callbackTime,value:t.values.callbackTime,label:e.callbackTime.label,id:"callbackTime",children:[((b=e==null?void 0:e.callbackTime)==null?void 0:b.morningOptionLabel)&&a.jsx(M,{values:t.values.callbackTime,arrayHelpers:h,group:"callbackTime",inputValue:"morning",label:e.callbackTime.morningOptionLabel,isGrey:!0}),((x=e==null?void 0:e.callbackTime)==null?void 0:x.afternoonOptionLabel)&&a.jsx(M,{values:t.values.callbackTime,arrayHelpers:h,group:"callbackTime",inputValue:"afternoon",label:e.callbackTime.afternoonOptionLabel,isGrey:!0})]})}})})})]})]})]}),((q=e==null?void 0:e.enquiry)==null?void 0:q.label)&&a.jsx(i,{children:a.jsx(c,{column:100,children:a.jsx(j,{name:"enquiry",component:"textarea",rows:"6",label:(S=e==null?void 0:e.enquiry)==null?void 0:S.label,type:"text",error:t.errors.enquiry,touched:t.touched.enquiry,value:t.values.enquiry,placeholder:(C=e==null?void 0:e.enquiry)==null?void 0:C.placeholder})})}),y&&a.jsx(i,{children:a.jsx(c,{children:a.jsx(ve,{setFieldValue:t.setFieldValue,siteKey:(A=e==null?void 0:e.recaptcha)==null?void 0:A.key})})}),a.jsx(i,{children:a.jsx(c,{children:a.jsx(je,{text:l==null?void 0:l.privacyPolicy})})})]})}})})})};export{Oe as default}; 2//# sourceMappingURL=StaffEnquiryForm-Di_ARGHu.js.map
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.