',!e.getElementById("vf-anti-zoom-style")){const st=e.createElement("style");st.id="vf-anti-zoom-style",st.textContent="@media(max-width:1024px){.vf-anti-zoom input,.vf-anti-zoom textarea,.vf-anti-zoom select{font-size:16px!important;-webkit-text-size-adjust:100%}}",e.head.appendChild(st)}i.appendChild(r),L(i,r),a.hideFor(r);const s=r.querySelector(".vf-loc-input"),d=r.querySelector(".vf-loc-drop"),c=r.querySelector(".vf-loc-helper"),p=r.querySelector(".vf-loc-chip"),f=r.querySelector(".vf-loc-chip-val"),v=r.querySelector(".vf-loc-loading"),h=r.querySelector(".vf-loc-error"),u=r.querySelector(".vf-loc-btn"),m=r.querySelector(".vf-loc-inputwrap"),g=r.querySelector(".vf-loc-main"),x=r.querySelector(".vf-loc-done"),b=r.querySelector(".vf-loc-done-val"),y=r.querySelector(".vf-loc-fallback a"),D=r.querySelector(".vf-loc-change"),F=r.querySelector(".vf-form-card"),GEO=r.querySelector(".vf-loc-geo");let w=null,_=null,z=null,E=null;function T(){v.classList.remove("show")}function j(e){h.textContent=e,h.style.display="block",T()}function q(){h.style.display="none"}function A(e){const t=["sublocality_level_1","locality","administrative_area_level_3"];for(const n of t){const t=e.find(e=>e.types.includes(n));if(t)return t.long_name}return""}function G(){requestAnimationFrame(()=>{requestAnimationFrame(()=>{try{const t=e=>e.parentElement||e.getRootNode&&e.getRootNode().host||null,n=e=>{try{const t=getComputedStyle(e);return/(auto|scroll)/.test(t.overflowY)&&e.scrollHeight>e.clientHeight+4}catch(e){return!1}};let o=t(u);for(let a=0;a<30&&o&&o!==e.documentElement&&o!==e.body;a++){try{!n(o)&&o.scrollTop&&(o.scrollTop=0)}catch(e){}o=t(o)}let a=null,i=u;for(let e=0;e<30&&i;e++){if(i.classList&&i.classList.contains("vfrc-chat--dialog")){a=i;break}i=t(i)}if(!a||!n(a)){let o=t(u);for(let i=0;i<30&&o&&o!==e.documentElement&&o!==e.body;i++){if(n(o)){a=o;break}o=t(o)}}if(!a||!n(a))return;const r=a.getBoundingClientRect(),s=u.getBoundingClientRect().bottom-r.bottom+24;s>0&&a.scrollTo({top:a.scrollTop+s,behavior:"smooth"})}catch(e){}})})}function H(t){z&&(v.querySelector("span").textContent="Getting location details...",v.classList.add("show"),d.classList.remove("show"),s.classList.remove("open"),z.getDetails({placeId:t.place_id,fields:["address_components","formatted_address","geometry","name"],sessionToken:E},(t,i)=>{if(T(),i===google.maps.places.PlacesServiceStatus.OK&&t){const i={formattedAddress:t.formatted_address,suburb:A(t.address_components||[])||t.name||"",lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};w=i,s.value=t.formatted_address,f.textContent=i.formattedAddress,p.classList.add("show"),m.style.display="none",GEO.style.display="none",c.classList.remove("show"),u.disabled=!1,q(),E=new google.maps.places.AutocompleteSessionToken,G()}else j("Could not get location details. Please try another suburb.")}))}function B(t){d.innerHTML="";const V=(t||[]).filter(p2=>(p2.types||[]).some(q2=>["sublocality","sublocality_level_1","locality","neighborhood"].includes(q2)));if(0===V.length)return d.innerHTML='
No suburbs found. Check the spelling, try Use my current location, or tap Enter it another way below.
',d.classList.add("show"),void s.classList.add("open");V.slice(0,2).forEach(t=>{const n=e.createElement("div");n.className="vf-loc-item",n.innerHTML='',n.querySelector(".vf-loc-item-main").textContent=t.structured_formatting.main_text,n.querySelector(".vf-loc-item-sec").textContent=t.structured_formatting.secondary_text,n.addEventListener("click",()=>H(t)),n.addEventListener("touchstart",()=>{n.style.background="#dbeafe"},{passive:!0}),n.addEventListener("touchend",()=>{n.style.background=""},{passive:!0}),d.appendChild(n)}),d.classList.add("show"),s.classList.add("open")}return D.addEventListener("click",()=>{w=null,p.classList.remove("show"),m.style.display="",GEO.style.display="",u.disabled=!0,q(),s.focus()}),GEO.addEventListener("click",()=>{if(q(),!navigator.geolocation)return void j("Location is not supported on this device \u2014 please type your suburb instead.");if(!(window.google&&google.maps&&google.maps.Geocoder))return void j("Location services are still loading \u2014 please try again in a moment.");v.querySelector("span").textContent="Getting your location...",v.classList.add("show"),d.classList.remove("show"),s.classList.remove("open"),navigator.geolocation.getCurrentPosition(pos=>{try{(new google.maps.Geocoder).geocode({location:{lat:pos.coords.latitude,lng:pos.coords.longitude}},(res,st2)=>{if(T(),"OK"===st2&&res&&res.length){const g2=res.find(r2=>(r2.types||[]).some(t2=>["sublocality_level_1","sublocality","locality","neighborhood"].includes(t2)))||res[0],sb=A(g2.address_components||[]);if(!sb)return void j("We couldn't pinpoint your suburb \u2014 please type it instead.");w={formattedAddress:g2.formatted_address,suburb:sb,lat:pos.coords.latitude,lng:pos.coords.longitude},s.value=g2.formatted_address,f.textContent=w.formattedAddress,p.classList.add("show"),m.style.display="none",GEO.style.display="none",c.classList.remove("show"),u.disabled=!1,q(),G()}else j("We couldn't pinpoint your suburb \u2014 please type it instead.")})}catch(e2){T(),j("We couldn't pinpoint your suburb \u2014 please type it instead.")}},er=>{T(),j(er&&1===er.code?"Location permission was denied \u2014 please type your suburb instead.":"We couldn't get your location \u2014 please type your suburb instead.")},{enableHighAccuracy:!0,timeout:1e4,maximumAge:6e4})}),y.addEventListener("click",e=>{e.preventDefault(),t.interact({type:"captured",payload:{locationFallback:!0}}),n.blurActive(),o.show(),n.disable()}),u.onclick=()=>{w?(q(),S("formattedAddress",w.formattedAddress),S("suburb",w.suburb),S("googleLat",w.lat.toString()),S("googleLong",w.lng.toString()),b.textContent=w.formattedAddress,g.style.opacity="0",setTimeout(()=>{g.style.display="none",x.classList.add("show"),F.style.padding="0",F.style.border="none",F.style.background="transparent"},250),n.blurActive(),o.show(),n.disable(),t.interact({type:"captured",payload:{formattedAddress:w.formattedAddress,suburb:w.suburb,latitude:w.lat,longitude:w.lng,locationConfirmed:!0}})):j("Please select your suburb before continuing.")},async function(){try{await new Promise((t,n)=>{if(window.google&&window.google.maps)return void t();const o=e.createElement("script");o.src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC51PJx9faiS3ptAxYuMfkYKKtTU00Tz-Q&libraries=places",o.onload=()=>t(),o.onerror=()=>n(new Error("Failed to load Google Maps")),e.head.appendChild(o)}),_=new google.maps.places.AutocompleteService;const t=e.createElement("div");t.style.display="none",e.body.appendChild(t),z=new google.maps.places.PlacesService(t),E=new google.maps.places.AutocompleteSessionToken,function(){let t;s.addEventListener("input",()=>{const e=s.value.trim();return clearTimeout(t),0===e.length?(c.classList.remove("show"),d.classList.remove("show"),void s.classList.remove("open")):(c.textContent="Select your suburb from the suggestions below",c.classList.add("show"),void(t=setTimeout(()=>{var t;e.length>=1&&(t=e,_&&_.getPlacePredictions({input:t,componentRestrictions:{country:"za"},types:["(regions)"],sessionToken:E},(e,t)=>{t===google.maps.places.PlacesServiceStatus.OK&&e?B(e):t===google.maps.places.PlacesServiceStatus.ZERO_RESULTS?(d.innerHTML='
No suburbs found. Check the spelling, try Use my current location, or tap Enter it another way below.
',d.classList.add("show"),s.classList.add("open")):(d.classList.remove("show"),s.classList.remove("open"))}))},300)))}),s.addEventListener("keydown",e=>{" "!==e.key&&32!==e.keyCode||e.stopPropagation()}),e.addEventListener("click",e=>{m.contains(e.target)||(d.classList.remove("show"),s.classList.remove("open"))})}()}catch(e){j("Failed to load location services. Please refresh and try again.")}}(),()=>{o.show(),n.disable()}}},z={name:"calendar-picker",type:"response",match:({trace:e})=>"calendar"===e?.type||"calendar-picker"===e?.payload?.name,render:({element:i})=>{o.hide(),n.enable();const r=e.createElement("div");if(r.className="vf-wide-card",r.innerHTML='
Takes under a minute: sign in with your email. Then we'll just need your name and number too.
Your booking has moved to the secure portal \u2014 please complete it there.
`,r.appendChild(v),L(r,v),a.hideFor(v);const h=v.querySelector(".vf-ho2-btn"),u=v.querySelector(".vf-ho2-locked"),hcb=v.querySelector(".vf-ho2-chk"),hbx=v.querySelector(".vf-ho2-box"),hts=v.querySelector(".vf-ho2-toast"),hlk=v.querySelector(".vf-ho2-legal a");let htn=null;hlk&&hlk.addEventListener("click",e2=>e2.stopPropagation());const hsync=()=>{h.classList.toggle("vf-ho2-off",!hcb.checked),h.setAttribute("aria-disabled",hcb.checked?"false":"true"),hcb.checked&&(hts.classList.remove("show"),hbx.classList.remove("nudge"),clearTimeout(htn))};hcb.addEventListener("change",hsync),hsync();h.addEventListener("click",e2=>{if(!hcb.checked){e2.preventDefault(),hts.classList.add("show"),hbx.classList.remove("nudge");void hbx.offsetWidth;hbx.classList.add("nudge"),clearTimeout(htn),htn=setTimeout(()=>{hts.classList.remove("show"),hbx.classList.remove("nudge")},3200);return}S("termsAccepted","true");try{"function"==typeof gtag&>ag("event","handover_click",{event_category:"funnel",event_label:"User clicked through to booking portal",user_id:l||"unknown",transcript_id:p||"unknown"})}catch(e){}(()=>{try{o.hide(),n.disable(),n.blurActive(),u.classList.add("show");let e=0;const t=setInterval(()=>{o.hide(),e++,e>20&&clearInterval(t)},500)}catch(e){}})()}),o.hide(),requestAnimationFrame(()=>{try{o.hide()}catch(e){}}),setTimeout(()=>{try{o.hide()}catch(e){}},50);const w=setInterval(()=>{try{o.hide()}catch(e){}},500);return()=>{try{clearInterval(w)}catch(e){}o.hide(),n.disable()}}};function j({name:t,step:n,label:o}){return{name:t,type:"response",match:({trace:e})=>e?.type===t||e?.payload?.name===t,render:({element:i})=>{const T=3,p=['','',''],u=[2.2,2.2,2.5],d=k=>{const c2=k1&&k`},h=k=>k`:'',g=1===n?"vf-ps-first":n===T?"vf-ps-last":"vf-ps-mid",y2=1===n||n===T?"":"left:50%;",x=.1+.5*(n-2)+.75,m=e.createElement("div");m.className="vf-ps-wrap vf-wide-card",m.innerHTML=`
${d(1)}${h(1)}${d(2)}${h(2)}${d(3)}
${o}Step ${n} of ${T}
`,i.appendChild(m),L(i,m),a.hideFor(m)}}}const q=j({name:"ext_progress_step1",step:1,label:"Describe your problem"}),A=j({name:"ext_progress_step2",step:2,label:"Where and when you need help"}),PC={name:"ext_page_context",type:"response",match:({trace:e})=>"ext_page_context"===e?.type||"ext_page_context"===e?.payload?.name,render:({element:o})=>{let a="";try{const k=window.kanduaPage;k&&"string"==typeof k.context&&(a=k.context.trim().toLowerCase())}catch(e2){}const m2={plumbing:"plumber",plumbers:"plumber",electrical:"electrician",electricians:"electrician",handymen:"handyman",painting:"painter",painters:"painter",carpentry:"carpenter",carpenters:"carpenter"};m2[a]&&(a=m2[a]);setTimeout(()=>{try{t.interact({type:"captured",payload:{pageContext:a,pagePath:location.pathname}})}catch(e2){}},0);return s(o),()=>{}}};t=window.voiceflow.chat,t.load({verify:{projectID:"6a1d7b09a2bdb2f81d8077cd"},url:"https://general-runtime.sanlamstudios.voiceflow.com",versionID:"production",assistant:{persistence:"memory",extensions:[y,w,q,A,_,z,E,M,PC,...TRK]}}).then(()=>{e.querySelectorAll(".launch_jess").forEach(e=>e.addEventListener("click",()=>t.open()));try{const k=window.kanduaPage;if(k&&!0===k.autoOpen&&!sessionStorage.getItem("kandua_auto_opened")){const d2="number"==typeof k.autoOpenDelay?k.autoOpenDelay:4e3;setTimeout(()=>{try{sessionStorage.setItem("kandua_auto_opened","1")}catch(e2){}try{t.open()}catch(e2){}},d2)}}catch(e2){}})},e.body.appendChild(o)}()}(document);