Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@britannica/quiz-components

Package Overview
Dependencies
Maintainers
5
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@britannica/quiz-components - npm Package Compare versions

Comparing version 1.0.0-beta.7 to 1.0.0-beta.8

2

dist/quiz-components.cjs.production.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("deepmerge"),t=require("react"),r=require("react-router-dom"),a=require("classnames"),n=require("react-responsive");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),c=l(t),s=l(a),u=t.createContext({}),i=u.Provider,d=function(){return d=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},d.apply(this,arguments)};function f(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function m(e,t,r,a){return new(r||(r=Promise))((function(n,l){function o(e){try{s(a.next(e))}catch(e){l(e)}}function c(e){try{s(a.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((a=a.apply(e,t||[])).next())}))}function p(e,t){var r,a,n,l,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return l={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function c(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,a&&(n=2&l[0]?a.return:l[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,l[1])).done)return n;switch(a=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,a=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){o.label=l[1];break}if(6===l[0]&&o.label<n[1]){o.label=n[1],n=l;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(l);break}n[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],a=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(e,t,r){if(r||2===arguments.length)for(var a,n=0,l=t.length;n<l;n++)!a&&n in t||(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var v,h={responseIndexes:[],correctResponses:0,currentQuestionIndex:0,restarted:!1,totalCorrectScore:0,totalScore:0,totalTimerScore:0,timerEnabled:!0,user:null,getLeaderboardResults:function(){return m(void 0,void 0,void 0,(function(){return p(this,(function(e){return[2,[]]}))}))},dispatch:function(){}};function E(e,t){switch(t.type){case v.SetCorrectIndexes:return d(d({},e),{responseIndexes:t.payload});case v.SetCorrectResponses:return d(d({},e),{correctResponses:t.payload});case v.setCurrentQuestionIndex:return d(d({},e),{currentQuestionIndex:t.payload});case v.SetRestarted:return d(d({},e),{correctResponses:h.correctResponses,currentQuestionIndex:h.currentQuestionIndex,responseIndexes:h.responseIndexes,restarted:!0,totalCorrectScore:h.totalCorrectScore,totalScore:h.totalScore,totalTimerScore:h.totalTimerScore});case v.setTotalCorrectScore:return d(d({},e),{totalCorrectScore:t.payload});case v.SetTotalScore:return d(d({},e),{totalScore:t.payload});case v.setTotalTimerScore:return d(d({},e),{totalTimerScore:t.payload});case v.SetTimerEnabled:return d(d({},e),{timerEnabled:t.payload});default:throw new Error("Please make sure to use the right action type reducer.")}}!function(e){e[e.SetCorrectIndexes=0]="SetCorrectIndexes",e[e.SetCorrectResponses=1]="SetCorrectResponses",e[e.setCurrentQuestionIndex=2]="setCurrentQuestionIndex",e[e.SetRestarted=3]="SetRestarted",e[e.setTotalCorrectScore=4]="setTotalCorrectScore",e[e.SetTotalScore=5]="SetTotalScore",e[e.setTotalTimerScore=6]="setTotalTimerScore",e[e.SetTimerEnabled=7]="SetTimerEnabled"}(v||(v={}));var y,x,g=t.createContext(h),w=function(e){var r=e.children,a=e.value,n=t.useReducer(E,h),l=n[0],o=n[1];return c.default.createElement(g.Provider,{value:d(d(d({},l),a),{dispatch:o})},r)},S={quizContainer:"eb-16RLBn"},N=t.createContext(S),I=N.Provider;function C(){var e=t.useState(!1),r=e[0],a=e[1];return t.useEffect((function(){void 0!==window.gtag&&a(!0)}),[]),{event:t.useCallback((function(e,t){r&&window.gtag("event",e,t)}),[r])}}function O(){return t.useContext(u)}function j(){return t.useContext(g)}exports.Template=void 0,(y=exports.Template||(exports.Template={})).TextMultipleChoice="TEXT_MULTIPLE_CHOICE",y.ImageMultipleChoice="IMAGE_MULTIPLE_CHOICE",exports.Breakpoint=void 0,(x=exports.Breakpoint||(exports.Breakpoint={}))[x.XsMin=0]="XsMin",x[x.XsMax=671]="XsMax",x[x.SmMin=672]="SmMin",x[x.SmMax=959]="SmMax",x[x.MdMin=960]="MdMin",x[x.MdMax=1247]="MdMax",x[x.LgMin=1248]="LgMin",x[x.LgMax=1399]="LgMax",x[x.XlMin=1400]="XlMin";var _={Box:"eb-ASYLqS",snowBackground:"eb-ZLkp2m",whiteBackground:"eb-DGfpHy",iceBackground:"eb-Nvt3tb",rainBorder:"eb-cMrTGF",grayBorder:"eb-94S9mY",rounded:"eb-GHgeM2",shadow:"eb-PiP0Bt"},T=function(e){var t,r,a=e.children,n=e.className,l=e.backgroundColor,o=void 0===l?"white":l,u=e.borderColor,i=void 0===u?"gray":u,m=e.rounded,p=void 0!==m&&m,b=e.shadow,v=void 0!==b&&b,h=f(e,["children","className","backgroundColor","borderColor","rounded","shadow"]);return c.default.createElement("div",d({className:s.default(_.Box,(t={},t[_.rounded]=p,t),(r={},r[_.shadow]=v,r),_["".concat(o,"Background")],_["".concat(i,"Border")],n),"data-testid":"Box"},h),a)},k=t.lazy((function(){return Promise.resolve().then((function(){return or}))})),R=function(e){return c.default.createElement(t.Suspense,{fallback:null},c.default.createElement(k,d({},e)))},P=t.lazy((function(){return Promise.resolve().then((function(){return yr}))})),M=function(e){return c.default.createElement(t.Suspense,{fallback:null},c.default.createElement(P,d({},e)))},L=t.lazy((function(){return Promise.resolve().then((function(){return na}))})),z=function(e){return c.default.createElement(t.Suspense,{fallback:null},c.default.createElement(L,d({},e)))},q=function(){return c.default.createElement(r.MemoryRouter,null,c.default.createElement(r.Routes,null,c.default.createElement(r.Route,{path:"/",element:c.default.createElement(M,null)}),c.default.createElement(r.Route,{path:"/:questionId",element:c.default.createElement(z,null)}),c.default.createElement(r.Route,{path:"/results",element:c.default.createElement(R,null)})))},V=function(e){var r=e.template,a=t.useContext(N).quizContainer,n=C().event,l=O(),o=l.id,s=l.questions,u=l.type,i=j(),d=i.correctResponses,f=i.restarted,m=i.responseIndexes;return t.useEffect((function(){function e(){m.length<s.length&&n("quiz_abandoned",{quiz_id:o,questions_answered:m.length,restarted:f,correct_responses:d,quiz_type:u.toString(),total_questions:s.length})}return window.addEventListener("beforeunload",e),function(){return window.removeEventListener("beforeunload",e)}}),[o,m,d,s.length,n,f,u]),c.default.createElement(T,{className:a,borderColor:"rain",rounded:!0,"data-testid":"TemplateLoader"},r===exports.Template.TextMultipleChoice&&c.default.createElement(q,null))},B=function(e){var t=e.data,r=e.template,a=e.theme,n=void 0===a?{}:a,l=e.user,s=e.onLeaderboardResults;return c.default.createElement(I,{value:o.default(S,n)},c.default.createElement(i,{value:t},c.default.createElement(w,{value:{getLeaderboardResults:s,user:l}},c.default.createElement(V,{template:r}))))},G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})})),r}var F,H={},Q={exports:{}},D={};function U(){if(F)return D;F=1;var e=c.default,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function o(e,r,o){var c,s={},u=null,i=null;for(c in void 0!==o&&(u=""+o),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(i=r.ref),r)a.call(r,c)&&!l.hasOwnProperty(c)&&(s[c]=r[c]);if(e&&e.defaultProps)for(c in r=e.defaultProps)void 0===s[c]&&(s[c]=r[c]);return{$$typeof:t,type:e,key:u,ref:i,props:s,_owner:n.current}}return D.Fragment=r,D.jsx=o,D.jsxs=o,D}function W(e,t){if(!t)return e;var r=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(a,n){return r.call(t,n)&&t[n]&&(a="".concat(a," ").concat(e,"--").concat(n)),a}),e)}function X(e){return function(t,r){return t?"string"!=typeof t?W(e,t):W("".concat(e,"__").concat(t),r):e}}Q.exports=U();var Z=function(){return Z=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Z.apply(this,arguments)},Y=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r},K=X("rmd-icon"),J=t.forwardRef((function(e,t){var r=e.className,a=e.children,n=e["aria-hidden"],l=void 0===n||n,o=e.dense,c=void 0!==o&&o,u=e.iconClassName,i=void 0===u?"material-icons":u,d=e.forceSize,f=void 0!==d&&d,m=e.forceFontSize,p=void 0!==m&&m,b=Y(e,["className","children","aria-hidden","dense","iconClassName","forceSize","forceFontSize"]);return Q.exports.jsx("i",Z({},b,{"aria-hidden":l,ref:t,className:s.default(K({font:!0,dense:c,"forced-font":p,"forced-size":f}),i,r)},{children:a}))})),$=function(){return $=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},$.apply(this,arguments)},ee=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r},te=X("rmd-icon"),re=t.forwardRef((function(e,t){var r=e["aria-hidden"],a=void 0===r||r,n=e.focusable,l=void 0===n?"false":n,o=e.xmlns,c=void 0===o?"http://www.w3.org/2000/svg":o,u=e.viewBox,i=void 0===u?"0 0 24 24":u,d=e.dense,f=void 0!==d&&d,m=e.className,p=e.use,b=e.children,v=ee(e,["aria-hidden","focusable","xmlns","viewBox","dense","className","use","children"]),h=b;return!h&&p&&(h=Q.exports.jsx("use",{xlinkHref:p})),Q.exports.jsx("svg",$({},v,{"aria-hidden":a,ref:t,className:s.default(te({svg:!0,dense:f}),m),focusable:l,xmlns:c,viewBox:i},{children:h}))})),ae=function(){return ae=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ae.apply(this,arguments)};var ne=function(){return ne=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ne.apply(this,arguments)},le=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r},oe=X("rmd-icon-rotator"),ce=t.forwardRef((function(e,r){var a=e.style,n=e.className,l=e.animate,o=void 0===l||l,c=e.rotated,u=e.children,i=e.forceIconWrap,d=void 0!==i&&i,f=le(e,["style","className","animate","rotated","children","forceIconWrap"]),m=s.default(oe({animate:o,rotated:c}),n);if(!d&&t.isValidElement(u)){var p=t.Children.only(u);return t.cloneElement(p,{className:s.default(m,p.props.className)})}return Q.exports.jsx("span",ne({},f,{style:a,className:m,ref:r},{children:u}))})),se=function(){return se=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},se.apply(this,arguments)},ue={back:Q.exports.jsx(J,{children:"keyboard_arrow_left"}),checkbox:Q.exports.jsx(J,{children:"check_box"}),upload:Q.exports.jsx(J,{children:"file_upload"}),dropdown:Q.exports.jsx(J,{children:"arrow_drop_down"}),error:Q.exports.jsx(J,{children:"error_outline"}),expander:Q.exports.jsx(J,{children:"keyboard_arrow_down"}),forward:Q.exports.jsx(J,{children:"keyboard_arrow_right"}),menu:Q.exports.jsx(J,{children:"menu"}),notification:Q.exports.jsx(J,{children:"notifications"}),password:Q.exports.jsx(J,{children:"remove_red_eye"}),radio:Q.exports.jsx(J,{children:"radio_button_checked"}),selected:Q.exports.jsx(J,{children:"check"}),sort:Q.exports.jsx(J,{children:"arrow_upward"})},ie=t.createContext(ue),de=ie.Provider;var fe=A(Object.freeze({__proto__:null,FontIcon:J,SVGIcon:re,TextIconSpacing:function(e){var r,a=e.className,n=e.icon,l=e.children,o=void 0===l?null:l,c=e.stacked,u=void 0!==c&&c,i=e.iconAfter,d=void 0!==i&&i,f=e.flexReverse,m=void 0!==f&&f,p=e.forceIconWrap,b=void 0!==p&&p,v=e.beforeClassName,h=void 0===v?"rmd-icon--before":v,E=e.afterClassName,y=void 0===E?"rmd-icon--after":E,x=e.aboveClassName,g=void 0===x?"rmd-icon--above":x,w=e.belowClassName,S=void 0===w?"rmd-icon--below":w;if(!n)return Q.exports.jsx(Q.exports.Fragment,{children:o});var N=m?!d:d,I=s.default(((r={})[h]=!u&&!N,r[y]=!u&&N,r[g]=u&&!N,r[S]=u&&N,r),a),C=n,O=o;if(!b&&t.isValidElement(n)){var j=t.Children.only(n);C=t.cloneElement(j,{className:s.default(I,j.props.className)})}else n&&(C=Q.exports.jsx("span",ae({className:s.default("rmd-text-icon-spacing",I)},{children:n})));return C&&(O=Q.exports.jsxs(Q.exports.Fragment,{children:[!d&&C,o,d&&C]})),Q.exports.jsx(Q.exports.Fragment,{children:O})},IconRotator:ce,useIcon:function(e,r){var a=t.useContext(ie);return void 0!==r?r:a[e]},IconProvider:function(e){var r=e.children,a=e.back,n=void 0===a?ue.back:a,l=e.checkbox,o=void 0===l?ue.checkbox:l,c=e.dropdown,s=void 0===c?ue.dropdown:c,u=e.expander,i=void 0===u?ue.expander:u,d=e.error,f=void 0===d?ue.error:d,m=e.forward,p=void 0===m?ue.forward:m,b=e.menu,v=void 0===b?ue.menu:b,h=e.notification,E=void 0===h?ue.notification:h,y=e.password,x=void 0===y?ue.password:y,g=e.radio,w=void 0===g?ue.radio:g,S=e.selected,N=void 0===S?ue.selected:S,I=e.sort,C=void 0===I?ue.sort:I,O=e.upload,j=void 0===O?ue.upload:O,_=t.useMemo((function(){return{back:n,checkbox:o,dropdown:s,error:f,expander:i,forward:p,menu:v,notification:E,password:x,radio:w,selected:N,sort:C,upload:j}}),[n,o,s,f,i,p,v,E,x,w,N,C,j]);return Q.exports.jsx(de,se({value:_},{children:r}))}})),me=G&&G.__assign||function(){return me=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},me.apply(this,arguments)};Object.defineProperty(H,"__esModule",{value:!0});var pe=H.LightbulbOutlineSVGIcon=void 0,be=Q.exports,ve=c.default,he=fe;pe=H.LightbulbOutlineSVGIcon=(0,ve.forwardRef)((function(e,t){return(0,be.jsx)(he.SVGIcon,me({},e,{ref:t},{children:(0,be.jsx)("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"})}))}));var Ee={lightbulbIcon:"eb-z4RCtv"},ye=function(e){var t=e.className,r=e.explanation;return c.default.createElement("div",{className:s.default(Ee.explanationContainer,t),"data-testid":"Explanation"},c.default.createElement(pe,{className:s.default(Ee.lightbulbIcon,"mr-4")}),c.default.createElement("span",{className:s.default(Ee.explanation,"m-0"),dangerouslySetInnerHTML:{__html:r}}))},xe="eb-6lGJ0X",ge="eb-hAkxpo",we="eb-HLIy3V",Se="eb-VsNFkm",Ne="eb-6nDHds",Ie="eb-DBAmCC",Ce="eb-HjILKR",Oe=function(){var e=O().questions,t=j().responseIndexes;return c.default.createElement("div",{className:xe,"data-testid":"AnswersTab"},e.map((function(e,r){var a=e.text,n=e.answers,l=e.correctAnswerIndex,o=e.explanation;return c.default.createElement("div",{className:s.default(ge,"mb-32"),key:a},c.default.createElement("div",{className:s.default(we,"font-weight-bold")},r+1),c.default.createElement("div",{className:s.default(Se,"font-weight-bold"),dangerouslySetInnerHTML:{__html:a}}),c.default.createElement("div",{className:Ne},c.default.createElement("div",{className:s.default(l===t[r]?Ce:Ie)},"Your Answer: ",n[t[r]]),c.default.createElement("div",{className:"mt-4"},"Correct Answer: ",n[l]),c.default.createElement(ye,{className:"mt-16",explanation:o})))})))},je={},_e=G&&G.__assign||function(){return _e=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},_e.apply(this,arguments)};Object.defineProperty(je,"__esModule",{value:!0});var Te=je.CheckCircleSVGIcon=void 0,ke=Q.exports,Re=c.default,Pe=fe;Te=je.CheckCircleSVGIcon=(0,Re.forwardRef)((function(e,t){return(0,ke.jsx)(Pe.SVGIcon,_e({},e,{ref:t},{children:(0,ke.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}))}));var Me={},Le=G&&G.__assign||function(){return Le=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Le.apply(this,arguments)};Object.defineProperty(Me,"__esModule",{value:!0});var ze=Me.ReplaySVGIcon=void 0,qe=Q.exports,Ve=c.default,Be=fe;ze=Me.ReplaySVGIcon=(0,Ve.forwardRef)((function(e,t){return(0,qe.jsx)(Be.SVGIcon,Le({},e,{ref:t},{children:(0,qe.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})}))}));var Ge={},Ae=G&&G.__assign||function(){return Ae=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ae.apply(this,arguments)};Object.defineProperty(Ge,"__esModule",{value:!0});var Fe=Ge.AlarmSVGIcon=void 0,He=Q.exports,Qe=c.default,De=fe;Fe=Ge.AlarmSVGIcon=(0,Qe.forwardRef)((function(e,t){return(0,He.jsx)(De.SVGIcon,Ae({},e,{ref:t},{children:(0,He.jsx)("path",{d:"M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})}))}));var Ue="https://9zdy2kcoy6.execute-api.us-east-1.amazonaws.com/dev";function We(){var e=this,r=O(),a=r.categories,n=r.generalAudience,l=r.metadata,o=r.id,c=r.popular,s=r.tightrope,u=r.type,i=r.vocab,d=j(),f=d.getLeaderboardResults,b=d.totalScore,v=t.useState(null),h=v[0],E=v[1],y=t.useState(!1),x=y[0],g=y[1],w=t.useState(!1),S=w[0],N=w[1],I=t.useState(null),C=I[0],_=I[1],T=t.useState(null),k=T[0],R=T[1],P=t.useState(!1),M=P[0],L=P[1],z=t.useState(!1),q=z[0],V=z[1],B=t.useCallback((function(t){return void 0===t&&(t=3),m(e,void 0,void 0,(function(){var e,r,a;return p(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,5,6]),N(!0),[4,fetch("".concat(Ue,"/leaderboard?appId=").concat(l.source,"&quizId=").concat(o,"&limit=").concat(t))];case 1:return[4,n.sent().json()];case 2:return e=n.sent(),[4,f(e)];case 3:return r=n.sent(),E(r),g(!1),[3,6];case 4:return a=n.sent(),console.log(a),g(!0),[3,6];case 5:return N(!1),[7];case 6:return[2]}}))}))}),[f,l,o]),G=t.useCallback((function(t){return m(e,void 0,void 0,(function(){var e,r;return p(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,fetch("".concat(Ue,"/stats/percentile?appId=").concat(l.source,"&quizId=").concat(o,"&userId=").concat(t))];case 1:return[4,a.sent().json()];case 2:return e=a.sent(),_(e.scorePercentile),[3,4];case 3:return r=a.sent(),console.log(r),[3,4];case 4:return[2]}}))}))}),[l.source,o]),A=t.useCallback((function(t,r){return void 0===r&&(r=1),m(e,void 0,void 0,(function(){var e,a,n;return p(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,5,6]),V(!0),[4,fetch("".concat(Ue,"/rank?appId=").concat(l.source,"&quizId=").concat(o,"&userId=").concat(t,"&neighbors=").concat(r))];case 1:return[4,c.sent().json()];case 2:return e=c.sent(),[4,f(e)];case 3:return a=c.sent(),R(a),[3,6];case 4:return n=c.sent(),console.log(n),L(!0),[3,6];case 5:return V(!1),[7];case 6:return[2]}}))}))}),[f,l.source,o]),F=t.useCallback((function(t){return m(e,void 0,void 0,(function(){var e,r;return p(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),console.log("saving user score..."),[4,fetch("".concat(Ue,"/score"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({appId:l.source,quizId:o,score:b,userId:t,metadata:{isGeneralAudience:n,isPopular:c,isTightrope:s,isVocab:i,primaryCategory:a[0].label,type:u,slug:l.slug}})})];case 1:return e=d.sent(),console.log("done",e),[3,3];case 2:return r=d.sent(),console.log(r),[3,3];case 3:return[2]}}))}))}),[a,n,l.source,l.slug,c,o,s,b,u,i]);return{getLeaderboardResults:B,getUserPercentile:G,getUserRankResults:A,saveUserScore:F,leaderboardResults:h,leaderboardResultsError:x,leaderboardResultsLoading:S,userPercentile:C,userRankResults:k,userRankResultsError:M,userRankResultsLoading:q}}function Xe(e){return 10*Math.min(e,10)}function Ze(e,t,r){return r?100*t+Xe(e):100*t}var Ye,Ke="eb-h0JoJS",Je="eb-g0oWRe",$e="eb-cDH2ZZ",et="eb-PMfRkP",tt="eb-6MTWIi",rt="eb-P5IGFV",at="eb-R87VrN",nt="eb-b7udwo",lt="eb-mzexJz";!function(e){e.Left="left",e.Right="right"}(Ye||(Ye={}));var ot,ct=function(e){var r,a,n,l,o,u,i=e.block,m=void 0!==i&&i,p=e.children,b=e.className,v=e.icon,h=e.iconPosition,E=void 0===h?Ye.Left:h,y=e.outline,x=void 0!==y&&y,g=e.shadow,w=void 0!==g&&g,S=e.shadowSm,N=void 0!==S&&S,I=e.superButton,C=void 0!==I&&I,O=e.tag,j=void 0===O?"button":O,_=f(e,["block","children","className","icon","iconPosition","outline","shadow","shadowSm","superButton","tag"]);return c.default.createElement(j,d({className:s.default(Ke,(r={},r[Je]=m,r),(a={},a[et]=v,a),(n={},n[$e]=x,n),(l={},l[at]=w,l),(o={},o[nt]=N,o),(u={},u[lt]=C,u),b),"data-testid":"Button"},_),E===Ye.Left&&v&&t.cloneElement(v,{className:s.default(v.props.className,tt)}),p,E===Ye.Right&&v&&t.cloneElement(v,{className:s.default(v.props.className,rt)}))},st="eb-WrBwzW",ut="eb-LlKpPo",it=function(e){var t,r=e.children,a=e.className,n=e.bgColor,l=void 0===n?void 0:n,o=e.outline;return c.default.createElement("div",{className:s.default(st,(t={},t[ut]=o,t),a),style:{backgroundColor:l},"data-testid":"Badge"},r)},dt="eb-ttCsCh",ft=function(e){var t=e.children,r=e.className,a=f(e,["children","className"]);return c.default.createElement("div",d({className:s.default(dt,r),"data-testid":"ListGroup"},a),t)},mt="eb-Dgd6nO",pt="eb-DkhGFO",bt="eb-kwge39",vt=function(e){var t,r,a=e.children,n=e.active,l=e.className,o=e.justified,u=f(e,["children","active","className","justified"]);return c.default.createElement("div",d({className:s.default(mt,(t={},t[pt]=n,t),(r={},r[bt]=o,r),l),"data-testid":"ListItem"},u),a)},ht="eb-l7tnqS",Et="eb-FQUR34",yt=function(e){var t=e.className,r=e.items,a=e.newScore,n=e.user;return c.default.createElement(ft,{className:t,"data-testid":"Leaderboard"},r.map((function(e,t){var r=e.id,l=e.rank,o=e.name,s=e.score;return c.default.createElement(vt,{key:r,justified:!0,active:r===(null==n?void 0:n.id)},c.default.createElement("div",{className:ht},l||t+1,". ",c.default.createElement("strong",null,o)),c.default.createElement("div",{className:Et},r===(null==n?void 0:n.id)&&a>0&&a>s&&c.default.createElement(it,null,"+",a-s),(new Intl.NumberFormat).format(s)))})))},xt="eb-Hq5iFO",gt="eb-p1vZ3L",wt="eb-8GC4cE",St="eb-rgrfl0",Nt="eb-KmoX7Q",It="eb-z33RWL",Ct="eb-5f5DSo",Ot="eb-RjthEk",jt="eb-lf4O2l",_t="eb-ykC0zi",Tt=function(e){var r=e.onRestartQuiz,a=O().questions,n=j(),l=n.correctResponses,o=n.totalCorrectScore,u=n.totalScore,i=n.totalTimerScore,d=n.user,f=We(),m=f.leaderboardResults,p=f.leaderboardResultsError,b=f.getLeaderboardResults,v=f.getUserPercentile,h=f.getUserRankResults,E=f.userPercentile,y=f.userRankResults,x=f.userRankResultsError;return t.useEffect((function(){d?(h(d.id),v(d.id)):b()}),[v,h,b,d]),t.useEffect((function(){if(d&&(null==y?void 0:y.length)&&!x){var e=y.find((function(e){return e.id===d.id}));!!e&&e.rank<=3||b()}x&&b()}),[b,d,y,x]),c.default.createElement("div",{className:xt,"data-testid":"LeaderboardTab"},c.default.createElement(T,{className:Nt,backgroundColor:"snow",borderColor:"rain",rounded:!0},c.default.createElement("div",{className:gt},c.default.createElement("h2",{className:"mb-4"},"All Quizzes"),c.default.createElement("p",{className:"font-14"},"Total Weekly Points")),m&&c.default.createElement(yt,{className:"mt-20",newScore:u,items:m}),p&&c.default.createElement("p",null,"We're experiencing issues loading the Leaderboard at this time. Please try again later."),y&&c.default.createElement(yt,{className:"mt-20",newScore:u,items:y,user:d}),x&&c.default.createElement("p",null,"We're experiencing issues loading your score at this time. Please try again later.")),c.default.createElement(T,{className:It,backgroundColor:"white",borderColor:"rain",rounded:!0},c.default.createElement("div",{className:s.default(wt,"text-center mb-20")},c.default.createElement("h2",{className:"mb-16"},"This Quiz"),E&&c.default.createElement("p",{className:"mt-16 font-14"},"You scored ",E,"% better than most users!")),c.default.createElement("div",{className:Ct},c.default.createElement("div",null,c.default.createElement("div",{className:"mb-8"},c.default.createElement("div",{className:Ot},c.default.createElement(Te,{className:"mr-4"})," ",c.default.createElement("strong",null,l," Correct")),c.default.createElement("div",null,c.default.createElement("strong",null,o," Points"))),c.default.createElement("div",{className:"mt-16"},c.default.createElement("div",{className:jt},c.default.createElement(Fe,{className:"mr-4"})," ",c.default.createElement("strong",null,"Time Bonus")),c.default.createElement("div",null,c.default.createElement("strong",null,i," Points")))),c.default.createElement("div",{className:"text-center"},c.default.createElement("div",{className:St},c.default.createElement("div",null,c.default.createElement("h1",null,u)),c.default.createElement("div",null,c.default.createElement("strong",null,"POINTS"))),c.default.createElement("div",null,"Of ",function(e){var t=0;return e.forEach((function(e){return t+=100*e.difficulty+100})),t}(a)))),c.default.createElement("div",{className:"text-center mt-28"},c.default.createElement(ct,{icon:c.default.createElement(ze,{className:_t}),onClick:r,outline:!0,shadow:!0},"Play Again"))))},kt="eb-oCfRGq",Rt=function(e){var t=e.children,r=e.className,a=f(e,["children","className"]);return c.default.createElement("a",d({},a,{className:s.default(kt,"font-weight-semi-bold",r)}),t)},Pt=function(){var e=O().nextUpQuiz,t=e.image,r=e.url,a=e.title;return c.default.createElement(T,{borderColor:"rain",className:"mt-20","data-testid":"NextUpQuizCard",rounded:!0,shadow:!0},c.default.createElement("div",{style:{aspectRatio:"16/9"}},c.default.createElement("img",{src:t.fullUrl,alt:t.altText})),c.default.createElement("div",{className:"p-20"},c.default.createElement(Rt,{className:"font-20",href:r},a),c.default.createElement(ct,{tag:"a",href:r,className:"mt-20",block:!0},"Play")))},Mt="eb-NdGzM3",Lt="eb-fQMdMF",zt="eb-i8uKTc",qt="eb-ZBrDqu",Vt="eb-FOeG4W",Bt="eb-fQceh4",Gt="eb-vzHSa2",At="eb-sS9sRH",Ft=function(){var e=j(),t=e.correctResponses,r=e.totalScore,a=O().questions,n=t/a.length*100;return c.default.createElement("div",{className:Mt},c.default.createElement("div",{className:Lt,"data-testid":"ScoreSummaryWheel"},c.default.createElement("div",{className:s.default(Bt,"px-12 py-8 font-weight-semi-bold")},"Congrats!"),c.default.createElement("svg",{viewBox:"0 0 36 36",className:zt},c.default.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:Vt}),c.default.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:qt,strokeDasharray:"".concat(n," 100")})),c.default.createElement("div",{className:s.default(Gt,"text-center")},c.default.createElement("div",{className:s.default(At,"font-weight-super-bold")},t,"/",a.length),c.default.createElement("div",{className:"font-12"},r," points"))))},Ht="eb-od4oX9",Qt="eb-F71AtK",Dt="eb-EM5HVl",Ut="eb-yx3D4X",Wt="eb-0AMT86",Xt=function(e){var t=e.onRestartQuiz,r=n.useMediaQuery({maxWidth:exports.Breakpoint.XsMax}),a=O().title;return c.default.createElement("div",{"data-testid":"ScoreTab",className:Ht},c.default.createElement(T,{className:Qt,borderColor:"rain",backgroundColor:"ice",rounded:!r,shadow:!r},c.default.createElement("div",{className:Dt},c.default.createElement("div",{className:"font-18 font-weight-extra-bold"},a),c.default.createElement(Ft,null),c.default.createElement(ct,{icon:c.default.createElement(ze,{className:Wt}),onClick:t,outline:!0,shadow:!0},"Play Again")),c.default.createElement("div",{className:Ut},c.default.createElement("div",{className:"font-weight-extra-bold font-24"},"Next Up!"),c.default.createElement(Pt,null))))},Zt={activeTabId:"default",setActiveTabId:function(){}},Yt=t.createContext(Zt),Kt=function(e){var r=e.children,a=e.defaultActiveTabId,n=t.useState(a),l=n[0],o=n[1];return c.default.createElement(Yt.Provider,{value:{activeTabId:l,setActiveTabId:o}},r)},Jt="eb-fkZcg2",$t="eb-ntGIO4",er=function(e){var r,a=e.children,n=e.className,l=e.controlFor,o=t.useContext(Yt),u=o.setActiveTabId,i=o.activeTabId===l;return c.default.createElement("button",{className:s.default(Jt,(r={},r[$t]=i,r),n),"data-testid":"Tab",id:"".concat(l,"-tab"),role:"tab","aria-controls":l,"aria-selected":i,tabIndex:i?void 0:-1,onClick:function(){return u(l)}},a)},tr=function(e){var r=e.children,a=e.className,n=e.id,l=f(e,["children","className","id"]);return n===t.useContext(Yt).activeTabId?c.default.createElement("div",d({id:n,className:a,"data-testid":"TabContent",tabIndex:0,role:"tabpanel","aria-labelledby":"".concat(n,"-tab")},l),r):null},rr="eb-ftdu2H",ar=function(e){var t=e.children,r=e.className,a=e.label;return c.default.createElement("div",{className:s.default(rr,r),"data-testid":"Tabs",role:"tablist","aria-label":a},t)},nr="eb-vDPeCr",lr="eb-bMiWKa";!function(e){e.AnswersTab="AnswersTab",e.LeaderboardTab="LeaderboardTab",e.ScoreTab="ScoreTab"}(ot||(ot={}));var or=Object.freeze({__proto__:null,default:function(){var e=O().image,a=j(),n=a.dispatch,l=a.user,o=We().saveUserScore,s=r.useNavigate();function u(){n({type:v.SetRestarted}),s("/")}return t.useEffect((function(){l&&o(l.id)}),[o,l]),c.default.createElement("div",{"data-testid":"ResultsView",className:nr,style:{backgroundImage:"url(".concat(e.fullUrl,")")}},c.default.createElement(Kt,{defaultActiveTabId:ot.ScoreTab},c.default.createElement(ar,{label:"Results View"},c.default.createElement(er,{controlFor:ot.ScoreTab},"Score"),c.default.createElement(er,{controlFor:ot.AnswersTab},"Answers"),c.default.createElement(er,{controlFor:ot.LeaderboardTab},"Leaderboard")),c.default.createElement(tr,{className:lr,id:ot.ScoreTab},c.default.createElement(Xt,{onRestartQuiz:u})),c.default.createElement(tr,{className:lr,id:ot.AnswersTab},c.default.createElement(Oe,null)),c.default.createElement(tr,{className:lr,id:ot.LeaderboardTab},c.default.createElement(Tt,{onRestartQuiz:u}))))}}),cr="eb-8LB0Z6",sr="eb-xrnrMX",ur="eb-uQ6x3r",ir="eb-RTZJDf",dr="eb-nCZamz",fr="eb-XBUSmk",mr="eb-6uIIpF",pr="eb-vaYYcz",br="eb-FGnvGm",vr=function(e){var t=e.children;return c.default.createElement("div",{className:br,"data-testid":"SwitchControl"},t)},hr="eb-FxfgLd",Er=function(e){var t=e.id,r=f(e,["id"]);return c.default.createElement("input",d({id:t,className:hr,type:"checkbox",role:"switch"},r))},yr=Object.freeze({__proto__:null,default:function(){var e=O(),t=e.id,a=e.categories,n=e.image,l=e.title,o=e.timed,u=e.questions,i=j(),d=i.dispatch,f=i.timerEnabled;return c.default.createElement("div",{className:cr,"data-testid":"IntroView",style:{aspectRatio:"900 / 675"}},c.default.createElement("img",{className:sr,src:n.fullUrl,alt:n.altText}),c.default.createElement("div",{className:ur},c.default.createElement(T,{borderColor:"rain",className:s.default(fr,"p-20"),rounded:!0,shadow:!0},c.default.createElement("div",{className:ir},c.default.createElement(it,{className:s.default(dr),bgColor:"var(--qc-ice)",outline:!0},c.default.createElement("span",{className:"font-14"},a[0].label))),c.default.createElement("h1",{className:s.default(pr,"font-weight-semi-bold text-center")},l),c.default.createElement("div",{className:"text-center"},c.default.createElement(ct,{className:"p-28",tag:r.Link,to:"/".concat(t),block:!0,superButton:!0},"Start")),c.default.createElement("div",{className:s.default(mr,"pt-16")},c.default.createElement("div",{className:"font-14 font-weight-semi-bold"},u.length," Questions"),o&&c.default.createElement(vr,null,c.default.createElement("label",{className:"font-14",htmlFor:"toggle"},"Timer Bonus"),c.default.createElement(Er,{id:"".concat(t),defaultChecked:f,onClick:function(){return d({type:v.SetTimerEnabled,payload:!f})}}))))))}}),xr={},gr=G&&G.__assign||function(){return gr=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},gr.apply(this,arguments)};Object.defineProperty(xr,"__esModule",{value:!0});var wr=xr.ArrowForwardSVGIcon=void 0,Sr=Q.exports,Nr=c.default,Ir=fe;wr=xr.ArrowForwardSVGIcon=(0,Nr.forwardRef)((function(e,t){return(0,Sr.jsx)(Ir.SVGIcon,gr({},e,{ref:t},{children:(0,Sr.jsx)("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"})}))}));var Cr={},Or=G&&G.__assign||function(){return Or=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Or.apply(this,arguments)};Object.defineProperty(Cr,"__esModule",{value:!0});var jr=Cr.CloseSVGIcon=void 0,_r=Q.exports,Tr=c.default,kr=fe;jr=Cr.CloseSVGIcon=(0,Tr.forwardRef)((function(e,t){return(0,_r.jsx)(kr.SVGIcon,Or({},e,{ref:t},{children:(0,_r.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}));var Rr={},Pr=G&&G.__assign||function(){return Pr=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Pr.apply(this,arguments)};Object.defineProperty(Rr,"__esModule",{value:!0});var Mr=Rr.CheckSVGIcon=void 0,Lr=Q.exports,zr=c.default,qr=fe;Mr=Rr.CheckSVGIcon=(0,zr.forwardRef)((function(e,t){return(0,Lr.jsx)(qr.SVGIcon,Pr({},e,{ref:t},{children:(0,Lr.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}))}));var Vr,Br={answerButtonContainer:"eb-hm0P2D",answerButton:"eb-EkupIl",selected:"eb-p8ZbDY",correct:"eb-5WC5qo",correctSelected:"eb-Z1YT6r",incorrectSelected:"eb-V0bjjy",disabled:"eb-N51x3L",default:"eb-e7y9O4",icon:"eb-8I8Gjv",correctIcon:"eb-NVqaa3",incorrectIcon:"eb-5sHpoZ"};!function(e){e.Correct="correct",e.CorrectSelected="correctSelected",e.Default="default",e.IncorrectSelected="incorrectSelected",e.Selected="selected"}(Vr||(Vr={}));var Gr,Ar,Fr,Hr=function(e){var t,r=e.children,a=e.status,n=void 0===a?Vr.Default:a,l=e.disabled,o=f(e,["children","status","disabled"]);return c.default.createElement("div",{className:Br.answerButtonContainer},Vr.CorrectSelected===n&&c.default.createElement(Mr,{className:s.default(Br.icon,Br.correctIcon,"font-12 p-4")}),Vr.IncorrectSelected===n&&c.default.createElement(jr,{className:s.default(Br.icon,Br.incorrectIcon,"font-12 p-4")}),c.default.createElement(ct,d({className:s.default(Br.answerButton,n&&Br[n],(t={},t[Br.disabled]=l,t)),outline:!0,block:!0,disabled:l,superButton:!0,shadowSm:!0},o),r))},Qr="eb-fKHH4k",Dr="eb-Ka5TRS",Ur="eb-eQLIHc",Wr="eb-YcibRH",Xr="eb-pAHhPN";!function(e){e.Play="play",e.Pause="pause",e.Stop="stop"}(Gr||(Gr={})),function(e){e.Correct="var(--qc-green)",e.Incorrect="var(--qc-red)",e.Default="var(--qc-blue-200)"}(Ar||(Ar={})),function(e){e.Left="left",e.Right="right"}(Fr||(Fr={}));var Zr=function(e){var r=e.labelMessage,a=e.labelPosition,n=void 0===a?Fr.Left:a,l=e.onExpire,o=e.status,s=e.theme,u=void 0===s?Ar.Default:s,i=e.time,d=void 0===i?15:i,f=e.timerRef,m=t.useState(d),p=m[0],b=m[1],v=t.useState(!1),h=v[0],E=v[1],y=t.useRef(0);return t.useEffect((function(){return o===Gr.Play&&(y.current=window.setInterval((function(){return b((function(e){return e-1}))}),1e3)),o===Gr.Stop&&(clearInterval(y.current),b(d)),o===Gr.Pause&&clearInterval(y.current),function(){clearInterval(y.current),E(!1)}}),[o,d]),t.useEffect((function(){0===p&&(clearInterval(y.current),E(!0),l&&l())}),[l,p]),c.default.createElement("div",{className:Qr,"data-testid":"Timer"},n===Fr.Left&&c.default.createElement("div",{className:Wr},!p&&c.default.createElement(it,{bgColor:Ar.Incorrect},"Time's Up!"),r&&!!p&&c.default.createElement(it,{bgColor:u},r)),c.default.createElement("div",{className:Dr},c.default.createElement("svg",null,c.default.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:h?Ar.Incorrect:"var(--qc-rain)"}}),c.default.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:u,strokeDashoffset:145-145*p/d}})),c.default.createElement("p",{ref:f,className:Ur},p)),n===Fr.Right&&c.default.createElement("div",{className:Xr},!p&&c.default.createElement(it,{bgColor:Ar.Incorrect},"Time's Up!"),r&&!!p&&c.default.createElement(it,{bgColor:u},r)))},Yr="eb-db86L8",Kr="eb-fl8Stz",Jr="eb-MbWQdV",$r=function(e){var t=e.title,r=e.timerEnabled,a=void 0===r||r,l=e.timerRef,o=e.timerScore,u=e.timerStatus,i=void 0===u?Gr.Stop:u,d=e.timerTheme,f=void 0===d?Ar.Default:d,m=e.timerTime,p=void 0===m?15:m,b=e.onTimerExpire,v=e.totalScore,h=void 0===v?0:v,E=e.currentCount,y=void 0===E?0:E,x=e.totalCount,g=void 0===x?0:x,w=n.useMediaQuery({maxWidth:exports.Breakpoint.MdMin});return c.default.createElement("div",{className:s.default(Yr,"p-4")},c.default.createElement("span",{className:s.default(Jr,"pl-16")},t),c.default.createElement("div",{className:s.default(Kr,"px-16")},a&&c.default.createElement(Zr,{time:p,timerRef:l,theme:f,status:i,onExpire:b,labelMessage:o?"+".concat(o):void 0,labelPosition:w?Fr.Right:Fr.Left}),c.default.createElement("div",{className:"pl-24"},c.default.createElement("span",{className:"font-weight-bold "},y)," of"," ",c.default.createElement("span",{className:"font-weight-bold"},g)),c.default.createElement("div",{className:"pl-24"},"Score: ",c.default.createElement("span",{className:"font-weight-bold"},h))))},ea="eb-NelLRW",ta="eb-nXyIBf",ra="eb-VgMNit",aa="eb-8SxGFY",na=Object.freeze({__proto__:null,default:function(){var e=r.useNavigate(),a=C().event,n=t.useRef(null),l=t.useState(Gr.Stop),o=l[0],u=l[1],i=t.useState(0),d=i[0],f=i[1],m=t.useState(null),p=m[0],h=m[1],E=O(),y=E.id,x=E.title,g=E.questions,w=E.seconds,S=E.type,N=j(),I=N.currentQuestionIndex,_=N.correctResponses,k=N.dispatch,R=N.responseIndexes,P=N.restarted,M=N.totalCorrectScore,L=N.totalScore,z=N.totalTimerScore,q=N.timerEnabled,V=g[I];t.useEffect((function(){return q&&u(Gr.Play),function(){q&&u(Gr.Stop)}}),[I,q]);var B=t.useCallback((function(){h(-1)}),[]);function G(e){return e===p&&p===V.correctAnswerIndex?Vr.CorrectSelected:e===p&&p!==V.correctAnswerIndex?Vr.IncorrectSelected:null!==p&&e===V.correctAnswerIndex?Vr.Correct:Vr.Default}return c.default.createElement("div",{"data-testid":"QuestionView"},c.default.createElement($r,{currentCount:I+1,onTimerExpire:B,title:x,totalCount:g.length,totalScore:L,timerEnabled:q,timerRef:n,timerScore:d,timerStatus:o,timerTime:w,timerTheme:p===V.correctAnswerIndex?Ar.Correct:null!==p&&p!==V.correctAnswerIndex?Ar.Incorrect:Ar.Default}),c.default.createElement(T,{className:s.default(s.default(ea,"pb-20")),backgroundColor:"ice"},c.default.createElement("div",{className:s.default(aa,"p-24 font-24 font-weight-normal text-center"),dangerouslySetInnerHTML:{__html:V.text}}),c.default.createElement("div",{className:s.default(ta,"p-24")},V.answers.map((function(e,t){return c.default.createElement(Hr,{disabled:null!==p,key:e,onClick:function(){return function(e){var t,r,l=e===V.correctAnswerIndex;if(l){var o=(null===(t=n.current)||void 0===t?void 0:t.innerHTML)?+(null===(r=n.current)||void 0===r?void 0:r.innerHTML):0,c=Ze(o,V.difficulty,q);f(c),k({type:v.setTotalCorrectScore,payload:M+Ze(0,V.difficulty,!1)}),q&&k({type:v.setTotalTimerScore,payload:z+Xe(o)}),k({type:v.SetTotalScore,payload:L+c}),k({type:v.SetCorrectResponses,payload:_+1})}h(e),u(Gr.Pause),k({type:v.SetCorrectIndexes,payload:b(b([],R,!0),[e],!1)}),a("question_answered",{quiz_id:y,question_index:I,answer_index:e,answered_correctly:l,answer_text:V.answers[e],quiz_type:S.toString(),total_questions:g.length})}(t)},status:G(t)},e)}))),null!==p&&c.default.createElement(ct,{onClick:function(){I<g.length-1?(k({type:v.setCurrentQuestionIndex,payload:I+1}),h(null),q&&(u(Gr.Stop),f(0))):(e("/results"),a("quiz_complete",{quiz_id:y,questions_answered:R.length,restarted:P,correct_responses:_,quiz_type:S.toString(),total_questions:g.length}))},superButton:!0},"Next ",c.default.createElement(wr,{className:"ml-8"})),null!==p&&c.default.createElement(ye,{className:s.default(ra,"mt-24 p-24"),explanation:V.explanation})))}});exports.Quiz=B;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("deepmerge"),t=require("react"),r=require("react-router-dom"),a=require("classnames"),n=require("react-responsive");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=l(e),c=l(t),s=l(a),i=t.createContext({}),u=i.Provider,d=function(){return d=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},d.apply(this,arguments)};function f(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r}function m(e,t,r,a){return new(r||(r=Promise))((function(n,l){function o(e){try{s(a.next(e))}catch(e){l(e)}}function c(e){try{s(a.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}s((a=a.apply(e,t||[])).next())}))}function p(e,t){var r,a,n,l,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return l={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function c(l){return function(c){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,a&&(n=2&l[0]?a.return:l[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,l[1])).done)return n;switch(a=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,a=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){o.label=l[1];break}if(6===l[0]&&o.label<n[1]){o.label=n[1],n=l;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(l);break}n[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],a=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function b(e,t,r){if(r||2===arguments.length)for(var a,n=0,l=t.length;n<l;n++)!a&&n in t||(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var v,h={responseIndexes:[],correctResponses:0,currentQuestionIndex:0,restarted:!1,totalCorrectScore:0,totalScore:0,totalTimerScore:0,timerEnabled:!0,user:null,getLeaderboardResults:function(){return m(void 0,void 0,void 0,(function(){return p(this,(function(e){return[2,[]]}))}))},dispatch:function(){}};function E(e,t){switch(t.type){case v.SetCorrectIndexes:return d(d({},e),{responseIndexes:t.payload});case v.SetCorrectResponses:return d(d({},e),{correctResponses:t.payload});case v.setCurrentQuestionIndex:return d(d({},e),{currentQuestionIndex:t.payload});case v.SetRestarted:return d(d({},e),{correctResponses:h.correctResponses,currentQuestionIndex:h.currentQuestionIndex,responseIndexes:h.responseIndexes,restarted:!0,totalCorrectScore:h.totalCorrectScore,totalScore:h.totalScore,totalTimerScore:h.totalTimerScore});case v.setTotalCorrectScore:return d(d({},e),{totalCorrectScore:t.payload});case v.SetTotalScore:return d(d({},e),{totalScore:t.payload});case v.setTotalTimerScore:return d(d({},e),{totalTimerScore:t.payload});case v.SetTimerEnabled:return d(d({},e),{timerEnabled:t.payload});default:throw new Error("Please make sure to use the right action type reducer.")}}!function(e){e[e.SetCorrectIndexes=0]="SetCorrectIndexes",e[e.SetCorrectResponses=1]="SetCorrectResponses",e[e.setCurrentQuestionIndex=2]="setCurrentQuestionIndex",e[e.SetRestarted=3]="SetRestarted",e[e.setTotalCorrectScore=4]="setTotalCorrectScore",e[e.SetTotalScore=5]="SetTotalScore",e[e.setTotalTimerScore=6]="setTotalTimerScore",e[e.SetTimerEnabled=7]="SetTimerEnabled"}(v||(v={}));var y,x,g=t.createContext(h),w=function(e){var r=e.children,a=e.value,n=t.useReducer(E,h),l=n[0],o=n[1];return c.default.createElement(g.Provider,{value:d(d(d({},l),a),{dispatch:o})},r)},S={quizContainer:"eb-16RLBn"},N=t.createContext(S),I=N.Provider;function C(){var e=t.useState(!1),r=e[0],a=e[1];return t.useEffect((function(){void 0!==window.gtag&&a(!0)}),[]),{event:t.useCallback((function(e,t){r&&window.gtag("event",e,t)}),[r])}}function O(){return t.useContext(i)}function j(){return t.useContext(g)}exports.Template=void 0,(y=exports.Template||(exports.Template={})).TextMultipleChoice="TEXT_MULTIPLE_CHOICE",y.ImageMultipleChoice="IMAGE_MULTIPLE_CHOICE",exports.Breakpoint=void 0,(x=exports.Breakpoint||(exports.Breakpoint={}))[x.XsMin=0]="XsMin",x[x.XsMax=671]="XsMax",x[x.SmMin=672]="SmMin",x[x.SmMax=959]="SmMax",x[x.MdMin=960]="MdMin",x[x.MdMax=1247]="MdMax",x[x.LgMin=1248]="LgMin",x[x.LgMax=1399]="LgMax",x[x.XlMin=1400]="XlMin";var _={Box:"eb-ASYLqS",snowBackground:"eb-ZLkp2m",whiteBackground:"eb-DGfpHy",iceBackground:"eb-Nvt3tb",rainBorder:"eb-cMrTGF",grayBorder:"eb-94S9mY",rounded:"eb-GHgeM2",shadow:"eb-PiP0Bt"},T=function(e){var t,r,a=e.children,n=e.className,l=e.backgroundColor,o=void 0===l?"white":l,i=e.borderColor,u=void 0===i?"gray":i,m=e.rounded,p=void 0!==m&&m,b=e.shadow,v=void 0!==b&&b,h=f(e,["children","className","backgroundColor","borderColor","rounded","shadow"]);return c.default.createElement("div",d({className:s.default(_.Box,(t={},t[_.rounded]=p,t),(r={},r[_.shadow]=v,r),_["".concat(o,"Background")],_["".concat(u,"Border")],n),"data-testid":"Box"},h),a)},k=t.lazy((function(){return Promise.resolve().then((function(){return or}))})),R=function(e){return c.default.createElement(t.Suspense,{fallback:null},c.default.createElement(k,d({},e)))},P=t.lazy((function(){return Promise.resolve().then((function(){return yr}))})),M=function(e){return c.default.createElement(t.Suspense,{fallback:null},c.default.createElement(P,d({},e)))},L=t.lazy((function(){return Promise.resolve().then((function(){return na}))})),z=function(e){return c.default.createElement(t.Suspense,{fallback:null},c.default.createElement(L,d({},e)))},q=function(){return c.default.createElement(r.MemoryRouter,null,c.default.createElement(r.Routes,null,c.default.createElement(r.Route,{path:"/",element:c.default.createElement(M,null)}),c.default.createElement(r.Route,{path:"/:questionId",element:c.default.createElement(z,null)}),c.default.createElement(r.Route,{path:"/results",element:c.default.createElement(R,null)})))},V=function(e){var r=e.template,a=t.useContext(N).quizContainer,n=C().event,l=O(),o=l.id,s=l.questions,i=l.type,u=j(),d=u.correctResponses,f=u.restarted,m=u.responseIndexes;return t.useEffect((function(){function e(){m.length<s.length&&n("quiz_abandoned",{quiz_id:o,questions_answered:m.length,restarted:f,correct_responses:d,quiz_type:i.toString(),total_questions:s.length})}return window.addEventListener("beforeunload",e),function(){return window.removeEventListener("beforeunload",e)}}),[o,m,d,s.length,n,f,i]),c.default.createElement(T,{className:a,borderColor:"rain",rounded:!0,"data-testid":"TemplateLoader"},r===exports.Template.TextMultipleChoice&&c.default.createElement(q,null))},B=function(e){var t=e.data,r=e.template,a=e.theme,n=void 0===a?{}:a,l=e.user,s=e.onLeaderboardResults;return c.default.createElement(I,{value:o.default(S,n)},c.default.createElement(u,{value:t},c.default.createElement(w,{value:{getLeaderboardResults:s,user:l}},c.default.createElement(V,{template:r}))))},G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function A(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})})),r}var F,H={},Q={exports:{}},D={};function U(){if(F)return D;F=1;var e=c.default,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function o(e,r,o){var c,s={},i=null,u=null;for(c in void 0!==o&&(i=""+o),void 0!==r.key&&(i=""+r.key),void 0!==r.ref&&(u=r.ref),r)a.call(r,c)&&!l.hasOwnProperty(c)&&(s[c]=r[c]);if(e&&e.defaultProps)for(c in r=e.defaultProps)void 0===s[c]&&(s[c]=r[c]);return{$$typeof:t,type:e,key:i,ref:u,props:s,_owner:n.current}}return D.Fragment=r,D.jsx=o,D.jsxs=o,D}function W(e,t){if(!t)return e;var r=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(a,n){return r.call(t,n)&&t[n]&&(a="".concat(a," ").concat(e,"--").concat(n)),a}),e)}function X(e){return function(t,r){return t?"string"!=typeof t?W(e,t):W("".concat(e,"__").concat(t),r):e}}Q.exports=U();var Z=function(){return Z=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Z.apply(this,arguments)},Y=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r},K=X("rmd-icon"),J=t.forwardRef((function(e,t){var r=e.className,a=e.children,n=e["aria-hidden"],l=void 0===n||n,o=e.dense,c=void 0!==o&&o,i=e.iconClassName,u=void 0===i?"material-icons":i,d=e.forceSize,f=void 0!==d&&d,m=e.forceFontSize,p=void 0!==m&&m,b=Y(e,["className","children","aria-hidden","dense","iconClassName","forceSize","forceFontSize"]);return Q.exports.jsx("i",Z({},b,{"aria-hidden":l,ref:t,className:s.default(K({font:!0,dense:c,"forced-font":p,"forced-size":f}),u,r)},{children:a}))})),$=function(){return $=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},$.apply(this,arguments)},ee=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r},te=X("rmd-icon"),re=t.forwardRef((function(e,t){var r=e["aria-hidden"],a=void 0===r||r,n=e.focusable,l=void 0===n?"false":n,o=e.xmlns,c=void 0===o?"http://www.w3.org/2000/svg":o,i=e.viewBox,u=void 0===i?"0 0 24 24":i,d=e.dense,f=void 0!==d&&d,m=e.className,p=e.use,b=e.children,v=ee(e,["aria-hidden","focusable","xmlns","viewBox","dense","className","use","children"]),h=b;return!h&&p&&(h=Q.exports.jsx("use",{xlinkHref:p})),Q.exports.jsx("svg",$({},v,{"aria-hidden":a,ref:t,className:s.default(te({svg:!0,dense:f}),m),focusable:l,xmlns:c,viewBox:u},{children:h}))})),ae=function(){return ae=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ae.apply(this,arguments)};var ne=function(){return ne=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ne.apply(this,arguments)},le=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(r[a[n]]=e[a[n]])}return r},oe=X("rmd-icon-rotator"),ce=t.forwardRef((function(e,r){var a=e.style,n=e.className,l=e.animate,o=void 0===l||l,c=e.rotated,i=e.children,u=e.forceIconWrap,d=void 0!==u&&u,f=le(e,["style","className","animate","rotated","children","forceIconWrap"]),m=s.default(oe({animate:o,rotated:c}),n);if(!d&&t.isValidElement(i)){var p=t.Children.only(i);return t.cloneElement(p,{className:s.default(m,p.props.className)})}return Q.exports.jsx("span",ne({},f,{style:a,className:m,ref:r},{children:i}))})),se=function(){return se=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},se.apply(this,arguments)},ie={back:Q.exports.jsx(J,{children:"keyboard_arrow_left"}),checkbox:Q.exports.jsx(J,{children:"check_box"}),upload:Q.exports.jsx(J,{children:"file_upload"}),dropdown:Q.exports.jsx(J,{children:"arrow_drop_down"}),error:Q.exports.jsx(J,{children:"error_outline"}),expander:Q.exports.jsx(J,{children:"keyboard_arrow_down"}),forward:Q.exports.jsx(J,{children:"keyboard_arrow_right"}),menu:Q.exports.jsx(J,{children:"menu"}),notification:Q.exports.jsx(J,{children:"notifications"}),password:Q.exports.jsx(J,{children:"remove_red_eye"}),radio:Q.exports.jsx(J,{children:"radio_button_checked"}),selected:Q.exports.jsx(J,{children:"check"}),sort:Q.exports.jsx(J,{children:"arrow_upward"})},ue=t.createContext(ie),de=ue.Provider;var fe=A(Object.freeze({__proto__:null,FontIcon:J,SVGIcon:re,TextIconSpacing:function(e){var r,a=e.className,n=e.icon,l=e.children,o=void 0===l?null:l,c=e.stacked,i=void 0!==c&&c,u=e.iconAfter,d=void 0!==u&&u,f=e.flexReverse,m=void 0!==f&&f,p=e.forceIconWrap,b=void 0!==p&&p,v=e.beforeClassName,h=void 0===v?"rmd-icon--before":v,E=e.afterClassName,y=void 0===E?"rmd-icon--after":E,x=e.aboveClassName,g=void 0===x?"rmd-icon--above":x,w=e.belowClassName,S=void 0===w?"rmd-icon--below":w;if(!n)return Q.exports.jsx(Q.exports.Fragment,{children:o});var N=m?!d:d,I=s.default(((r={})[h]=!i&&!N,r[y]=!i&&N,r[g]=i&&!N,r[S]=i&&N,r),a),C=n,O=o;if(!b&&t.isValidElement(n)){var j=t.Children.only(n);C=t.cloneElement(j,{className:s.default(I,j.props.className)})}else n&&(C=Q.exports.jsx("span",ae({className:s.default("rmd-text-icon-spacing",I)},{children:n})));return C&&(O=Q.exports.jsxs(Q.exports.Fragment,{children:[!d&&C,o,d&&C]})),Q.exports.jsx(Q.exports.Fragment,{children:O})},IconRotator:ce,useIcon:function(e,r){var a=t.useContext(ue);return void 0!==r?r:a[e]},IconProvider:function(e){var r=e.children,a=e.back,n=void 0===a?ie.back:a,l=e.checkbox,o=void 0===l?ie.checkbox:l,c=e.dropdown,s=void 0===c?ie.dropdown:c,i=e.expander,u=void 0===i?ie.expander:i,d=e.error,f=void 0===d?ie.error:d,m=e.forward,p=void 0===m?ie.forward:m,b=e.menu,v=void 0===b?ie.menu:b,h=e.notification,E=void 0===h?ie.notification:h,y=e.password,x=void 0===y?ie.password:y,g=e.radio,w=void 0===g?ie.radio:g,S=e.selected,N=void 0===S?ie.selected:S,I=e.sort,C=void 0===I?ie.sort:I,O=e.upload,j=void 0===O?ie.upload:O,_=t.useMemo((function(){return{back:n,checkbox:o,dropdown:s,error:f,expander:u,forward:p,menu:v,notification:E,password:x,radio:w,selected:N,sort:C,upload:j}}),[n,o,s,f,u,p,v,E,x,w,N,C,j]);return Q.exports.jsx(de,se({value:_},{children:r}))}})),me=G&&G.__assign||function(){return me=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},me.apply(this,arguments)};Object.defineProperty(H,"__esModule",{value:!0});var pe=H.LightbulbOutlineSVGIcon=void 0,be=Q.exports,ve=c.default,he=fe;pe=H.LightbulbOutlineSVGIcon=(0,ve.forwardRef)((function(e,t){return(0,be.jsx)(he.SVGIcon,me({},e,{ref:t},{children:(0,be.jsx)("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"})}))}));var Ee={lightbulbIcon:"eb-z4RCtv"},ye=function(e){var t=e.className,r=e.explanation;return c.default.createElement("div",{className:s.default(Ee.explanationContainer,t),"data-testid":"Explanation"},c.default.createElement(pe,{className:s.default(Ee.lightbulbIcon,"mr-4")}),c.default.createElement("span",{className:s.default(Ee.explanation,"m-0"),dangerouslySetInnerHTML:{__html:r}}))},xe="eb-6lGJ0X",ge="eb-hAkxpo",we="eb-HLIy3V",Se="eb-VsNFkm",Ne="eb-6nDHds",Ie="eb-DBAmCC",Ce="eb-HjILKR",Oe=function(){var e=O().questions,t=j().responseIndexes;return c.default.createElement("div",{className:xe,"data-testid":"AnswersTab"},e.map((function(e,r){var a=e.text,n=e.answers,l=e.correctAnswerIndex,o=e.explanation;return c.default.createElement("div",{className:s.default(ge,"mb-32"),key:a},c.default.createElement("div",{className:s.default(we,"font-weight-bold")},r+1),c.default.createElement("div",{className:s.default(Se,"font-weight-bold"),dangerouslySetInnerHTML:{__html:a}}),c.default.createElement("div",{className:Ne},c.default.createElement("div",{className:s.default(l===t[r]?Ce:Ie)},"Your Answer: ",n[t[r]]),c.default.createElement("div",{className:"mt-4"},"Correct Answer: ",n[l]),c.default.createElement(ye,{className:"mt-16",explanation:o})))})))},je={},_e=G&&G.__assign||function(){return _e=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},_e.apply(this,arguments)};Object.defineProperty(je,"__esModule",{value:!0});var Te=je.CheckCircleSVGIcon=void 0,ke=Q.exports,Re=c.default,Pe=fe;Te=je.CheckCircleSVGIcon=(0,Re.forwardRef)((function(e,t){return(0,ke.jsx)(Pe.SVGIcon,_e({},e,{ref:t},{children:(0,ke.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}))}));var Me={},Le=G&&G.__assign||function(){return Le=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Le.apply(this,arguments)};Object.defineProperty(Me,"__esModule",{value:!0});var ze=Me.ReplaySVGIcon=void 0,qe=Q.exports,Ve=c.default,Be=fe;ze=Me.ReplaySVGIcon=(0,Ve.forwardRef)((function(e,t){return(0,qe.jsx)(Be.SVGIcon,Le({},e,{ref:t},{children:(0,qe.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})}))}));var Ge={},Ae=G&&G.__assign||function(){return Ae=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ae.apply(this,arguments)};Object.defineProperty(Ge,"__esModule",{value:!0});var Fe=Ge.AlarmSVGIcon=void 0,He=Q.exports,Qe=c.default,De=fe;Fe=Ge.AlarmSVGIcon=(0,Qe.forwardRef)((function(e,t){return(0,He.jsx)(De.SVGIcon,Ae({},e,{ref:t},{children:(0,He.jsx)("path",{d:"M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})}))}));var Ue="https://9zdy2kcoy6.execute-api.us-east-1.amazonaws.com/dev";function We(){var e=this,r=O(),a=r.categories,n=r.generalAudience,l=r.metadata,o=r.id,c=r.popular,s=r.tightrope,i=r.type,u=r.vocab,d=j(),f=d.getLeaderboardResults,b=d.totalScore,v=t.useState(null),h=v[0],E=v[1],y=t.useState(!1),x=y[0],g=y[1],w=t.useState(!1),S=w[0],N=w[1],I=t.useState(null),C=I[0],_=I[1],T=t.useState(null),k=T[0],R=T[1],P=t.useState(!1),M=P[0],L=P[1],z=t.useState(!1),q=z[0],V=z[1],B=t.useCallback((function(t){return void 0===t&&(t=3),m(e,void 0,void 0,(function(){var e,r,a;return p(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,5,6]),N(!0),[4,fetch("".concat(Ue,"/leaderboard?appId=").concat(l.source,"&quizId=").concat(o,"&limit=").concat(t))];case 1:return[4,n.sent().json()];case 2:return e=n.sent(),[4,f(e)];case 3:return r=n.sent(),E(r),g(!1),[3,6];case 4:return a=n.sent(),console.log(a),g(!0),[3,6];case 5:return N(!1),[7];case 6:return[2]}}))}))}),[f,l,o]),G=t.useCallback((function(t){return m(e,void 0,void 0,(function(){var e,r;return p(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,fetch("".concat(Ue,"/stats/percentile?appId=").concat(l.source,"&quizId=").concat(o,"&userId=").concat(t))];case 1:return[4,a.sent().json()];case 2:return e=a.sent(),_(e.scorePercentile),[3,4];case 3:return r=a.sent(),console.log(r),[3,4];case 4:return[2]}}))}))}),[l.source,o]),A=t.useCallback((function(t,r){return void 0===r&&(r=1),m(e,void 0,void 0,(function(){var e,a,n;return p(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,5,6]),V(!0),[4,fetch("".concat(Ue,"/rank?appId=").concat(l.source,"&quizId=").concat(o,"&userId=").concat(t,"&neighbors=").concat(r))];case 1:return[4,c.sent().json()];case 2:return e=c.sent(),[4,f(e)];case 3:return a=c.sent(),R(a),[3,6];case 4:return n=c.sent(),console.log(n),L(!0),[3,6];case 5:return V(!1),[7];case 6:return[2]}}))}))}),[f,l.source,o]),F=t.useCallback((function(t){return m(e,void 0,void 0,(function(){var e,r;return p(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),console.log("saving user score..."),[4,fetch("".concat(Ue,"/score"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({appId:l.source,quizId:o,score:b,userId:t,metadata:{isGeneralAudience:n,isPopular:c,isTightrope:s,isVocab:u,primaryCategory:a[0].label,type:i,slug:l.slug}})})];case 1:return e=d.sent(),console.log("done",e),[3,3];case 2:return r=d.sent(),console.log(r),[3,3];case 3:return[2]}}))}))}),[a,n,l.source,l.slug,c,o,s,b,i,u]);return{getLeaderboardResults:B,getUserPercentile:G,getUserRankResults:A,saveUserScore:F,leaderboardResults:h,leaderboardResultsError:x,leaderboardResultsLoading:S,userPercentile:C,userRankResults:k,userRankResultsError:M,userRankResultsLoading:q}}function Xe(e){return 10*Math.min(e,10)}function Ze(e,t,r){return r?100*t+Xe(e):100*t}var Ye,Ke="eb-h0JoJS",Je="eb-g0oWRe",$e="eb-cDH2ZZ",et="eb-PMfRkP",tt="eb-6MTWIi",rt="eb-P5IGFV",at="eb-R87VrN",nt="eb-b7udwo",lt="eb-mzexJz";!function(e){e.Left="left",e.Right="right"}(Ye||(Ye={}));var ot,ct=function(e){var r,a,n,l,o,i,u=e.block,m=void 0!==u&&u,p=e.children,b=e.className,v=e.icon,h=e.iconPosition,E=void 0===h?Ye.Left:h,y=e.outline,x=void 0!==y&&y,g=e.shadow,w=void 0!==g&&g,S=e.shadowSm,N=void 0!==S&&S,I=e.superButton,C=void 0!==I&&I,O=e.tag,j=void 0===O?"button":O,_=f(e,["block","children","className","icon","iconPosition","outline","shadow","shadowSm","superButton","tag"]);return c.default.createElement(j,d({className:s.default(Ke,(r={},r[Je]=m,r),(a={},a[et]=v,a),(n={},n[$e]=x,n),(l={},l[at]=w,l),(o={},o[nt]=N,o),(i={},i[lt]=C,i),b),"data-testid":"Button"},_),E===Ye.Left&&v&&t.cloneElement(v,{className:s.default(v.props.className,tt)}),p,E===Ye.Right&&v&&t.cloneElement(v,{className:s.default(v.props.className,rt)}))},st="eb-WrBwzW",it="eb-LlKpPo",ut=function(e){var t,r=e.children,a=e.className,n=e.bgColor,l=void 0===n?void 0:n,o=e.outline;return c.default.createElement("div",{className:s.default(st,(t={},t[it]=o,t),a),style:{backgroundColor:l},"data-testid":"Badge"},r)},dt="eb-ttCsCh",ft=function(e){var t=e.children,r=e.className,a=f(e,["children","className"]);return c.default.createElement("div",d({className:s.default(dt,r),"data-testid":"ListGroup"},a),t)},mt="eb-Dgd6nO",pt="eb-DkhGFO",bt="eb-kwge39",vt=function(e){var t,r,a=e.children,n=e.active,l=e.className,o=e.justified,i=f(e,["children","active","className","justified"]);return c.default.createElement("div",d({className:s.default(mt,(t={},t[pt]=n,t),(r={},r[bt]=o,r),l),"data-testid":"ListItem"},i),a)},ht="eb-l7tnqS",Et="eb-FQUR34",yt=function(e){var t=e.className,r=e.items,a=e.newScore,n=e.user;return c.default.createElement(ft,{className:t,"data-testid":"Leaderboard"},r.map((function(e,t){var r=e.id,l=e.rank,o=e.name,s=e.score;return c.default.createElement(vt,{key:r,justified:!0,active:r===(null==n?void 0:n.id)},c.default.createElement("div",{className:ht},l||t+1,". ",c.default.createElement("strong",null,o)),c.default.createElement("div",{className:Et},r===(null==n?void 0:n.id)&&a>0&&a>s&&c.default.createElement(ut,null,"+",a-s),(new Intl.NumberFormat).format(s)))})))},xt="eb-Hq5iFO",gt="eb-p1vZ3L",wt="eb-8GC4cE",St="eb-rgrfl0",Nt="eb-KmoX7Q",It="eb-z33RWL",Ct="eb-5f5DSo",Ot="eb-RjthEk",jt="eb-lf4O2l",_t="eb-ykC0zi",Tt=function(e){var r=e.onRestartQuiz,a=O().questions,n=j(),l=n.correctResponses,o=n.totalCorrectScore,i=n.totalScore,u=n.totalTimerScore,d=n.user,f=We(),m=f.leaderboardResults,p=f.leaderboardResultsError,b=f.getLeaderboardResults,v=f.getUserPercentile,h=f.getUserRankResults,E=f.userPercentile,y=f.userRankResults,x=f.userRankResultsError;return t.useEffect((function(){d?(h(d.id),v(d.id)):b()}),[v,h,b,d]),t.useEffect((function(){if(d&&(null==y?void 0:y.length)&&!x){var e=y.find((function(e){return e.id===d.id}));!!e&&e.rank<=3||b()}x&&b()}),[b,d,y,x]),c.default.createElement("div",{className:xt,"data-testid":"LeaderboardTab"},c.default.createElement(T,{className:Nt,backgroundColor:"snow",borderColor:"rain",rounded:!0},c.default.createElement("div",{className:gt},c.default.createElement("h2",{className:"mb-4"},"All Quizzes"),c.default.createElement("p",{className:"font-14"},"Total Weekly Points")),m&&c.default.createElement(yt,{className:"mt-20",newScore:i,items:m}),p&&c.default.createElement("p",null,"We're experiencing issues loading the Leaderboard at this time. Please try again later."),y&&c.default.createElement(yt,{className:"mt-20",newScore:i,items:y,user:d}),x&&c.default.createElement("p",null,"We're experiencing issues loading your score at this time. Please try again later.")),c.default.createElement(T,{className:It,backgroundColor:"white",borderColor:"rain",rounded:!0},c.default.createElement("div",{className:s.default(wt,"text-center mb-20")},c.default.createElement("h2",{className:"mb-16"},"This Quiz"),E&&c.default.createElement("p",{className:"mt-16 font-14"},"You scored ",E,"% better than most users!")),c.default.createElement("div",{className:Ct},c.default.createElement("div",null,c.default.createElement("div",{className:"mb-8"},c.default.createElement("div",{className:Ot},c.default.createElement(Te,{className:"mr-4"})," ",c.default.createElement("strong",null,l," Correct")),c.default.createElement("div",null,c.default.createElement("strong",null,o," Points"))),c.default.createElement("div",{className:"mt-16"},c.default.createElement("div",{className:jt},c.default.createElement(Fe,{className:"mr-4"})," ",c.default.createElement("strong",null,"Time Bonus")),c.default.createElement("div",null,c.default.createElement("strong",null,u," Points")))),c.default.createElement("div",{className:"text-center"},c.default.createElement("div",{className:St},c.default.createElement("div",null,c.default.createElement("h1",null,i)),c.default.createElement("div",null,c.default.createElement("strong",null,"POINTS"))),c.default.createElement("div",null,"Of ",function(e){var t=0;return e.forEach((function(e){return t+=100*e.difficulty+100})),t}(a)))),c.default.createElement("div",{className:"text-center mt-28"},c.default.createElement(ct,{icon:c.default.createElement(ze,{className:_t}),onClick:r,outline:!0,shadow:!0},"Play Again"))))},kt="eb-oCfRGq",Rt=function(e){var t=e.children,r=e.className,a=f(e,["children","className"]);return c.default.createElement("a",d({},a,{className:s.default(kt,"font-weight-semi-bold",r)}),t)},Pt=function(){var e=O().nextUpQuiz,t=e.image,r=e.url,a=e.title;return c.default.createElement(T,{borderColor:"rain",className:"mt-20","data-testid":"NextUpQuizCard",rounded:!0,shadow:!0},c.default.createElement("div",{style:{aspectRatio:"16/9"}},c.default.createElement("img",{src:t.fullUrl,alt:t.altText})),c.default.createElement("div",{className:"p-20"},c.default.createElement(Rt,{className:"font-20",href:r},a),c.default.createElement(ct,{tag:"a",href:r,className:"mt-20",block:!0},"Play")))},Mt="eb-NdGzM3",Lt="eb-fQMdMF",zt="eb-i8uKTc",qt="eb-ZBrDqu",Vt="eb-FOeG4W",Bt="eb-fQceh4",Gt="eb-vzHSa2",At="eb-sS9sRH",Ft=function(){var e=j(),t=e.correctResponses,r=e.totalScore,a=O().questions,n=t/a.length*100;return c.default.createElement("div",{className:Mt},c.default.createElement("div",{className:Lt,"data-testid":"ScoreSummaryWheel"},c.default.createElement("div",{className:s.default(Bt,"px-12 py-8 font-weight-semi-bold")},"Congrats!"),c.default.createElement("svg",{viewBox:"0 0 36 36",className:zt},c.default.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:Vt}),c.default.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:qt,strokeDasharray:"".concat(n," 100")})),c.default.createElement("div",{className:s.default(Gt,"text-center")},c.default.createElement("div",{className:s.default(At,"font-weight-super-bold")},t,"/",a.length),c.default.createElement("div",{className:"font-12"},r," points"))))},Ht="eb-od4oX9",Qt="eb-F71AtK",Dt="eb-EM5HVl",Ut="eb-yx3D4X",Wt="eb-0AMT86",Xt=function(e){var t=e.onRestartQuiz,r=n.useMediaQuery({maxWidth:exports.Breakpoint.XsMax}),a=O().title;return c.default.createElement("div",{"data-testid":"ScoreTab",className:Ht},c.default.createElement(T,{className:Qt,borderColor:"rain",backgroundColor:"ice",rounded:!r,shadow:!r},c.default.createElement("div",{className:Dt},c.default.createElement("div",{className:"font-18 font-weight-extra-bold"},a),c.default.createElement(Ft,null),c.default.createElement(ct,{icon:c.default.createElement(ze,{className:Wt}),onClick:t,outline:!0,shadow:!0},"Play Again")),c.default.createElement("div",{className:Ut},c.default.createElement("div",{className:"font-weight-extra-bold font-24"},"Next Up!"),c.default.createElement(Pt,null))))},Zt={activeTabId:"default",setActiveTabId:function(){}},Yt=t.createContext(Zt),Kt=function(e){var r=e.children,a=e.defaultActiveTabId,n=t.useState(a),l=n[0],o=n[1];return c.default.createElement(Yt.Provider,{value:{activeTabId:l,setActiveTabId:o}},r)},Jt="eb-fkZcg2",$t="eb-ntGIO4",er=function(e){var r,a=e.children,n=e.className,l=e.controlFor,o=t.useContext(Yt),i=o.setActiveTabId,u=o.activeTabId===l;return c.default.createElement("button",{className:s.default(Jt,(r={},r[$t]=u,r),n),"data-testid":"Tab",id:"".concat(l,"-tab"),role:"tab","aria-controls":l,"aria-selected":u,tabIndex:u?void 0:-1,onClick:function(){return i(l)}},a)},tr=function(e){var r=e.children,a=e.className,n=e.id,l=f(e,["children","className","id"]);return n===t.useContext(Yt).activeTabId?c.default.createElement("div",d({id:n,className:a,"data-testid":"TabContent",tabIndex:0,role:"tabpanel","aria-labelledby":"".concat(n,"-tab")},l),r):null},rr="eb-ftdu2H",ar=function(e){var t=e.children,r=e.className,a=e.label;return c.default.createElement("div",{className:s.default(rr,r),"data-testid":"Tabs",role:"tablist","aria-label":a},t)},nr="eb-vDPeCr",lr="eb-bMiWKa";!function(e){e.AnswersTab="AnswersTab",e.LeaderboardTab="LeaderboardTab",e.ScoreTab="ScoreTab"}(ot||(ot={}));var or=Object.freeze({__proto__:null,default:function(){var e=O().image,a=j(),n=a.dispatch,l=a.user,o=We().saveUserScore,s=r.useNavigate();function i(){n({type:v.SetRestarted}),s("/")}return t.useEffect((function(){l&&o(l.id)}),[o,l]),c.default.createElement("div",{"data-testid":"ResultsView",className:nr,style:{backgroundImage:"url(".concat(e.fullUrl,")")}},c.default.createElement(Kt,{defaultActiveTabId:ot.ScoreTab},c.default.createElement(ar,{label:"Results View"},c.default.createElement(er,{controlFor:ot.ScoreTab},"Score"),c.default.createElement(er,{controlFor:ot.AnswersTab},"Answers"),c.default.createElement(er,{controlFor:ot.LeaderboardTab},"Leaderboard")),c.default.createElement(tr,{className:lr,id:ot.ScoreTab},c.default.createElement(Xt,{onRestartQuiz:i})),c.default.createElement(tr,{className:lr,id:ot.AnswersTab},c.default.createElement(Oe,null)),c.default.createElement(tr,{className:lr,id:ot.LeaderboardTab},c.default.createElement(Tt,{onRestartQuiz:i}))))}}),cr="eb-8LB0Z6",sr="eb-xrnrMX",ir="eb-uQ6x3r",ur="eb-RTZJDf",dr="eb-nCZamz",fr="eb-XBUSmk",mr="eb-6uIIpF",pr="eb-vaYYcz",br="eb-FGnvGm",vr=function(e){var t=e.children;return c.default.createElement("div",{className:br,"data-testid":"SwitchControl"},t)},hr="eb-FxfgLd",Er=function(e){var t=e.id,r=f(e,["id"]);return c.default.createElement("input",d({id:t,className:hr,type:"checkbox",role:"switch"},r))},yr=Object.freeze({__proto__:null,default:function(){var e=O(),t=e.id,a=e.categories,n=e.image,l=e.title,o=e.timed,i=e.questions,u=j(),d=u.dispatch,f=u.timerEnabled;return c.default.createElement("div",{className:cr,"data-testid":"IntroView",style:{aspectRatio:"900 / 675"}},c.default.createElement("img",{className:sr,src:n.fullUrl,alt:n.altText}),c.default.createElement("div",{className:ir},c.default.createElement(T,{borderColor:"rain",className:s.default(fr,"p-20"),rounded:!0,shadow:!0},c.default.createElement("div",{className:ur},c.default.createElement(ut,{className:s.default(dr),bgColor:"var(--qc-ice)",outline:!0},c.default.createElement("span",{className:"font-14"},a[0].label))),c.default.createElement("h1",{className:s.default(pr,"font-weight-semi-bold text-center")},l),c.default.createElement("div",{className:"text-center"},c.default.createElement(ct,{className:"p-28",tag:r.Link,to:"/".concat(t),block:!0,superButton:!0},"Start")),c.default.createElement("div",{className:s.default(mr,"pt-16")},c.default.createElement("div",{className:"font-14 font-weight-semi-bold"},i.length," Questions"),o&&c.default.createElement(vr,null,c.default.createElement("label",{className:"font-14",htmlFor:"toggle"},"Timer Bonus"),c.default.createElement(Er,{id:"".concat(t),defaultChecked:f,onClick:function(){return d({type:v.SetTimerEnabled,payload:!f})}}))))))}}),xr={},gr=G&&G.__assign||function(){return gr=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},gr.apply(this,arguments)};Object.defineProperty(xr,"__esModule",{value:!0});var wr=xr.ArrowForwardSVGIcon=void 0,Sr=Q.exports,Nr=c.default,Ir=fe;wr=xr.ArrowForwardSVGIcon=(0,Nr.forwardRef)((function(e,t){return(0,Sr.jsx)(Ir.SVGIcon,gr({},e,{ref:t},{children:(0,Sr.jsx)("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"})}))}));var Cr={},Or=G&&G.__assign||function(){return Or=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Or.apply(this,arguments)};Object.defineProperty(Cr,"__esModule",{value:!0});var jr=Cr.CloseSVGIcon=void 0,_r=Q.exports,Tr=c.default,kr=fe;jr=Cr.CloseSVGIcon=(0,Tr.forwardRef)((function(e,t){return(0,_r.jsx)(kr.SVGIcon,Or({},e,{ref:t},{children:(0,_r.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}));var Rr={},Pr=G&&G.__assign||function(){return Pr=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Pr.apply(this,arguments)};Object.defineProperty(Rr,"__esModule",{value:!0});var Mr=Rr.CheckSVGIcon=void 0,Lr=Q.exports,zr=c.default,qr=fe;Mr=Rr.CheckSVGIcon=(0,zr.forwardRef)((function(e,t){return(0,Lr.jsx)(qr.SVGIcon,Pr({},e,{ref:t},{children:(0,Lr.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}))}));var Vr,Br={answerButtonContainer:"eb-hm0P2D",answerButton:"eb-EkupIl",selected:"eb-p8ZbDY",correct:"eb-5WC5qo",correctSelected:"eb-Z1YT6r",incorrectSelected:"eb-V0bjjy",disabled:"eb-N51x3L",default:"eb-e7y9O4",icon:"eb-8I8Gjv",correctIcon:"eb-NVqaa3",incorrectIcon:"eb-5sHpoZ"};!function(e){e.Correct="correct",e.CorrectSelected="correctSelected",e.Default="default",e.IncorrectSelected="incorrectSelected",e.Selected="selected"}(Vr||(Vr={}));var Gr,Ar,Fr,Hr=function(e){var t,r=e.children,a=e.status,n=void 0===a?Vr.Default:a,l=e.disabled,o=f(e,["children","status","disabled"]);return c.default.createElement("div",{className:Br.answerButtonContainer},Vr.CorrectSelected===n&&c.default.createElement(Mr,{className:s.default(Br.icon,Br.correctIcon,"font-12 p-4")}),Vr.IncorrectSelected===n&&c.default.createElement(jr,{className:s.default(Br.icon,Br.incorrectIcon,"font-12 p-4")}),c.default.createElement(ct,d({className:s.default(Br.answerButton,n&&Br[n],(t={},t[Br.disabled]=l,t)),outline:!0,block:!0,disabled:l,superButton:!0,shadowSm:!0},o),r))},Qr="eb-fKHH4k",Dr="eb-Ka5TRS",Ur="eb-eQLIHc",Wr="eb-YcibRH",Xr="eb-pAHhPN";!function(e){e.Play="play",e.Pause="pause",e.Stop="stop"}(Gr||(Gr={})),function(e){e.Correct="var(--qc-green)",e.Incorrect="var(--qc-red)",e.Default="var(--qc-blue-200)"}(Ar||(Ar={})),function(e){e.Left="left",e.Right="right"}(Fr||(Fr={}));var Zr=function(e){var r=e.labelMessage,a=e.labelPosition,n=void 0===a?Fr.Left:a,l=e.onExpire,o=e.status,s=e.theme,i=void 0===s?Ar.Default:s,u=e.time,d=void 0===u?15:u,f=e.timerRef,m=t.useState(d),p=m[0],b=m[1],v=t.useState(!1),h=v[0],E=v[1],y=t.useRef(0);return t.useEffect((function(){return o===Gr.Play&&(y.current=window.setInterval((function(){return b((function(e){return e-1}))}),1e3)),o===Gr.Stop&&(clearInterval(y.current),b(d)),o===Gr.Pause&&clearInterval(y.current),function(){clearInterval(y.current),E(!1)}}),[o,d]),t.useEffect((function(){0===p&&(clearInterval(y.current),E(!0),l&&l())}),[l,p]),c.default.createElement("div",{className:Qr,"data-testid":"Timer"},n===Fr.Left&&c.default.createElement("div",{className:Wr},!p&&c.default.createElement(ut,{bgColor:Ar.Incorrect},"Time's Up!"),r&&!!p&&c.default.createElement(ut,{bgColor:i},r)),c.default.createElement("div",{className:Dr},c.default.createElement("svg",null,c.default.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:h?Ar.Incorrect:"var(--qc-rain)"}}),c.default.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:i,strokeDashoffset:145-145*p/d}})),c.default.createElement("div",{ref:f,className:Ur},p)),n===Fr.Right&&c.default.createElement("div",{className:Xr},!p&&c.default.createElement(ut,{bgColor:Ar.Incorrect},"Time's Up!"),r&&!!p&&c.default.createElement(ut,{bgColor:i},r)))},Yr="eb-db86L8",Kr="eb-fl8Stz",Jr="eb-MbWQdV",$r=function(e){var t=e.title,r=e.timerEnabled,a=void 0===r||r,l=e.timerRef,o=e.timerScore,i=e.timerStatus,u=void 0===i?Gr.Stop:i,d=e.timerTheme,f=void 0===d?Ar.Default:d,m=e.timerTime,p=void 0===m?15:m,b=e.onTimerExpire,v=e.totalScore,h=void 0===v?0:v,E=e.currentCount,y=void 0===E?0:E,x=e.totalCount,g=void 0===x?0:x,w=n.useMediaQuery({maxWidth:exports.Breakpoint.MdMin});return c.default.createElement("div",{className:s.default(Yr,"p-4")},c.default.createElement("span",{className:s.default(Jr,"pl-16")},t),c.default.createElement("div",{className:s.default(Kr,"px-16")},a&&c.default.createElement(Zr,{time:p,timerRef:l,theme:f,status:u,onExpire:b,labelMessage:o?"+".concat(o):void 0,labelPosition:w?Fr.Right:Fr.Left}),c.default.createElement("div",{className:"pl-24"},c.default.createElement("span",{className:"font-weight-bold "},y)," of"," ",c.default.createElement("span",{className:"font-weight-bold"},g)),c.default.createElement("div",{className:"pl-24"},"Score: ",c.default.createElement("span",{className:"font-weight-bold"},h))))},ea="eb-NelLRW",ta="eb-nXyIBf",ra="eb-VgMNit",aa="eb-8SxGFY",na=Object.freeze({__proto__:null,default:function(){var e=r.useNavigate(),a=C().event,n=t.useRef(null),l=t.useState(Gr.Stop),o=l[0],i=l[1],u=t.useState(0),d=u[0],f=u[1],m=t.useState(null),p=m[0],h=m[1],E=O(),y=E.id,x=E.title,g=E.questions,w=E.seconds,S=E.type,N=j(),I=N.currentQuestionIndex,_=N.correctResponses,k=N.dispatch,R=N.responseIndexes,P=N.restarted,M=N.totalCorrectScore,L=N.totalScore,z=N.totalTimerScore,q=N.timerEnabled,V=g[I];t.useEffect((function(){return q&&i(Gr.Play),function(){q&&i(Gr.Stop)}}),[I,q]);var B=t.useCallback((function(){h(-1)}),[]);function G(e){return e===p&&p===V.correctAnswerIndex?Vr.CorrectSelected:e===p&&p!==V.correctAnswerIndex?Vr.IncorrectSelected:null!==p&&e===V.correctAnswerIndex?Vr.Correct:Vr.Default}return c.default.createElement("div",{"data-testid":"QuestionView"},c.default.createElement($r,{currentCount:I+1,onTimerExpire:B,title:x,totalCount:g.length,totalScore:L,timerEnabled:q,timerRef:n,timerScore:d,timerStatus:o,timerTime:w,timerTheme:p===V.correctAnswerIndex?Ar.Correct:null!==p&&p!==V.correctAnswerIndex?Ar.Incorrect:Ar.Default}),c.default.createElement(T,{className:s.default(s.default(ea,"pb-20")),backgroundColor:"ice"},c.default.createElement("div",{className:s.default(aa,"p-24 font-24 font-weight-normal text-center"),dangerouslySetInnerHTML:{__html:V.text}}),c.default.createElement("div",{className:s.default(ta,"p-24")},V.answers.map((function(e,t){return c.default.createElement(Hr,{disabled:null!==p,key:e,onClick:function(){return function(e){var t,r,l=e===V.correctAnswerIndex;if(l){var o=(null===(t=n.current)||void 0===t?void 0:t.innerHTML)?+(null===(r=n.current)||void 0===r?void 0:r.innerHTML):0,c=Ze(o,V.difficulty,q);f(c),k({type:v.setTotalCorrectScore,payload:M+Ze(0,V.difficulty,!1)}),q&&k({type:v.setTotalTimerScore,payload:z+Xe(o)}),k({type:v.SetTotalScore,payload:L+c}),k({type:v.SetCorrectResponses,payload:_+1})}h(e),i(Gr.Pause),k({type:v.SetCorrectIndexes,payload:b(b([],R,!0),[e],!1)}),a("question_answered",{quiz_id:y,question_index:I,answer_index:e,answered_correctly:l,answer_text:V.answers[e],quiz_type:S.toString(),total_questions:g.length})}(t)},status:G(t)},e)}))),null!==p&&c.default.createElement(ct,{onClick:function(){I<g.length-1?(k({type:v.setCurrentQuestionIndex,payload:I+1}),h(null),q&&(i(Gr.Stop),f(0))):(e("/results"),a("quiz_complete",{quiz_id:y,questions_answered:R.length,restarted:P,correct_responses:_,quiz_type:S.toString(),total_questions:g.length}))},superButton:!0},"Next ",c.default.createElement(wr,{className:"ml-8"})),null!==p&&c.default.createElement(ye,{className:s.default(ra,"mt-24 p-24"),explanation:V.explanation})))}});exports.Quiz=B;
//# sourceMappingURL=quiz-components.cjs.production.js.map

@@ -1,2 +0,2 @@

import e from"deepmerge";import t,{createContext as r,useReducer as n,useState as a,useEffect as o,useCallback as c,useContext as l,Suspense as s,lazy as i,forwardRef as d,isValidElement as u,Children as m,cloneElement as f,useMemo as p,useRef as v}from"react";import{MemoryRouter as b,Routes as h,Route as y,useNavigate as E,Link as g}from"react-router-dom";import x from"classnames";import{useMediaQuery as w}from"react-responsive";var N=r({}),S=N.Provider,I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},I.apply(this,arguments)};function O(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function C(e,t,r,n){return new(r||(r=Promise))((function(a,o){function c(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,l)}s((n=n.apply(e,t||[])).next())}))}function j(e,t){var r,n,a,o,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;c;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,n=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(a=c.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){c.label=o[1];break}if(6===o[0]&&c.label<a[1]){c.label=a[1],a=o;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(o);break}a[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}function _(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}var T,k={responseIndexes:[],correctResponses:0,currentQuestionIndex:0,restarted:!1,totalCorrectScore:0,totalScore:0,totalTimerScore:0,timerEnabled:!0,user:null,getLeaderboardResults:function(){return C(void 0,void 0,void 0,(function(){return j(this,(function(e){return[2,[]]}))}))},dispatch:function(){}};function R(e,t){switch(t.type){case T.SetCorrectIndexes:return I(I({},e),{responseIndexes:t.payload});case T.SetCorrectResponses:return I(I({},e),{correctResponses:t.payload});case T.setCurrentQuestionIndex:return I(I({},e),{currentQuestionIndex:t.payload});case T.SetRestarted:return I(I({},e),{correctResponses:k.correctResponses,currentQuestionIndex:k.currentQuestionIndex,responseIndexes:k.responseIndexes,restarted:!0,totalCorrectScore:k.totalCorrectScore,totalScore:k.totalScore,totalTimerScore:k.totalTimerScore});case T.setTotalCorrectScore:return I(I({},e),{totalCorrectScore:t.payload});case T.SetTotalScore:return I(I({},e),{totalScore:t.payload});case T.setTotalTimerScore:return I(I({},e),{totalTimerScore:t.payload});case T.SetTimerEnabled:return I(I({},e),{timerEnabled:t.payload});default:throw new Error("Please make sure to use the right action type reducer.")}}!function(e){e[e.SetCorrectIndexes=0]="SetCorrectIndexes",e[e.SetCorrectResponses=1]="SetCorrectResponses",e[e.setCurrentQuestionIndex=2]="setCurrentQuestionIndex",e[e.SetRestarted=3]="SetRestarted",e[e.setTotalCorrectScore=4]="setTotalCorrectScore",e[e.SetTotalScore=5]="SetTotalScore",e[e.setTotalTimerScore=6]="setTotalTimerScore",e[e.SetTimerEnabled=7]="SetTimerEnabled"}(T||(T={}));var P,M,L=r(k),z=function(e){var r=e.children,a=e.value,o=n(R,k),c=o[0],l=o[1];return t.createElement(L.Provider,{value:I(I(I({},c),a),{dispatch:l})},r)},G={quizContainer:"eb-16RLBn"},V=r(G),q=V.Provider;function A(){var e=a(!1),t=e[0],r=e[1];return o((function(){void 0!==window.gtag&&r(!0)}),[]),{event:c((function(e,r){t&&window.gtag("event",e,r)}),[t])}}function B(){return l(N)}function F(){return l(L)}!function(e){e.TextMultipleChoice="TEXT_MULTIPLE_CHOICE",e.ImageMultipleChoice="IMAGE_MULTIPLE_CHOICE"}(P||(P={})),function(e){e[e.XsMin=0]="XsMin",e[e.XsMax=671]="XsMax",e[e.SmMin=672]="SmMin",e[e.SmMax=959]="SmMax",e[e.MdMin=960]="MdMin",e[e.MdMax=1247]="MdMax",e[e.LgMin=1248]="LgMin",e[e.LgMax=1399]="LgMax",e[e.XlMin=1400]="XlMin"}(M||(M={}));var H={Box:"eb-ASYLqS",snowBackground:"eb-ZLkp2m",whiteBackground:"eb-DGfpHy",iceBackground:"eb-Nvt3tb",rainBorder:"eb-cMrTGF",grayBorder:"eb-94S9mY",rounded:"eb-GHgeM2",shadow:"eb-PiP0Bt"},Q=function(e){var r,n,a=e.children,o=e.className,c=e.backgroundColor,l=void 0===c?"white":c,s=e.borderColor,i=void 0===s?"gray":s,d=e.rounded,u=void 0!==d&&d,m=e.shadow,f=void 0!==m&&m,p=O(e,["children","className","backgroundColor","borderColor","rounded","shadow"]);return t.createElement("div",I({className:x(H.Box,(r={},r[H.rounded]=u,r),(n={},n[H.shadow]=f,n),H["".concat(l,"Background")],H["".concat(i,"Border")],o),"data-testid":"Box"},p),a)},D=i((function(){return Promise.resolve().then((function(){return Er}))})),U=function(e){return t.createElement(s,{fallback:null},t.createElement(D,I({},e)))},W=i((function(){return Promise.resolve().then((function(){return Rr}))})),X=function(e){return t.createElement(s,{fallback:null},t.createElement(W,I({},e)))},Z=i((function(){return Promise.resolve().then((function(){return yn}))})),Y=function(e){return t.createElement(s,{fallback:null},t.createElement(Z,I({},e)))},K=function(){return t.createElement(b,null,t.createElement(h,null,t.createElement(y,{path:"/",element:t.createElement(X,null)}),t.createElement(y,{path:"/:questionId",element:t.createElement(Y,null)}),t.createElement(y,{path:"/results",element:t.createElement(U,null)})))},J=function(e){var r=e.template,n=l(V).quizContainer,a=A().event,c=B(),s=c.id,i=c.questions,d=c.type,u=F(),m=u.correctResponses,f=u.restarted,p=u.responseIndexes;return o((function(){function e(){p.length<i.length&&a("quiz_abandoned",{quiz_id:s,questions_answered:p.length,restarted:f,correct_responses:m,quiz_type:d.toString(),total_questions:i.length})}return window.addEventListener("beforeunload",e),function(){return window.removeEventListener("beforeunload",e)}}),[s,p,m,i.length,a,f,d]),t.createElement(Q,{className:n,borderColor:"rain",rounded:!0,"data-testid":"TemplateLoader"},r===P.TextMultipleChoice&&t.createElement(K,null))},$=function(r){var n=r.data,a=r.template,o=r.theme,c=void 0===o?{}:o,l=r.user,s=r.onLeaderboardResults;return t.createElement(q,{value:e(G,c)},t.createElement(S,{value:n},t.createElement(z,{value:{getLeaderboardResults:s,user:l}},t.createElement(J,{template:a}))))},ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function te(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var re,ne={},ae={exports:{}},oe={};function ce(){if(re)return oe;re=1;var e=t,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var l,s={},i=null,d=null;for(l in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,l)&&!c.hasOwnProperty(l)&&(s[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===s[l]&&(s[l]=t[l]);return{$$typeof:r,type:e,key:i,ref:d,props:s,_owner:o.current}}return oe.Fragment=n,oe.jsx=l,oe.jsxs=l,oe}function le(e,t){if(!t)return e;var r=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(n,a){return r.call(t,a)&&t[a]&&(n="".concat(n," ").concat(e,"--").concat(a)),n}),e)}function se(e){return function(t,r){return t?"string"!=typeof t?le(e,t):le("".concat(e,"__").concat(t),r):e}}ae.exports=ce();var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},ie.apply(this,arguments)},de=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},ue=se("rmd-icon"),me=d((function(e,t){var r=e.className,n=e.children,a=e["aria-hidden"],o=void 0===a||a,c=e.dense,l=void 0!==c&&c,s=e.iconClassName,i=void 0===s?"material-icons":s,d=e.forceSize,u=void 0!==d&&d,m=e.forceFontSize,f=void 0!==m&&m,p=de(e,["className","children","aria-hidden","dense","iconClassName","forceSize","forceFontSize"]);return ae.exports.jsx("i",ie({},p,{"aria-hidden":o,ref:t,className:x(ue({font:!0,dense:l,"forced-font":f,"forced-size":u}),i,r)},{children:n}))})),fe=function(){return fe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},fe.apply(this,arguments)},pe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},ve=se("rmd-icon"),be=d((function(e,t){var r=e["aria-hidden"],n=void 0===r||r,a=e.focusable,o=void 0===a?"false":a,c=e.xmlns,l=void 0===c?"http://www.w3.org/2000/svg":c,s=e.viewBox,i=void 0===s?"0 0 24 24":s,d=e.dense,u=void 0!==d&&d,m=e.className,f=e.use,p=e.children,v=pe(e,["aria-hidden","focusable","xmlns","viewBox","dense","className","use","children"]),b=p;return!b&&f&&(b=ae.exports.jsx("use",{xlinkHref:f})),ae.exports.jsx("svg",fe({},v,{"aria-hidden":n,ref:t,className:x(ve({svg:!0,dense:u}),m),focusable:o,xmlns:l,viewBox:i},{children:b}))})),he=function(){return he=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},he.apply(this,arguments)};var ye=function(){return ye=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},ye.apply(this,arguments)},Ee=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},ge=se("rmd-icon-rotator"),xe=d((function(e,t){var r=e.style,n=e.className,a=e.animate,o=void 0===a||a,c=e.rotated,l=e.children,s=e.forceIconWrap,i=void 0!==s&&s,d=Ee(e,["style","className","animate","rotated","children","forceIconWrap"]),p=x(ge({animate:o,rotated:c}),n);if(!i&&u(l)){var v=m.only(l);return f(v,{className:x(p,v.props.className)})}return ae.exports.jsx("span",ye({},d,{style:r,className:p,ref:t},{children:l}))})),we=function(){return we=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},we.apply(this,arguments)},Ne={back:ae.exports.jsx(me,{children:"keyboard_arrow_left"}),checkbox:ae.exports.jsx(me,{children:"check_box"}),upload:ae.exports.jsx(me,{children:"file_upload"}),dropdown:ae.exports.jsx(me,{children:"arrow_drop_down"}),error:ae.exports.jsx(me,{children:"error_outline"}),expander:ae.exports.jsx(me,{children:"keyboard_arrow_down"}),forward:ae.exports.jsx(me,{children:"keyboard_arrow_right"}),menu:ae.exports.jsx(me,{children:"menu"}),notification:ae.exports.jsx(me,{children:"notifications"}),password:ae.exports.jsx(me,{children:"remove_red_eye"}),radio:ae.exports.jsx(me,{children:"radio_button_checked"}),selected:ae.exports.jsx(me,{children:"check"}),sort:ae.exports.jsx(me,{children:"arrow_upward"})},Se=r(Ne),Ie=Se.Provider;var Oe=te(Object.freeze({__proto__:null,FontIcon:me,SVGIcon:be,TextIconSpacing:function(e){var t,r=e.className,n=e.icon,a=e.children,o=void 0===a?null:a,c=e.stacked,l=void 0!==c&&c,s=e.iconAfter,i=void 0!==s&&s,d=e.flexReverse,p=void 0!==d&&d,v=e.forceIconWrap,b=void 0!==v&&v,h=e.beforeClassName,y=void 0===h?"rmd-icon--before":h,E=e.afterClassName,g=void 0===E?"rmd-icon--after":E,w=e.aboveClassName,N=void 0===w?"rmd-icon--above":w,S=e.belowClassName,I=void 0===S?"rmd-icon--below":S;if(!n)return ae.exports.jsx(ae.exports.Fragment,{children:o});var O=p?!i:i,C=x(((t={})[y]=!l&&!O,t[g]=!l&&O,t[N]=l&&!O,t[I]=l&&O,t),r),j=n,_=o;if(!b&&u(n)){var T=m.only(n);j=f(T,{className:x(C,T.props.className)})}else n&&(j=ae.exports.jsx("span",he({className:x("rmd-text-icon-spacing",C)},{children:n})));return j&&(_=ae.exports.jsxs(ae.exports.Fragment,{children:[!i&&j,o,i&&j]})),ae.exports.jsx(ae.exports.Fragment,{children:_})},IconRotator:xe,useIcon:function(e,t){var r=l(Se);return void 0!==t?t:r[e]},IconProvider:function(e){var t=e.children,r=e.back,n=void 0===r?Ne.back:r,a=e.checkbox,o=void 0===a?Ne.checkbox:a,c=e.dropdown,l=void 0===c?Ne.dropdown:c,s=e.expander,i=void 0===s?Ne.expander:s,d=e.error,u=void 0===d?Ne.error:d,m=e.forward,f=void 0===m?Ne.forward:m,v=e.menu,b=void 0===v?Ne.menu:v,h=e.notification,y=void 0===h?Ne.notification:h,E=e.password,g=void 0===E?Ne.password:E,x=e.radio,w=void 0===x?Ne.radio:x,N=e.selected,S=void 0===N?Ne.selected:N,I=e.sort,O=void 0===I?Ne.sort:I,C=e.upload,j=void 0===C?Ne.upload:C,_=p((function(){return{back:n,checkbox:o,dropdown:l,error:u,expander:i,forward:f,menu:b,notification:y,password:g,radio:w,selected:S,sort:O,upload:j}}),[n,o,l,u,i,f,b,y,g,w,S,O,j]);return ae.exports.jsx(Ie,we({value:_},{children:t}))}})),Ce=ee&&ee.__assign||function(){return Ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ce.apply(this,arguments)};Object.defineProperty(ne,"__esModule",{value:!0});var je=ne.LightbulbOutlineSVGIcon=void 0,_e=ae.exports,Te=t,ke=Oe;je=ne.LightbulbOutlineSVGIcon=(0,Te.forwardRef)((function(e,t){return(0,_e.jsx)(ke.SVGIcon,Ce({},e,{ref:t},{children:(0,_e.jsx)("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"})}))}));var Re={lightbulbIcon:"eb-z4RCtv"},Pe=function(e){var r=e.className,n=e.explanation;return t.createElement("div",{className:x(Re.explanationContainer,r),"data-testid":"Explanation"},t.createElement(je,{className:x(Re.lightbulbIcon,"mr-4")}),t.createElement("span",{className:x(Re.explanation,"m-0"),dangerouslySetInnerHTML:{__html:n}}))},Me="eb-6lGJ0X",Le="eb-hAkxpo",ze="eb-HLIy3V",Ge="eb-VsNFkm",Ve="eb-6nDHds",qe="eb-DBAmCC",Ae="eb-HjILKR",Be=function(){var e=B().questions,r=F().responseIndexes;return t.createElement("div",{className:Me,"data-testid":"AnswersTab"},e.map((function(e,n){var a=e.text,o=e.answers,c=e.correctAnswerIndex,l=e.explanation;return t.createElement("div",{className:x(Le,"mb-32"),key:a},t.createElement("div",{className:x(ze,"font-weight-bold")},n+1),t.createElement("div",{className:x(Ge,"font-weight-bold"),dangerouslySetInnerHTML:{__html:a}}),t.createElement("div",{className:Ve},t.createElement("div",{className:x(c===r[n]?Ae:qe)},"Your Answer: ",o[r[n]]),t.createElement("div",{className:"mt-4"},"Correct Answer: ",o[c]),t.createElement(Pe,{className:"mt-16",explanation:l})))})))},Fe={},He=ee&&ee.__assign||function(){return He=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},He.apply(this,arguments)};Object.defineProperty(Fe,"__esModule",{value:!0});var Qe=Fe.CheckCircleSVGIcon=void 0,De=ae.exports,Ue=t,We=Oe;Qe=Fe.CheckCircleSVGIcon=(0,Ue.forwardRef)((function(e,t){return(0,De.jsx)(We.SVGIcon,He({},e,{ref:t},{children:(0,De.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}))}));var Xe={},Ze=ee&&ee.__assign||function(){return Ze=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ze.apply(this,arguments)};Object.defineProperty(Xe,"__esModule",{value:!0});var Ye=Xe.ReplaySVGIcon=void 0,Ke=ae.exports,Je=t,$e=Oe;Ye=Xe.ReplaySVGIcon=(0,Je.forwardRef)((function(e,t){return(0,Ke.jsx)($e.SVGIcon,Ze({},e,{ref:t},{children:(0,Ke.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})}))}));var et={},tt=ee&&ee.__assign||function(){return tt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},tt.apply(this,arguments)};Object.defineProperty(et,"__esModule",{value:!0});var rt=et.AlarmSVGIcon=void 0,nt=ae.exports,at=t,ot=Oe;rt=et.AlarmSVGIcon=(0,at.forwardRef)((function(e,t){return(0,nt.jsx)(ot.SVGIcon,tt({},e,{ref:t},{children:(0,nt.jsx)("path",{d:"M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})}))}));var ct="https://9zdy2kcoy6.execute-api.us-east-1.amazonaws.com/dev";function lt(){var e=this,t=B(),r=t.categories,n=t.generalAudience,o=t.metadata,l=t.id,s=t.popular,i=t.tightrope,d=t.type,u=t.vocab,m=F(),f=m.getLeaderboardResults,p=m.totalScore,v=a(null),b=v[0],h=v[1],y=a(!1),E=y[0],g=y[1],x=a(!1),w=x[0],N=x[1],S=a(null),I=S[0],O=S[1],_=a(null),T=_[0],k=_[1],R=a(!1),P=R[0],M=R[1],L=a(!1),z=L[0],G=L[1],V=c((function(t){return void 0===t&&(t=3),C(e,void 0,void 0,(function(){var e,r,n;return j(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,5,6]),N(!0),[4,fetch("".concat(ct,"/leaderboard?appId=").concat(o.source,"&quizId=").concat(l,"&limit=").concat(t))];case 1:return[4,a.sent().json()];case 2:return e=a.sent(),[4,f(e)];case 3:return r=a.sent(),h(r),g(!1),[3,6];case 4:return n=a.sent(),console.log(n),g(!0),[3,6];case 5:return N(!1),[7];case 6:return[2]}}))}))}),[f,o,l]),q=c((function(t){return C(e,void 0,void 0,(function(){var e,r;return j(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch("".concat(ct,"/stats/percentile?appId=").concat(o.source,"&quizId=").concat(l,"&userId=").concat(t))];case 1:return[4,n.sent().json()];case 2:return e=n.sent(),O(e.scorePercentile),[3,4];case 3:return r=n.sent(),console.log(r),[3,4];case 4:return[2]}}))}))}),[o.source,l]),A=c((function(t,r){return void 0===r&&(r=1),C(e,void 0,void 0,(function(){var e,n,a;return j(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,5,6]),G(!0),[4,fetch("".concat(ct,"/rank?appId=").concat(o.source,"&quizId=").concat(l,"&userId=").concat(t,"&neighbors=").concat(r))];case 1:return[4,c.sent().json()];case 2:return e=c.sent(),[4,f(e)];case 3:return n=c.sent(),k(n),[3,6];case 4:return a=c.sent(),console.log(a),M(!0),[3,6];case 5:return G(!1),[7];case 6:return[2]}}))}))}),[f,o.source,l]),H=c((function(t){return C(e,void 0,void 0,(function(){var e,a;return j(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),console.log("saving user score..."),[4,fetch("".concat(ct,"/score"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({appId:o.source,quizId:l,score:p,userId:t,metadata:{isGeneralAudience:n,isPopular:s,isTightrope:i,isVocab:u,primaryCategory:r[0].label,type:d,slug:o.slug}})})];case 1:return e=c.sent(),console.log("done",e),[3,3];case 2:return a=c.sent(),console.log(a),[3,3];case 3:return[2]}}))}))}),[r,n,o.source,o.slug,s,l,i,p,d,u]);return{getLeaderboardResults:V,getUserPercentile:q,getUserRankResults:A,saveUserScore:H,leaderboardResults:b,leaderboardResultsError:E,leaderboardResultsLoading:w,userPercentile:I,userRankResults:T,userRankResultsError:P,userRankResultsLoading:z}}function st(e){return 10*Math.min(e,10)}function it(e,t,r){return r?100*t+st(e):100*t}var dt,ut="eb-h0JoJS",mt="eb-g0oWRe",ft="eb-cDH2ZZ",pt="eb-PMfRkP",vt="eb-6MTWIi",bt="eb-P5IGFV",ht="eb-R87VrN",yt="eb-b7udwo",Et="eb-mzexJz";!function(e){e.Left="left",e.Right="right"}(dt||(dt={}));var gt,xt=function(e){var r,n,a,o,c,l,s=e.block,i=void 0!==s&&s,d=e.children,u=e.className,m=e.icon,p=e.iconPosition,v=void 0===p?dt.Left:p,b=e.outline,h=void 0!==b&&b,y=e.shadow,E=void 0!==y&&y,g=e.shadowSm,w=void 0!==g&&g,N=e.superButton,S=void 0!==N&&N,C=e.tag,j=void 0===C?"button":C,_=O(e,["block","children","className","icon","iconPosition","outline","shadow","shadowSm","superButton","tag"]);return t.createElement(j,I({className:x(ut,(r={},r[mt]=i,r),(n={},n[pt]=m,n),(a={},a[ft]=h,a),(o={},o[ht]=E,o),(c={},c[yt]=w,c),(l={},l[Et]=S,l),u),"data-testid":"Button"},_),v===dt.Left&&m&&f(m,{className:x(m.props.className,vt)}),d,v===dt.Right&&m&&f(m,{className:x(m.props.className,bt)}))},wt="eb-WrBwzW",Nt="eb-LlKpPo",St=function(e){var r,n=e.children,a=e.className,o=e.bgColor,c=void 0===o?void 0:o,l=e.outline;return t.createElement("div",{className:x(wt,(r={},r[Nt]=l,r),a),style:{backgroundColor:c},"data-testid":"Badge"},n)},It="eb-ttCsCh",Ot=function(e){var r=e.children,n=e.className,a=O(e,["children","className"]);return t.createElement("div",I({className:x(It,n),"data-testid":"ListGroup"},a),r)},Ct="eb-Dgd6nO",jt="eb-DkhGFO",_t="eb-kwge39",Tt=function(e){var r,n,a=e.children,o=e.active,c=e.className,l=e.justified,s=O(e,["children","active","className","justified"]);return t.createElement("div",I({className:x(Ct,(r={},r[jt]=o,r),(n={},n[_t]=l,n),c),"data-testid":"ListItem"},s),a)},kt="eb-l7tnqS",Rt="eb-FQUR34",Pt=function(e){var r=e.className,n=e.items,a=e.newScore,o=e.user;return t.createElement(Ot,{className:r,"data-testid":"Leaderboard"},n.map((function(e,r){var n=e.id,c=e.rank,l=e.name,s=e.score;return t.createElement(Tt,{key:n,justified:!0,active:n===(null==o?void 0:o.id)},t.createElement("div",{className:kt},c||r+1,". ",t.createElement("strong",null,l)),t.createElement("div",{className:Rt},n===(null==o?void 0:o.id)&&a>0&&a>s&&t.createElement(St,null,"+",a-s),(new Intl.NumberFormat).format(s)))})))},Mt="eb-Hq5iFO",Lt="eb-p1vZ3L",zt="eb-8GC4cE",Gt="eb-rgrfl0",Vt="eb-KmoX7Q",qt="eb-z33RWL",At="eb-5f5DSo",Bt="eb-RjthEk",Ft="eb-lf4O2l",Ht="eb-ykC0zi",Qt=function(e){var r=e.onRestartQuiz,n=B().questions,a=F(),c=a.correctResponses,l=a.totalCorrectScore,s=a.totalScore,i=a.totalTimerScore,d=a.user,u=lt(),m=u.leaderboardResults,f=u.leaderboardResultsError,p=u.getLeaderboardResults,v=u.getUserPercentile,b=u.getUserRankResults,h=u.userPercentile,y=u.userRankResults,E=u.userRankResultsError;return o((function(){d?(b(d.id),v(d.id)):p()}),[v,b,p,d]),o((function(){if(d&&(null==y?void 0:y.length)&&!E){var e=y.find((function(e){return e.id===d.id}));!!e&&e.rank<=3||p()}E&&p()}),[p,d,y,E]),t.createElement("div",{className:Mt,"data-testid":"LeaderboardTab"},t.createElement(Q,{className:Vt,backgroundColor:"snow",borderColor:"rain",rounded:!0},t.createElement("div",{className:Lt},t.createElement("h2",{className:"mb-4"},"All Quizzes"),t.createElement("p",{className:"font-14"},"Total Weekly Points")),m&&t.createElement(Pt,{className:"mt-20",newScore:s,items:m}),f&&t.createElement("p",null,"We're experiencing issues loading the Leaderboard at this time. Please try again later."),y&&t.createElement(Pt,{className:"mt-20",newScore:s,items:y,user:d}),E&&t.createElement("p",null,"We're experiencing issues loading your score at this time. Please try again later.")),t.createElement(Q,{className:qt,backgroundColor:"white",borderColor:"rain",rounded:!0},t.createElement("div",{className:x(zt,"text-center mb-20")},t.createElement("h2",{className:"mb-16"},"This Quiz"),h&&t.createElement("p",{className:"mt-16 font-14"},"You scored ",h,"% better than most users!")),t.createElement("div",{className:At},t.createElement("div",null,t.createElement("div",{className:"mb-8"},t.createElement("div",{className:Bt},t.createElement(Qe,{className:"mr-4"})," ",t.createElement("strong",null,c," Correct")),t.createElement("div",null,t.createElement("strong",null,l," Points"))),t.createElement("div",{className:"mt-16"},t.createElement("div",{className:Ft},t.createElement(rt,{className:"mr-4"})," ",t.createElement("strong",null,"Time Bonus")),t.createElement("div",null,t.createElement("strong",null,i," Points")))),t.createElement("div",{className:"text-center"},t.createElement("div",{className:Gt},t.createElement("div",null,t.createElement("h1",null,s)),t.createElement("div",null,t.createElement("strong",null,"POINTS"))),t.createElement("div",null,"Of ",function(e){var t=0;return e.forEach((function(e){return t+=100*e.difficulty+100})),t}(n)))),t.createElement("div",{className:"text-center mt-28"},t.createElement(xt,{icon:t.createElement(Ye,{className:Ht}),onClick:r,outline:!0,shadow:!0},"Play Again"))))},Dt="eb-oCfRGq",Ut=function(e){var r=e.children,n=e.className,a=O(e,["children","className"]);return t.createElement("a",I({},a,{className:x(Dt,"font-weight-semi-bold",n)}),r)},Wt=function(){var e=B().nextUpQuiz,r=e.image,n=e.url,a=e.title;return t.createElement(Q,{borderColor:"rain",className:"mt-20","data-testid":"NextUpQuizCard",rounded:!0,shadow:!0},t.createElement("div",{style:{aspectRatio:"16/9"}},t.createElement("img",{src:r.fullUrl,alt:r.altText})),t.createElement("div",{className:"p-20"},t.createElement(Ut,{className:"font-20",href:n},a),t.createElement(xt,{tag:"a",href:n,className:"mt-20",block:!0},"Play")))},Xt="eb-NdGzM3",Zt="eb-fQMdMF",Yt="eb-i8uKTc",Kt="eb-ZBrDqu",Jt="eb-FOeG4W",$t="eb-fQceh4",er="eb-vzHSa2",tr="eb-sS9sRH",rr=function(){var e=F(),r=e.correctResponses,n=e.totalScore,a=B().questions,o=r/a.length*100;return t.createElement("div",{className:Xt},t.createElement("div",{className:Zt,"data-testid":"ScoreSummaryWheel"},t.createElement("div",{className:x($t,"px-12 py-8 font-weight-semi-bold")},"Congrats!"),t.createElement("svg",{viewBox:"0 0 36 36",className:Yt},t.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:Jt}),t.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:Kt,strokeDasharray:"".concat(o," 100")})),t.createElement("div",{className:x(er,"text-center")},t.createElement("div",{className:x(tr,"font-weight-super-bold")},r,"/",a.length),t.createElement("div",{className:"font-12"},n," points"))))},nr="eb-od4oX9",ar="eb-F71AtK",or="eb-EM5HVl",cr="eb-yx3D4X",lr="eb-0AMT86",sr=function(e){var r=e.onRestartQuiz,n=w({maxWidth:M.XsMax}),a=B().title;return t.createElement("div",{"data-testid":"ScoreTab",className:nr},t.createElement(Q,{className:ar,borderColor:"rain",backgroundColor:"ice",rounded:!n,shadow:!n},t.createElement("div",{className:or},t.createElement("div",{className:"font-18 font-weight-extra-bold"},a),t.createElement(rr,null),t.createElement(xt,{icon:t.createElement(Ye,{className:lr}),onClick:r,outline:!0,shadow:!0},"Play Again")),t.createElement("div",{className:cr},t.createElement("div",{className:"font-weight-extra-bold font-24"},"Next Up!"),t.createElement(Wt,null))))},ir=r({activeTabId:"default",setActiveTabId:function(){}}),dr=function(e){var r=e.children,n=e.defaultActiveTabId,o=a(n),c=o[0],l=o[1];return t.createElement(ir.Provider,{value:{activeTabId:c,setActiveTabId:l}},r)},ur="eb-fkZcg2",mr="eb-ntGIO4",fr=function(e){var r,n=e.children,a=e.className,o=e.controlFor,c=l(ir),s=c.setActiveTabId,i=c.activeTabId===o;return t.createElement("button",{className:x(ur,(r={},r[mr]=i,r),a),"data-testid":"Tab",id:"".concat(o,"-tab"),role:"tab","aria-controls":o,"aria-selected":i,tabIndex:i?void 0:-1,onClick:function(){return s(o)}},n)},pr=function(e){var r=e.children,n=e.className,a=e.id,o=O(e,["children","className","id"]);return a===l(ir).activeTabId?t.createElement("div",I({id:a,className:n,"data-testid":"TabContent",tabIndex:0,role:"tabpanel","aria-labelledby":"".concat(a,"-tab")},o),r):null},vr="eb-ftdu2H",br=function(e){var r=e.children,n=e.className,a=e.label;return t.createElement("div",{className:x(vr,n),"data-testid":"Tabs",role:"tablist","aria-label":a},r)},hr="eb-vDPeCr",yr="eb-bMiWKa";!function(e){e.AnswersTab="AnswersTab",e.LeaderboardTab="LeaderboardTab",e.ScoreTab="ScoreTab"}(gt||(gt={}));var Er=Object.freeze({__proto__:null,default:function(){var e=B().image,r=F(),n=r.dispatch,a=r.user,c=lt().saveUserScore,l=E();function s(){n({type:T.SetRestarted}),l("/")}return o((function(){a&&c(a.id)}),[c,a]),t.createElement("div",{"data-testid":"ResultsView",className:hr,style:{backgroundImage:"url(".concat(e.fullUrl,")")}},t.createElement(dr,{defaultActiveTabId:gt.ScoreTab},t.createElement(br,{label:"Results View"},t.createElement(fr,{controlFor:gt.ScoreTab},"Score"),t.createElement(fr,{controlFor:gt.AnswersTab},"Answers"),t.createElement(fr,{controlFor:gt.LeaderboardTab},"Leaderboard")),t.createElement(pr,{className:yr,id:gt.ScoreTab},t.createElement(sr,{onRestartQuiz:s})),t.createElement(pr,{className:yr,id:gt.AnswersTab},t.createElement(Be,null)),t.createElement(pr,{className:yr,id:gt.LeaderboardTab},t.createElement(Qt,{onRestartQuiz:s}))))}}),gr="eb-8LB0Z6",xr="eb-xrnrMX",wr="eb-uQ6x3r",Nr="eb-RTZJDf",Sr="eb-nCZamz",Ir="eb-XBUSmk",Or="eb-6uIIpF",Cr="eb-vaYYcz",jr="eb-FGnvGm",_r=function(e){var r=e.children;return t.createElement("div",{className:jr,"data-testid":"SwitchControl"},r)},Tr="eb-FxfgLd",kr=function(e){var r=e.id,n=O(e,["id"]);return t.createElement("input",I({id:r,className:Tr,type:"checkbox",role:"switch"},n))},Rr=Object.freeze({__proto__:null,default:function(){var e=B(),r=e.id,n=e.categories,a=e.image,o=e.title,c=e.timed,l=e.questions,s=F(),i=s.dispatch,d=s.timerEnabled;return t.createElement("div",{className:gr,"data-testid":"IntroView",style:{aspectRatio:"900 / 675"}},t.createElement("img",{className:xr,src:a.fullUrl,alt:a.altText}),t.createElement("div",{className:wr},t.createElement(Q,{borderColor:"rain",className:x(Ir,"p-20"),rounded:!0,shadow:!0},t.createElement("div",{className:Nr},t.createElement(St,{className:x(Sr),bgColor:"var(--qc-ice)",outline:!0},t.createElement("span",{className:"font-14"},n[0].label))),t.createElement("h1",{className:x(Cr,"font-weight-semi-bold text-center")},o),t.createElement("div",{className:"text-center"},t.createElement(xt,{className:"p-28",tag:g,to:"/".concat(r),block:!0,superButton:!0},"Start")),t.createElement("div",{className:x(Or,"pt-16")},t.createElement("div",{className:"font-14 font-weight-semi-bold"},l.length," Questions"),c&&t.createElement(_r,null,t.createElement("label",{className:"font-14",htmlFor:"toggle"},"Timer Bonus"),t.createElement(kr,{id:"".concat(r),defaultChecked:d,onClick:function(){return i({type:T.SetTimerEnabled,payload:!d})}}))))))}}),Pr={},Mr=ee&&ee.__assign||function(){return Mr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Mr.apply(this,arguments)};Object.defineProperty(Pr,"__esModule",{value:!0});var Lr=Pr.ArrowForwardSVGIcon=void 0,zr=ae.exports,Gr=t,Vr=Oe;Lr=Pr.ArrowForwardSVGIcon=(0,Gr.forwardRef)((function(e,t){return(0,zr.jsx)(Vr.SVGIcon,Mr({},e,{ref:t},{children:(0,zr.jsx)("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"})}))}));var qr={},Ar=ee&&ee.__assign||function(){return Ar=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ar.apply(this,arguments)};Object.defineProperty(qr,"__esModule",{value:!0});var Br=qr.CloseSVGIcon=void 0,Fr=ae.exports,Hr=t,Qr=Oe;Br=qr.CloseSVGIcon=(0,Hr.forwardRef)((function(e,t){return(0,Fr.jsx)(Qr.SVGIcon,Ar({},e,{ref:t},{children:(0,Fr.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}));var Dr={},Ur=ee&&ee.__assign||function(){return Ur=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ur.apply(this,arguments)};Object.defineProperty(Dr,"__esModule",{value:!0});var Wr=Dr.CheckSVGIcon=void 0,Xr=ae.exports,Zr=t,Yr=Oe;Wr=Dr.CheckSVGIcon=(0,Zr.forwardRef)((function(e,t){return(0,Xr.jsx)(Yr.SVGIcon,Ur({},e,{ref:t},{children:(0,Xr.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}))}));var Kr,Jr={answerButtonContainer:"eb-hm0P2D",answerButton:"eb-EkupIl",selected:"eb-p8ZbDY",correct:"eb-5WC5qo",correctSelected:"eb-Z1YT6r",incorrectSelected:"eb-V0bjjy",disabled:"eb-N51x3L",default:"eb-e7y9O4",icon:"eb-8I8Gjv",correctIcon:"eb-NVqaa3",incorrectIcon:"eb-5sHpoZ"};!function(e){e.Correct="correct",e.CorrectSelected="correctSelected",e.Default="default",e.IncorrectSelected="incorrectSelected",e.Selected="selected"}(Kr||(Kr={}));var $r,en,tn,rn=function(e){var r,n=e.children,a=e.status,o=void 0===a?Kr.Default:a,c=e.disabled,l=O(e,["children","status","disabled"]);return t.createElement("div",{className:Jr.answerButtonContainer},Kr.CorrectSelected===o&&t.createElement(Wr,{className:x(Jr.icon,Jr.correctIcon,"font-12 p-4")}),Kr.IncorrectSelected===o&&t.createElement(Br,{className:x(Jr.icon,Jr.incorrectIcon,"font-12 p-4")}),t.createElement(xt,I({className:x(Jr.answerButton,o&&Jr[o],(r={},r[Jr.disabled]=c,r)),outline:!0,block:!0,disabled:c,superButton:!0,shadowSm:!0},l),n))},nn="eb-fKHH4k",an="eb-Ka5TRS",on="eb-eQLIHc",cn="eb-YcibRH",ln="eb-pAHhPN";!function(e){e.Play="play",e.Pause="pause",e.Stop="stop"}($r||($r={})),function(e){e.Correct="var(--qc-green)",e.Incorrect="var(--qc-red)",e.Default="var(--qc-blue-200)"}(en||(en={})),function(e){e.Left="left",e.Right="right"}(tn||(tn={}));var sn=function(e){var r=e.labelMessage,n=e.labelPosition,c=void 0===n?tn.Left:n,l=e.onExpire,s=e.status,i=e.theme,d=void 0===i?en.Default:i,u=e.time,m=void 0===u?15:u,f=e.timerRef,p=a(m),b=p[0],h=p[1],y=a(!1),E=y[0],g=y[1],x=v(0);return o((function(){return s===$r.Play&&(x.current=window.setInterval((function(){return h((function(e){return e-1}))}),1e3)),s===$r.Stop&&(clearInterval(x.current),h(m)),s===$r.Pause&&clearInterval(x.current),function(){clearInterval(x.current),g(!1)}}),[s,m]),o((function(){0===b&&(clearInterval(x.current),g(!0),l&&l())}),[l,b]),t.createElement("div",{className:nn,"data-testid":"Timer"},c===tn.Left&&t.createElement("div",{className:cn},!b&&t.createElement(St,{bgColor:en.Incorrect},"Time's Up!"),r&&!!b&&t.createElement(St,{bgColor:d},r)),t.createElement("div",{className:an},t.createElement("svg",null,t.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:E?en.Incorrect:"var(--qc-rain)"}}),t.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:d,strokeDashoffset:145-145*b/m}})),t.createElement("p",{ref:f,className:on},b)),c===tn.Right&&t.createElement("div",{className:ln},!b&&t.createElement(St,{bgColor:en.Incorrect},"Time's Up!"),r&&!!b&&t.createElement(St,{bgColor:d},r)))},dn="eb-db86L8",un="eb-fl8Stz",mn="eb-MbWQdV",fn=function(e){var r=e.title,n=e.timerEnabled,a=void 0===n||n,o=e.timerRef,c=e.timerScore,l=e.timerStatus,s=void 0===l?$r.Stop:l,i=e.timerTheme,d=void 0===i?en.Default:i,u=e.timerTime,m=void 0===u?15:u,f=e.onTimerExpire,p=e.totalScore,v=void 0===p?0:p,b=e.currentCount,h=void 0===b?0:b,y=e.totalCount,E=void 0===y?0:y,g=w({maxWidth:M.MdMin});return t.createElement("div",{className:x(dn,"p-4")},t.createElement("span",{className:x(mn,"pl-16")},r),t.createElement("div",{className:x(un,"px-16")},a&&t.createElement(sn,{time:m,timerRef:o,theme:d,status:s,onExpire:f,labelMessage:c?"+".concat(c):void 0,labelPosition:g?tn.Right:tn.Left}),t.createElement("div",{className:"pl-24"},t.createElement("span",{className:"font-weight-bold "},h)," of"," ",t.createElement("span",{className:"font-weight-bold"},E)),t.createElement("div",{className:"pl-24"},"Score: ",t.createElement("span",{className:"font-weight-bold"},v))))},pn="eb-NelLRW",vn="eb-nXyIBf",bn="eb-VgMNit",hn="eb-8SxGFY",yn=Object.freeze({__proto__:null,default:function(){var e=E(),r=A().event,n=v(null),l=a($r.Stop),s=l[0],i=l[1],d=a(0),u=d[0],m=d[1],f=a(null),p=f[0],b=f[1],h=B(),y=h.id,g=h.title,w=h.questions,N=h.seconds,S=h.type,I=F(),O=I.currentQuestionIndex,C=I.correctResponses,j=I.dispatch,k=I.responseIndexes,R=I.restarted,P=I.totalCorrectScore,M=I.totalScore,L=I.totalTimerScore,z=I.timerEnabled,G=w[O];o((function(){return z&&i($r.Play),function(){z&&i($r.Stop)}}),[O,z]);var V=c((function(){b(-1)}),[]);function q(e){return e===p&&p===G.correctAnswerIndex?Kr.CorrectSelected:e===p&&p!==G.correctAnswerIndex?Kr.IncorrectSelected:null!==p&&e===G.correctAnswerIndex?Kr.Correct:Kr.Default}return t.createElement("div",{"data-testid":"QuestionView"},t.createElement(fn,{currentCount:O+1,onTimerExpire:V,title:g,totalCount:w.length,totalScore:M,timerEnabled:z,timerRef:n,timerScore:u,timerStatus:s,timerTime:N,timerTheme:p===G.correctAnswerIndex?en.Correct:null!==p&&p!==G.correctAnswerIndex?en.Incorrect:en.Default}),t.createElement(Q,{className:x(x(pn,"pb-20")),backgroundColor:"ice"},t.createElement("div",{className:x(hn,"p-24 font-24 font-weight-normal text-center"),dangerouslySetInnerHTML:{__html:G.text}}),t.createElement("div",{className:x(vn,"p-24")},G.answers.map((function(e,a){return t.createElement(rn,{disabled:null!==p,key:e,onClick:function(){return function(e){var t,a,o=e===G.correctAnswerIndex;if(o){var c=(null===(t=n.current)||void 0===t?void 0:t.innerHTML)?+(null===(a=n.current)||void 0===a?void 0:a.innerHTML):0,l=it(c,G.difficulty,z);m(l),j({type:T.setTotalCorrectScore,payload:P+it(0,G.difficulty,!1)}),z&&j({type:T.setTotalTimerScore,payload:L+st(c)}),j({type:T.SetTotalScore,payload:M+l}),j({type:T.SetCorrectResponses,payload:C+1})}b(e),i($r.Pause),j({type:T.SetCorrectIndexes,payload:_(_([],k,!0),[e],!1)}),r("question_answered",{quiz_id:y,question_index:O,answer_index:e,answered_correctly:o,answer_text:G.answers[e],quiz_type:S.toString(),total_questions:w.length})}(a)},status:q(a)},e)}))),null!==p&&t.createElement(xt,{onClick:function(){O<w.length-1?(j({type:T.setCurrentQuestionIndex,payload:O+1}),b(null),z&&(i($r.Stop),m(0))):(e("/results"),r("quiz_complete",{quiz_id:y,questions_answered:k.length,restarted:R,correct_responses:C,quiz_type:S.toString(),total_questions:w.length}))},superButton:!0},"Next ",t.createElement(Lr,{className:"ml-8"})),null!==p&&t.createElement(Pe,{className:x(bn,"mt-24 p-24"),explanation:G.explanation})))}});export{M as Breakpoint,$ as Quiz,P as Template};
import e from"deepmerge";import t,{createContext as r,useReducer as n,useState as a,useEffect as o,useCallback as c,useContext as l,Suspense as s,lazy as i,forwardRef as d,isValidElement as u,Children as m,cloneElement as f,useMemo as p,useRef as v}from"react";import{MemoryRouter as b,Routes as h,Route as y,useNavigate as E,Link as g}from"react-router-dom";import x from"classnames";import{useMediaQuery as w}from"react-responsive";var N=r({}),S=N.Provider,I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},I.apply(this,arguments)};function O(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}function C(e,t,r,n){return new(r||(r=Promise))((function(a,o){function c(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(c,l)}s((n=n.apply(e,t||[])).next())}))}function j(e,t){var r,n,a,o,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;c;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,n=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(a=c.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){c.label=o[1];break}if(6===o[0]&&c.label<a[1]){c.label=a[1],a=o;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(o);break}a[2]&&c.ops.pop(),c.trys.pop();continue}o=t.call(e,c)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}function _(e,t,r){if(r||2===arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}var T,k={responseIndexes:[],correctResponses:0,currentQuestionIndex:0,restarted:!1,totalCorrectScore:0,totalScore:0,totalTimerScore:0,timerEnabled:!0,user:null,getLeaderboardResults:function(){return C(void 0,void 0,void 0,(function(){return j(this,(function(e){return[2,[]]}))}))},dispatch:function(){}};function R(e,t){switch(t.type){case T.SetCorrectIndexes:return I(I({},e),{responseIndexes:t.payload});case T.SetCorrectResponses:return I(I({},e),{correctResponses:t.payload});case T.setCurrentQuestionIndex:return I(I({},e),{currentQuestionIndex:t.payload});case T.SetRestarted:return I(I({},e),{correctResponses:k.correctResponses,currentQuestionIndex:k.currentQuestionIndex,responseIndexes:k.responseIndexes,restarted:!0,totalCorrectScore:k.totalCorrectScore,totalScore:k.totalScore,totalTimerScore:k.totalTimerScore});case T.setTotalCorrectScore:return I(I({},e),{totalCorrectScore:t.payload});case T.SetTotalScore:return I(I({},e),{totalScore:t.payload});case T.setTotalTimerScore:return I(I({},e),{totalTimerScore:t.payload});case T.SetTimerEnabled:return I(I({},e),{timerEnabled:t.payload});default:throw new Error("Please make sure to use the right action type reducer.")}}!function(e){e[e.SetCorrectIndexes=0]="SetCorrectIndexes",e[e.SetCorrectResponses=1]="SetCorrectResponses",e[e.setCurrentQuestionIndex=2]="setCurrentQuestionIndex",e[e.SetRestarted=3]="SetRestarted",e[e.setTotalCorrectScore=4]="setTotalCorrectScore",e[e.SetTotalScore=5]="SetTotalScore",e[e.setTotalTimerScore=6]="setTotalTimerScore",e[e.SetTimerEnabled=7]="SetTimerEnabled"}(T||(T={}));var P,M,L=r(k),z=function(e){var r=e.children,a=e.value,o=n(R,k),c=o[0],l=o[1];return t.createElement(L.Provider,{value:I(I(I({},c),a),{dispatch:l})},r)},G={quizContainer:"eb-16RLBn"},V=r(G),q=V.Provider;function A(){var e=a(!1),t=e[0],r=e[1];return o((function(){void 0!==window.gtag&&r(!0)}),[]),{event:c((function(e,r){t&&window.gtag("event",e,r)}),[t])}}function B(){return l(N)}function F(){return l(L)}!function(e){e.TextMultipleChoice="TEXT_MULTIPLE_CHOICE",e.ImageMultipleChoice="IMAGE_MULTIPLE_CHOICE"}(P||(P={})),function(e){e[e.XsMin=0]="XsMin",e[e.XsMax=671]="XsMax",e[e.SmMin=672]="SmMin",e[e.SmMax=959]="SmMax",e[e.MdMin=960]="MdMin",e[e.MdMax=1247]="MdMax",e[e.LgMin=1248]="LgMin",e[e.LgMax=1399]="LgMax",e[e.XlMin=1400]="XlMin"}(M||(M={}));var H={Box:"eb-ASYLqS",snowBackground:"eb-ZLkp2m",whiteBackground:"eb-DGfpHy",iceBackground:"eb-Nvt3tb",rainBorder:"eb-cMrTGF",grayBorder:"eb-94S9mY",rounded:"eb-GHgeM2",shadow:"eb-PiP0Bt"},Q=function(e){var r,n,a=e.children,o=e.className,c=e.backgroundColor,l=void 0===c?"white":c,s=e.borderColor,i=void 0===s?"gray":s,d=e.rounded,u=void 0!==d&&d,m=e.shadow,f=void 0!==m&&m,p=O(e,["children","className","backgroundColor","borderColor","rounded","shadow"]);return t.createElement("div",I({className:x(H.Box,(r={},r[H.rounded]=u,r),(n={},n[H.shadow]=f,n),H["".concat(l,"Background")],H["".concat(i,"Border")],o),"data-testid":"Box"},p),a)},D=i((function(){return Promise.resolve().then((function(){return Er}))})),U=function(e){return t.createElement(s,{fallback:null},t.createElement(D,I({},e)))},W=i((function(){return Promise.resolve().then((function(){return Rr}))})),X=function(e){return t.createElement(s,{fallback:null},t.createElement(W,I({},e)))},Z=i((function(){return Promise.resolve().then((function(){return yn}))})),Y=function(e){return t.createElement(s,{fallback:null},t.createElement(Z,I({},e)))},K=function(){return t.createElement(b,null,t.createElement(h,null,t.createElement(y,{path:"/",element:t.createElement(X,null)}),t.createElement(y,{path:"/:questionId",element:t.createElement(Y,null)}),t.createElement(y,{path:"/results",element:t.createElement(U,null)})))},J=function(e){var r=e.template,n=l(V).quizContainer,a=A().event,c=B(),s=c.id,i=c.questions,d=c.type,u=F(),m=u.correctResponses,f=u.restarted,p=u.responseIndexes;return o((function(){function e(){p.length<i.length&&a("quiz_abandoned",{quiz_id:s,questions_answered:p.length,restarted:f,correct_responses:m,quiz_type:d.toString(),total_questions:i.length})}return window.addEventListener("beforeunload",e),function(){return window.removeEventListener("beforeunload",e)}}),[s,p,m,i.length,a,f,d]),t.createElement(Q,{className:n,borderColor:"rain",rounded:!0,"data-testid":"TemplateLoader"},r===P.TextMultipleChoice&&t.createElement(K,null))},$=function(r){var n=r.data,a=r.template,o=r.theme,c=void 0===o?{}:o,l=r.user,s=r.onLeaderboardResults;return t.createElement(q,{value:e(G,c)},t.createElement(S,{value:n},t.createElement(z,{value:{getLeaderboardResults:s,user:l}},t.createElement(J,{template:a}))))},ee="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function te(e){var t=e.default;if("function"==typeof t){var r=function(){return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var re,ne={},ae={exports:{}},oe={};function ce(){if(re)return oe;re=1;var e=t,r=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var l,s={},i=null,d=null;for(l in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,l)&&!c.hasOwnProperty(l)&&(s[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===s[l]&&(s[l]=t[l]);return{$$typeof:r,type:e,key:i,ref:d,props:s,_owner:o.current}}return oe.Fragment=n,oe.jsx=l,oe.jsxs=l,oe}function le(e,t){if(!t)return e;var r=Object.prototype.hasOwnProperty;return Object.keys(t).reduce((function(n,a){return r.call(t,a)&&t[a]&&(n="".concat(n," ").concat(e,"--").concat(a)),n}),e)}function se(e){return function(t,r){return t?"string"!=typeof t?le(e,t):le("".concat(e,"__").concat(t),r):e}}ae.exports=ce();var ie=function(){return ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},ie.apply(this,arguments)},de=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},ue=se("rmd-icon"),me=d((function(e,t){var r=e.className,n=e.children,a=e["aria-hidden"],o=void 0===a||a,c=e.dense,l=void 0!==c&&c,s=e.iconClassName,i=void 0===s?"material-icons":s,d=e.forceSize,u=void 0!==d&&d,m=e.forceFontSize,f=void 0!==m&&m,p=de(e,["className","children","aria-hidden","dense","iconClassName","forceSize","forceFontSize"]);return ae.exports.jsx("i",ie({},p,{"aria-hidden":o,ref:t,className:x(ue({font:!0,dense:l,"forced-font":f,"forced-size":u}),i,r)},{children:n}))})),fe=function(){return fe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},fe.apply(this,arguments)},pe=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},ve=se("rmd-icon"),be=d((function(e,t){var r=e["aria-hidden"],n=void 0===r||r,a=e.focusable,o=void 0===a?"false":a,c=e.xmlns,l=void 0===c?"http://www.w3.org/2000/svg":c,s=e.viewBox,i=void 0===s?"0 0 24 24":s,d=e.dense,u=void 0!==d&&d,m=e.className,f=e.use,p=e.children,v=pe(e,["aria-hidden","focusable","xmlns","viewBox","dense","className","use","children"]),b=p;return!b&&f&&(b=ae.exports.jsx("use",{xlinkHref:f})),ae.exports.jsx("svg",fe({},v,{"aria-hidden":n,ref:t,className:x(ve({svg:!0,dense:u}),m),focusable:o,xmlns:l,viewBox:i},{children:b}))})),he=function(){return he=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},he.apply(this,arguments)};var ye=function(){return ye=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},ye.apply(this,arguments)},Ee=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},ge=se("rmd-icon-rotator"),xe=d((function(e,t){var r=e.style,n=e.className,a=e.animate,o=void 0===a||a,c=e.rotated,l=e.children,s=e.forceIconWrap,i=void 0!==s&&s,d=Ee(e,["style","className","animate","rotated","children","forceIconWrap"]),p=x(ge({animate:o,rotated:c}),n);if(!i&&u(l)){var v=m.only(l);return f(v,{className:x(p,v.props.className)})}return ae.exports.jsx("span",ye({},d,{style:r,className:p,ref:t},{children:l}))})),we=function(){return we=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},we.apply(this,arguments)},Ne={back:ae.exports.jsx(me,{children:"keyboard_arrow_left"}),checkbox:ae.exports.jsx(me,{children:"check_box"}),upload:ae.exports.jsx(me,{children:"file_upload"}),dropdown:ae.exports.jsx(me,{children:"arrow_drop_down"}),error:ae.exports.jsx(me,{children:"error_outline"}),expander:ae.exports.jsx(me,{children:"keyboard_arrow_down"}),forward:ae.exports.jsx(me,{children:"keyboard_arrow_right"}),menu:ae.exports.jsx(me,{children:"menu"}),notification:ae.exports.jsx(me,{children:"notifications"}),password:ae.exports.jsx(me,{children:"remove_red_eye"}),radio:ae.exports.jsx(me,{children:"radio_button_checked"}),selected:ae.exports.jsx(me,{children:"check"}),sort:ae.exports.jsx(me,{children:"arrow_upward"})},Se=r(Ne),Ie=Se.Provider;var Oe=te(Object.freeze({__proto__:null,FontIcon:me,SVGIcon:be,TextIconSpacing:function(e){var t,r=e.className,n=e.icon,a=e.children,o=void 0===a?null:a,c=e.stacked,l=void 0!==c&&c,s=e.iconAfter,i=void 0!==s&&s,d=e.flexReverse,p=void 0!==d&&d,v=e.forceIconWrap,b=void 0!==v&&v,h=e.beforeClassName,y=void 0===h?"rmd-icon--before":h,E=e.afterClassName,g=void 0===E?"rmd-icon--after":E,w=e.aboveClassName,N=void 0===w?"rmd-icon--above":w,S=e.belowClassName,I=void 0===S?"rmd-icon--below":S;if(!n)return ae.exports.jsx(ae.exports.Fragment,{children:o});var O=p?!i:i,C=x(((t={})[y]=!l&&!O,t[g]=!l&&O,t[N]=l&&!O,t[I]=l&&O,t),r),j=n,_=o;if(!b&&u(n)){var T=m.only(n);j=f(T,{className:x(C,T.props.className)})}else n&&(j=ae.exports.jsx("span",he({className:x("rmd-text-icon-spacing",C)},{children:n})));return j&&(_=ae.exports.jsxs(ae.exports.Fragment,{children:[!i&&j,o,i&&j]})),ae.exports.jsx(ae.exports.Fragment,{children:_})},IconRotator:xe,useIcon:function(e,t){var r=l(Se);return void 0!==t?t:r[e]},IconProvider:function(e){var t=e.children,r=e.back,n=void 0===r?Ne.back:r,a=e.checkbox,o=void 0===a?Ne.checkbox:a,c=e.dropdown,l=void 0===c?Ne.dropdown:c,s=e.expander,i=void 0===s?Ne.expander:s,d=e.error,u=void 0===d?Ne.error:d,m=e.forward,f=void 0===m?Ne.forward:m,v=e.menu,b=void 0===v?Ne.menu:v,h=e.notification,y=void 0===h?Ne.notification:h,E=e.password,g=void 0===E?Ne.password:E,x=e.radio,w=void 0===x?Ne.radio:x,N=e.selected,S=void 0===N?Ne.selected:N,I=e.sort,O=void 0===I?Ne.sort:I,C=e.upload,j=void 0===C?Ne.upload:C,_=p((function(){return{back:n,checkbox:o,dropdown:l,error:u,expander:i,forward:f,menu:b,notification:y,password:g,radio:w,selected:S,sort:O,upload:j}}),[n,o,l,u,i,f,b,y,g,w,S,O,j]);return ae.exports.jsx(Ie,we({value:_},{children:t}))}})),Ce=ee&&ee.__assign||function(){return Ce=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ce.apply(this,arguments)};Object.defineProperty(ne,"__esModule",{value:!0});var je=ne.LightbulbOutlineSVGIcon=void 0,_e=ae.exports,Te=t,ke=Oe;je=ne.LightbulbOutlineSVGIcon=(0,Te.forwardRef)((function(e,t){return(0,_e.jsx)(ke.SVGIcon,Ce({},e,{ref:t},{children:(0,_e.jsx)("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z"})}))}));var Re={lightbulbIcon:"eb-z4RCtv"},Pe=function(e){var r=e.className,n=e.explanation;return t.createElement("div",{className:x(Re.explanationContainer,r),"data-testid":"Explanation"},t.createElement(je,{className:x(Re.lightbulbIcon,"mr-4")}),t.createElement("span",{className:x(Re.explanation,"m-0"),dangerouslySetInnerHTML:{__html:n}}))},Me="eb-6lGJ0X",Le="eb-hAkxpo",ze="eb-HLIy3V",Ge="eb-VsNFkm",Ve="eb-6nDHds",qe="eb-DBAmCC",Ae="eb-HjILKR",Be=function(){var e=B().questions,r=F().responseIndexes;return t.createElement("div",{className:Me,"data-testid":"AnswersTab"},e.map((function(e,n){var a=e.text,o=e.answers,c=e.correctAnswerIndex,l=e.explanation;return t.createElement("div",{className:x(Le,"mb-32"),key:a},t.createElement("div",{className:x(ze,"font-weight-bold")},n+1),t.createElement("div",{className:x(Ge,"font-weight-bold"),dangerouslySetInnerHTML:{__html:a}}),t.createElement("div",{className:Ve},t.createElement("div",{className:x(c===r[n]?Ae:qe)},"Your Answer: ",o[r[n]]),t.createElement("div",{className:"mt-4"},"Correct Answer: ",o[c]),t.createElement(Pe,{className:"mt-16",explanation:l})))})))},Fe={},He=ee&&ee.__assign||function(){return He=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},He.apply(this,arguments)};Object.defineProperty(Fe,"__esModule",{value:!0});var Qe=Fe.CheckCircleSVGIcon=void 0,De=ae.exports,Ue=t,We=Oe;Qe=Fe.CheckCircleSVGIcon=(0,Ue.forwardRef)((function(e,t){return(0,De.jsx)(We.SVGIcon,He({},e,{ref:t},{children:(0,De.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}))}));var Xe={},Ze=ee&&ee.__assign||function(){return Ze=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ze.apply(this,arguments)};Object.defineProperty(Xe,"__esModule",{value:!0});var Ye=Xe.ReplaySVGIcon=void 0,Ke=ae.exports,Je=t,$e=Oe;Ye=Xe.ReplaySVGIcon=(0,Je.forwardRef)((function(e,t){return(0,Ke.jsx)($e.SVGIcon,Ze({},e,{ref:t},{children:(0,Ke.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"})}))}));var et={},tt=ee&&ee.__assign||function(){return tt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},tt.apply(this,arguments)};Object.defineProperty(et,"__esModule",{value:!0});var rt=et.AlarmSVGIcon=void 0,nt=ae.exports,at=t,ot=Oe;rt=et.AlarmSVGIcon=(0,at.forwardRef)((function(e,t){return(0,nt.jsx)(ot.SVGIcon,tt({},e,{ref:t},{children:(0,nt.jsx)("path",{d:"M22 5.72l-4.6-3.86-1.29 1.53 4.6 3.86L22 5.72zM7.88 3.39L6.6 1.86 2 5.71l1.29 1.53 4.59-3.85zM12.5 8H11v6l4.75 2.85.75-1.23-4-2.37V8zM12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9c4.97 0 9-4.03 9-9s-4.03-9-9-9zm0 16c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})}))}));var ct="https://9zdy2kcoy6.execute-api.us-east-1.amazonaws.com/dev";function lt(){var e=this,t=B(),r=t.categories,n=t.generalAudience,o=t.metadata,l=t.id,s=t.popular,i=t.tightrope,d=t.type,u=t.vocab,m=F(),f=m.getLeaderboardResults,p=m.totalScore,v=a(null),b=v[0],h=v[1],y=a(!1),E=y[0],g=y[1],x=a(!1),w=x[0],N=x[1],S=a(null),I=S[0],O=S[1],_=a(null),T=_[0],k=_[1],R=a(!1),P=R[0],M=R[1],L=a(!1),z=L[0],G=L[1],V=c((function(t){return void 0===t&&(t=3),C(e,void 0,void 0,(function(){var e,r,n;return j(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,5,6]),N(!0),[4,fetch("".concat(ct,"/leaderboard?appId=").concat(o.source,"&quizId=").concat(l,"&limit=").concat(t))];case 1:return[4,a.sent().json()];case 2:return e=a.sent(),[4,f(e)];case 3:return r=a.sent(),h(r),g(!1),[3,6];case 4:return n=a.sent(),console.log(n),g(!0),[3,6];case 5:return N(!1),[7];case 6:return[2]}}))}))}),[f,o,l]),q=c((function(t){return C(e,void 0,void 0,(function(){var e,r;return j(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch("".concat(ct,"/stats/percentile?appId=").concat(o.source,"&quizId=").concat(l,"&userId=").concat(t))];case 1:return[4,n.sent().json()];case 2:return e=n.sent(),O(e.scorePercentile),[3,4];case 3:return r=n.sent(),console.log(r),[3,4];case 4:return[2]}}))}))}),[o.source,l]),A=c((function(t,r){return void 0===r&&(r=1),C(e,void 0,void 0,(function(){var e,n,a;return j(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,5,6]),G(!0),[4,fetch("".concat(ct,"/rank?appId=").concat(o.source,"&quizId=").concat(l,"&userId=").concat(t,"&neighbors=").concat(r))];case 1:return[4,c.sent().json()];case 2:return e=c.sent(),[4,f(e)];case 3:return n=c.sent(),k(n),[3,6];case 4:return a=c.sent(),console.log(a),M(!0),[3,6];case 5:return G(!1),[7];case 6:return[2]}}))}))}),[f,o.source,l]),H=c((function(t){return C(e,void 0,void 0,(function(){var e,a;return j(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),console.log("saving user score..."),[4,fetch("".concat(ct,"/score"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({appId:o.source,quizId:l,score:p,userId:t,metadata:{isGeneralAudience:n,isPopular:s,isTightrope:i,isVocab:u,primaryCategory:r[0].label,type:d,slug:o.slug}})})];case 1:return e=c.sent(),console.log("done",e),[3,3];case 2:return a=c.sent(),console.log(a),[3,3];case 3:return[2]}}))}))}),[r,n,o.source,o.slug,s,l,i,p,d,u]);return{getLeaderboardResults:V,getUserPercentile:q,getUserRankResults:A,saveUserScore:H,leaderboardResults:b,leaderboardResultsError:E,leaderboardResultsLoading:w,userPercentile:I,userRankResults:T,userRankResultsError:P,userRankResultsLoading:z}}function st(e){return 10*Math.min(e,10)}function it(e,t,r){return r?100*t+st(e):100*t}var dt,ut="eb-h0JoJS",mt="eb-g0oWRe",ft="eb-cDH2ZZ",pt="eb-PMfRkP",vt="eb-6MTWIi",bt="eb-P5IGFV",ht="eb-R87VrN",yt="eb-b7udwo",Et="eb-mzexJz";!function(e){e.Left="left",e.Right="right"}(dt||(dt={}));var gt,xt=function(e){var r,n,a,o,c,l,s=e.block,i=void 0!==s&&s,d=e.children,u=e.className,m=e.icon,p=e.iconPosition,v=void 0===p?dt.Left:p,b=e.outline,h=void 0!==b&&b,y=e.shadow,E=void 0!==y&&y,g=e.shadowSm,w=void 0!==g&&g,N=e.superButton,S=void 0!==N&&N,C=e.tag,j=void 0===C?"button":C,_=O(e,["block","children","className","icon","iconPosition","outline","shadow","shadowSm","superButton","tag"]);return t.createElement(j,I({className:x(ut,(r={},r[mt]=i,r),(n={},n[pt]=m,n),(a={},a[ft]=h,a),(o={},o[ht]=E,o),(c={},c[yt]=w,c),(l={},l[Et]=S,l),u),"data-testid":"Button"},_),v===dt.Left&&m&&f(m,{className:x(m.props.className,vt)}),d,v===dt.Right&&m&&f(m,{className:x(m.props.className,bt)}))},wt="eb-WrBwzW",Nt="eb-LlKpPo",St=function(e){var r,n=e.children,a=e.className,o=e.bgColor,c=void 0===o?void 0:o,l=e.outline;return t.createElement("div",{className:x(wt,(r={},r[Nt]=l,r),a),style:{backgroundColor:c},"data-testid":"Badge"},n)},It="eb-ttCsCh",Ot=function(e){var r=e.children,n=e.className,a=O(e,["children","className"]);return t.createElement("div",I({className:x(It,n),"data-testid":"ListGroup"},a),r)},Ct="eb-Dgd6nO",jt="eb-DkhGFO",_t="eb-kwge39",Tt=function(e){var r,n,a=e.children,o=e.active,c=e.className,l=e.justified,s=O(e,["children","active","className","justified"]);return t.createElement("div",I({className:x(Ct,(r={},r[jt]=o,r),(n={},n[_t]=l,n),c),"data-testid":"ListItem"},s),a)},kt="eb-l7tnqS",Rt="eb-FQUR34",Pt=function(e){var r=e.className,n=e.items,a=e.newScore,o=e.user;return t.createElement(Ot,{className:r,"data-testid":"Leaderboard"},n.map((function(e,r){var n=e.id,c=e.rank,l=e.name,s=e.score;return t.createElement(Tt,{key:n,justified:!0,active:n===(null==o?void 0:o.id)},t.createElement("div",{className:kt},c||r+1,". ",t.createElement("strong",null,l)),t.createElement("div",{className:Rt},n===(null==o?void 0:o.id)&&a>0&&a>s&&t.createElement(St,null,"+",a-s),(new Intl.NumberFormat).format(s)))})))},Mt="eb-Hq5iFO",Lt="eb-p1vZ3L",zt="eb-8GC4cE",Gt="eb-rgrfl0",Vt="eb-KmoX7Q",qt="eb-z33RWL",At="eb-5f5DSo",Bt="eb-RjthEk",Ft="eb-lf4O2l",Ht="eb-ykC0zi",Qt=function(e){var r=e.onRestartQuiz,n=B().questions,a=F(),c=a.correctResponses,l=a.totalCorrectScore,s=a.totalScore,i=a.totalTimerScore,d=a.user,u=lt(),m=u.leaderboardResults,f=u.leaderboardResultsError,p=u.getLeaderboardResults,v=u.getUserPercentile,b=u.getUserRankResults,h=u.userPercentile,y=u.userRankResults,E=u.userRankResultsError;return o((function(){d?(b(d.id),v(d.id)):p()}),[v,b,p,d]),o((function(){if(d&&(null==y?void 0:y.length)&&!E){var e=y.find((function(e){return e.id===d.id}));!!e&&e.rank<=3||p()}E&&p()}),[p,d,y,E]),t.createElement("div",{className:Mt,"data-testid":"LeaderboardTab"},t.createElement(Q,{className:Vt,backgroundColor:"snow",borderColor:"rain",rounded:!0},t.createElement("div",{className:Lt},t.createElement("h2",{className:"mb-4"},"All Quizzes"),t.createElement("p",{className:"font-14"},"Total Weekly Points")),m&&t.createElement(Pt,{className:"mt-20",newScore:s,items:m}),f&&t.createElement("p",null,"We're experiencing issues loading the Leaderboard at this time. Please try again later."),y&&t.createElement(Pt,{className:"mt-20",newScore:s,items:y,user:d}),E&&t.createElement("p",null,"We're experiencing issues loading your score at this time. Please try again later.")),t.createElement(Q,{className:qt,backgroundColor:"white",borderColor:"rain",rounded:!0},t.createElement("div",{className:x(zt,"text-center mb-20")},t.createElement("h2",{className:"mb-16"},"This Quiz"),h&&t.createElement("p",{className:"mt-16 font-14"},"You scored ",h,"% better than most users!")),t.createElement("div",{className:At},t.createElement("div",null,t.createElement("div",{className:"mb-8"},t.createElement("div",{className:Bt},t.createElement(Qe,{className:"mr-4"})," ",t.createElement("strong",null,c," Correct")),t.createElement("div",null,t.createElement("strong",null,l," Points"))),t.createElement("div",{className:"mt-16"},t.createElement("div",{className:Ft},t.createElement(rt,{className:"mr-4"})," ",t.createElement("strong",null,"Time Bonus")),t.createElement("div",null,t.createElement("strong",null,i," Points")))),t.createElement("div",{className:"text-center"},t.createElement("div",{className:Gt},t.createElement("div",null,t.createElement("h1",null,s)),t.createElement("div",null,t.createElement("strong",null,"POINTS"))),t.createElement("div",null,"Of ",function(e){var t=0;return e.forEach((function(e){return t+=100*e.difficulty+100})),t}(n)))),t.createElement("div",{className:"text-center mt-28"},t.createElement(xt,{icon:t.createElement(Ye,{className:Ht}),onClick:r,outline:!0,shadow:!0},"Play Again"))))},Dt="eb-oCfRGq",Ut=function(e){var r=e.children,n=e.className,a=O(e,["children","className"]);return t.createElement("a",I({},a,{className:x(Dt,"font-weight-semi-bold",n)}),r)},Wt=function(){var e=B().nextUpQuiz,r=e.image,n=e.url,a=e.title;return t.createElement(Q,{borderColor:"rain",className:"mt-20","data-testid":"NextUpQuizCard",rounded:!0,shadow:!0},t.createElement("div",{style:{aspectRatio:"16/9"}},t.createElement("img",{src:r.fullUrl,alt:r.altText})),t.createElement("div",{className:"p-20"},t.createElement(Ut,{className:"font-20",href:n},a),t.createElement(xt,{tag:"a",href:n,className:"mt-20",block:!0},"Play")))},Xt="eb-NdGzM3",Zt="eb-fQMdMF",Yt="eb-i8uKTc",Kt="eb-ZBrDqu",Jt="eb-FOeG4W",$t="eb-fQceh4",er="eb-vzHSa2",tr="eb-sS9sRH",rr=function(){var e=F(),r=e.correctResponses,n=e.totalScore,a=B().questions,o=r/a.length*100;return t.createElement("div",{className:Xt},t.createElement("div",{className:Zt,"data-testid":"ScoreSummaryWheel"},t.createElement("div",{className:x($t,"px-12 py-8 font-weight-semi-bold")},"Congrats!"),t.createElement("svg",{viewBox:"0 0 36 36",className:Yt},t.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:Jt}),t.createElement("path",{d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",className:Kt,strokeDasharray:"".concat(o," 100")})),t.createElement("div",{className:x(er,"text-center")},t.createElement("div",{className:x(tr,"font-weight-super-bold")},r,"/",a.length),t.createElement("div",{className:"font-12"},n," points"))))},nr="eb-od4oX9",ar="eb-F71AtK",or="eb-EM5HVl",cr="eb-yx3D4X",lr="eb-0AMT86",sr=function(e){var r=e.onRestartQuiz,n=w({maxWidth:M.XsMax}),a=B().title;return t.createElement("div",{"data-testid":"ScoreTab",className:nr},t.createElement(Q,{className:ar,borderColor:"rain",backgroundColor:"ice",rounded:!n,shadow:!n},t.createElement("div",{className:or},t.createElement("div",{className:"font-18 font-weight-extra-bold"},a),t.createElement(rr,null),t.createElement(xt,{icon:t.createElement(Ye,{className:lr}),onClick:r,outline:!0,shadow:!0},"Play Again")),t.createElement("div",{className:cr},t.createElement("div",{className:"font-weight-extra-bold font-24"},"Next Up!"),t.createElement(Wt,null))))},ir=r({activeTabId:"default",setActiveTabId:function(){}}),dr=function(e){var r=e.children,n=e.defaultActiveTabId,o=a(n),c=o[0],l=o[1];return t.createElement(ir.Provider,{value:{activeTabId:c,setActiveTabId:l}},r)},ur="eb-fkZcg2",mr="eb-ntGIO4",fr=function(e){var r,n=e.children,a=e.className,o=e.controlFor,c=l(ir),s=c.setActiveTabId,i=c.activeTabId===o;return t.createElement("button",{className:x(ur,(r={},r[mr]=i,r),a),"data-testid":"Tab",id:"".concat(o,"-tab"),role:"tab","aria-controls":o,"aria-selected":i,tabIndex:i?void 0:-1,onClick:function(){return s(o)}},n)},pr=function(e){var r=e.children,n=e.className,a=e.id,o=O(e,["children","className","id"]);return a===l(ir).activeTabId?t.createElement("div",I({id:a,className:n,"data-testid":"TabContent",tabIndex:0,role:"tabpanel","aria-labelledby":"".concat(a,"-tab")},o),r):null},vr="eb-ftdu2H",br=function(e){var r=e.children,n=e.className,a=e.label;return t.createElement("div",{className:x(vr,n),"data-testid":"Tabs",role:"tablist","aria-label":a},r)},hr="eb-vDPeCr",yr="eb-bMiWKa";!function(e){e.AnswersTab="AnswersTab",e.LeaderboardTab="LeaderboardTab",e.ScoreTab="ScoreTab"}(gt||(gt={}));var Er=Object.freeze({__proto__:null,default:function(){var e=B().image,r=F(),n=r.dispatch,a=r.user,c=lt().saveUserScore,l=E();function s(){n({type:T.SetRestarted}),l("/")}return o((function(){a&&c(a.id)}),[c,a]),t.createElement("div",{"data-testid":"ResultsView",className:hr,style:{backgroundImage:"url(".concat(e.fullUrl,")")}},t.createElement(dr,{defaultActiveTabId:gt.ScoreTab},t.createElement(br,{label:"Results View"},t.createElement(fr,{controlFor:gt.ScoreTab},"Score"),t.createElement(fr,{controlFor:gt.AnswersTab},"Answers"),t.createElement(fr,{controlFor:gt.LeaderboardTab},"Leaderboard")),t.createElement(pr,{className:yr,id:gt.ScoreTab},t.createElement(sr,{onRestartQuiz:s})),t.createElement(pr,{className:yr,id:gt.AnswersTab},t.createElement(Be,null)),t.createElement(pr,{className:yr,id:gt.LeaderboardTab},t.createElement(Qt,{onRestartQuiz:s}))))}}),gr="eb-8LB0Z6",xr="eb-xrnrMX",wr="eb-uQ6x3r",Nr="eb-RTZJDf",Sr="eb-nCZamz",Ir="eb-XBUSmk",Or="eb-6uIIpF",Cr="eb-vaYYcz",jr="eb-FGnvGm",_r=function(e){var r=e.children;return t.createElement("div",{className:jr,"data-testid":"SwitchControl"},r)},Tr="eb-FxfgLd",kr=function(e){var r=e.id,n=O(e,["id"]);return t.createElement("input",I({id:r,className:Tr,type:"checkbox",role:"switch"},n))},Rr=Object.freeze({__proto__:null,default:function(){var e=B(),r=e.id,n=e.categories,a=e.image,o=e.title,c=e.timed,l=e.questions,s=F(),i=s.dispatch,d=s.timerEnabled;return t.createElement("div",{className:gr,"data-testid":"IntroView",style:{aspectRatio:"900 / 675"}},t.createElement("img",{className:xr,src:a.fullUrl,alt:a.altText}),t.createElement("div",{className:wr},t.createElement(Q,{borderColor:"rain",className:x(Ir,"p-20"),rounded:!0,shadow:!0},t.createElement("div",{className:Nr},t.createElement(St,{className:x(Sr),bgColor:"var(--qc-ice)",outline:!0},t.createElement("span",{className:"font-14"},n[0].label))),t.createElement("h1",{className:x(Cr,"font-weight-semi-bold text-center")},o),t.createElement("div",{className:"text-center"},t.createElement(xt,{className:"p-28",tag:g,to:"/".concat(r),block:!0,superButton:!0},"Start")),t.createElement("div",{className:x(Or,"pt-16")},t.createElement("div",{className:"font-14 font-weight-semi-bold"},l.length," Questions"),c&&t.createElement(_r,null,t.createElement("label",{className:"font-14",htmlFor:"toggle"},"Timer Bonus"),t.createElement(kr,{id:"".concat(r),defaultChecked:d,onClick:function(){return i({type:T.SetTimerEnabled,payload:!d})}}))))))}}),Pr={},Mr=ee&&ee.__assign||function(){return Mr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Mr.apply(this,arguments)};Object.defineProperty(Pr,"__esModule",{value:!0});var Lr=Pr.ArrowForwardSVGIcon=void 0,zr=ae.exports,Gr=t,Vr=Oe;Lr=Pr.ArrowForwardSVGIcon=(0,Gr.forwardRef)((function(e,t){return(0,zr.jsx)(Vr.SVGIcon,Mr({},e,{ref:t},{children:(0,zr.jsx)("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"})}))}));var qr={},Ar=ee&&ee.__assign||function(){return Ar=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ar.apply(this,arguments)};Object.defineProperty(qr,"__esModule",{value:!0});var Br=qr.CloseSVGIcon=void 0,Fr=ae.exports,Hr=t,Qr=Oe;Br=qr.CloseSVGIcon=(0,Hr.forwardRef)((function(e,t){return(0,Fr.jsx)(Qr.SVGIcon,Ar({},e,{ref:t},{children:(0,Fr.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))}));var Dr={},Ur=ee&&ee.__assign||function(){return Ur=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Ur.apply(this,arguments)};Object.defineProperty(Dr,"__esModule",{value:!0});var Wr=Dr.CheckSVGIcon=void 0,Xr=ae.exports,Zr=t,Yr=Oe;Wr=Dr.CheckSVGIcon=(0,Zr.forwardRef)((function(e,t){return(0,Xr.jsx)(Yr.SVGIcon,Ur({},e,{ref:t},{children:(0,Xr.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}))}));var Kr,Jr={answerButtonContainer:"eb-hm0P2D",answerButton:"eb-EkupIl",selected:"eb-p8ZbDY",correct:"eb-5WC5qo",correctSelected:"eb-Z1YT6r",incorrectSelected:"eb-V0bjjy",disabled:"eb-N51x3L",default:"eb-e7y9O4",icon:"eb-8I8Gjv",correctIcon:"eb-NVqaa3",incorrectIcon:"eb-5sHpoZ"};!function(e){e.Correct="correct",e.CorrectSelected="correctSelected",e.Default="default",e.IncorrectSelected="incorrectSelected",e.Selected="selected"}(Kr||(Kr={}));var $r,en,tn,rn=function(e){var r,n=e.children,a=e.status,o=void 0===a?Kr.Default:a,c=e.disabled,l=O(e,["children","status","disabled"]);return t.createElement("div",{className:Jr.answerButtonContainer},Kr.CorrectSelected===o&&t.createElement(Wr,{className:x(Jr.icon,Jr.correctIcon,"font-12 p-4")}),Kr.IncorrectSelected===o&&t.createElement(Br,{className:x(Jr.icon,Jr.incorrectIcon,"font-12 p-4")}),t.createElement(xt,I({className:x(Jr.answerButton,o&&Jr[o],(r={},r[Jr.disabled]=c,r)),outline:!0,block:!0,disabled:c,superButton:!0,shadowSm:!0},l),n))},nn="eb-fKHH4k",an="eb-Ka5TRS",on="eb-eQLIHc",cn="eb-YcibRH",ln="eb-pAHhPN";!function(e){e.Play="play",e.Pause="pause",e.Stop="stop"}($r||($r={})),function(e){e.Correct="var(--qc-green)",e.Incorrect="var(--qc-red)",e.Default="var(--qc-blue-200)"}(en||(en={})),function(e){e.Left="left",e.Right="right"}(tn||(tn={}));var sn=function(e){var r=e.labelMessage,n=e.labelPosition,c=void 0===n?tn.Left:n,l=e.onExpire,s=e.status,i=e.theme,d=void 0===i?en.Default:i,u=e.time,m=void 0===u?15:u,f=e.timerRef,p=a(m),b=p[0],h=p[1],y=a(!1),E=y[0],g=y[1],x=v(0);return o((function(){return s===$r.Play&&(x.current=window.setInterval((function(){return h((function(e){return e-1}))}),1e3)),s===$r.Stop&&(clearInterval(x.current),h(m)),s===$r.Pause&&clearInterval(x.current),function(){clearInterval(x.current),g(!1)}}),[s,m]),o((function(){0===b&&(clearInterval(x.current),g(!0),l&&l())}),[l,b]),t.createElement("div",{className:nn,"data-testid":"Timer"},c===tn.Left&&t.createElement("div",{className:cn},!b&&t.createElement(St,{bgColor:en.Incorrect},"Time's Up!"),r&&!!b&&t.createElement(St,{bgColor:d},r)),t.createElement("div",{className:an},t.createElement("svg",null,t.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:E?en.Incorrect:"var(--qc-rain)"}}),t.createElement("circle",{cx:"23",cy:"23",r:"23",style:{stroke:d,strokeDashoffset:145-145*b/m}})),t.createElement("div",{ref:f,className:on},b)),c===tn.Right&&t.createElement("div",{className:ln},!b&&t.createElement(St,{bgColor:en.Incorrect},"Time's Up!"),r&&!!b&&t.createElement(St,{bgColor:d},r)))},dn="eb-db86L8",un="eb-fl8Stz",mn="eb-MbWQdV",fn=function(e){var r=e.title,n=e.timerEnabled,a=void 0===n||n,o=e.timerRef,c=e.timerScore,l=e.timerStatus,s=void 0===l?$r.Stop:l,i=e.timerTheme,d=void 0===i?en.Default:i,u=e.timerTime,m=void 0===u?15:u,f=e.onTimerExpire,p=e.totalScore,v=void 0===p?0:p,b=e.currentCount,h=void 0===b?0:b,y=e.totalCount,E=void 0===y?0:y,g=w({maxWidth:M.MdMin});return t.createElement("div",{className:x(dn,"p-4")},t.createElement("span",{className:x(mn,"pl-16")},r),t.createElement("div",{className:x(un,"px-16")},a&&t.createElement(sn,{time:m,timerRef:o,theme:d,status:s,onExpire:f,labelMessage:c?"+".concat(c):void 0,labelPosition:g?tn.Right:tn.Left}),t.createElement("div",{className:"pl-24"},t.createElement("span",{className:"font-weight-bold "},h)," of"," ",t.createElement("span",{className:"font-weight-bold"},E)),t.createElement("div",{className:"pl-24"},"Score: ",t.createElement("span",{className:"font-weight-bold"},v))))},pn="eb-NelLRW",vn="eb-nXyIBf",bn="eb-VgMNit",hn="eb-8SxGFY",yn=Object.freeze({__proto__:null,default:function(){var e=E(),r=A().event,n=v(null),l=a($r.Stop),s=l[0],i=l[1],d=a(0),u=d[0],m=d[1],f=a(null),p=f[0],b=f[1],h=B(),y=h.id,g=h.title,w=h.questions,N=h.seconds,S=h.type,I=F(),O=I.currentQuestionIndex,C=I.correctResponses,j=I.dispatch,k=I.responseIndexes,R=I.restarted,P=I.totalCorrectScore,M=I.totalScore,L=I.totalTimerScore,z=I.timerEnabled,G=w[O];o((function(){return z&&i($r.Play),function(){z&&i($r.Stop)}}),[O,z]);var V=c((function(){b(-1)}),[]);function q(e){return e===p&&p===G.correctAnswerIndex?Kr.CorrectSelected:e===p&&p!==G.correctAnswerIndex?Kr.IncorrectSelected:null!==p&&e===G.correctAnswerIndex?Kr.Correct:Kr.Default}return t.createElement("div",{"data-testid":"QuestionView"},t.createElement(fn,{currentCount:O+1,onTimerExpire:V,title:g,totalCount:w.length,totalScore:M,timerEnabled:z,timerRef:n,timerScore:u,timerStatus:s,timerTime:N,timerTheme:p===G.correctAnswerIndex?en.Correct:null!==p&&p!==G.correctAnswerIndex?en.Incorrect:en.Default}),t.createElement(Q,{className:x(x(pn,"pb-20")),backgroundColor:"ice"},t.createElement("div",{className:x(hn,"p-24 font-24 font-weight-normal text-center"),dangerouslySetInnerHTML:{__html:G.text}}),t.createElement("div",{className:x(vn,"p-24")},G.answers.map((function(e,a){return t.createElement(rn,{disabled:null!==p,key:e,onClick:function(){return function(e){var t,a,o=e===G.correctAnswerIndex;if(o){var c=(null===(t=n.current)||void 0===t?void 0:t.innerHTML)?+(null===(a=n.current)||void 0===a?void 0:a.innerHTML):0,l=it(c,G.difficulty,z);m(l),j({type:T.setTotalCorrectScore,payload:P+it(0,G.difficulty,!1)}),z&&j({type:T.setTotalTimerScore,payload:L+st(c)}),j({type:T.SetTotalScore,payload:M+l}),j({type:T.SetCorrectResponses,payload:C+1})}b(e),i($r.Pause),j({type:T.SetCorrectIndexes,payload:_(_([],k,!0),[e],!1)}),r("question_answered",{quiz_id:y,question_index:O,answer_index:e,answered_correctly:o,answer_text:G.answers[e],quiz_type:S.toString(),total_questions:w.length})}(a)},status:q(a)},e)}))),null!==p&&t.createElement(xt,{onClick:function(){O<w.length-1?(j({type:T.setCurrentQuestionIndex,payload:O+1}),b(null),z&&(i($r.Stop),m(0))):(e("/results"),r("quiz_complete",{quiz_id:y,questions_answered:k.length,restarted:R,correct_responses:C,quiz_type:S.toString(),total_questions:w.length}))},superButton:!0},"Next ",t.createElement(Lr,{className:"ml-8"})),null!==p&&t.createElement(Pe,{className:x(bn,"mt-24 p-24"),explanation:G.explanation})))}});export{M as Breakpoint,$ as Quiz,P as Template};
//# sourceMappingURL=quiz-components.esm.production.js.map
{
"name": "@britannica/quiz-components",
"version": "1.0.0-beta.7",
"version": "1.0.0-beta.8",
"author": "Ryan Walters",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc