1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1609],{20424:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/students",function(){return i(85144)}])},51118:function(e,t,i){"use strict";var n=i(85893),o=i(49363),a=i(92105),s=i.n(a);t.Z=e=>{let{message:t="Loading...",color:i="#262E4A"}=e;return(0,n.jsx)(d,{children:(0,n.jsxs)(r,{children:[(0,n.jsx)(l,{children:t}),(0,n.jsx)(s(),{color:i})]})})};var d=(0,o.ZP)("div").withConfig({displayName:"Loaders___StyledDiv",componentId:"sc-ge6x5h-0"})({display:"flex",width:"100%",flexDirection:"column",alignSelf:"stretch"}),r=(0,o.ZP)("div").withConfig({displayName:"Loaders___StyledDiv2",componentId:"sc-ge6x5h-1"})({display:"flex",minHeight:"100px",flexDirection:"column",alignItems:"center",justifyContent:"center"}),l=(0,o.ZP)("h2").withConfig({displayName:"Loaders___StyledH",componentId:"sc-ge6x5h-2"})({marginBottom:"10px",fontFamily:"var(--font-typo-hoop)",fontSize:"20px","--tw-text-opacity":"1",color:"rgb(38 46 74 / var(--tw-text-opacity))","@media (min-width: 768px)":{marginBottom:"20px",fontSize:"1.125rem",lineHeight:"1.75rem"}})},17988:function(e,t,i){"use strict";var n=i(85893),o=i(49363),a=i(67294),s=i(90822),d=i(45056),r=i(11535);t.Z=e=>{let{children:t,label:i="Assign To Child",saveAction:o=null,saveLabel:v="Save",saveType:_="primary",cancelLabel:b="Cancel",cancelAction:S=null,modalState:j=!1,setModalState:I=null,icon:C=null,modalComponent:Z=null}=e,[k,P]=(0,a.useState)(j);(0,a.useEffect)(()=>{P(j)},[j]);let toggleModal=()=>{P(!k),k?(0,r.K9)():(0,r.XY)()};return(0,n.jsxs)(n.Fragment,{children:[Z?(0,n.jsx)("a",{href:"#",onClick:toggleModal,children:Z}):(0,n.jsx)("a",{href:"#",onClick:toggleModal,children:(0,n.jsxs)(l,{children:[(0,n.jsx)(c,{children:i}),C&&(0,n.jsx)(s.Z,{name:C,color:"#ff673A",size:50,outline:!0,cssOverrides:{display:"none","@media (min-width: 768px)":{display:"flex"}}})]})}),k?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p,{children:(0,n.jsx)(m,{children:(0,n.jsxs)(h,{children:[(0,n.jsxs)(g,{children:[i&&(0,n.jsx)(x,{children:i}),(0,n.jsx)(u,{onClick:toggleModal,children:(0,n.jsx)(s.Z,{name:"close",color:"currentColor",size:15})})]}),(0,n.jsx)(w,{children:t}),(0,n.jsxs)(f,{children:[S&&(0,n.jsx)(d.Z,{onClick:()=>{S&&S()},danger:!0,block:!0,medium:!0,text:b,cssOverrides:{fontSize:"18px"}}),o&&(0,n.jsx)(d.Z,{onClick:e=>{e.preventDefault(),toggleModal(),o()},primary:"primary"===_,danger:"danger"===_,block:!0,medium:!0,text:v})]})]})})}),(0,n.jsx)(y,{})]}):null]})};var l=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv",componentId:"sc-1bmvwmt-0"})({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:"0px","@media (min-width: 768px)":{gap:"1.25rem"}}),c=(0,o.ZP)("span").withConfig({displayName:"Modal___StyledSpan",componentId:"sc-1bmvwmt-1"})({fontFamily:"var(--font-typo-hoop)",fontSize:"18px",fontWeight:"700","--tw-text-opacity":"1",color:"rgb(139 42 191 / var(--tw-text-opacity))",textDecorationLine:"underline","@media (min-width: 768px)":{fontSize:"1.875rem",lineHeight:"2.25rem"}}),p=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv2",componentId:"sc-1bmvwmt-2"})({position:"fixed",inset:"0px",zIndex:"50",display:"flex",width:"100%",alignItems:"center",justifyContent:"center",overflowY:"auto",overflowX:"hidden",outline:"2px solid transparent",outlineOffset:"2px","&:focus":{outline:"2px solid transparent",outlineOffset:"2px"}}),m=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv3",componentId:"sc-1bmvwmt-3"})({position:"relative",marginLeft:"auto",marginRight:"auto",marginTop:"1.5rem",marginBottom:"1.5rem",width:"100%",maxWidth:"48rem"}),h=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv4",componentId:"sc-1bmvwmt-4"})({position:"relative",marginLeft:"auto",marginRight:"auto",display:"flex",maxHeight:"85vh",width:"83.333333%",flexDirection:"column",borderRadius:"1.5rem",borderWidth:"0px","--tw-bg-opacity":"1",backgroundColor:"rgb(255 255 255 / var(--tw-bg-opacity))","--tw-shadow":"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)","--tw-shadow-colored":"0 10px 15px -3px var(--tw-sha
1dow-color), 0 4px 6px -4px var(--tw-shadow-color)",boxShadow:"var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)",outline:"2px solid transparent",outlineOffset:"2px","&:focus":{outline:"2px solid transparent",outlineOffset:"2px"},"@media (min-width: 768px)":{marginLeft:"auto",marginRight:"auto",width:"700px",paddingLeft:"50px",paddingRight:"50px"}}),g=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv5",componentId:"sc-1bmvwmt-5"})({display:"flex",padding:"30px",paddingBottom:"0px"}),x=(0,o.ZP)("h3").withConfig({displayName:"Modal___StyledH",componentId:"sc-1bmvwmt-6"})({flexGrow:"1",paddingTop:"30px",paddingBottom:"30px",textAlign:"center",fontFamily:"var(--font-typo-hoop)",fontSize:"1.25rem",lineHeight:"1.75rem","--tw-text-opacity":"1",color:"rgb(139 42 191 / var(--tw-text-opacity))"}),u=(0,o.ZP)("button").withConfig({displayName:"Modal___StyledButton",componentId:"sc-1bmvwmt-7"})({position:"absolute",right:"30px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"9999px",borderWidth:"4px","--tw-border-opacity":"1",borderColor:"rgb(139 42 191 / var(--tw-border-opacity))",padding:"10px","--tw-text-opacity":"1",color:"rgb(139 42 191 / var(--tw-text-opacity))","@media (hover: hover) and (pointer: fine)":{"&:hover":{"--tw-bg-opacity":"1",backgroundColor:"rgb(139 42 191 / var(--tw-bg-opacity))","--tw-text-opacity":"1",color:"rgb(255 255 255 / var(--tw-text-opacity))"}}}),w=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv6",componentId:"sc-1bmvwmt-8"})({position:"relative",flex:"1 1 auto",overflowY:"auto",paddingLeft:"1.5rem",paddingRight:"1.5rem"}),f=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv7",componentId:"sc-1bmvwmt-9"})({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"10px",borderBottomRightRadius:"0.25rem",borderBottomLeftRadius:"0.25rem",padding:"30px","@media (min-width: 768px)":{gap:"30px"}}),y=(0,o.ZP)("div").withConfig({displayName:"Modal___StyledDiv8",componentId:"sc-1bmvwmt-10"})({position:"fixed",inset:"0px",zIndex:"40","--tw-bg-opacity":"1",backgroundColor:"rgb(0 0 0 / var(--tw-bg-opacity))",opacity:"0.25"})},21324:function(e,t,i){"use strict";var n=i(85893),o=i(49363),a=i(80902),s=i(90384),d=i(67294),r=i(54182),l=i(28419),c=i(15356),p=i(88767),m=i(50175);t.Z=e=>{let{type:t="link",studentId:i,sharedAccessUserId:o,sharedAccessUserEmail:y,button:v}=e,{mutateAsync:_}=(0,c.aF)(),{data:b,isLoading:S}=(0,s.hz)(i),{data:{id:j}}=(0,l.xJ)(),I=(0,p.useQueryClient)(),[C,Z]=(0,d.useState)(!1),[k,P]=(0,d.useState)(!1),[N,D]=(0,d.useState)(!1),handleRemoveAccess=async()=>{Z(!0),D(!0),await _({userId:o||j,studentId:i}),await I.invalidateQueries(["sharedAccess",i]),D(!1),P(!1),Z(!1)};return(0,n.jsx)(a.Z,{button:v,onOpen:()=>P(!0),onClose:()=>P(!1),width:"small",overrideIsOpen:k,contentCssOverrides:{maxHeight:"90svh"},children:S?(0,n.jsx)(m.Z,{message:"Loading student...",cssOverrides:{flex:"1 1 0%"}}):(0,n.jsxs)(h,{children:[(0,n.jsxs)(g,{children:[(0,n.jsx)(x,{children:"link"===t?"Are you sure you want to disconnect from this student?":"Are you sure you want to remove access?"}),(0,n.jsx)(u,{children:"link"===t?(0,n.jsxs)(n.Fragment,{children:["Please note, you will lose access to all student data, including tests that you have purchased and have been taken by"," ",(0,n.jsxs)(w,{children:[null==b?void 0:b.firstname," ",null==b?void 0:b.surname]}),". If you have assigned tests to this student that have not yet been taken, please unassign them before disconnecting to ensure they are returned to your account."]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f,{children:y}),"The user, whose email is shown above, will lose access to your student and will no longer be able to assign tests or review results. Any tests they have assigned to the student but not yet taken will remain with your student. Please confirm with the user before proceeding."]})})]}),(0,n.jsx)(r.Z,{variant:"danger",size:"lg",cssOverrides:{marginLeft:"auto",marginRight:"auto",marginTop:"3rem",width:"240px"},textAlignment:"center",onClick:handleRemoveAccess,disabled:C,isLoading:N,children:"link"===t?"Unlink":"Remove Access"})]})})};var h=(0,o.ZP)("div").withConfig({displayName:"RemoveShareAccessModal___StyledDiv",componentId:"sc-n11eqt-0"})({display:"flex",flex:"1 1 0%",flexDirection:"column",justifyContent:"space-between",paddingBottom:"2.25rem"}),g=(0,o.ZP)("div").withConfig({displayName:"RemoveShareAccessModal___StyledDiv2",componentId:"sc-n11eqt-1"})({marginLeft:"auto",marginRight:"auto",marginTop:"3rem",width:"80%",textAlign:"center","@media (min-width: 768px)":{width:"75%"}}),x=(0,o.ZP)("h2").withConfig({displayName:"RemoveShareAccessModal___StyledH",componentId:"sc-n11eqt-2"})({fontFamily:"var(--font-typo-hoop)",fontSize:"1.5rem",lineHeight:"2rem",fontWeight:"700","--tw-text-opacity":"1",color:"rgb(51 51 51 / var(--tw-text-opacity))","@media (min-width: 768px)":{fontSize:"1.875rem",lineHeight:"2.25rem"}}),u=(0,o.ZP)("p").withConfig({displayName:"RemoveShareAccessModal___StyledP",componentId:"sc-n11eqt-3"})({marginTop:"1.5rem",fontFamily:"var(--font-source-sans)",fontSize:"1.125rem",lineHeight:"1.75rem","--tw-text-opacity":"1",color:"rgb(51 51 51 / var(--tw-text-opacity))"}),w=(0,o.ZP)("span").withConfig({displayName:"RemoveShareAccessModal___StyledSpan",componentId:"sc-n11eqt-4"})({maxWidth:"16ch",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-typo-hoop)","--tw-text-opacity":"1",color:"rgb(139 42 191 / var(--tw-text-opacity))"}),f=(0,o.ZP)("span").withConfig({displayName:"RemoveShareAccessModal___StyledSpan2",componentId:"sc-n11eqt-5"})({marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",display:"block",maxWidth:"28ch",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-typo-hoop)","--tw-text-opacity":"1",color:"rgb(94 92 230 / var(--tw-text-opacity))"})},60029:function(e,t,i){"use strict";var n=i(85893),o=i(49363),a=i(50382),s=i(54182),d=i(67294),r=i(10990),l=i(21324),c=i(92105),p=i.n(c),m=i(14795),h=i(55078),g=i(3465),x=i(42551);t.Z=function(e){let{child:t,cssOverrides:o,highlighted:c=!1}=e,j=(0,d.useRef)(null),[I,C]=(0,d.useState)(!1);(0,d.useEffect)(()=>{c&&j.current&&r.ZP.to(j.current,{scale:1.05,duration:.3,yoyo:!0,delay:.5,ease:"power1.inOut",repeat:1})},[c]);let handleLoginAsStudent=async()=>{try{let e=prompt("Enter password for ".concat(t.firstname," ").concat(t.surname,":"));if(!e)return;C(!0);let n=await h.b.graphql({query:"\n mutation LoginAsStudent($studentId: ID!, $password: String!) {\n loginAsStudent(studentId: $studentId, password: $password) {\n success\n student {\n username\n name\n }\n tokens {\n idToken\n accessToken\n refreshToken\n expiresIn\n }\n error\n }\n }\n",variables:{studentId:t.id,password:e}});if(n.data.loginAsStudent.success){let e=n.data.loginAsStudent.tokens,o=n.data.loginAsStudent.student;await g.g.signOut({global:!1});let a=new x.CognitoIdToken({IdToken:e.idToken}),s=new x.CognitoAccessToken({AccessToken:e.accessToken}),d=new x.CognitoRefreshToken({RefreshToken:e.refreshToken}),r=new x.CognitoUserSession({IdToken:a,AccessToken:s,RefreshToken:d}),l={UserPoolId:g.g.configure().userPoolId,ClientId:g.g.configure().userPoolWebClientId}
1,c=new(await Promise.resolve().then(i.bind(i,42551))).CognitoUserPool(l),p=new x.CognitoUser({Username:o.username,Pool:c});p.setSignInUserSession(r),p.cacheTokens(),alert("Successfully logged in as ".concat(t.firstname," ").concat(t.surname,"!")),window.location.href="/dashboard"}else alert("Failed to login: ".concat(n.data.loginAsStudent.error))}catch(e){alert("Error: ".concat(e.message))}finally{C(!1)}};return t?(0,n.jsxs)(u,{ref:j,$_css:[{display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:"9999px","--tw-bg-opacity":"1",backgroundColor:"rgb(233 242 255 / var(--tw-bg-opacity))",padding:"0.5rem"},o,c&&{borderWidth:"2px","--tw-border-opacity":"1",borderColor:"rgb(38 46 74 / var(--tw-border-opacity))","--tw-shadow":"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","--tw-shadow-colored":"0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color)",boxShadow:"var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)"}],children:[(0,n.jsxs)(w,{children:[(0,n.jsx)(a.Z,{firstName:null==t?void 0:t.firstname,sureName:null==t?void 0:t.surname,sizeClass:{height:"2.5rem",width:"2.5rem",flexShrink:"0"},border:!1,shadow:!1}),(0,n.jsxs)(f,{children:[t.firstname," ",t.surname]})]}),(0,n.jsxs)(y,{children:[(null==t?void 0:t.linked)&&(0,n.jsx)(l.Z,{type:"link",button:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.Z,{size:"xsIcon",variant:"danger",leftIcon:(0,n.jsx)(m.Z,{name:"link",size:20}),cssOverrides:{display:"none","@media (min-width: 768px)":{display:"inline-flex"}},children:"Unlink"}),(0,n.jsx)(s.Z,{size:"xsIcon",variant:"danger",leftIcon:(0,n.jsx)(m.Z,{name:"link",size:20}),cssOverrides:{display:"inline-flex","@media (min-width: 768px)":{display:"none"}}})]}),studentId:null==t?void 0:t.id}),!(null==t?void 0:t.isCreating)&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.Z,{size:"xsIcon",variant:"secondary",onClick:handleLoginAsStudent,disabled:I,leftIcon:(0,n.jsx)(m.Z,{name:"user",size:16}),cssOverrides:{display:"inline-flex","@media (min-width: 768px)":{display:"none"}}})}),(null==t?void 0:t.isCreating)?(0,n.jsxs)(v,{children:[(0,n.jsx)(_,{children:"Creating student..."}),(0,n.jsx)(p(),{color:"#262E4A",size:10})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{children:(0,n.jsx)(s.Z,{size:"xs",variant:"tertiary",href:"/students/".concat(t.id),color:"action",rightIcon:(0,n.jsx)(m.Z,{name:"arrowRight",size:32}),children:"View Student"})}),(0,n.jsx)(S,{children:(0,n.jsx)(s.Z,{size:"smIcon",variant:"tertiary",href:"/students/".concat(t.id),color:"action",rightIcon:(0,n.jsx)(m.Z,{name:"arrowRight",size:32})})})]})]})]}):null};var u=(0,o.ZP)("div").withConfig({displayName:"StudentItem___StyledDiv",componentId:"sc-11ga3ic-0"})(["",""],e=>e.$_css),w=(0,o.ZP)("div").withConfig({displayName:"StudentItem___StyledDiv2",componentId:"sc-11ga3ic-1"})({display:"flex",alignItems:"center",gap:"0.5rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","@media (min-width: 768px)":{gap:"0.75rem"}}),f=(0,o.ZP)("span").withConfig({displayName:"StudentItem___StyledSpan",componentId:"sc-11ga3ic-2"})({maxWidth:"60ch",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-source-sans)",fontWeight:"500","--tw-text-opacity":"1",color:"rgb(51 51 51 / var(--tw-text-opacity))","@media (min-width: 768px)":{fontSize:"1.125rem",lineHeight:"1.75rem"}}),y=(0,o.ZP)("div").withConfig({displayName:"StudentItem___StyledDiv3",componentId:"sc-11ga3ic-3"})({display:"flex",alignItems:"center",gap:"0.5rem"}),v=(0,o.ZP)("div").withConfig({displayName:"StudentItem___StyledDiv4",componentId:"sc-11ga3ic-4"})({display:"flex",alignItems:"center",justifyContent:"center",gap:"0.75rem",paddingRight:"1.25rem"}),_=(0,o.ZP)("p").withConfig({displayName:"StudentItem___StyledP",componentId:"sc-11ga3ic-5"})({display:"none","--tw-text-opacity":"1",color:"rgb(38 46 74 / var(--tw-text-opacity))","@media (min-width: 768px)":{display:"inline"}}),b=(0,o.ZP)("div").withConfig({displayName:"StudentItem___StyledDiv5",componentId:"sc-11ga3ic-6"})({display:"none",paddingRight:"0.25rem","@media (min-width: 768px)":{display:"block"}}),S=(0,o.ZP)("div").withConfig({displayName:"StudentItem___StyledDiv6",componentId:"sc-11ga3ic-7"})({display:"block","@media (min-width: 768px)":{display:"none"}})},85144:function(e,t,i){"use strict";i.r(t);var n=i(85893),o=i(49363),a=i(45056),s=i(54895),d=i(90384),r=i(13565),l=i(12902);i(17988);var c=i(80132),p=i(60029),m=i(80405);i(67294);var h=i(51118);t.default=(0,m.ZP)(function(){let{data:e,isLoading:t}=(0,d.AF)();return(0,n.jsxs)(l.Z,{backgroundColor:"#F4F0FF",children:[(0,n.jsxs)(g,{children:[(0,n.jsx)(c.Z,{children:"Students"}),(0,n.jsx)(r.Z,{})]}),(0,n.jsxs)(s.Z,{white:!0,children:[(0,n.jsx)(x,{children:(0,n.jsx)(u,{children:(0,n.jsx)(a.Z,{secondary:!0,text:"Students",disabled:!0})})}),t?(0,n.jsx)(h.Z,{message:"Fetching students..."}):null==e?void 0:e.map((e,t)=>(0,n.jsx)(p.Z,{child:e},t))]})]})}),(0,o.ZP)("div").withConfig({displayName:"students___StyledDiv",componentId:"sc-15ajl4y-0"})({display:"flex",flexDirection:"column",gap:"0.75rem"}),(0,o.ZP)("input").withConfig({displayName:"students___StyledInput",componentId:"sc-15ajl4y-1"})({borderWidth:"1px"});var g=(0,o.ZP)("div").withConfig({displayName:"students___StyledDiv2",componentId:"sc-15ajl4y-2"})({marginTop:"50px",marginBottom:"50px",display:"flex",height:"60px",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"1.25rem",paddingRight:"30px"}),x=(0,o.ZP)("div").withConfig({displayName:"students___StyledDiv3",componentId:"sc-15ajl4y-3"})({marginTop:"20px",marginBottom:"20px",display:"flex",height:"60px",width:"100%",flexDirection:"row",justifyContent:"space-between",gap:"1.25rem"}),u=(0,o.ZP)("div").withConfig({displayName:"students___StyledDiv4",componentId:"sc-15ajl4y-4"})({display:"flex",width:"50%",flexDirection:"row",gap:"1.25rem"})}},function(e){e.O(0,[3631,8802,5524,3465,5078,5,6005,7536,3806,768,6310,9386,2189,8040,5104,4182,9152,1718,193,8389,3723,384,2902,7164,9774,2888,179],function(){return e(e.s=20424)}),_N_E=e.O()}]);
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.