(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1670],{12895:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/residential/en/schedule-service",function(){return t(72743)}])},83907:function(e,a,t){"use strict";var s=t(85893),r=t(3798),n=t(67294);a.Z=e=>{let{setZip:a,customFunction:t}=e,[l,i]=(0,n.useState)(""),[o,d]=(0,n.useState)(!1);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("form",{className:"mb-2 flex flex-nowrap",onSubmit:e=>{e.preventDefault(),""!==l?(d(!1),localStorage&&localStorage.setItem&&localStorage.setItem("zipcode",l),a(l),t&&t()):d(!0)},children:[(0,s.jsx)("input",{onChange:function(e){i(e.target.value.trim())},className:"h-[56px] w-full rounded-l border-2 border-gray-200 p-4",placeholder:"Enter Postal/Zip Code"}),(0,s.jsx)("button",{type:"submit",className:"h-full rounded-r bg-trane-red p-5","data-position":"body","data-location":"filter","data-action":"search","data-text-grouping":"cta","data-text":"search","data-type":"button",title:"Search","aria-label":"Search",children:(0,s.jsx)(r.Z,{svgClass:"stroke-white",pathClass:"stroke-white"})})]}),o&&(0,s.jsx)("small",{className:"absolute pl-5 text-trane-red",children:"Zip code or city is required"})]})}},14901:function(e,a,t){"use strict";var s=t(85893),r=t(83907),n=t(67294),l=t(52738);a.Z=e=>{let[a,t]=(0,n.useState)(!1),{setZip:i}=e;function o(){t(!a)}return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{children:(0,s.jsx)("button",{onClick:o,className:"font-bold text-trane-red hover:underline","data-testid":"ChangeLocation--button",children:"Change Location"})}),(0,s.jsx)(l.Z,{show:a,onClose:o,modalHeight:"h-max",customDimensions:"max-h-max",children:(0,s.jsxs)("div",{className:"w-[80vw] px-2 md:w-auto md:px-16",children:[(0,s.jsx)("h2",{className:"mb-8 text-22 font-bold md:text-32",children:"Update your location"}),(0,s.jsxs)("div",{className:"relative mb-20 w-full",children:[(0,s.jsx)("p",{className:"font-bold",children:"Postal Code / City"}),(0,s.jsx)(r.Z,{setZip:i,customFunction:o})]})]})})]})}},72743:function(e,a,t){"use strict";t.r(a),t.d(a,{__N_SSP:function(){return z},default:function(){return L}});var s=t(85893),r=t(81451),n=t(67294),l=t(43078),i=t(93967),o=t.n(i),d=t(30654),c=t(72095),u=t(1445),m=t(97631),h=t(83884),x=t(28314),p=t(33249),b=t(49795),f=t(52061),j=t(65421),g=t(25261),v=t(44582),y=t(8933),C=t(36140),S=t(53472),N=t(32752),Z=t(55534),w=t(29e3),q=t(22808),E=t(14901),_=t(33086),P=t(83907),k=e=>{var a;let{setZip:t,zip:r,schemaBlock:i}=e,{isNavDark:k}=(0,n.useContext)(d.z),[z,L]=(0,n.useState)(!1),[,T]=(0,n.useState)(!1),[I,H]=(0,n.useState)([]),[M,D]=(0,n.useState)({firstName:"",lastName:"",email:"",phone:"",addressLine1:"",city:"",state:"",zip:"",reason:""}),{handleChange:R,setInputRef:A,GoogleMapsScript:F}=(0,u.Z)({externalSetState:D}),O=(0,n.useMemo)(()=>(null==I?void 0:I.length)?I[0]:null,[I]),U="trane-dealer-contact";(0,n.useEffect)(()=>{(async()=>{if(r){let e=await (0,c.d)(r);e.dealers&&H(e.dealers)}})()},[r]);let Q=e=>{let{name:a,value:t}=e.target,s={...M,[a]:t},r=!0;for(let e in s)""===s[e]&&(r=!1);L(r),D(s)},B=n.useRef(),V=(0,n.useRef)(!1),X=e=>{V.current||((0,h.p)({event:"dealer_form_start",formId:U,fieldStarted:e}),V.current=!0)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(F,{}),(0,s.jsx)(C.Z,{seo:e.seo,title:null!==(a=e.title)&&void 0!==a?a:"Schedule Service"}),(0,s.jsx)(_.Z,{schemaData:null==i?void 0:i.schemaBlock}),(0,s.jsx)(S.Z,{}),!k&&(0,s.jsx)(w.Z,{contentClass:"pl-4",children:(0,s.jsx)(q.Z,{crumbs:[{href:"/residential/",label:"Home"},{href:"/residential/en/schedule-service/",label:"Schedule Service"}]})}),(0,s.jsxs)("main",{className:"relative",children:[k&&(0,s.jsx)("div",{className:"absolute -top-[72px] -z-1 block h-[144px] w-full bg-black"}),(0,s.jsxs)(w.Z,{backgroundClass:"pt-2",children:[k&&(0,s.jsx)(q.Z,{crumbs:[{href:"/residential/",label:"Home"},{href:"/residential/en/schedule-service/",label:"Schedule Service"}]}),(0,s.jsx)("h1",{className:"mt-10 text-28 font-bold sm:text-42 lg:mb-6 lg:mt-16",children:"Contact a dealer"}),I.length?(0,s.jsxs)("div",{className:"block",children:[(0,s.jsx)("p",{className:"mt-0 pb-11",children:"Please provide the following information"}),(0,s.jsxs)("div",{ref:B,className:"grid gap-4 md:grid-cols-12",children:[(0,s.jsxs)(l.l0,{className:"col-span-12 md:col-span-7",id:U,trackFormSubmitted:!0,brand:"Trane",kind:"CONTACT_DEALER",source:"TRANE:SCHEDULE_SERVICE_TEMPLATE",companyId:"".concat(null==O?void 0:O.data.companyID),successNode:(0,s.jsx)(g.Z,{isDealer:!0}),onSubmit:()=>{(0,h.p)({event:"dealer_form_success",formId:U,cardPosition:1,dealerName:(null==O?void 0:O.data.name)||"Unknown Dealer",dataText:"Schedule Service",zipcode:M.zip}),T(!0)},name:"SCHEDULE SERVICE",formContainerRef:B,children:[(0,s.jsxs)("div",{className:"grid gap-6 sm:grid-cols-2",children:[(0,s.jsx)(b.Z,{label:"First name",name:"firstName",id:"firstName","data-testid":"firstName",autoComplete:"given-name",onChange:e=>{Q(e),X("firstName")},errorMessages:{external:"Please enter your first name",required:"First name is required",none:null,regex:"First name must be at least 2 characters"},required:!0}),(0,s.jsx)(b.Z,{label:"Last name",name:"lastName",autoComplete:"family-name",onChange:e=>{Q(e),X("lastName")},errorMessages:{external:"Please enter your last name",required:"Last name is required",none:null,regex:"Last name must be at least 2 characters"},required:!0}),(0,s.jsx)(x.Z,{label:"Email",name:"email",autoComplete:"email",onChange:e=>{Q(e),X("email")},errorMessages:{external:"Please enter your email",required:"Email is required",none:null,regex:"Email must be valid"},required:!0}),(0,s.jsx)(p.Z,{label:"Phone number",name:"phone",value:M.phone,autoComplete:"tel",onChange:e=>{Q(e),X("phone")},required:!0}),(0,s.jsx)("div",{ref:e=>{let a=null==e?void 0:e.querySelector("input");a&&A(a)},children:(0,s.jsx)(b.Z,{label:"Street address",name:"addressLine1",value:M.addressLine1,onChange:e=>{R(e),Q(e),X("addressLine1")},autoComplete:"street-address",errorMessages:{external:"Please enter your street address",required:"Street address is required",none:null,regex:"Street address must be at least 2 characters"},pattern:/^(\d)+( ([a-zA-Z0-9\/\.-])+)+$/,required:!0})}),(0,s.jsx)(b.Z,{label:"City",name:"city",value:M.city,onChange:e=>{Q(e),X("city")},autoComplete:"address-level2",errorMessages:{external:"Please enter your city",required:"City is required",none:null,regex:"City must be at least 2 characters"},required:!0}),(0,s.jsxs)(f.Z,{label:"State",name:"state",value:M.state,onChange:e=>{Q(e),X("state")},errorMessages:{external:"Please enter your state",required:"State is required",none:null,regex:"State must be at least 2 characters"},required:!0,children:[(0,s.jsx)("option",{value:""}),m.Z.map((e,a)=>(0,s.jsx)("option",{value:e.abbreviation,children:e.name},a))]}),(0,s.jsx)(j.Z,{label:"Zip/Postal Code",name:"zip",value:M.zip,onChange:e=>{Q(e),X("zip")},required:!0}),(0,s.jsxs)(f.Z,{label:"How can we help you",name:"reason",onChange:e=>{Q(e),X("reason")},errorMessages:{external:"Please select how we can help you",required:"How can we help you is required",none:null,regex:"How can we help you must be at least 2 characters"},required:!0,children:[(0,s.jsx)("option",{value:""}),(0,s.jsx)("option",{value:"New System",children:"New System"}),(0,s.jsx)("option",{value:"Repair",children:"Repair"}),(0,s.jsx)("option",{value:"Indoor Air Quality",children:"Indoor Air Quality"}),(0,s.jsx)("option",{value:"Smart Home",children:"Smart Home"}),(0,s.jsx)("option",{value:"Offers",children:"Offers"})]})]}),(0,s.jsx)(l.Q2,{children:(0,s.jsxs)("p",{className:"py-10 text-12",children:["By pressing submit, I consent that my information be shared with Trane, approved affiliates, and third party partners, including connecting me with a local Trane dealer to be contacted about products and services. Our"," ",(0,s.jsx)("a",{className:"hover:text-hover-red",target:"_blank",href:"https://www.tranetechnologies.com/en/index/privacy-policy.html",rel:"noreferrer",children:"Privacy Policy"})," ","governs the use of your information."]})}),(0,s.jsx)(l.Mm,{"data-position":"body","data-location":"form","data-action":"submit","data-text-grouping":"cta","data-text":"submit","data-type":"button",className:o()("mb-24 rounded-md px-7 py-4 font-bold text-white",{"bg-silver-sand":!z},{"bg-trane-red":z}),children:"Submit"})]}),(0,s.jsxs)("aside",{className:"order-first col-span-12 md:order-none md:col-span-4 md:col-start-9 md:block",children:[O&&(0,s.jsx)(y.Z,{dealer:O,compact:!0,cta:"In a rush call us at "}),(0,s.jsxs)("p",{children:["Showing specialists for"," ",(0,s.jsx)("span",{className:"font-bold",children:r}),". Not your zipcode?"]}),(0,s.jsx)(E.Z,{zip:r,setZip:t})]})]})]}):(0,s.jsx)("div",{className:"block",children:(0,s.jsx)(v.Z,{zip:r,zipCodeChanger:(0,s.jsx)(P.Z,{setZip:t})})})]}),(0,s.jsx)(N.Z,{...e})]}),(0,s.jsx)(Z.Z,{disclaimer:e.disclaimer})]})},z=!0;function L(e){return(0,s.jsx)(r.Z,{renderTemplate:(0,s.jsx)(k,{}),...e})}}},function(e){e.O(0,[3697,4725,8756,7149,1451,2861,4935,5184,6057,8933,4365,2888,9774,179],function(){return e(e.s=12895)}),_N_E=e.O()}]);