1"use strict";(self.webpackChunkrjm_layout_templaye=self.webpackChunkrjm_layout_templaye||[]).push([[815],{978:function(e,t,r){r.d(t,{G:function(){return $},L:function(){return g},M:function(){return E},P:function(){return C},_:function(){return i},a:function(){return a},b:function(){return c},c:function(){return u},g:function(){return d},h:function(){return s}});var o=r(6540),l=(r(5147),r(5556)),n=r.n(l);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},a.apply(this,arguments)}function i(e,t){if(null==e)return{};var r,o,l={},n=Object.keys(e);for(o=0;o<n.length;o++)t.indexOf(r=n[o])>=0||(l[r]=e[r]);return l}const s=()=>"undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;const u=e=>{var t;return(e=>{var t,r;return Boolean(null==e||null==(t=e.images)||null==(r=t.fallback)?void 0:r.src)})(e)?e:(e=>Boolean(null==e?void 0:e.gatsbyImageData))(e)?e.gatsbyImageData:(e=>Boolean(null==e?void 0:e.gatsbyImage))(e)?e.gatsbyImage:null==e||null==(t=e.childImageSharp)?void 0:t.gatsbyImageData};function c(e,t,r,o,l){return void 0===l&&(l={}),a({},r,{loading:o,shouldLoad:e,"data-main-image":"",style:a({},l,{opacity:t?1:0})})}function d(e,t,r,o,l,n,i,s){const u={};n&&(u.backgroundColor=n,"fixed"===r?(u.width=o,u.height=l,u.backgroundColor=n,u.position="relative"):("constrained"===r||"fullWidth"===r)&&(u.position="absolute",u.top=0,u.left=0,u.bottom=0,u.right=0)),i&&(u.objectFit=i),s&&(u.objectPosition=s);const c=a({},e,{"aria-hidden":!0,"data-placeholder-image":"",style:a({opacity:t?0:1,transition:"opacity 500ms linear"},u)});return c}const m=["children"],p=function(e){let{layout:t,width:r,height:l}=e;return"fullWidth"===t?o.createElement("div",{"aria-hidden":!0,style:{paddingTop:l/r*100+"%"}}):"constrained"===t?o.createElement("div",{style:{maxWidth:r,display:"block"}},o.createElement("img",{alt:"",role:"presentation","aria-hidden":"true",src:`data:image/svg+xml;charset=utf-8,%3Csvg height='${l}' width='${r}' xmlns='http://www.w3.org/2000/svg' version='1.1'%3E%3C/svg%3E`,style:{maxWidth:"100%",display:"block",position:"static"}})):null},g=function(e){let{children:t}=e,r=i(e,m);return o.createElement(o.Fragment,null,o.createElement(p,a({},r)),t,null)},y=["src","srcSet","loading","alt","shouldLoad"],h=["fallback","sources","shouldLoad"],b=function(e){let{src:t,srcSet:r,loading:l,alt:n="",shouldLoad:s}=e,u=i(e,y);return o.createElement("img",a({},u,{decoding:"async",loading:l,src:s?t:void 0,"data-src":s?void 0:t,srcSet:s?r:void 0,"data-srcset":s?void 0:r,alt:n}))},f=function(e){let{fallback:t,sources:r=[],shouldLoad:l=!0}=e,n=i(e,h);const s=n.sizes||(null==t?void 0:t.sizes),u=o.createElement(b,a({},n,t,{sizes:s,shouldLoad:l}));return r.length?o.createElement("picture",null,r.map(e=>{let{media:t,srcSet:r,type:n}=e;return o.createElement("source",{key:`${t}-${n}-${r}`,type:n,media:t,srcSet:l?r:void 0,"data-srcset":l?void 0:r,sizes:s})}),u):u};var v;b.propTypes={src:l.string.isRequired,alt:l.string.isRequired,sizes:l.string,srcSet:l.string,shouldLoad:l.bool},f.displayName="Picture",f.propTypes={alt:l.string.isRequired,shouldLoad:l.bool,fallback:l.exact({src:l.string.isRequired,srcSet:l.string,sizes:l.string}),sources:l.arrayOf(l.oneOfType([l.exact({media:l.string.isRequired,type:l.string,sizes:l.string,srcSet:l.string.isRequired}),l.exact({media:l.string,type:l.string.isRequired,sizes:l.string,srcSet:l.string.isRequired})]))};const x=["fallback"],C=function(e){let{fallback:t}=e,r=i(e,x);return t?o.createElement(f,a({},r,{fallback:{src:t},"aria-hidden":!0,alt:""})):o.createElement("div",a({},r))};C.displayName="Placeholder",C.propTypes={fallback:l.string,sources:null==(v=f.propTypes)?void 0:v.sources,alt:function(e,t,r){return e[t]?new Error(`Invalid prop \`${t}\` supplied to \`${r}\`. Validation failed.`):null}};const E=function(e){return o.createElement(o.Fragment,null,o.createElement(f,a({},e)),o.createElement("noscript",null,o.createElement(f,a({},e,{shouldLoad:!0}))))};E.displayName="MainImage",E.propTypes=f.propTypes;const w=function(e,t,r){for(var o=arguments.length,l=new Array(o>3?o-3:0),a=3;a<o;a++)l[a-3]=arguments[a];return e.alt||""===e.alt?n().string.apply(n(),[e,t,r].concat(l)):new Error(`The "alt" prop is required in ${r}. If the image is purely presentational then pass an empty string: e.g. alt="". Learn more: https://a11y-style-guide.com/style-guide/section-media.html`)},q={image:n().object.isRequired,alt:w},k=["as","image","style","backgroundColor","className","class","onStartLoad","onLoad","onError"],N=["style","className"],z=new Set;let A,T;const S=function(e){let{as:t="div",image:l,style:n,backgroundColor:u,className:c,class:d,onStartLoad:m,onLoad:p,onError:g}=e,y=i(e,k);const{width:h,height:b,layout:f}=l,v=function(e,t,r){const o={};let l="gatsby-image-wrapper";return"fixed"===r?(o.width=e,o.height=t):"constrained"===r&&(l="gatsby-image-wrapper gatsby-image-wrapper-constrained"),{className:l,"data-gatsby-image-wrapper":"",style:o}}(h,b,f),{style:x,className:C}=v,E=i(v,N),w=(0,o.useRef)(),q=(0,o.useMemo)(()=>JSON.stringify(l.images),[l.images]);d&&(c=d);const S=function(e,t,r){let o="";return"fullWidth"===e&&(o=`<div aria-hidden="true" style="padding-top: ${r/t*100}%;"></div>`),"constrained"===e&&(o=`<div style="max-width: ${t}px; display: block;"><img alt="" role="presentation" aria-hidden="true" src="data:image/svg+xml;charset=utf-8,%3Csvg height='${r}' width='${t}' xmlns='http://www.w3.org/2000/svg' version='1.1'%3E%3C/svg%3E" style="max-width: 100%; display: block; position: static;"></div>`),o}(f,h,b);return(0,o.useEffect)(()=>{A||(A=Promise.all([r.e(593),r.e(896)]).then(r.bind(r,7896)).then(e=>{let{renderImageToString:t,swapPlaceholderImage:r}=e;return T=t,{renderImageToString:t,swapPlaceholderImage:r}}));const e=w.current.querySelector("[data-gatsby-image-ssr]");if(e&&s())return e.complete?(null==m||m({wasCached:!0}),null==p||p({wasCached:!0}),setTimeout(()=>{e.removeAttribute("data-gatsby-image-ssr")},0)):(null==m||m({wasCached:!0}),e.addEventListener("load",function t(){e.removeEventListener("load",t),null==p||p({wasCached:!0}),setTimeout(()=>{e.removeAttribute("data-gatsby-image-ssr")},0)})),void z.add(q);if(T&&z.has(q))return;let t,o;return A.then(e=>{let{renderImageToString:r,swapPlaceholderImage:i}=e;w.current&&(w.current.innerHTML=r(a({isLoading:!0,isLoaded:z.has(q),image:l},y)),z.has(q)||(t=requestAnimationFrame(()=>{w.current&&(o=i(w.current,q,z,n,m,p,g))})))}),()=>{t&&cancelAnimationFrame(t),o&&o()}},[l]),(0,o.useLayoutEffect)(()=>{z.has(q)&&T&&(w.current.innerHTML=T(a({isLoading:z.has(q),isLoaded:z.has(q),image:l},y)),null==m||m({wasCached:!0}),null==p||p({wasCached:!0}))},[l]),(0,o.createElement)(t,a({},E,{style:a({},x,n,{backgroundColor:u}),className:`${C}${c?` ${c}`:""}`,ref:w,dangerouslySetInnerHTML:{__html:S},suppressHydrationWarning:!0}))},$=(0,o.memo)(function(e){return e.image?(0,o.createElement)(S,e):null});$.propTypes=q,$.displayName="GatsbyImage";const _=["src","__imageData","__error","width","height","aspectRatio","tracedSVGOptions","placeholder","formats","quality","transformOptions","jpgOptions","pngOptions","webpOptions","avifOptions","blurredOptions","breakpoints","outputPixelDensities"],L=function(e,t){for(var r=arguments.length,o=new Array(r>2?r-2:0),l=2;l<r;l++)o[l-2]=arguments[l];return"fullWidth"!==e.layout||"width"!==t&&"height"!==t||!e[t]?n().number.apply(n(),[e,t].concat(o)):new Error(`"${t}" ${e[t]} may not be passed when layout is fullWidth.`)},P=new Set(["fixed","fullWidth","constrained"]),R={src:n().string.isRequired,alt:w,width:L,height:L,sizes:n().string,layout:e=>{if(void 0!==e.layout&&!P.has(e.layout))return new Error(`Invalid value ${e.layout}" provided for prop "layout". Defaulting to "constrained". Valid values are "fixed", "fullWidth" or "constrained".`)}},B=(I=$,function(e){let{src:t,__imageData:r,__error:l}=e,n=i(e,_);return l&&console.warn(l),r?o.createElement(I,a({image:r},n)):(console.warn("Image not loaded",t),null)});var I;B.displayName="StaticImage",B.propTypes=R},5147:function(e){const t=(e,t)=>{if("string"!=typeof e&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);if(e=Array.isArray(e)?e.map(e=>e.trim()).filter(e=>e.length).join("-"):e.trim(),0===e.length)return"";if(1===e.length)return t.pascalCase?e.toUpperCase():e.toLowerCase();return e!==e.toLowerCase()&&(e=(e=>{let t=!1,r=!1,o=!1;for(let l=0;l<e.length;l++){const n=e[l];t&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(e=e.slice(0,l)+"-"+e.slice(l),t=!1,o=r,r=!0,l++):r&&o&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(e=e.slice(0,l-1)+"-"+e.slice(l-1),o=r,r=!1,t=!0):(t=n.toLowerCase()===n&&n.toUpperCase()!==n,o=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return e})(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(e,t)=>t.toUpperCase()).replace(/\d+(\w|$)/g,e=>e.toUpperCase()),r=e,t.pascalCase?r.charAt(0).toUpperCase()+r.slice(1):r;var r};e.exports=t,e.exports.default=t},7735:function(e,t,r){r.r(t),r.d(t,{default:function(){return B}});var o=r(4506),l=r(5703),n=r(6540),a=r(8154),i=r(2955),s=r(3048),u=r(4479),c=r(1105),d=r(5615),m=r(978),p=r(2266);var g=e=>{let{title:t,description:r,benefits:o,disclaimer:l,cta:a,onStart:i,primaryColour:g,secondaryColour:y,primaryTextColour:h,secondaryTextColour:b}=e;return n.createElement("section",{className:"quiz-intro-section py-5"},n.createElement(s.A,{className:"quiz-intro-container"},n.createElement(u.A,{className:"justify-content-center py-4 mx-3 mx-md-5 mx-lg-9 py-lg-5 rounded-top-1 px-md-4",style:{background:g}},n.createElement(c.A,{xs:12},t&&n.createElement("h1",{className:"text-center quiz-title",style:{color:"#fff"}},n.createElement(p.s,{htmlContent:t})))),o&&o.length>0&&n.createElement(u.A,{className:"pb-5 mx-3 mx-md-5 mx-lg-9 quiz-benefits-row"},n.createElement("hr",{className:"mt-2 mb-5 border-3 opacity-100",style:{borderColor:g}}),r&&n.createElement("p",{className:"text-center mb-5 px-lg-9 pb-lg-5"},r),o.map((e,t)=>{var r,o,l,a;const i=(0,m.c)(null==e||null===(r=e.icon)||void 0===r?void 0:r.localFile);return n.createElement(c.A,{xs:12,md:4,key:t,className:"quiz-intro-benefit-col"},n.createElement("div",{className:"quiz-intro-benefit-item position-relative d-flex d-md-block align-items-center py-2 py-md-2 px-md-1 mb-3 rounded-start-3 rounded-top-3 h-md-100 w-lg-75 mx-lg-auto",style:{background:y,color:b}},i&&n.createElement("div",{className:"quiz-benefit-icon-wrapper d-flex justify-content-center align-items-center"},n.createElement(m.G,{image:i,alt:(null==e||null===(o=e.icon)||void 0===o?void 0:o.altText)||"Benefit icon",className:"mb-0",style:{maxHeight:"60px",maxWidth:"60px"}})),!i&&(null==e||null===(l=e.icon)||void 0===l?void 0:l.sourceUrl)&&n.createElement("div",{className:"quiz-benefit-icon-wrapper d-flex justify-content-center align-items-center"},n.createElement("img",{src:e.icon.sourceUrl,alt:(null==e||null===(a=e.icon)||void 0===a?void 0:a.altText)||"Benefit icon",className:"mb-0",style:{maxHeight:"60px",maxWidth:"60px"}})),(null==e?void 0:e.benefit)&&n.createElement("p",{className:"quiz-benefit-text mb-0 ms-3 ms-md-0 px-md-3 py-md-0 mt-md-4 text-md-center",style:{color:b}},n.createElement("strong",null,e.benefit))))})),n.createElement(u.A,{className:"justify-content-center bg-white mx-3 mx-md-5 pb-4 mx-lg-9 pt-lg-5 rounded-bottom-1"},n.createElement(c.A,{xs:12,md:6,className:"quiz-intro-cta-col text-center"},a&&a.title&&n.createElement(d.A,{variant:"primary",size:"lg",onClick:i,className:"quiz-intro-cta-button mb-3 py-3 px-4",style:{borderRadius:"100px"}},a.title),l&&n.createElement("small",{className:"quiz-intro-disclaimer text-muted d-block"},l)))))},y=r(6402),h=r(6942),b=r.n(h),f=r(6519),v=r(9528),x=r(4848);function C(e,t,r){const o=(e-t)/(r-t)*100;return Math.round(1e3*o)/1e3}function E({min:e,now:t,max:r,label:o,visuallyHidden:l,striped:n,animated:a,className:i,style:s,variant:u,bsPrefix:c,...d},m){return(0,x.jsx)("div",{ref:m,...d,role:"progressbar",className:b()(i,`${c}-bar`,{[`bg-${u}`]:u,[`${c}-bar-animated`]:a,[`${c}-bar-striped`]:a||n}),style:{width:`${C(t,e,r)}%`,...s},"aria-valuenow":t,"aria-valuemin":e,"aria-valuemax":r,children:l?(0,x.jsx)("span",{className:"visually-hidden",children:o}):o})}const w=n.forwardRef(({isChild:e=!1,...t},r)=>{const o={min:0,max:100,animated:!1,visuallyHidden:!1,striped:!1,...t};if(o.bsPrefix=(0,f.oU)(o.bsPrefix,"progress"),e)return E(o,r);const{min:l,now:a,max:i,label:s,visuallyHidden:u,striped:c,animated:d,bsPrefix:m,variant:p,className:g,children:y,...h}=o;return(0,x.jsx)("div",{ref:r,...h,className:b()(g,m),children:y?(0,v.Tj)(y,e=>(0,n.cloneElement)(e,{isChild:!0})):E({min:l,now:a,max:i,label:s,visuallyHidden:u,striped:c,animated:d,bsPrefix:m,variant:p},r)})});w.displayName="ProgressBar";var q=w;var k=e=>{let{quizAnswerType:t,question:r,answer:l,onChange:a,currentQuestion:i,totalQuestions:m,onNext:p,onBack:g,primaryColour:h,secondaryColour:b,primaryTextColour:f,secondaryTextColour:v,buttonBackgroun
1dColour:x,buttonTextColour:C,buttonBorderColour:E,buttonHoverBackgroundColour:w,buttonHoverTextColour:k,buttonHoverBorderColour:N}=e;const z=[x&&`.quiz-question-section .btn-outline-primary { background-color: ${x} !important; }`,C&&`.quiz-question-section .btn-outline-primary { color: ${C} !important; }`,E&&`.quiz-question-section .btn-outline-primary { border-color: ${E} !important; }`,w&&`.quiz-question-section .btn-outline-primary:hover { background-color: ${w} !important; }`,k&&`.quiz-question-section .btn-outline-primary:hover { color: ${k} !important; }`,N&&`.quiz-question-section .btn-outline-primary:hover { border-color: ${N} !important; }`].filter(Boolean).join("\n"),A=null!=l&&""!==l,T=!r.isRequired||A,S=i/m*100;return n.createElement(n.Fragment,null,n.createElement("section",{className:"quiz-question-section py-5"},n.createElement(s.A,{className:"quiz-question-container"},n.createElement(u.A,{className:"quiz-question-progress-row justify-content-center"},n.createElement(c.A,{xs:12,lg:8,className:"quiz-question-progress-col mb-3 py-3 px-4 rounded"},n.createElement("p",{className:"mb-2 quiz-progress-text"},"Question ",i," of ",m),n.createElement(q,{now:S,className:"mb-0"})),n.createElement(c.A,{xs:12,lg:8,className:"px-1 px-md-0"},n.createElement("div",{className:"quiz-question-box py-5 px-5 rounded-top",style:{borderBottomLeftRadius:"50% 20px",borderBottomRightRadius:"50% 20px",backgroundColor:b,color:v}},n.createElement("h3",{className:"quiz-question-heading text-center",style:{color:"rgb(75, 85, 99)"}},r.question)),r.helpText&&n.createElement("p",{className:"quiz-question-subtext text-muted mb-4"},r.helpText),n.createElement("div",{className:"py-6 pt-md-5"},(()=>{switch(t){case"multiple_choice":return n.createElement("div",null,r.options&&r.options.map((e,t)=>n.createElement(y.A.Check,{key:t,type:r.mcAllowMultiple?"checkbox":"radio",id:`option-${t}`,label:e.optionLabel,name:`question-${i}`,checked:r.mcAllowMultiple?Array.isArray(l)&&l.includes(t):l===t,onChange:()=>(e=>
1{if(r.mcAllowMultiple){const t=Array.isArray(l)?l:[];t.includes(e)?a(t.filter(t=>t!==e)):a([].concat((0,o.A)(t),[e]))}else a(e)})(t),className:"mb-3 py-3"})));case"scale_0_10":{var e,s;const t=null!==(e=r.minValue)&&void 0!==e?e:0,o=null!==(s=r.maxValue)&&void 0!==s?s:10,i=r.step||1,u=[];for(let e=t;e<=o;e+=i)u.push(e);return n.createElement("div",{className:"quiz-question-scale-buttons d-flex flex-wrap justify-content-center gap-2"},u.map(e=>n.createElement(d.A,{key:e,variant:l===e?"primary":"outline-primary",onClick:()=>a(e),className:"quiz-question-scale-button py-2 px-3",style:l===e?{background:h,color:f,borderColor:h}:{}},e)))}case"true_false":return n.createElement("div",{className:"d-grid gap-3 px-5"},n.createElement(d.A,{variant:!0===l?"primary":"outline-primary",onClick:()=>a(!0),className:"py-3 rounded-5 mb-md-3",style:!0===l?{background:h,color:f,borderColor:h}:{}},r.labelTrue||"True"),n.createElement(d.A,{variant:!1===l?"primary":"outline-primary",onClick:()=>a(!1),className:"py-3 rounded-5",style:!1===l?{background:h,color:f,borderColor:h}:{}},r.labelFalse||"False"));default:return n.createElement("p",null,"Unknown question type")}})()),n.createElement(u.A,{className:"quiz-question-nav-row g-3 pt-4"},n.createElement(c.A,{xs:6},n.createElement(d.A,{variant:"secondary",onClick:g,disabled:1===i,className:"quiz-question-back-button w-100 py-3 w-xl-75",style:{background:b,color:v,borderColor:b}},"Previous")),n.createElement(c.A,{xs:6,className:"d-xl-flex justify-content-xl-end"},n.createElement(d.A,{variant:"primary",onClick:p,disabled:!T,className:"quiz-question-next-button w-100 py-3 w-xl-75",style:{background:h,color:f}},i===m?"Continue":"Next"))))))),z&&n.createElement("style",null,z),n.createElement("style",null,"\n .quiz-question-section .form-check-label { color: rgb(75, 85, 99); }\n .quiz-question-section .progress-bar { background: linear-gradient(to right, #18CBBE, #08877A) !important; }\n .quiz-question-section .form-check-input { border-color: #18cbbe; }\n .quiz-question-section .form-check-input:focus { border-color: #18cbbe; box-shadow: 0 0 0 0.25rem rgba(24, 203, 190, 0.25); }\n .quiz-question-section .form-check-input:checked { background-color: #18cbbe; border-color: #18cbbe; }\n"))};const N=e=>String(null!=e?e:"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e])),z=e=>{let{quizTitle:t,name:r,email:o,score:l,maxPossibleScore:n,insightName:a,insight:i,nextSteps:s,answers:u}=e;return`\n<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;">\n\t<h2 style="color:#111;border-bottom:2px solid #eee;padding-bottom:8px;">\n\t\t${N(t)} â Results\n\t</h2>\n\n\t<p style="font-size:16px;"><strong>Name:</strong> ${N(r)}</p>\n\t<p style="font-size:16px;"><strong>Email:</strong> ${N(o)}</p>\n\t<p style="font-size:16px;"><strong>Score:</strong> ${N(l)} / ${N(n)}</p>\n\n\t${a?`\n\t\t<p style="font-size:16px;"><strong>Result:</strong> ${N(a)}</p>\n\t`:""}\n\n\t${i?`\n\t\t<div style="font-size:15px;line-height:1.5;margin-bottom:12px;">\n\t\t\t<strong>Insight:</strong><br/>\n\t\t\t${i}\n\t\t</div>\n\t`:""}\n\n\t${s?`\n\t\t<div style="font-size:15px;line-height:1.5;margin-bottom:12px;">\n\t\t\t<strong>Next Steps:</strong><br/>\n\t\t\t${s}\n\t\t</div>\n\t`:""}\n\n\t<table style="width:100%;border-collapse:collapse;margin-top:16px;">\n\t\t<thead>\n\t\t\t<tr>\n\t\t\t\t<th style="text-align:left;padding:8px;border-bottom:1px solid #ddd;background:#f7f7f7;">Question</th>\n\t\t\t\t<th style="text-align:left;padding:8px;border-bottom:1px solid #ddd;background:#f7f7f7;">Answer</th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t${(u||[]).map(e=>`\n\t\t\t\t<tr>\n\t\t\t\t\t<td style="padding:8px;border-bottom:1px solid #eee;">${N(e.question)}</td>\n\t\t\t\t\t<td style="padding:8px;border-bottom:1px solid #eee;">${N(e.answer_label)}</td>\n\t\t\t\t</tr>\n\t\t\t`).join("")}\n\t\t</tbody>\n\t</table>\n</div>\n`.trim()};var A=e=>{let{webhookUrl:t,quizTitle:r,quizSlug:o,score:l,maxPossibleScore:a,answers:i,totalQuestions:m,insightName:p,insight:g,nextSteps:h,onSuccess:b,onBack:f,primaryColour:v,secondaryColour:x,primaryTextColour:C,secondaryTextColour:E,formFieldBorderColour:w,formFieldTextColour:q,formFieldPlaceholderColour:k,formFieldActiveBorderColour:N}=e;const A=[w&&`.quiz-email-capture-form .form-control { border-color: ${w} !important; }`,q&&`.quiz-email-capture-form .form-control { color: ${q} !important; }`,k&&`.quiz-email-capture-form .form-control::placeholder { color: ${k} !important; opacity: 1; }`,N&&`.quiz-email-capture-form .form-control:focus { border-color: ${N} !important; box-shadow: none; }
1`].filter(Boolean).join("\n"),{0:T,1:S}=(0,n.useState)(""),{0:$,1:_}=(0,n.useState)(""),{0:L,1:P}=(0,n.useState)(!1),{0:R,1:B}=(0,n.useState)("");return n.createElement(n.Fragment,null,n.createElement("section",{className:"quiz-email-capture-section py-5"},n.createElement(s.A,{className:"quiz-email-capture-container"},n.createElement(u.A,{className:"quiz-email-capture-row justify-content-center"},n.createElement(c.A,{xs:12,md:8,lg:6,className:"quiz-email-capture-col"},n.createElement("h1",{className:"quiz-email-capture-heading text-center mb-4",style:{color:E}},"Get Your Results"),n.createElement("p",{className:"quiz-email-capture-description text-center mb-4",style:{color:E}},"Enter your details below to see your personalised quiz results."),n.createElement(y.A,{className:"quiz-email-capture-form",onSubmit:async e=>{var n;if((e.preventDefault(),!R)&&!(T&&(n=T,!/\s/.test(n)&&n.length>12||/(https?:\/\/|www\.)/i.test(n))))if(T&&$){P(!0);try{if(t){const e=await fetch("/.netlify/functions/submit-lead",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({webhookUrl:t,name:T,email:$,nameField:"Name",emailField:"Email",quiz_title:r,quiz_slug:o,score:l,total_questions:m,category:null!=p?p:null,insight_text:null!=g?g:null,next_steps:null!=h?h:null,answers:i,categoryName:null!=p?p:null,insightText:null!=g?g:null,nextSteps:null!=h?h:null,answers_html:z({quizTitle:r,name:T,email:$,score:l,maxPossibleScore:a,insightName:p,insight:g,nextSteps:h,answers:i})})});if(!e.ok){const t=await e.text();throw new Error(`Webhook responded ${e.status}: ${t}`)}}}catch(s){console.error("Webhook submission error:",s)}finally{P(!1),b()}}else alert("Please fill in all fields")}},n.createElement("input",{type:"text",name:"website",value:R,tabIndex:-1,autoComplete:"off","aria-hidden":"true",onChange:e=>B(e.target.value),style:{position:"absolute",left:"-9999px",width:"1px",height:"1px",overflow:"hidden"}}),n.createElement(y.A.Group,{className:"quiz-email-capture-form-group-name mb-3"},n.createElement(y.A.Label,{className:"quiz-email-capture-label-name",style:{color:E}},"Name"),n.createElement(y.A.Control,{type:"text",placeholder:"Your name",value:T,onChange:e=>S(e.target.value),required:!0,className:"quiz-email-capture-input-name py-3"})),n.createElement(y.A.Group,{className:"quiz-email-capture-form-group-email mb-4"},n.createElement(y.A.Label,{className:"quiz-email-capture-label-email",style:{color:E}},"Email"),n.createElement(y.A.Control,{type:"email",placeholder:"[email protected]",value:$,onChange:e=>_(e.target.value),required:!0,className:"quiz-email-capture-input-email py-3"})),n.createElement(u.A,{className:"g-3"},n.createElement(c.A,{xs:6},n.createElement(d.A,{onClick:f,className:"quiz-email-capture-back-button w-100 py-3",type:"button",style:{background:x,color:E,borderColor:x}},"Back")),n.createElement(c.A,{xs:6},n.createElement(d.A,{variant:"primary",type:"submit",disabled:L,className:"quiz-email-capture-submit-button w-100 py-3",style:{background:v,color:C}},L?"Submitting...":"See Results")))))))),A&&n.createElement("style",null,A))},T=function(e,t){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},T(e,t)};function S(e){var t=e.className,r=e.counterClockwise,o=e.dashRatio,l=e.pathRadius,a=e.strokeWidth,i=e.style;return(0,n.createElement)("path",{className:t,style:Object.assign({},i,_({pathRadius:l,dashRatio:o,counterClockwise:r})),d:$({pathRadius:l,counterClockwise:r}),strokeWidth:a,fillOpacity:0})}function $(e){var t=e.pathRadius,r=e.counterClockwise?1:0;return"\n M 50,50\n m 0,-"+t+"\n a "+t+","+t+" "+r+" 1 1 0,"+2*t+"\n a "+t+","+t+" "+r+" 1 1 0,-"+2*t+"\n "}function _(e){var t=e.counterClockwise,r=e.dashRatio,o=e.pathRadius,l=2*Math.PI*o,n=(1-r)*l;return{strokeDasharray:l+"px "+l+"px",strokeDashoffset:(t?-n:n)+"px"}}var L=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return function(e,t){function r(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}
1(t,e),t.prototype.getBackgroundPadding=function(){return this.props.background?this.props.backgroundPadding:0},t.prototype.getPathRadius=function(){return 50-this.props.strokeWidth/2-this.getBackgroundPadding()},t.prototype.getPathRatio=function(){var e=this.props,t=e.value,r=e.minValue,o=e.maxValue;return(Math.min(Math.max(t,r),o)-r)/(o-r)},t.prototype.render=function(){var e=this.props,t=e.circleRatio,r=e.className,o=e.classes,l=e.counterClockwise,a=e.styles,i=e.strokeWidth,s=e.text,u=this.getPathRadius(),c=this.getPathRatio();return(0,n.createElement)("svg",{className:o.root+" "+r,style:a.root,viewBox:"0 0 100 100","data-test-id":"CircularProgressbar"},this.props.background?(0,n.createElement)("circle",{className:o.background,style:a.background,cx:50,cy:50,r:50}):null,(0,n.createElement)(S,{className:o.trail,counterClockwise:l,dashRatio:t,pathRadius:u,strokeWidth:i,style:a.trail}),(0,n.createElement)(S,{className:o.path,counterClockwise:l,dashRatio:c*t,pathRadius:u,strokeWidth:i,style:a.path}),s?(0,n.createElement)("text",{className:o.text,style:a.text,x:50,y:50},s):null)},t.defaultProps={background:!1,backgroundPadding:0,circleRatio:1,classes:{root:"CircularProgressbar",trail:"CircularProgressbar-trail",path:"CircularProgressbar-path",text:"CircularProgressbar-text",background:"CircularProgressbar-background"},counterClockwise:!1,className:"",maxValue:100,minValue:0,strokeWidth:8,styles:{root:{},trail:{},path:{},text:{},background:{}},text:""},t}(n.Component);function P(e){return Object.keys(e).forEach(function(t){null==e[t]&&delete e[t]}),e}var R=e=>{let{resultsHeading:t,resultsSubheading:r,score:o,maxPossibleScore:l,totalQuestions:a,scorecardAssessments:i,discoveryCallIframe:d,primaryColour:m,secondaryColour:g,primaryTextColour:y,secondaryTextColour:h,progressTrailColour:b,resultsSectionBackgroundColour:f}=e;const v=null==i?void 0:i.find(e=>o>=e.scoreRangeLow&&o<=e.scoreRangeHigh);return n.createElement("section",{className:"quiz-results-section pb-5"},n.createElement(u.A,{className:"quiz-results-header-row justify-content-center py-5 px-4 px-md-7",style:{backgroundColor:m}},n.createElement(c.A,{xs:12,lg:10,className:"quiz-results-header-col"},t&&n.createElement("h1",{className:"quiz-results-heading text-center mb-3",style:{color:y}},t),r&&n.createElement("p",{className:"quiz-results-subheading text-center mb-4",style:{color:y}},r))),n.createElement("hr",{className:"mt-2",style:{borderTopWidth:"3px",borderColor:m}}),n.createElement(s.A,{className:"quiz-results-container mt-5"},n.createElement(u.A,{className:"quiz-results-score-row justify-content-center"},n.createElement(c.A,{xs:12,lg:10,className:"quiz-results-score-col rounded py-4 py-md-5 px-4 px-md-5"},n.createElement("div",{className:"quiz-results-score-chart",style:{width:"200px",maxWidth:"100%",margin:"0 auto 2rem"}},n.createElement(L,{value:o,maxValue:l,text:`${Math.round(o/l*100)}%`,styles:(x={textSize:"20px",textColor:m,pathColor:m,trailColor:b||"#e0e0e0"},C=x.rotation,E=x.strokeLinecap,w=x.textColor,q=x.textSize,k=x.pathColor,N=x.pathTransition,z=x.pathTransitionDuration,A=x.trailColor,T=x.backgroundColor,S=null==C?void 0:"rotate("+C+"turn)",$=null==C?void 0:"center center",{root:{},path:P({stroke:k,strokeLinecap:E,transform:S,transformOrigin:$,transition:N,transitionDuration:null==z?void 0:z+"s"}),trail:P({stroke:A,strokeLinecap:E,transform:S,transformOrigin:$}),text:P({fill:w,fontSize:q}),background:P({fill:T})})}),n.createElement("p",{className:"quiz-results-score-label text-center mt-3 mb-2",style:{color:m}},n.createElement("strong",null,o," out of ",l))),(null==v?void 0:v.insightName)&&n.createElement("h3",{className:"quiz-results-insight-name text-center mb-0",style:{color:m}},v.insightName))),n.createElement(u.A,{className:"quiz-results-detail-row justify-content-center mt-4"},n.createElement(c.A,{xs:12,lg:10,className:"quiz-results-detail-col border-2 rounded py-4 py-md-5 px-md-5",style:f?{backgroundColor:f}:{}},v?n.createElement(n.Fragment,null,n.createElement("h3",{className:"quiz-results-score-value mb-md-4",style:{color:h}},"Your Score: ",o),v.insight&&n.createElement("div",{className:"quiz-results-category mb-4"},n.createElement("h4",{className:"quiz-results-category-heading"},"Insight:"),n.createElement(p.s,{htmlContent:v.insight})),v.nextSteps&&n.createElement("div",{className:"quiz-results-next-steps mb-4"},n.createElement("h4",{className:"mb-3"}
1,"Next Steps:"),n.createElement(p.s,{htmlContent:v.nextSteps}))):n.createElement("div",{className:"alert alert-info"},n.createElement("p",{className:"mb-0"},"Thank you for completing the quiz! We're processing your results."))),n.createElement(c.A,{xs:12,lg:10,className:"quiz-results-cta-col mt-4 mt-md-5"},n.createElement("h2",{className:"quiz-results-cta-heading text-center",style:y?{color:y}:{}},"LET'S TALK ABOUT YOUR RESULTS"),n.createElement("p",{className:"quiz-results-cta-description text-center mb-md-4"},n.createElement("strong",null,"Book your time slot below")),d&&n.createElement("div",{className:"quiz-results-booking-container mt-4 iframe-container"},n.createElement("div",{dangerouslySetInnerHTML:{__html:d}}))))),n.createElement("style",null,"\n\t\t\t\t.iframe-container {\n\t\t\t\t\tposition: relative;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.iframe-container iframe {\n\t\t\t\t\twidth: 100% !important;\n\t\t\t\t\tmin-height: 1000px;\n\t\t\t\t\theight: auto;\n\t\t\t\t\tborder: none;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t@media (max-width: 768px) {\n\t\t\t\t\t.iframe-container iframe {\n\t\t\t\t\t\tmin-height: 900px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"));var x,C,E,w,q,k,N,z,A,T,S,$};var B=e=>{var t,r,s,u,c,d,m,p;let{data:{wpQuiz:y,site:h}}=e;const b=null==h||null===(t=h.siteMetadata)||void 0===t?void 0:t.siteUrl,{seoFields:f,quizFields:v}=y,{0:x,1:C}=(0,n.useState)("intro"),{0:E,1:w}=(0,n.useState)({}),{0:q,1:N}=(0,n.useState)(0),z=(null==v?void 0:v.questionsAndAnswers)||[],T=z.length,S=(()=>{let e=0;return z.forEach(t=>{let r=0;const l=t.weight||1;switch(null==v?void 0:v.quizAnswerType){case"multiple_choice":if(t.mcAllowMultiple){var n;null===(n=t.options)||void 0===n||n.forEach(e=>{r+=(null==e?void 0:e.score)||0})}else{var a;const e=(null===(a=t.options)||void 0===a?void 0:a.map(e=>(null==e?void 0:e.score)||0))||[0];r=Math.max.apply(Math,(0,o.A)(e))}break;case"scale_0_10":if(t.valueScoreMap&&t.valueScoreMap.length>0){const e=t.valueScoreMap.map(e=>e.score||0);r=Math.max.apply(Math,(0,o.A)(e))}else{const e=t.maxValue||10;r=e*(t.pointsPerUnit||1)}break;case"true_false":r=Math.max(t.scoreIfTrue||0,t.scoreIfFalse||0)}e+=r*l}),e})();(0,n.useEffect)(()=>{const e=$();N(e)},[E,z,null==v?void 0:v.quizAnswerType]);const $=()=>{let e=0;return z.forEach((t,r)=>{var o;const l=E[r];if(null==l)return;let n=0;const a=t.weight||1;switch(null==v?void 0:v.quizAnswerType){case"multiple_choice":if(t.mcAllowMultiple)Array.isArray(l)&&l.forEach(e=>{var r;const o=null===(r=t.options)||void 0===r?void 0:r[e];n+=(null==o?void 0:o.score)||0});else{var i;const e=null===(i=t.options)||void 0===i?void 0:i[l];n=(null==e?void 0:e.score)||0}break;case"scale_0_10":const e=null===(o=t.valueScoreMap)||void 0===o?void 0:o.find(e=>e.value===l);n=e?e.score:l*(t.pointsPerUnit||1);break;case"true_false":n=!0===l?t.scoreIfTrue||0:t.scoreIfFalse||0}e+=n*a}),e},_=()=>{C("question-0")},L=()=>{C("results")},P=()=>{C("question-"+(T-1))},B={"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:"1",name:"Home",item:{url:`${b}`,id:`${b}`}},{"@type":"ListItem",position:"2",name:"Quiz",item:{url:`${b}/quiz`,id:`${b}/quiz`}},{"@type":"ListItem",position:"3",name:`${(null==f?void 0:f.metaTitle)||y.title}`,item:{url:`${b}/quiz/${y.slug}`,id:`${b}/quiz/${y.slug}`}}]},I=z.map((e,t)=>({question:e.question,answer:E[t],answer_label:M(e,E[t]),question_score:O(e,E[t],t)})),j=null==v||null===(r=v.scorecardAssessments)||void 0===r?void 0:r.find(e=>q>=e.scoreRangeLow&&q<=e.scoreRangeHigh);function M(e,t){var r,o,l;if(null==t)return"";switch(null==v?void 0:v.quizAnswerType){case"multiple_choice":return e.mcAllowMultiple&&Array.isArray(t)?t.map(t=>{var r,o;return null===(r=e.options)||void 0===r||null===(o=r[t])||void 0===o?void 0:o.optionLabel}).filter(Boolean).join(", "):null!==(r=null===(o=e.options)||void 0===o||null===(l=o[t])||void 0===l?void 0:l.optionLabel)&&void 0!==r?r:String(t);case"true_false":return!0===t?e.labelTrue||"Yes":e.labelFalse||"No";default:return String(t)}}function O(e,t,r){var o;if(null==t)return 0;let l=0;const n=e.weight||1;switch(null==v?void 0:v.quizAnswerType){case"multiple_choice":if(e.mcAllowMultiple&&Array.isArray(t))t.forEach(t=>{var r;const o=null===(r=e.options)||void 0===r?void 0:r[t];l+=(null==o?void 0:o.score)||0});else{var a;const r=null===(a=e.options)||void 0===a?void 0:a[t];l=(null==r?void 0:r.score)||0}break;case"scale_0_10":const r=null===(o=e.valueScoreMap)||void 0===o?void 0:o.find(e=>e.value===t);l=r?r.score:t*(e.pointsPerUnit||1);break;case"true_false":l=!0===t?e.scoreIfTrue||0:e.scoreIfFalse||0}return l*n}return n.createElement(i.A,null,n.createElement(a.Helmet,null,n.createElement("script",{type:"application/ld+json"},JSON.stringify(B))),n.createElement(l.GatsbySeo,{title:(null==f?void 0:f.metaTitle)||(null==y?void 0:y.title),description:null==f?void 0:f.metaDescription,language:"en",openGraph:{type:"website",url:`${b}/quiz/${y.slug}`,title:`${(null==f?void 0:f.opengraphTitle)||(null==y?void 0:y.title)}`,description:`${null==f?void 0:f.opengraphDescription}`,images:[{url:`${null==f||null===(s=f.image)||void 0===s?void 0:s.sourceUrl}`,width:`${null==f||null===(u=f.image)||void 0===u||null===(c=u.mediaDetails)||void 0===c?void 0:c.width}`,height:`${null==f||null===(d=f.image)||void 0===d||null===(m=d.mediaDetails)||void 0===m?void 0:m.height}`,alt:`${null==f||null===(p=f.image)||void 0===p?void 0:p.altText}`}]}}),(()=>{if("intro"===x)return n.createElement(g,{title:null==v?void 0:v.title,de
1scription:null==v?void 0:v.descriptionOfQuiz,benefits:null==v?void 0:v.benefitsOfQuiz,disclaimer:null==v?void 0:v.disclaimerText,cta:null==v?void 0:v.cta,onStart:_,primaryColour:null==v?void 0:v.primaryColour,secondaryColour:null==v?void 0:v.secondaryColour,primaryTextColour:null==v?void 0:v.primaryTextColour,secondaryTextColour:null==v?void 0:v.secondaryTextColour,customCss:null==v?void 0:v.customCss});if("email"===x)return n.createElement(A,{webhookUrl:null==v?void 0:v.webhookUrl,quizTitle:y.title,quizSlug:y.slug,score:q,maxPossibleScore:S,answers:I,totalQuestions:T,insightName:null==j?void 0:j.insightName,insight:null==j?void 0:j.insight,nextSteps:null==j?void 0:j.nextSteps,onSuccess:L,onBack:P,primaryColour:null==v?void 0:v.primaryColour,secondaryColour:null==v?void 0:v.secondaryColour,primaryTextColour:null==v?void 0:v.primaryTextColour,secondaryTextColour:null==v?void 0:v.secondaryTextColour,formFieldBorderColour:null==v?void 0:v.formFieldBorderColour,formFieldTextColour:null==v?void 0:v.formFieldTextColour,formFieldPlaceholderColour:null==v?void 0:v.formFieldPlaceholderColour,formFieldActiveBorderColour:null==v?void 0:v.formFieldActiveBorderColour});if("results"===x)return n.createElement(R,{resultsHeading:null==v?void 0:v.resultsHeading,resultsSubheading:null==v?void 0:v.resultsSubheading,score:q,maxPossibleScore:S,totalQuestions:T,scorecardAssessments:null==v?void 0:v.scorecardAssessments,discoveryCallIframe:null==v?void 0:v.discoveryCallIframe,primaryColour:null==v?void 0:v.primaryColour,secondaryColour:null==v?void 0:v.secondaryColour,primaryTextColour:null==v?void 0:v.primaryTextColour,secondaryTextColour:null==v?void 0:v.secondaryTextColour,progressTrailColour:null==v?void 0:v.progressTrailColour,resultsSectionBackgroundColour:null==v?void 0:v.resultsSectionBackgroundColour});const e=parseInt(x.split("-")[1]),t=z[e];return t?n.createElement(k,{quizAnswerType:null==v?void 0:v.quizAnswerType,question:t,answer:E[e],onChange:t=>((e,t)=>{w(r=>({...r,[e]:t}))})(e,t),currentQuestion:e+1,totalQuestions:T,onNext:()=>(e=>{const t=z[e],r=E[e];null==t||!t.isRequired||null!=r&&""!==r?C(e<T-1?`question-${e+1}`:"email"):alert("This question is required")})(e),onBack:()=>{var t;C(0===(t=e)?"intro":"question-"+(t-1))},primaryColour:null==v?void 0:v.primaryColour,secondaryColour:null==v?void 0:v.secondaryColour,primaryTextColour:null==v?void 0:v.primaryTextColour,secondaryTextColour:null==v?void 0:v.secondaryTextColour,buttonBackgroundColour:null==v?void 0:v.buttonBackgroundColour,buttonTextColour:null==v?void 0:v.buttonTextColour,buttonBorderColour:null==v?void 0:v.buttonBorderColour,buttonHoverBackgroundColour:null==v?void 0:v.buttonHoverBackgroundColour,buttonHoverTextColour:null==v?void 0:v.buttonHoverTextColour,buttonHoverBorderColour:null==v?void 0:v.buttonHoverBorderColour}):null})(),n.createElement("style",null,`${null==v?void 0:v.customCss}`))}}}]); 2//# sourceMappingURL=component---src-templates-quiz-js-2e7926c6828f8ca08ce3.js.map
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.