1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[991],{37162:function(e,n,t){"use strict";var r=t(85893),i=t(68527),o=t(49609);n.Z=function(){return(0,r.jsx)(i.xu,{pt:"8",w:"full",children:(0,r.jsx)(i.M5,{children:(0,r.jsx)(o.$,{color:"blue.400"})})})}},41390:function(e,n,t){"use strict";t.d(n,{s:function(){return r}});var r=function(){return!1}},50873:function(e,n,t){"use strict";t.d(n,{b:function(){return s}});var r=t(11163),i=t(41390),o=t(89789),s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",n=(0,r.useRouter)(),t=(0,o.a)(),s=t.state,c=s.isAuthenticated,a=s.isLoading;return(0,i.s)()||c||a||n.push(e),{isLoading:a}}},97311:function(e,n,t){"use strict";var r=t(85893),i=(t(67294),t(68527));n.Z=function(){return(0,r.jsx)(i.gC,{children:(0,r.jsx)(i.X6,{pt:"2",size:"sm",children:"No subexercises for this exercise yet"})})}},42077:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ie}});var r=t(55645),i=t(85893),o=t(67294),s=t(68527),c=t(20949),a=t(809),l=t.n(a),u=t(30266),d=t(97375),x=t(90456),f=t(55667),p=t(10894),h=t(33344),m=t(37496),g=t(44592),v=t(26450),b=t(40242);function j(){return(j=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)}function w(e,n){if(null==e)return{};var t,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}var y=["onChange","defaultIndex","index","allowMultiple","allowToggle"],_=["isDisabled","isFocusable","id"],C=(0,b.n)(),E=C[0],A=(C[1],C[2]),O=C[3];function k(e){var n=e.onChange,t=e.defaultIndex,r=e.index,i=e.allowMultiple,s=e.allowToggle,c=w(e,y);!function(e){var n=e.index||e.defaultIndex,t=!(0,g.o8)(n)&&!(0,g.kJ)(n)&&e.allowMultiple;(0,g.ZK)({condition:!!t,message:"If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: "+typeof n+","})}(e),function(e){(0,g.ZK)({condition:!(!e.allowMultiple||!e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}(e);var a=A(),l=(0,o.useState)(-1),u=l[0],x=l[1];(0,d.zq)((function(){x(-1)}));var f=(0,d.Tx)({value:r,defaultValue:function(){return i?null!=t?t:[]:null!=t?t:-1},onChange:n}),p=f[0],h=f[1];
1return{index:p,setIndex:h,htmlProps:c,getAccordionItemProps:function(e){var n=!1;null!==e&&(n=(0,g.kJ)(p)?p.includes(e):p===e);return{isOpen:n,onChange:function(n){if(null!==e)if(i&&(0,g.kJ)(p)){var t=n?(0,g.jX)(p,e):(0,g.cl)(p,e);h(t)}else n?h(e):s&&h(-1)}}},focusedIndex:u,setFocusedIndex:x,descendants:a}}var M=(0,v.kr)({name:"AccordionContext",errorMessage:"useAccordionContext: `context` is undefined. Seems you forgot to wrap the accordion components in `<Accordion />`"}),N=M[0],P=M[1];function T(e){var n=e.isDisabled,t=e.isFocusable,r=e.id,i=w(e,_),s=P(),c=s.getAccordionItemProps,a=s.setFocusedIndex,l=(0,o.useRef)(null),u=(0,d.ZS)(r,"accordion-button","accordion-panel"),x=u[0],f=u[1];!function(e){(0,g.ZK)({condition:!(!e.isFocusable||e.isDisabled),message:"Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.\n "})}(e);var p=O({disabled:n&&!t}),h=p.register,m=p.index,b=p.descendants,y=c(-1===m?null:m),C=y.isOpen,E=y.onChange;!function(e){(0,g.ZK)({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}({isOpen:C,isDisabled:n});var A=(0,o.useCallback)((function(){null==E||E(!C),a(m)}),[m,a,C,E]),k=(0,o.useCallback)((function(e){var n={ArrowDown:function(){var e=b.nextEnabled(m);e&&(0,g.T_)(e.node)},ArrowUp:function(){var e=b.prevEnabled(m);e&&(0,g.T_)(e.node)},Home:function(){var e=b.firstEnabled();e&&(0,g.T_)(e.node)},End:function(){var e=b.lastEnabled();e&&(0,g.T_)(e.node)}}[(0,g.uh)(e)];n&&(e.preventDefault(),n(e))}),[b,m]),M=(0,o.useCallback)((function(){a(m)}),[a,m]),N=(0,o.useCallback)((function(e,t){return void 0===e&&(e={}),void 0===t&&(t=null),j({},e,{type:"button",ref:(0,v.lq)(h,l,t),id:x,disabled:!!n,"aria-expanded":!!C,"aria-controls":f,onClick:(0,g.v0)(e.onClick,A),onFocus:(0,g.v0)(e.onFocus,M),onKeyDown:(0,g.v0)(e.onKeyDown,k)})}),[x,n,C,A,M,k,f,h]),T=(0,o.useCallback)((function(e,n){return void 0===e&&(e={}),void 0===n&&(n=null),j({},e,{ref:n,role:"region",id:f,"aria-labelledby":x,hidden:!C})}),[x,C,f]);return{isOpen:C,isDisabled:n,isFocusable:t,onOpen:function(){null==E||E(!0)},onClose:function(){null==E||E(!1)},getButtonProps:N,getPanelProps:T,htmlProps:i}}var I=["children","reduceMotion"],D=["htmlProps","descendants"],Z=["htmlProps"],K=(0,h.Gp)((function(e,n){var t=e.children,r=e.reduceMotion,i=w(e,I),s=(0,h.jC)("Accordion",i),c=k((0,h.Lr)(i)),a=c.htmlProps,l=c.descendants,u=w(c,D),d=o.useMemo((function(){return j({},u,{reduceMotion:!!r})}),[u,r]);return o.createElement(E,{value:l},o.createElement(N,{value:d},o.createElement(h.Fo,{value:s},o.createElement(h.m$.div,j({ref:n},a,{className:(0,g.cx)("chakra-accordion",i.className),__css:s.root}),t))))}));g.Ts&&(K.displayName="Accordion");var S=(0,v.kr)({name:"AccordionItemContext",errorMessage:"useAccordionItemContext: `context` is undefined. Seems you forgot to wrap the accordion item parts in `<AccordionItem />` "}),z=S[0],F=S[1],L=(0,h.Gp)((function(e,n){var t=e.children,r=e.className,i=T(e),s=i.htmlProps,c=w(i,Z),a=j({},(0,h.yK)().container,{overflowAnchor:"none"}),l=o.useMemo((function(){return c}),[c]);return o.createElement(z,{value:l},o.createElement(h.m$.div,j({ref:n},s,{className:(0,g.cx)("chakra-accordion__item",r),__css:a}),(0,g.Pu)(t,{isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled})))}));g.Ts&&(L.displayName="AccordionItem");var X=(0,h.Gp)((function(e,n){var t=(0,F().getButtonProps)(e,n),r=j({display:"flex",alignItems:"center",width:"100%",outline:0},(0,h.yK)().button);return o.createElement(h.m$.button,j({},t,{className:(0,g.cx)("chakra-accordion__button",e.className),__css:r}))}));g.Ts&&(X.displayName="AccordionButton");var U=(0,h.Gp)((function(e,n){var t=P().reduceMotion,r=F(),i=r.getPanelProps,s=r.isOpen,c=i(e,n),a=(0,g.cx)("chakra-accordion__panel",e.className),l=(0,h.yK)();t||delete c.hidden;var u=o.createElement(h.m$.div,j({},c,{__css:l.panel,className:a}));return t?u:o.createElement(m.UO,{in:s},u)}));g.Ts&&(U.displayName="AccordionPanel");var B=function(e){var n=F(),t=n.isOpen,r=n.isDisabled,i=P().reduceMotion,s=(0,g.cx)("chakra-accordion__icon",e.className),c=j({opacity:r?.4:1,transform:t?"rotate(-180deg)":void 0,transition:i?void 0:"transform 0.2s",transformOrigin:"center"},(0,h.yK)().icon);return o.createElement(p.JO,j({viewBox:"0 0 24 24","aria-hidden":!0,
1className:s,__css:c},e),o.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))};g.Ts&&(B.displayName="AccordionIcon");var W=t(15193),$=t(41664),q=t(88767),G=t(9669),J=t.n(G),R=t(58747),Y=t(37162),H=t(97311),Q=function(e,n,t){var r=!0;return e.forEach((function(e,n){n>=t||e.attempt||(r=!1)})),1!==n.level&&!r},V=function(){var e=(0,u.Z)(l().mark((function e(n){var t;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J().get("".concat(R.M,"/api/subexercises/exercise/").concat(n,"/completion/"));case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ee=function(e){var n=e.name,t=e.img,r=e.slug,o=e.description,a=(0,d.qY)(),l=a.isOpen,u=a.onOpen,p=a.onClose,h=(0,q.useQuery)(r,(function(){return V(r)}),{enabled:l,retryDelay:0,retry:3}),m=h.data,g=h.isLoading,v=h.isError;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Uc,{paddingX:"50px",children:(0,i.jsxs)(s.gC,{onClick:u,as:"button",children:[(0,i.jsx)(x.Ee,{src:t,boxSize:"135px"}),(0,i.jsx)(s.M5,{children:(0,i.jsx)(s.xv,{mt:"10px",width:"130px",fontWeight:"bold",fontSize:"xl",children:n})})]})}),(0,i.jsxs)(f.u_,{blockScrollOnMount:!1,isOpen:l,onClose:p,isCentered:!0,children:[(0,i.jsx)(f.ZA,{px:"0",mx:"0"}),(0,i.jsxs)(f.hz,{children:[(0,i.jsx)(f.xB,{children:(0,i.jsxs)(s.gC,{children:[(0,i.jsx)(s.X6,{children:n}),(0,i.jsx)(s.xv,{fontSize:"md",children:o})]})}),(0,i.jsx)(f.ol,{}),(0,i.jsx)(f.fe,{children:v?(0,i.jsx)(s.xv,{textAlign:"center",children:"There was an error getting subexercises for this exercise"}):g?(0,i.jsx)(Y.Z,{}):m&&m.length?(0,i.jsx)(K,{allowToggle:!0,children:m.map((function(e,n){return(0,i.jsxs)(L,{isDisabled:Q(m,e,n),children:[(0,i.jsx)("h2",{children:(0,i.jsxs)(X,{children:[(0,i.jsxs)(s.xu,{flex:"1",textAlign:"left",children:["Level ",n+1," - ",e.subexercise_name]}),(0,i.jsx)(B,{})]})}),(0,i.jsx)(U,{children:(0,i.jsxs)(s.xu,{textAlign:"center",padding:"0px 20px",children:[(0,i.jsx)(s.xv,{color:(0,c.ff)("gray.600","gray.300"),children:e.description}),(0,i.jsx)($.default,{href:"/practice/".concat(e.exercise_slug,"/subexercise/").concat(e.subexercise_slug),children:(0,i.jsx)("a",{children:(0,i.jsxs)(W.zx,{maxW:"80",h:"auto",py:"2",whiteSpace:"initial",variant:"ghost",color:"blue.400",textAlign:"center",margin:"10px",children:["Start ",e.subexercise_name]})})})]})})]})}))}):(0,i.jsx)(H.Z,{})}),(0,i.jsx)(f.mz,{})]})]})]})},ne=t(43366),te=t(50873),re=t(14428),ie=function(){var e=(0,te.b)("/auth/sign-in").isLoading,n=(0,ne.N)(),t=n.data,o=n.isLoading;return(0,re.Z)("KeyKorea - Practice Mode"),e?(0,i.jsx)(Y.Z,{}):(0,i.jsx)(s.W2,{pt:"8",maxW:"container.xl",children:(0,i.jsxs)(s.gC,{spacing:5,width:"100%",children:[(0,i.jsxs)(s.gC,{spacing:"1",children:[(0,i.jsx)(s.X6,{textAlign:"center",fontSize:"45px",children:"Practice Mode"}),(0,i.jsx)(s.xv,{textAlign:"center",fontSize:"20px",color:(0,c.ff)("gray.600","gray.200"),children:"Choose Your Path!"})]}),o||!t?(0,i.jsx)(Y.Z,{}):(0,i.jsx)(s.Eq,{spacing:"30px",justify:"center",maxW:"container.md",top:40,children:Object.entries(t).map((function(e){var n=(0,r.Z)(e,2),t=(n[0],n[1]);return(0,i.jsx)(ee,{name:t.exercise_name,slug:t.exercise_slug,description:t.description,img:t.image},t.exercise_slug)}))})]})})}},10594:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/practice",function(){return t(42077)}])},14428:function(e,n,t){"use strict";var r=t(67294),i={restoreOnUnmount:!1};n.Z="undefined"!==typeof document?function(e,n){void 0===n&&(n=i);var t=(0,r.useRef)(document.title);document.title!==e&&(document.title=e),(0,r.useEffect)((function(){return n&&n.restoreOnUnmount?function(){document.title=t.current}:void 0}),[])}:function(e){}}},function(e){e.O(0,[667,774,888,179],(function(){return n=10594,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.