"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[495],{29475:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(27361),a=n.n(r),i=n(68751),o=n(58885);function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"billboard",r=(0,o.Oc)(),s=r.config,l=r.prismicConfig,c="billboard"===n?"btn_link.":"",u=a()(l,"see_schedules",""),d=a()(l,"add_to_cart",""),p=a()(l,"product_detail_page",""),g=a()(l,"details",""),h=a()(l,"free_product",""),m=a()(l,"view_options",""),x=""!==a()(t,c+"sub_product[0].name[0].text",""),b=[a()(t,c+"catalog.classId")],f={link:"/",param:null,label:"",isExternal:!1,style:a()(t,"btn_style")?a()(t,"btn_style"):"primary",classIds:void 0};switch(e){case"add to cart":b=a()(t,c+"bundles")?a()(t,c+"bundles").reduce((function(e,t){var n=t.catalog;return n?(e.push(n.classId),e):e}),b):b,f.classIds=b.join(","),f.link=a()(t,c+"catalog.classId")?s.storefront.shoppingcart+b.join(","):"/",f.label=a()(t,"btn_label")?i.Z.asText(t.btn_label):x?m:d;break;case"add free trial to cart":f.link=a()(t,c+"catalog.trialClassId")?s.storefront.shoppingcart+a()(t,c+"catalog.trialClassId"):"/",f.label=a()(t,"btn_label")?i.Z.asText(t.btn_label):d,f.classIds=a()(t,c+"catalog.trialClassId");break;case"scheduler":case"see scheduler":f.param=a()(t,"scheduler_param",void 0)?i.Z.asText(a()(t,"scheduler_param")):"","billboard"===n?(f.link=a()(t,"btn_link",void 0),f.label=a()(t,"btn_label",void 0)?i.Z.asText(t.btn_label):u):(f.link=a()(t,"scheduler_link",void 0),f.label=a()(t,"scheduler_label",void 0)?i.Z.asText(t.scheduler_label):u);break;case"product detail":f.link=a()(t,"pdp_link",void 0),f.label=a()(t,"pdp_label",void 0)?i.Z.asText(t.pdp_label):p;break;case"simple sign up":f.link=a()(t,c+"catalog.classId")?a()(s,"storefront.signupLink","#")+a()(t,c+"catalog.classId"):void 0,f.label=a()(t,"btn_label")?i.Z.asText(t.btn_label):h,f.classIds=a()(t,c+"catalog.classId");break;case"show navigator dialog":f.link=a()(t,"btn_link",void 0)?"/"+a()(t,"btn_link._meta.uid",void 0)+"?showBackdropNavigator=true":void 0,f.label=a()(t,"btn_label")?i.Z.asText(t.btn_label):"";break;case"external purchase":f.link=a()(t,"external.url"),f.label=""!==a()(t,"external_label[0].text","")?i.Z.asText(t.external_label):"Buy",f.isExternal=!0;break;case"no label":f.link="_externallink"===a()(t,"btn_link.__typename","internallink").toLowerCase()?a()(t,"btn_link.url"):a()(t,"btn_link");break;case"internal-button":f.link="_externallink"===a()(t,"cta_btn_link.__typename","internallink").toLowerCase()?a()(t,"cta_btn_link.url"):a()(t,"cta_btn_link"),f.isExternal="_externallink"===a()(t,"cta_btn_link.__typename","internallink").toLowerCase(),f.label=a()(t,"cta_btn_label",void 0)?i.Z.asText(t.cta_btn_label):g,f.param="";break;case"internal-link":f.link="_externallink"===a()(t,"cta_text_link.__typename","internallink").toLowerCase()?a()(t,"cta_text_link.url"):a()(t,"cta_text_link"),f.isExternal="_externallink"===a()(t,"cta_text_link.__typename","internallink").toLowerCase(),f.label=a()(t,"cta_text_link",void 0)?i.Z.asText(t.cta_btn_label):g,f.param="";break;default:f.link="_externallink"===a()(t,"btn_link.__typename","internallink").toLowerCase()?a()(t,"btn_link.url"):a()(t,"btn_link"),f.isExternal="_externallink"===a()(t,"btn_link.__typename","internallink").toLowerCase(),f.param=a()(t,"scheduler_param",void 0)?i.Z.asText(a()(t,"scheduler_param")):"",f.label=a()(t,"btn_label",void 0)?i.Z.asText(t.btn_label):g}return f}},70495:function(e,t,n){n.r(t),n.d(t,{default:function(){return te}});var r=n(80318),a=n(92809),i=n(67294),o=n(66073),s=n.n(o),l=n(27361),c=n.n(l),u=n(98913),d=n.n(u),p=n(48122),g=n(58885),h=n(25282),m=n(11163),x=n(10861),b=n(41120),f=n(45258),y=n(43832),v=n(41749),j=n(46409);function k(e){var t=Object.keys(e).filter((function(t){return null!==e[t]&&void 0!==e[t]})).map((function(t){var n=e[t];return Array.isArray(n)&&(n=n.join("/")),[encodeURIComponent(t),encodeURIComponent(n)].join("=")})).join("&");return t&&t.length>0?"?"+t:t}var _=n(428),Z=n(71843),w=n(14670),C=n(33681),O=n(85893),N=(0,b.Z)((function(e){return{root:(0,a.Z)({flexGrow:1},e.breakpoints.up("md"),{padding:"0 5px"})}})),q=(0,w.Z)((function(e){return{root:{height:10,borderRadius:5},colorPrimary:{backgroundColor:e.palette.secondary.main},bar:{borderRadius:5,backgroundColor:e.palette.secondary.light}}}))(C.Z);function T(e){var t=e.currentQuestion,n=e.totalQuestions,r=e.noMoreQuestion,a=e.cls,i=N();return(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(v.Z,{item:!0,xs:12,md:4,align:"center",className:a,children:(0,O.jsx)("div",{className:i.root,children:(0,O.jsx)(q,{variant:"determinate",value:(r||(n=t+1),100*t===0?2:100*t/n),"aria-label":"progress bar"})})})})}function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t0&&(0,O.jsx)(v.Z,{container:!0,justifyContent:"flex-start",item:!0,xs:6,md:3,align:"center",className:h.textLeft,children:(0,O.jsxs)(j.Z,{href:"".concat(p).concat(k(S(S({},g),{},{navigator:b.length>0&&C?b.join("|"):void 0}))),noNext:!0,onClick:function(e){e.preventDefault(),n()},children:[(0,O.jsx)(Z.Z,{}),"Previous Question"]})}),(0,O.jsx)(T,{cls:h.progressBar,currentQuestion:a,totalQuestions:o,noMoreQuestion:i}),t&&t.length>0&&(0,O.jsx)(v.Z,{container:!0,justifyContent:"flex-end",item:!0,xs:6,md:3,align:"center",className:h.textRight,children:(0,O.jsxs)(j.Z,{href:"".concat(p).concat(k(S(S({},g),{},{navigator:void 0}))),noNext:!0,onClick:function(e){e.preventDefault(),r()},children:[(0,O.jsx)(_.Z,{}),"Start Over"]})})]})})})})})}function Q(e){var t=e.selectedAnswers,n=e.nextQuestion,r=e.onReset,a=e.cls,i=e.bgColor,o=(0,m.useRouter)(),s=(0,x.Qc)(o.asPath,!0),l=s.pathname,c=s.query,u=B(),d="dark-stanley-purple"===i;return(0,O.jsx)(O.Fragment,{children:t&&t.length>0&&!n&&(0,O.jsx)(f.Z,{position:"static",className:"".concat(u.appBar," ").concat(a),children:(0,O.jsx)(y.Z,{children:(0,O.jsx)(v.Z,{item:!0,xs:12,md:12,children:(0,O.jsx)(v.Z,{container:!0,className:"".concat(u.appBarContent," ").concat(u.selectedText," ").concat(d&&u.bodyTextColor),children:(0,O.jsx)(v.Z,{container:!0,justifyContent:"center",item:!0,xs:12,md:12,align:"center",children:(0,O.jsxs)(j.Z,{href:"".concat(l).concat(k(S(S({},c),{},{navigator:void 0}))),noNext:!0,onClick:function(e){e.preventDefault(),r()},children:[(0,O.jsx)(_.Z,{}),"Start Over"]})})})})})})})}var R=n(86977),A=n(83789),M=n(68751),D=n(99956),z=n(79895),E=n(71792);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t div":{backgroundColor:c()(e,"palette.navigator.backgroundHover",c()(e,"palette.navigator.accentColor")),color:e.palette.text.secondary,"& .MuiTypography-h1, .MuiTypography-h2, .MuiTypography-h3, .MuiTypography-h4":{color:c()(e,"palette.navigator.textHover",e.palette.text.secondary)}},"&:focus > div":{backgroundColor:c()(e,"palette.navigator.backgroundHover",c()(e,"palette.navigator.accentColor")),color:e.palette.text.secondary,"& .MuiTypography-h1, .MuiTypography-h2, .MuiTypography-h3, .MuiTypography-h4":{color:c()(e,"palette.navigator.textHover",e.palette.text.secondary)}}}),instruction:{"& p":{color:"inherit"}}}}));function W(e){var t=e.question,n=e.answers,r=e.selectedAnswers,a=e.instruction,o=e.onSelect,s=e.isBackDropNavigator,l=(0,m.useRouter)(),c=(0,x.Qc)(l.asPath,!0),u=c.pathname,d=c.query,p=L(),g=(0,i.useRef)(null),h="".concat(t&&t[0].text," Choose from ").concat(n&&n.length," options."),b=function(){g.current&&g.current.focus()};return(0,O.jsxs)(D.Z,{"aria-live":"assertive",children:[(0,O.jsx)("span",{ref:g,tabIndex:"0",className:p.hdline,role:"heading","aria-label":h,"aria-level":"1",children:(0,O.jsx)(M.Z,{render:t,htmlSerializer:E.y})}),(0,O.jsx)(D.Z,{mb:3,children:(0,O.jsx)(v.Z,{container:!0,spacing:2,direction:"row",justifyContent:"center",alignItems:"stretch",children:n&&n.map((function(e,t){var a=e.choice,i=e.selectValue;return(0,O.jsx)(v.Z,{item:!0,xs:12,sm:12,md:n.length<3?5:4,children:(0,O.jsx)(j.Z,{className:p.questionLink,noNext:!0,href:"".concat(u).concat(k(H(H({},d),{},{navigator:[].concat((0,A.Z)(r),[i]).join("|")}))),onClick:function(e){e.preventDefault(),o(i),b()},onKeyPress:function(e){32===e.charCode&&(o(i),b())},children:(0,O.jsx)(z.Z,{className:"".concat(p.questionCard),children:(0,O.jsx)(M.Z,{render:a,htmlSerializer:E.y})})})},t)}))})}),a&&!s&&(0,O.jsx)("span",{className:p.instruction,children:(0,O.jsx)(M.Z,{render:a,htmlSerializer:E.y})})]})}var G=n(29475),U=n(282),V=n(22318),K=n(52663),J=n(17812),Y=n(80366);function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $(e){for(var t=1;t0?x.navigator.split("|").map((function(e){return e.toLowerCase()})):[],w=x.showBackdropNavigator&&"true"===x.showBackdropNavigator,C=i.useState(w),N=(0,r.Z)(C,2),q=N[0],T=N[1],P=c()(e,"recommendedProduct"),S=k?k.reduce((function(e,t){if("navigation"===t.type_filter&&e.navigation.push({instruction:t.instruction,btn_link:t.btn_link}),"question"===t.type_filter)e.question.push({question:t.question,instruction:t.instruction});else if(e.question.length>0){var n=e.question[e.question.length-1];n.answers||(n.answers=[]),Z.includes(t.type_filter)&&(n.selectedAnswer=t.type_filter),n.answers.push({choice:t.question,selectValue:t.type_filter,skip:t.skip})}else console.error("unorganized answer choices");return e}),{question:[],navigation:[]}):[],B=S.question.filter((function(e){return void 0!==e.selectedAnswer})).map((function(e){return e.selectedAnswer}));t=(t=document.referrer)&&t.replace(/https?:\/\/[^/]+/,"");var A=!1,z=[];s()(S.question,(function(e,t){var r=e&&e.answers&&e.answers.find((function(e){return e.selectValue===B[B.length-1]}));void 0!==r&&(z=S.question.indexOf(e)+1,"skip"===r.skip?t+2>=S.question.length?(n=void 0,A=!0):n=S.question[t+2]:"skip_2"===r.skip?t+3>=S.question.length?(n=void 0,A=!0):n=S.question[t+3]:"end"===r.skip?(A=!0,n=void 0):n=S.question[t+1])})),void 0!==n||A||(n=S.question.find((function(e){return void 0===e.selectedAnswer})));var F=(0,g.ws)(),H=(0,g.yK)();B.length===S.question.length!==c()(H,"navigator.noMoreQuestion",!1)&&F({type:g.s4,navigator:{noMoreQuestion:B.length===S.question.length}});var L=ee({bgColor:a,titleColor:o,textColor:l}),X=function(e){return function(t){t.preventDefault(),e&&b.pushRoute("page",$($({},x),{},{csjId:e}))}},te=(0,O.jsx)(I,{bgColor:a,cls:L.navigatorBillboard,selectedAnswers:B,currentQuestion:z,noMoreQuestion:A,totalQuestions:S.question.length,nextQuestion:n,onPrevious:function(){var e=B.filter((function(e){return e})),t=e.length-1,n=e.splice(t,1);b.pushRoute("page",$($({},x),{},{navigator:e.length>0&&n?e.join("|"):void 0}))},onReset:function(){b.pushRoute("page",$($({},x),{},{navigator:void 0})).then((function(){return window.scrollTo(0,0)}))}}),ne=function(){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(D.Z,{className:L.navigatorBillboard,align:"center",children:[w&&(0,O.jsx)(D.Z,{display:"flex",justifyContent:"flex-end",pr:{xs:4,lg:20},children:(0,O.jsx)(J.Z,{className:L.closeButton,size:"medium",onClick:re,children:(0,O.jsx)(Y.Z,{})})}),S&&S.navigation&&S.navigation.length>=1&&S.question&&0===S.question.length&&(0,O.jsx)(y.Z,{maxWidth:"lg",children:(0,O.jsxs)(D.Z,{py:10,children:[(0,O.jsx)("span",{className:L.title,children:f&&(0,O.jsx)(M.Z,{render:f,htmlSerializer:E.y})}),(0,O.jsx)(v.Z,{item:!0,sm:12,md:8,children:(0,O.jsx)(v.Z,{container:!0,justifyContent:"center",spacing:2,children:S.navigation&&S.navigation.map((function(e,t){var n=(0,G.Z)("no label",e,"product");return(0,O.jsx)(v.Z,{item:!0,sm:12,md:4,children:(0,O.jsx)(U.Z,{component:j.Z,href:n.link,param:n.param,passHref:!0,naked:!0,variant:"contained",color:_,className:L.button,children:(0,O.jsx)(M.Z,{render:e.instruction,htmlSerializer:E.x})})},t)}))})})]})}),n&&!A&&(0,O.jsx)(y.Z,{maxWidth:"lg",children:(0,O.jsxs)(D.Z,{py:4,children:[w&&(0,O.jsxs)(O.Fragment,{children:[te,n.instruction&&(0,O.jsx)("span",{className:L.instruction,children:(0,O.jsx)(M.Z,{render:n.instruction,htmlSerializer:E.y})})]}),(0,O.jsx)("span",{className:L.title,children:f&&(0,O.jsx)(M.Z,{render:f,htmlSerializer:E.y})}),n&&(0,O.jsx)(W,{question:n.question,answers:n.answers,selectedAnswers:B,totalQuestions:S.question.length,instruction:n.instruction,currentQuestion:z,noMoreQuestion:A,onSelect:function(e){B.push(e),b.pushRoute("page",$($({},x),{},{navigator:B.join("|")},x.showBackdropNavigator&&{showBackdropNavigator:B.length===S.question.length?"false":"true"}))},isBackDropNavigator:w})]})}),P&&(void 0===S.navigation||0===S.navigation.length)&&(A||B.length===S.question.length)&&(0,O.jsx)(y.Z,{maxWidth:"lg",children:(0,O.jsx)(D.Z,{pt:4,pb:6,children:(0,O.jsxs)(v.Z,{container:!0,spacing:2,direction:"row",alignItems:"flex-start",justifyContent:"space-between",children:[(0,O.jsx)(v.Z,{item:!0,xs:12,container:!0,justifyContent:"center",children:(0,O.jsxs)(D.Z,{display:"inline",children:[(0,O.jsx)("span",{className:L.title,children:f&&(0,O.jsx)(M.Z,{render:f,htmlSerializer:E.y})}),(0,O.jsx)(V.Z,{variant:"h3",className:L.recommendedName,tabIndex:"0",children:"We think this would work best:"})]})}),(0,O.jsx)(v.Z,{item:!0,xs:12,container:!0,justifyContent:"flex-start",children:P.journey_end_quote&&(0,O.jsx)("img",{className:L.quoteArt,src:"https://images.prismic.io/kaptestmocha/697ea6f7-4d35-4278-b4ee-b37cd7e63cb0_Quote.svg?auto=compress,format",alt:""})}),(0,O.jsx)(v.Z,{item:!0,xs:12,md:8,children:(0,O.jsx)("div",{className:L.quote,children:(0,O.jsx)(M.Z,{render:P.journey_end_quote})})}),(0,O.jsx)(v.Z,{item:!0,xs:12,md:4,children:(0,O.jsxs)("div",{className:L.quoteAuthor,children:[(0,O.jsx)(M.Z,{render:P.journey_end_author}),P.star>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("img",{className:L.trustPilot,src:"https://images.prismic.io/kaptestmocha/19f83073-d2ed-4d91-8cfd-c7fe9793fe41_Trustpilot_brandmark_blk_RGB.svg",alt:"Trustpilot"}),d()(P.star,(function(){return(0,O.jsx)("img",{className:L.stars,src:"https://images.prismic.io/kaptestmocha/43cd7ab1-b67e-401d-a5c8-1acbb6035f6b_Trustpilot_ratings_5star-RGB.svg?auto=compress,format",alt:""})}))]})]})})]})})}),void 0===P&&(void 0===S.navigation||0===S.navigation.length)&&(A||B.length===S.question.length)&&(0,O.jsx)(y.Z,{maxWidth:"xl",children:(0,O.jsx)(D.Z,{pt:4,pb:6,align:"center",children:(0,O.jsx)(v.Z,{container:!0,children:(0,O.jsxs)(v.Z,{item:!0,xs:12,md:12,children:[(0,O.jsx)("span",{className:L.title,children:(0,O.jsx)(M.Z,{render:f,htmlSerializer:E.y})}),(0,O.jsx)(V.Z,{variant:"h3",className:L.recommendedName,children:"OOPS. THERE ISN\u2019T AN OPTION THAT FITS YOUR CHOICES."}),(0,O.jsx)(R.nm,{cls:"".concat(L.navigatorBillboard," ").concat(L.noProductMsg)}),(0,O.jsx)(V.Z,{variant:"h6",children:"Or you can adjust your filters and give it another go."})]})})})})]}),!w&&(0,O.jsx)(O.Fragment,{children:te}),P&&B.length>0&&!w&&(0,O.jsx)(D.Z,{pb:6,mt:n?0:-2,className:L.navigatorBillboard,children:(0,O.jsx)(y.Z,{maxWidth:"xl",children:(0,O.jsx)(R.le,{primaryActionButton:(0,O.jsx)(h.NavigationActionButton,{product:P,onCrossSellJourneyStart:X}),secondaryActionButton:(0,O.jsx)(h.NavigationActionButton,{product:P,color:"secondary",navigation:"pdp"}),image:P.product_image,name:P.name,catalog:P.catalog,classId:P.catalog.classId,promo_text:P.promo_text,recommendDesc:P.recommend_text,priceMsg:P.priceMsg,affirmEligible:P.catalog.affirmEligible,nextQuestion:n,brand:m.theme})})}),(0,O.jsx)(Q,{bgColor:a,cls:L.navigatorBillboard,selectedAnswers:B,nextQuestion:n,onReset:function(){b.pushRoute("page",$($({},x),{},{navigator:void 0})).then((function(){return window.scrollTo(0,0)}))}})]})},re=function(){T(!1),b.pushRoute(t)};return(0,O.jsx)(O.Fragment,{children:w?(0,O.jsx)(K.Z,{open:q,fullScreen:!0,onClose:re,className:L.navigatorDialog,children:ne()}):ne()})}}}]);