1import{w as F,g as H,r as n,j as e,d as y}from"./jsx-runtime-Cm37R4uK.js";import{S as U,P as D,b as W,L as q,a as B}from"./site-chrome-ClpKbpQX.js";import{i as G,n as Y,a as V,b as z}from"./lead-funnel-form-BchUY-VT.js";import{p as Q}from"./page-meta-CQtHku-r.js";import{C as X}from"./company-D_V2vXqt.js";import"./media-utils-DVU8QNJ8.js";const j=3e3,T=150,P=[{value:"general-question",label:"General Customer Service"},{value:"existing-application",label:"Existing Application Question"},{value:"compliment",label:"Compliment or Feedback"},{value:"complaint",label:"Complaint or Concern"},{value:"technical-issue",label:"Website or Technical Issue"},{value:"accessibility",label:"Accessibility Assistance"},{value:"licensing-compliance",label:"Licensing or Compliance Question"},{value:"privacy",label:"Privacy Request"},{value:"do-not-sell-share",label:"Do Not Sell or Share My Personal Information"},{value:"media-business",label:"Media or Business Inquiry"},{value:"other",label:"Other"}],J=[{value:"current-customer",label:"Yes, I have an active application"},{value:"former-customer",label:"Yes, I previously worked with Royal United"},{value:"prospective-customer",label:"No"},{value:"not-sure",label:"I'm not sure"}],$=[{value:"Email",label:"Email"},{value:"Phone",label:"Phone"}];function K(t){if(!t.firstName.trim()||!t.lastName.trim())return{ok:!1,error:"Please enter your first and last name."};if(!G(t.email))return{ok:!1,error:"Please enter a valid email address."};const l=Y(t.phone);if(l&&l.length!==10)return{ok:!1,error:"Please enter a valid 10-digit phone number."};const a=V(t.stateCode);if(a&&!z(a))return{ok:!1,error:"Please enter a valid 2-letter state code."};if(!P.some(N=>N.value===t.category))return{ok:!1,error:"Please choose what your message is about."};const c=t.subject.trim();if(!c)return{ok:!1,error:"Please enter a subject."};if(c.length>T)return{ok:!1,error:`Subject must be ${T} characters or fewer.`};const u=t.message.trim();return u?u.length>j?{ok:!1,error:`Message must be ${j} characters or fewer.`}:{ok:!0,payload:{firstName:t.firstName.trim(),lastName:t.lastName.trim(),email:t.email.trim(),phone:l,preferredContactMethod:t.preferredContactMethod.trim(),stateCode:a,relationshipStatus:t.relationshipStatus.trim(),category:t.category,subject:c,message:u}}:{ok:!1,error:"Please enter a message."}}const Z=X.address.full;function ne(t){return Q({title:"Contact Us | Royal United Mortgage",description:"Contact Royal United Mortgage for customer service, application questions, feedback, accessibility assistance, and general support.",path:"/contact-us"})}const S={firstName:"",lastName:"",email:"",phone:"",preferredContactMethod:"Email",stateCode:"",relationshipStatus:"",category:"",subject:"",message:""},ee=`First Name: 2Middle Name (Initial): 3Last Name: 4Email: 5State of Residence: 6Property State: 7Request Details: 8`;function _(t){return t==="do-not-sell-share"?ee:null}function ae(t){return!!t&&P.some(l=>l.value===t)}const ce=F(function(){const[l]=H(),[a,c]=n.useState(()=>
8{const s=l.get("category"),o=ae(s)?s:"";return{...S,category:o,message:_(o)??S.message}}),[u,N]=n.useState(""),[x,f]=n.useState("idle"),[E,v]=n.useState(""),[k,I]=n.useState(null),[r,p]=n.useState(null),g=n.useId(),C=n.useRef(null),R=n.useRef(null),M=n.useRef(null),h=s=>o=>c(i=>({...i,[s]:o.target.value})),A=s=>{const o=s.target.value;c(i=>{const b=_(o);return{...i,category:o,message:b&&!i.message.trim()?b:i.message}})};n.useEffect(()=>{x==="success"?R.current?.focus():x==="error"&&M.current?.focus()},[x]);const O=()=>{C.current?.focus(),C.current?.scrollIntoView({behavior:"smooth",block:"start"})},L=async s=>{s.preventDefault(),p(null);const o=K(a);if(!o.ok){f("error"),v(o.error),a.firstName.trim()?a.lastName.trim()?a.email.trim()?a.category?a.subject.trim()?a.message.trim()||p("message"):p("subject"):p("category"):p("email"):p("lastName"):p("firstName");return}f("submitting"),v("Sending your message...");try{const i=await fetch("/api/contact-us",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...o.payload,sourcePage:typeof window<"u"?window.location.pathname:"/contact-us",hp_company:u})}),b=await i.json().catch(()=>null);if(!i.ok)throw new Error(b?.error||"We couldn't send your message. Please try again.");f("success"),I(b?.id??null),v(b?.message||"Thank you. We received your message and will route it to the appropriate team."),c(S)}catch(i){f("error"),v(i instanceof Error?i.message:"We couldn't send your message. Please try again.")}};return e.jsxs("div",{className:"min-h-screen text-[color:var(--color-rum-ink)]",children:[e.jsx(U,{}),e.jsxs("main",{id:"main-content",children:[e.jsx("section",{className:"bg-[linear-gradient(to_bottom_left,#1a3a7a,#1e3a6e_40%,#152d5a)] px-4 pb-8 pt-8 sm:px-6 sm:pb-10 sm:pt-10 lg:px-8",children:e.jsxs("div",{className:"mx-auto max-w-4xl text-center",children:[e.jsx("p",{className:"inline-flex items-center rounded-full border border-white/20 bg-white/10 px-3 py-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-[color:var(--color-rum-teal)]",children:"Customer Support"}),e.jsx("h1",{className:"mt-4 text-balance text-3xl font-black leading-tight text-white sm:text-4xl lg:text-5xl font-heading",children:"How can we help?"}),e.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-base leading-7 text-white/80 sm:text-lg",children:"Whether you have a question, need help reaching the right team, or want to share feedback, we're here to point you in the right direction."})]})}),e.jsx("div",{className:"px-4 py-10 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"mx-auto max-w-4xl space-y-10",children:[e.jsxs("section",{"aria-labelledby":"contact-info-heading",className:"rounded-3xl border border-[color:var(--color-rum-border)] bg-[color:var(--color-rum-surface)] p-6 sm:p-8",children:[e.jsx("h2",{id:"contact-info-heading",className:"text-xl font-black text-[color:var(--color-rum-navy)] sm:text-2xl font-heading",children:"Reach us directly"}),e.jsxs("div",{className:"mt-5 grid gap-6 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.14em] text-slate-500",children:"Phone"}),e.jsx("a",{href:W,className:"mt-1 block text-lg font-semibold text-[color:var(--color-rum-navy)] hover:text-[color:var(--color-rum-teal)]",children:D})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.14em] text-slate-500",children:"Corporate office"}),e.jsx("address",{className:"mt-1 text-base not-italic leading-6 text-[color:var(--color-rum-ink)]",children:Z})]})]})]}),e.jsxs("section",{"aria-labelledby":"paths-heading",children:[e.jsx("h2",{id:"paths-heading",className:"text-xl font-black text-[color:var(--color-rum-navy)] sm:text-2xl font-heading",children:"Find the right path"}),e.jsxs("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:[e.jsx(w,{title:"Existing application",description:"Already working with a loan advisor? The quickest path is usually your assigned loan advisor or loan team directly."}),e.jsx(w,{title:"New mortgage options",description:"Interested in a purchase, refinance, cash-out refinance, or home equity option?",cta:"Explore My Options",href:q}),e.jsx(w,{title:"General customer service",description:"Questions, feedback, concerns, complaints, or accessibility help â send us a message below.",cta:"Send a Message",onClick:O})]})]}),e.jsxs("section",{"aria-labelledby":"form-heading",className:"rounded-3xl border border-[color:var(--color-rum-border)] bg-white p-6 shadow-sm sm:p-8",children:[e.jsx("h2",{ref:C,tabIndex:-1,id:"form-heading",className:"text-xl font-black text-[color:var(--color-rum-navy)] outline-none sm:text-2xl font-heading",children:"Send us a message"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-slate-600",children:"Tell us what you need help with, and we'll route your message to the appropriate team."}),e.jsx("div",{"aria-live":"polite","aria-atomic":"true",children:x==="success"?e.jsxs("div",{className:"mt-6 rounded-3xl border border-emerald-200 bg-emerald-50 p-6 sm:p-7",children:[e.jsx("h3",{ref:R,tabIndex:-1,
8className:"text-lg font-black text-emerald-800 outline-none",children:"Message received"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-emerald-900",children:E}),k?e.jsxs("p",{className:"mt-3 text-sm text-emerald-900",children:["Your reference number is: ",e.jsx("span",{className:"font-mono font-semibold",children:k}),e.jsx("br",{}),"Please keep this number in case you need to follow up."]}):null,e.jsx(y,{to:"/",className:"mt-5 inline-flex items-center rounded-full bg-[color:var(--color-rum-teal)] px-5 py-2.5 text-sm font-semibold text-white",children:"Back to homepage"})]}):e.jsxs("form",{onSubmit:L,className:"mt-6 space-y-4",noValidate:!0,children:[e.jsxs("div",{className:"hidden","aria-hidden":"true",children:[e.jsx("label",{htmlFor:"hp_company",children:"Company Website"}),e.jsx("input",{id:"hp_company",name:"hp_company",type:"text",tabIndex:-1,autoComplete:"off",value:u,onChange:s=>N(s.target.value)})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(m,{label:"First name",children:e.jsx("input",{autoComplete:"given-name",value:a.firstName,onChange:h("firstName"),required:!0,"aria-required":"true","aria-invalid":r==="firstName"?"true":void 0,"aria-describedby":r==="firstName"?g:void 0,className:d})}),e.jsx(m,{label:"Last name",children:e.jsx("input",{autoComplete:"family-name",value:a.lastName,onChange:h("lastName"),required:!0,"aria-required":"true","aria-invalid":r==="lastName"?"true":void 0,"aria-describedby":r==="lastName"?g:void 0,className:d})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(m,{label:"Email",children:e.jsx("input",{type:"email",autoComplete:"email",value:a.email,onChange:h("email"),required:!0,"aria-required":"true","aria-invalid":r==="email"?"true":void 0,"aria-describedby":r==="email"?g:void 0,className:d})}),e.jsx(m,{label:"Phone (optional)",children:e.jsx("input",{type:"tel",autoComplete:"tel",value:a.phone,onChange:h("phone"),className:d})})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(m,{label:"Preferred contact method",children:e.jsx("select",{value:a.preferredContactMethod,onChange:h("preferredContactMethod"),className:d,children:$.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})}),e.jsx(m,{label:"State (optional)",children:e.jsx("input",{autoComplete:"address-level1",value:a.stateCode,onChange:h("stateCode"),maxLength:2,placeholder:"e.g. OH",className:d})})]}),e.jsx(m,{label:"Are you currently working with Royal United Mortgage?",children:e.jsxs("select",{value:a.relationshipStatus,onChange:h("relationshipStatus"),className:d,children:[e.jsx("option",{value:"",children:"Select an option"}),J.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))]})}),e.jsx(m,{label:"What is your message about?",children:e.jsxs("select",{value:a.category,onChange:A,required:!0,"aria-required":"true","aria-invalid":r==="category"?"true":void 0,"aria-describedby":r==="category"?g:void 0,className:d,children:[e.jsx("option",{value:"",children:"Select a category"}),P.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))]})}),a.category==="existing-application"?e.jsx("p",{className:"rounded-2xl border border-[color:var(--color-rum-border)] bg-[color:var(--color-rum-surface)] px-4 py-3 text-sm leading-6 text-slate-600",children:"For the fastest help with an existing application, your assigned loan advisor or loan team is usually the quickest path. We'll still route this message for you."}):null,a.category==="general-question"||a.category==="other"?e.jsxs("p",{className:"rounded-2xl border border-[color:var(--color-rum-border)] bg-[color:var(--color-rum-surface)] px-4 py-3 text-sm leading-6 text-slate-600",children:["Interested in a new purchase, refinance, or home equity loan? Use"," ",e.jsx(y,{to:q,className:"font-semibold text-[color:var(--color-rum-teal)]",children:"Explore My Options"})," ","instead for the fastest response."]}):null,e.jsx(m,{label:"Subject",children:e.jsx("input",{value:a.subject,onChange:h("subject"),required:!0,"aria-required":"true","aria-invalid":r==="subject"?"true":void 0,"aria-describedby":r==="subject"?g:void 0,className:d})}),e.jsx(m,{label:"Message",children:e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:a.message,onChange:h("message"),required:!0,"aria-required":"true","aria-invalid":r==="message"?"true":void 0,"aria-describedby":r==="message"?g:void 0,maxLength:j,rows:5,className:d}),e.jsxs("p",{className:"mt-1 text-right text-xs text-slate-400",children:[a.message.length," / ",j]})]})}),e.jsx("div",{className:"flex gap-3 rounded-2xl border border-amber-200 bg-amber-50 px-5 py-4",children:e.jsx("p",{className:"text-sm leading-6 text-amber-900",children:"Please do not include Social Security numbers, bank account information, full loan numbers, passwords, or other sensitive financial information in this form."})}),e.jsxs("p",{className:"text-xs leading-5 text-slate-500",children:["I understand that Royal United Mortgage may contact me regarding this request using the contact information I provided. See our"," ",e.jsx(y,{to:"/privacy-policy",className:"font-semibold text-[color:var(--color-rum-teal)]",children:"Privacy Policy"}),"."]}),e.jsx("button",{type:"submit",disabled:x==="submitting",className:"inline-flex w-full items-center justify-center rounded-full bg-[color:var(--color-rum-teal)] px-5 py-3.5 text-base font-semibold text-white disabled:opacity-60",children:x==="submitting"?"Sending...":"Send message"}),x==="error"?e.jsx("div",{ref:M,tabIndex:-1,id:g,role:"alert","aria-live":"polite","aria-atomic":"true",className:"rounded-2xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-700 outline-none",children:E}):null]})})]})]})})]}),e.jsx(B,{fullBleed:!0})]})}),d="w-full rounded-[1.35rem] border border-slate-200 bg-slate-50 px-4 py-2.5 text-base text-slate-900 outline-none focus:border-rum-teal focus:ring-2 focus:ring-rum-teal/20";function m({label:t,children:l}){return e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"mb-2 block text-sm font-semibold text-slate-700",children:t}),l]})}function w({title:t,description:l,cta:a,href:c,onClick:u}){return e.jsxs("div",{className:"flex flex-col rounded-2xl border border-[color:var(--color-rum-border)] bg-white p-5 shadow-sm",children:[e.jsx("h3",{className:"font-semibold text-[color:var(--color-rum-navy)]",children:t}),e.jsx("p",{className:"mt-2 flex-1 text-sm leading-6 text-slate-600",children:l}),a&&c?e.jsx(y,{to:c,className:"mt-4 inline-flex items-center justify-center rounded-full bg-[color:var(--color-rum-teal)] px-4 py-2 text-sm font-semibold text-white",children:a}):a&&u?e.jsx("button",{type:"button",onClick:u,className:"mt-4 inline-flex items-center justify-center rounded-full border border-[color:var(--color-rum-teal)] px-4 py-2 text-sm font-semibold text-[color:var(--color-rum-teal)]",children:a}):null]})}export{ce as default,ne as meta};
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.