PageSourceSearch

https://polaronsolar.com/i/_next/static/chunks/6121.1fe82b438115c465.js

js polaronsolar.com collected 2026-10-07 11:21:36 UTC 18,717 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6121],{66648:function(e,t,r){r.d(t,{default:function(){return n.a}});var o=r(55601),n=r.n(o)},16463:function(e,t,r){var o=r(71169);r.o(o,"useParams")&&r.d(t,{useParams:function(){return o.useParams}}),r.o(o,"usePathname")&&r.d(t,{usePathname:function(){return o.usePathname}}),r.o(o,"useRouter")&&r.d(t,{useRouter:function(){return o.useRouter}}),r.o(o,"useSearchParams")&&r.d(t,{useSearchParams:function(){return o.useSearchParams}})},55601:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return i},getImageProps:function(){return s}});let o=r(99920),n=r(80497),a=r(38173),l=o._(r(21241));function s(e){let{props:t}=(0,n.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let i=a.Image},66121:function(e,t,r){r.r(t),r.d(t,{default:function(){return f}});var o=r(57437),n=r(2265),a=r(16463),l=r(13921),s=r(13534),i=r(80957),c=r(11645),d=r(7842),u=r(5054),h=r(91194);let g=["Alberta","British Columbia","Nova Scotia","Ontario","Prince Edward Island","New Brunswick"],x=["Solar Solution","Battery Solution","Solar + Battery Solutions","EV Charging Solution"],p=["Halifax Ideal Home Show","BC Homeshow","Others"];var f=function(e){let{leadSource:t}=e,r=(0,a.useRouter)(),f=(0,a.useSearchParams)(),[m,b]=(0,n.useState)(null),[k,v]=(0,n.use
1State)(!1),[N,w]=(0,n.useState)({}),[S,j]=(0,n.useState)({firstName:"",lastName:"",email:"",phoneNumber:"",province:"",solution:"",message:"",joinMailingList:!1,salesName:"",event:""});(0,n.useEffect)(()=>{let e=f.get("utm_content")||"";j(r=>({...r,utmContent:e,leadSource:t}))},[f,t]);let M=(e,t)=>{j(r=>({...r,[e]:t})),N[e]&&w(t=>{let r={...t};return delete r[e],r})},y=async e=>{var t,o,n;if(e.preventDefault(),k)return;let a={...S,salesName:(S.salesName||"").trim()},l=(0,h.n6)(a,[h.y$,h.jD,h.VP,h.YX]);if(Object.keys(l).length>0){w(l);return}let s={...a,firstName:null===(t=a.firstName)||void 0===t?void 0:t.trim(),lastName:null===(o=a.lastName)||void 0===o?void 0:o.trim(),email:null===(n=a.email)||void 0===n?void 0:n.trim(),phoneNumber:String(a.phoneNumber||"").trim(),message:(a.message||"").trim()};try{v(!0);let e=await fetch("/i/api/submit-survey-residential-contact-with-sales-name",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!e.ok)throw Error("Request failed: ".concat(e.status));b(200);let t=window.location.pathname;r.push("".concat(t,"/thankyou"))}catch(e){console.error("Error:",e),b("error")}finally{v(!1)}};return(0,o.jsx)("form",{onSubmit:y,className:" flex flex-col w-full smLaptop:w-[540px]  rounded-3xl bg-white/20       backdrop-blur-xl ring-1 ring-white/15 shadow-[0_20px_80px_rgba(0,0,0,0.45)] px-4 py-5 tablet:px-6 tablet:py-6 lgLaptop:px-8 lgLaptop:py-8 text-white ",id:"survey",children:(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsxs)("div",{className:"flex flex-wrap gap-6",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-5 w-full",children:[(0,o.jsx)(s.Z,{label:"First Name*",value:S.firstName,onChange:e=>M("firstName",e),error:N.firstName,placeholder:"Adam"}),(0,o.jsx)(s.Z,{label:"Last Name*",value:S.lastName,onChange:e=>M("lastName",e),error:N.lastName,placeholder:"Smith"})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-5 w-full",children:[(0,o.jsx)(c.Z,{label:"Phone Number*",value:S.phoneNumber,onChange:e=>M("phoneNumber",e),error:N.phoneNumber}),(0,o.jsx)(i.Z,{label:"Province*",options:g,placeholder:"Provinces",value:S.province,onChange:e=>M("province",e),error:N.province})]})]}),(0,o.jsxs)("div",{className:"flex flex-col mt-5 tablet:mt-6 gap-5 tablet:gap-6",children:[(0,o.jsx)(s.Z,{label:"Email*",value:S.email,onChange:e=>M("email",e),error:N.email,placeholder:"[email protected]"}),(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-5 w-full",children:[(0,o.jsx)(s.Z,{label:"Sales Name*",value:S.salesName,onChange:e=>M("salesName",e),error:N.salesName,placeholder:"Enter sales name"}),(0,o.jsx)(i.Z,{label:"Event Name: *",options:p,placeholder:"Select event",value:S.event,onChange:e=>M("event",e),error:N.event})]}),(0,o.jsx)(i.Z,{label:"What energy solution are you looking for?*",options:x,placeholder:"Select your solution",value:S.solution,onChange:e=>M("solution",e),error:N.solution}),(0,o.jsx)(d.Z,{label:"Message (Optional)",placeholder:"Write something here...",value:S.message,onChange:e=>M("message",e)}),(0,o.jsx)(u.Z,{checked:S.joinMailingList,onChange:()=>{j(e=>({...e,joinMailingList:!e.joinMailingList}))},text:"I would like to join the Polaron SMS and mailing list to receive newsletters, updates, and event invitations from Polaron."}),null===m&&(k?(0,o.jsx)("div",{className:"flex items-center px-8 py-3",children:(0,o.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-b-2 border-blue-500"})}):(0,o.jsx)(l.sH,{type:"submit",className:"mt-5",children:"Submit"})),"error"===m&&(0,o.jsxs)("div",{className:"mt-4 p-4 bg-red-100 text-red-800 rounded-md",children:["Something went wrong. Please refresh and try again.",(0,o.jsx)("button",{onClick:()=>{window.location.reload()},className:"mt-2 p-2 bg-blue-500 text-white rounded-md",children:"Refresh"})]})]})]})})}},5054:function(e,t,r){var o=r(57437);r(2265);var n=r(13921);let a={glass:{text:"text-darkMode-textTextLowest",border:"border-white/40",bg:"bg-transparent",checkedBg:"checked:bg-blue-500",checkedBorder:"checked:border-blue-500",checkColor:"after:text-white"},grey:{text:"text-lightMode-textTextHigh",border:"border-lightMode-storkStorkLowest",bg:"bg-white",checkedBg:"checked:bg-blue-500",checkedBorder:"checked:border-blue-500",checkColor:"after:text-white"}};t.Z=function(e){let{text:t,checked:r,onChange:l,variant:s="glass",className:i}=e,c=a[s]||a.glass;return(0,o.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer",children:[(0,o.jsx)("input",{type:"checkbox",checked:r,onChange:l,className:"\n          shrink-0 h-5 w-5\n          appearance-none\n          rounded-sm\n          border\n          focus:outline-none focus:ring-0\n          transition\n          relative\n\n          ".concat(c.border,"\n          ").concat(c.bg,"\n          ").concat(c.checkedBg,"\n          ").concat(c.checkedBorder,"\n\n          after:content-['✔']\n          after:absolute after:inset-0\n          after:flex after:items-center after:justify-center\n          ").concat(c.checkColor,"\n          after:text-xs\n          checked:after:opacity-100\n          after:opacity-0\n        ")}),(0,o.jsx)(n.TC,{className:i||c.text,children:t})]})}},13534:function(e,t,r){var o=r(57437);r(2265);var n=r(13921),a=r(66648),l=r(15546);let s={glass:{label:"text-darkMode-textTextHighest",inputBg:"bg-white/20",text:"text-darkMode-textTextHighest",caret:"caret-darkMode-storkStorkHighest",placeholder:"placeholder:text-darkMode-textTextLowest",border:"border-white/20",hover:"hover:border-darkMode-storkStorkHighest",focusRing:"focus:ring-darkMode-storkStorkHighest",focusBorder:"focus:border-darkMode-storkStorkHighest"},grey:{label:"text-lightMode-textTextHigh",inputBg:"bg-white",text:"text-gray-900",caret:"caret-lightMode-storkStorkHighest",placeholder:"placeholder:text-gray-400",border:"border border-lightMode-storkStorkLowest",hover:"hover:border-lightMode-storkStorkMid",focusRing:"focus:ring-2 focus:ring-lightMode-storkStorkHighest",focusBorder:"focus:border-lightMode-storkStorkHighest"}};t.Z=function(e){let{label:t,placeholder:r,value:i,onChange:c,error:d,variant:u="glass",className:h}=e,g=s[u]||s.glass;return(0,o.jsxs)("div",{className:"flex flex-col flex-1 min-w-[150px]",children:[(0,o.jsx)(n.K$,{className:h||g.label,children:t}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)("input",{type:"text",placeholder:r,"aria-label":t,value:i,onChange:e=>c(e.target.value),className:"\n            mt-2 tablet:mt-4 h-[40px] w-full\n            rounded-md\n            pl-4\n            border\n            transition\n\n            ".concat(g.inputBg,"\n            ").concat(g.text,"\n            ").concat(g.caret,"\n            ").concat(g.placeholder,"\n\n            text-[14px]\n            tablet:text-[16
1px]\n            smLaptop:text-[18px]\n            lgLaptop:text-[18px]\n\n            placeholder:font-light\n            placeholder:text-[14px]\n            tablet:placeholder:text-[16px]\n            smLaptop:placeholder:text-[18px]\n            lgLaptop:placeholder:text-[18px]\n\n            ").concat(d?"border-[#EF4444]":"".concat(g.border," ").concat(g.hover),"\n\n            focus:outline-none\n            focus:ring-2\n\n            ").concat(d?"focus:ring-[#EF4444] focus:border-[#EF4444]":"".concat(g.focusRing," ").concat(g.focusBorder),"\n          ")}),d&&(0,o.jsxs)("div",{className:"mt-2 flex items-center gap-1 text-[#EF4444]",children:[(0,o.jsx)(a.default,{src:l.Z,alt:"Error",width:14,height:14,className:"shrink-0"}),(0,o.jsx)(n.TC,{className:"text-xs",children:d})]})]})]})}},11645:function(e,t,r){var o=r(57437);r(2265);var n=r(94027),a=r(13921),l=r(66648),s=r(15546);let i={glass:{label:"text-darkMode-textTextHighest",inputBg:"bg-white/20",text:"text-darkMode-textTextHighest",caret:"caret-darkMode-storkStorkHighest",placeholder:"placeholder:text-darkMode-textTextLowest",border:"border-white/20",hover:"hover:border-darkMode-storkStorkHighest",focusRing:"focus:ring-darkMode-storkStorkHighest",focusBorder:"focus:border-darkMode-storkStorkHighest"},grey:{label:"text-lightMode-textTextHigh",inputBg:"bg-white",text:"text-gray-900",caret:"caret-lightMode-storkStorkHighest",placeholder:"placeholder:text-gray-400",border:"border border-lightMode-storkStorkLowest",hover:"hover:border-lightMode-storkStorkMid",focusRing:"focus:ring-2 focus:ring-lightMode-storkStorkHighest",focusBorder:"focus:border-lightMode-storkStorkHighest"}};t.Z=function(e){let{label:t,value:r,onChange:c,error:d,variant:u="glass",className:h}=e,g=i[u]||i.glass;return(0,o.jsxs)("div",{className:"flex flex-col flex-1 min-w-[150px]",children:[(0,o.jsx)(a.K$,{className:h||g.label,children:t}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(n.oc,{mask:"+{1} 000-000-0000",value:r,onAccept:e=>c(e),placeholder:"+1 XXX-XXX-XXXX",className:"\n            mt-2 tablet:mt-4 h-[40px] w-full\n            rounded-md\n            pl-4\n            border\n            transition\n\n            ".concat(g.inputBg,"\n            ").concat(g.text,"\n            ").concat(g.caret,"\n            ").concat(g.placeholder,"\n\n            text-[14px]\n            tablet:text-[16px]\n            smLaptop:text-[18px]\n            lgLaptop:text-[18px]\n\n            placeholder:font-light\n            placeholder:text-[14px]\n            tablet:placeholder:text-[16px]\n            smLaptop:placeholder:text-[18px]\n            lgLaptop:placeholder:text-[18px]\n\n            ").concat(d?"border-[#EF4444]":"".concat(g.border," ").concat(g.hover),"\n\n            focus:outline-none\n            focus:ring-2\n\n            ").concat(d?"focus:ring-[#EF4444] focus:border-[#EF4444]":"".concat(g.focusRing," ").concat(g.focusBorder),"\n          ")}),d&&(0,o.jsxs)("div",{className:"mt-2 flex items-center gap-1 text-[#EF4444]",children:[(0,o.jsx)(l.default,{src:s.Z,alt:"Error",width:14,height:14,className:"shrink-0"}),(0,o.jsx)(a.TC,{className:"text-xs",children:d})]})]})]})}},80957:function(e,t,r){r.d(t,{Z:function(){return i}});var o=r(57437);r(2265);var n=r(13921),a=r(66648),l=r(15546);let s={glass:{label:"text-darkMode-textTextHighest",inputBg:"bg-white/20",text:"text-darkMode-textTextHighest",placeholder:"text-darkMode-textTextLowest",border:"border-white/20",hover:"hover:border-darkMode-storkStorkHighest",focusRing:"focus:ring-darkMode-storkStorkHighest",focusBorder:"focus:border-darkMode-storkStorkHighest",arrow:"text-white/70",option:"text-black"},grey:{label:"text-lightMode-textTextHigh",inputBg:"bg-white",text:"text-gray-900",placeholder:"text-gray-400",border:"border border-lightMode-storkStorkLowest",hover:"hover:border-lightMode-storkStorkMid",focusRing:"focus:ring-2 focus:ring-lightMode-storkStorkHighest",focusBorder:"focus:border-lightMode-storkStorkHighest",arrow:"text-gray-500",option:"text-black"}};function i(e){let{label:t,options:r=[],value:i,onChange:c,placeholder:d,error:u,variant:h="glass",className:g}=e,x=s[h]||s.glass,p=r.map(e=>"string"==typeof e?{label:e,value:e}:e);return(0,o.jsxs)("div",{className:"flex flex-col flex-1 min-w-[150px]",children:[(0,o.jsx)(n.K$,{className:g||x.label,children:t}),(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsxs)("select",{className:"\n            mt-2 tablet:mt-4 h-[40px] w-full\n            rounded-md\n            border\n            pl-4 pr-10\n            transition\n            appearance-none\n\n            ".concat(x.inputBg,"\n            ").concat(i?x.text:x.placeholder,"\n\n            ").concat(u?"border-[#
1EF4444]":"".concat(x.border," ").concat(x.hover),"\n\n            focus:outline-none\n            focus:ring-2\n\n            ").concat(u?"focus:ring-[#EF4444] focus:border-[#EF4444]":"".concat(x.focusRing," ").concat(x.focusBorder),"\n          "),value:null!=i?i:"",onChange:e=>c(e.target.value),"aria-label":t,children:[(0,o.jsx)("option",{value:"",disabled:!0,className:x.option,children:d}),p.map(e=>(0,o.jsx)("option",{value:e.value,className:x.option,children:e.label},e.value))]}),(0,o.jsx)("div",{className:"pointer-events-none absolute inset-y-7 tablet:inset-y-9 right-3 flex items-center",children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 ".concat(x.arrow),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,o.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),u&&(0,o.jsxs)("div",{className:"mt-2 flex items-center gap-1 text-[#EF4444]",children:[(0,o.jsx)(a.default,{src:l.Z,alt:"Error",width:14,height:14,className:"shrink-0"}),(0,o.jsx)(n.TC,{className:"text-xs",children:u})]})]})}},7842:function(e,t,r){var o=r(57437);r(2265);var n=r(13921);let a={glass:{label:"text-darkMode-textTextHighest",inputBg:"bg-white/20",text:"text-darkMode-textTextHighest",caret:"caret-darkMode-storkStorkHighest",placeholder:"placeholder:text-darkMode-textTextLowest",border:"border-white/20",hover:"hover:border-darkMode-storkStorkHighest",focusRing:"focus:ring-darkMode-storkStorkHighest",focusBorder:"focus:border-darkMode-storkStorkHighest"},grey:{label:"text-lightMode-textTextHigh",inputBg:"bg-white",text:"text-gray-900",caret:"caret-lightMode-storkStorkHighest",placeholder:"placeholder:text-gray-400",border:"border border-lightMode-storkStorkLowest",hover:"hover:border-lightMode-storkStorkMid",focusRing:"focus:ring-2 focus:ring-lightMode-storkStorkHighest",focusBorder:"focus:border-lightMode-storkStorkHighest"}};t.Z=function(e){let{label:t,placeholder:r,value:l,onChange:s,variant:i="glass",className:c}=e,d=a[i]||a.glass;return(0,o.jsxs)("div",{className:"flex flex-col text-xs font-medium",children:[(0,o.jsx)(n.K$,{className:c||d.label,children:t}),(0,o.jsx)("div",{className:"flex flex-col justify-center",children:(0,o.jsx)("textarea",{id:"businessDescription",placeholder:r,rows:4,value:l,onChange:e=>s(e.target.value),className:"\n            w-full mt-2 tablet:mt-4 px-4 pt-2 h-[72px]\n            rounded-md\n            border\n            transition\n            resize-none\n\n            ".concat(d.inputBg,"\n            ").concat(d.text,"\n            ").concat(d.caret,"\n            ").concat(d.placeholder,"\n\n            text-[14px]\n            tablet:text-[16px]\n            smLaptop:text-[18px]\n            lgLaptop:text-[18px]\n\n            placeholder:font-light\n            placeholder:text-[14px]\n            tablet:placeholder:text-[16px]\n            smLaptop:placeholder:text-[18px]\n            lgLaptop:placeholder:text-[18px]\n\n            ").concat(d.border,"\n            ").concat(d.hover,"\n\n            focus:outline-none\n            focus:ring-2\n            ").concat(d.focusRing,"\n            ").concat(d.focusBorder,"\n          ")})})]})}},24475:function(e,t,r){r.d(t,{v:function(){return o}});let o=e=>{let t=String(e||"").trim();if(!t||/\s/.test(t))return!1;let r=t.split("@");if(2!==r.length)return!1;let[o,n]=r;if(!o||!n||!/^[a-zA-Z0-9._%+-]+$/.test(o)||o.includes("..")||n.includes("..")||/^[._%+-]|[._%+-]$/.test(o)||!n.includes(".")||!/^[a-zA-Z0-9.-]+$/.test(n)||/^[.-]|[.-]$/.test(n))return!1;let a=n.split(".");if(a.some(e=>!e||/^-|-$/.test(e)))return!1;let l=a[a.length-1];return!!/^[a-zA-Z]{2,}$/.test(l)}},95763:function(e,t,r){r.d(t,{ES:function(){return n},WP:function(){return a},wy:function(){return o}});let o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return String(e||"").replace(/\D/g,"")},n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=o(e);return 10===t.length?!t.startsWith("1"):11===t.length&&t.startsWith("1")},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=String(null!=e?e:"").trim(),r
1=o(t);return t?r.length<10||!n(t)?"Phone number is incomplete":"":"Phone number is required"}},91194:function(e,t,r){r.d(t,{VP:function(){return u},YX:function(){return d},cD:function(){return i},jD:function(){return c},n6:function(){return g},y$:function(){return h}});var o=r(24475),n=r(95763);let a=e=>/^(?:[A-Za-z]\d[A-Za-z]\s?\d[A-Za-z]\d)$/.test(String(e||"").trim()),l=e=>String(null!=e?e:"").trim(),s=e=>{let t={};l(e.firstName)||(t.firstName="First name is required"),l(e.lastName)||(t.lastName="Last name is required");let r=l(e.email);r?r.includes(" ")?t.email="Email cannot contain spaces":(0,o.v)(r)||(t.email="Enter a valid email address"):t.email="Email is required";let a=(0,n.WP)(e.phoneNumber);return a&&(t.phoneNumber=a),t},i=(e,t)=>{let r=l(e.postalCode);r?a(r)||(t.postalCode="Please enter a valid postal code"):t.postalCode="Postal code is required"},c=(e,t)=>{l(e.province)||(t.province="Province is required")},d=(e,t)=>{let r=e.solution;(Array.isArray(r)?0!==r.length:l(r))||(t.solution="Please select a solution")},u=(e,t)=>{l(e.salesName)||(t.salesName="Sales name is required")},h=(e,t)=>{l(e.event)||(t.event="Event is required")},g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=s(e);for(let o of t)o(e,r);return r}},15546:function(e,t){t.Z={src:"/i/_next/static/media/error.f094f8b8.svg",height:16,width:16,blurWidth:0,blurHeight:0}}}]);

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.