1var oa=Object.defineProperty,la=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var mt=Object.getOwnPropertySymbols;var na=Object.prototype.hasOwnProperty,ia=Object.prototype.propertyIsEnumerable;var ht=(e,o,u)=>o in e?oa(e,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[o]=u,q=(e,o)=>{for(var u in o||(o={}))na.call(o,u)&&ht(e,u,o[u]);if(mt)for(var u of mt(o))ia.call(o,u)&&ht(e,u,o[u]);return e},Ie=(e,o)=>la(e,sa(o));var R=(e,o,u)=>new Promise((w,g)=>{var m=x=>{try{T(u.next(x))}catch(_){g(_)}},p=x=>{try{T(u.throw(x))}catch(_){g(_)}},T=x=>x.done?w(x.value):Promise.resolve(x.value).then(m,p);T((u=u.apply(e,o)).next())});import{k as ve,a4 as wt,s as r,u as S,v as d,x as l,N as v,A as i,X as a,a5 as ft,r as I,c as k,q as N,z as f,C as s,B as Be,F as Z,T as Ae,S as K,_ as ra,E as y,O as Je,V as Ye,a0 as da,y as Le,ae as xt,U as ca,D as ua,a1 as St,w as ma,ab as gt,n as ha,aa as fa,G as ce,H as vt,f as ga,b as va}from"./chunk.BhnF8lqErK1Y.js";import{u as Pe,t,D as ya,a as me,P as Ee,S as W,I as ee,bH as pa,bI as ba,bv as yt,bD as _a,bb as wa,aC as xa,l as Ct,a4 as pt,aV as ke,s as Sa}from"./chunk.C6PXV3Pxc_ps.js";import{a0 as Ca,a1 as ka,L as Aa,a as G,G as kt,J as Xe,bz as oe,q as we,b as $e,T as Ea,bW as At,W as ae,b$ as Y,c0 as Ue,N as ge,D as ze,r as Qe,b5 as Ta,o as Ma,m as Ia,V as La,X as $a}from"./entry.CoPCKUW3BkOv.js";import{s as Oa}from"./chunk.DR20-frgwmjf.js";import{N as Fe}from"./chunk.CNprI4YmNo3n.js";import{P as Da}from"./chunk.vKmSb7iagUEM.js";import{u as Et}from"./chunk.DGksOcLQgZEB.js";import{u as Ra}from"./chunk.DzSDjcHC2K42.js";import{_ as He}from"./chunk.DbSEshNrmVP7.js";import{a as et,T as Na}from"./chunk.BCkaS6Xcp7AJ.js";import{S as Ua}from"./chunk.B3U-hymdOXX2.js";import{e as Va,k as Ba,s as Fa}from"./chunk.B5IZEoozr3Ue.js";import{k as za}from"./chunk.BcI8AjCmesA3.js";import{B as Ya}from"./chunk.BxGqqr4rYvx-.js";import{a as Pa,b as ue}from"./chunk.C7H1bMZZ1nyS.js";import{s as bt}from"./chunk.DFaii_0VQqXg.js";import{m as Ha}from"./chunk.Cf6RViWiRxKL.js";import{p as qa}from"./chunk.CVJ3qk6gptU6.js";import{H as Wa,e as Ga}from"./chunk.De7rQLLjLy7u.js";import{s as Ve}from"./chunk.mFDYeA7vDQXs.js";import{q as Ka}from"./chunk.DMiigLJ6-phQ.js";import{f as ja,g as Za,e as Xa,h as Ja}from"./chunk.B24uO4CbZ5Co.js";import"./chunk.BbtcIZGqd4iu.js";import"./chunk.CYb5VoSWUqQa.js";import"./chunk.BDU3fSxGx4NH.js";import"./chunk.BvdY-38ehWl1.js";import"./chunk.BKpYHMymaIYp.js";import"./chunk.Ci-BjNYea6Ft.js";import"./chunk.Bp1CXZvQiX5a.js";import"./chunk.CzTLjHNhLNYa.js";import"./chunk.CPd1t_aXeIFX.js";import"./chunk.CBTSrM8H8osD.js";import"./chunk.Ct6L_48m9-Sj.js";import"./chunk.CikXL8VgIIyA.js";import"./chunk.BY4R_htcd2D3.js";import"./chunk.DwqTvbU1d2pe.js";import"./chunk.BYYn09UaC-Rz.js";import"./chunk.De_R8el4I_uh.js";const Qa=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 25" fill="none"> <g clip-path="url(#clip0_1099_5545)"> <path d="M22 1.5H2.00002C0.897469 1.5 0 2.397 0 3.50002V17.5C0 18.603 0.897469 19.5 2.00002 19.5H9.00225C8.98125 20.2978 8.82891 21.5738 8.25684 22.1763C8.04689 22.397 7.80666 22.5 7.5 22.5C7.22363 22.5 6.99998 22.7237 6.99998 23.0001C6.99998 23.2764 7.22363 23.5001 7.5 23.5001H16.5C16.7764 23.5001 17 23.2764 17 23.0001C17 22.7237 16.7764 22.5 16.5 22.5C16.1933 22.5 15.9531 22.3975 15.7441 22.1768C15.1735 21.5773 15.0202 20.2994 14.9984 19.5H22C23.1026 19.5 24 18.6031 24 17.5V3.50002C24 2.397 23.1025 1.5 22 1.5ZM12 18.5029C11.4473 18.5029 10.9971 18.0527 10.9971 17.5C10.9971 16.9472 11.4473 16.497 12 16.497C12.5527 16.497 13.0029 16.9472 13.0029 17.5C13.0029 18.0527 12.5527 18.5029 12 18.5029ZM2.00002 15.5V3.50002H22L22.0009 15.5H2.00002Z" fill="currentColor"/> <path d="M10.1308 12.1965C10.331 12.3908 10.6026 12.5 10.8857 12.5C11.1687 12.5 11.4403 12.3908 11.6405 12.1965L15.6872 8.26894C16.1043 7.86415 16.1043 7.20838 15.6872 6.80359C15.2701 6.3988 14.5945 6.3988 14.1774 6.80359L10.8857 9.99786L9.82261 8.96611C9.40553 8.56132 8.72988 8.56132 8.3128 8.96611C7.89573 9.37037 7.89573 10.0267 8.3128 10.4315L10.1308 12.1965Z" fill="currentColor"/> </g> <defs> <clipPath id="clip0_1099_5545"> <rect width="24" height="24" fill="currentColor" transform="translate(0 0.5)"/> </clipPath> </defs> </svg> 2`,eo=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"> <path d="M16.1825 2.99999C8.87121 2.90124 2.90246 8.86999 3.00121 16.1812C3.09871 23.1931 8.80808 28.9025 15.82 29C23.1325 29.1 29.1 23.1312 29 15.82C28.9037 8.80686 23.1943 3.09749 16.1825 2.99999ZM24.0837 23.4531C24.0588 23.48 24.0283 23.5012 23.9943 23.515C23.9604 23.5288 23.9238 23.5349 23.8871 23.533C23.8505 23.5311 23.8148 23.5212 23.7824 23.5039C23.7501 23.4867 23.7219 23.4625 23.7 23.4331C23.1409 22.7017 22.4563 22.0755 21.6781 21.5837C20.0868 20.5625 18.0706 20 16.0012 20C13.9318 20 11.9156 20.5625 10.3243 21.5837C9.54613 22.0753 8.86152 22.7013 8.30246 23.4325C8.2805 23.4619 8.25234 23.486 8.21999 23.5033C8.18764 23.5206 8.15189 23.5305 8.11527 23.5324C8.07865 23.5343 8.04206 23.5282 8.00809 23.5143C7.97412 23.5005 7.9436 23.4794 7.91871 23.4525C6.08475 21.4727 5.04589 18.8858 5.00121 16.1875C4.89933 10.1056 9.88996 5.01499 15.9743 4.99999C22.0587 4.98499 27.0012 9.92561 27.0012 16C27.0033 18.7634 25.9612 21.4255 24.0837 23.4531Z" fill="#D10000"/> <path d="M15.9993 9C14.7668 9 13.6524 9.46188 12.8605 10.3013C12.0687 11.1406 11.673 12.3012 11.7624 13.5469C11.9437 16 13.8443 18 15.9993 18C18.1543 18 20.0512 16 20.2362 13.5475C20.3287 12.3137 19.9362 11.1638 19.1312 10.3088C18.3362 9.465 17.2237 9 15.9993 9Z" fill="#D10000"/> <circle cx="26" cy="6" r="5.5" fill="#D10000" stroke="white"/> </svg> 3`,to=ve({__name:"ExamCoordinatorDialog",props:ft({teacher:{},action:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:ft(["updated"],["update:visible"]),setup(e,{emit:o}){const u=wt(e,"visible"),w=o,g=Pe(),m=I(!1),p=k(()=>`${e.teacher.firstName} ${e.teacher.lastName}`),T=k(()=>e.action==="grant"?t("Make :name exam coordinator",{name:p.value}):t("Remove :name as exam coordinator",{name:p.value})),x=k(()=>
3e.action==="grant"?t("Make coordinator"):t("Remove coordinator"));function _(){return R(this,null,function*(){m.value=!0;try{const A=yield G.patch(`/api/site-admin/users/${e.teacher.id}/exam-coordinator`,{is_exam_coordinator:e.action==="grant"});w("updated",A.data.is_exam_coordinator),u.value=!1;const $=e.action==="grant"?t(":name is now an exam coordinator",{name:p.value}):t(":name is no longer an exam coordinator",{name:p.value});g.add({severity:"success",summary:$})}catch(A){g.add({severity:"error",summary:t("Something went wrong, please try again.")})}finally{m.value=!1}})}return(A,$)=>(r(),S(Aa,{visible:u.value,"onUpdate:visible":$[0]||($[0]=b=>u.value=b),modal:""},{header:d(()=>[l(ka,{level:2},{default:d(()=>[v(i(T.value),1)]),_:1})]),footer:d(()=>[l(ya,{secondary:{label:a(t)("Cancel"),onAction:()=>u.value=!1},primary:{label:x.value,loading:m.value,onAction:_}},null,8,["secondary","primary"])]),default:d(()=>[l(Ca,{tag:"p"},{default:d(()=>[v(i(a(t)("Exam coordinators can view and manage all exams created by teachers at their school.")),1)]),_:1})]),_:1},8,["visible"]))}}),ao={item:({context:e})=>e.item.key==="header"?{style:{opacity:1,pointerEvents:"auto"}}:void 0},oo={components:{ContextMenu:Oa,IconSVG:ee,Checkbox:Xe,SecondaryButton:W,PrimaryButton:Ee,ExamCoordinatorDialog:to,BaseDropdown:kt},props:{role:{type:String,required:!0}},setup(){return{menuPassThrough:ao}},data(){return{Modal:we,moveTarget:0,selectedTeacher:null,selectedMoveSchool:0,moveWithinOrganisationOptions:[{label:"Välj skola",value:0}],teacher:null,schoolHasAdmin:!1,showExamCoordinatorDialog:!1,removeReason:[],removeReasonOptions:[{value:"student",label:this.__("This person is a student")},{value:"quit",label:this.__("This person no longer works with us")},{value:"unrecognized",label:this.__("I don't know who this person is")}]}},computed:{name(){return this.teacher?`${this.teacher.firstName} ${this.teacher.lastName}`:""},email(){return this.teacher?this.teacher.email:""},isSchoolAdmin(){return oe.hasRole(this.role,"school_admin")},isOrganisationAdmin(){return oe.hasRole(this.role,"organisation_admin")},isSupportAdmin(){return oe.hasRole(this.role,"support_admin")},isSuggested(){return this.teacher?window.K$.school_votes.some(e=>Number(e.votee_id)===Number(this.teacher.id)&&e.type==="promote"):!1},hasSuggested(){return!this.teacher||!this.auth_teacher?!1:window.K$.school_votes.some(e=>Number(e.voter_id)===Number(this.auth_teacher.id)&&Number(e.votee_id)===Number(this.teacher.id)&&e.type==="promote")},promoteTitle(){return this.isSchoolAdmin?this.__("Give administrator status"):this.__("Suggest as school administrator")},promoteInfo(){return this.isSchoolAdmin?this.__("Are you sure that you want to give this teacher administrator access for the school? He or she will be able to handle administrators, as well as removing teachers from the school."):this.__("Are you sure that you want to suggest that this teacher becomes an administrator for your school? Your colleagues will be notified and given the option to confirm.")},canManageExamCoordinator(){return this.isSupportAdmin},actions(){var e;return[{key:"header",disabled:!0},{separator:!0},{label:this.isSchoolAdmin||this.isSuggested?this.__("Upgrade to school-administrator"):this.__("Suggest as school administrator"),svg:pa,visible:!this.hasRole("school_admin")&&(this.isSchoolAdmin||!this.schoolHasAdmin)&&!this.hasSuggested,command:()=>we.show(this.$refs.promoteTeacherModal)},{label:this.__("Remove administrator status"),svg:ba,visible:this.hasRole("school_admin")&&!this.hasRole("organisation_admin")&&this.isSchoolAdmin,command:()=>we.show(this.$refs.demoteTeacherModal)},{label:this.__("Move teacher to another school"),svg:yt,visible:this.isSupportAdmin,command:()=>we.show(this.$refs.moveTeacherModal)},{label:this.__("Move teacher to other school within the organization."),svg:yt,visible:this.isOrganisationAdmin,command:this.showMoveWithinOrganisationModal},{label:"Set user role",svg:_a,visible:this.isSupportAdmin,command:()=>we.show(this.$refs.setUserRoleModal)},{label:(e=this.teacher)!=null&&e.is_exam_coordinator?this.__("Remove exam coordinator status"):this.__("Make exam coordinator"),svg:wa,visible:this.canManageExamCoordinator,command:()=>{this.showExamCoordinatorDialog=!0}},{label:this.__("Remove teacher from school"),svg:xa,visible:this.isSchoolAdmin&&!this.hasRole("school_admin"),command:this.showRemoveTeacherModal,danger:!0}]}},mounted(){$e.$on("context-show-colleague",this.onShowColleague)},beforeUnmount(){$e.$off("context-show-colleague",this.onShowColleague)},methods:{onShowColleague(e,o){this.selectedTeacher=o.selectedTeacher.id,this.teacher=o.selectedTeacher,this.auth_teacher=o.auth_teacher,this.schoolHasAdmin=o.schoolHasAdmin,this.$refs.menu.show(e)},onMenuHide(){$e.$emit("context-hide")},showRemoveTeacherModal(){this.removeReason=[],we.show(this.$refs.reportTeacherModal)},onExamCoordinatorUpdated(e){this.teacher&&(this.teacher.is_exam_coordinator=e)},showMoveWithinOrganisationModal(){we.show(this.$refs.moveWithinOrganisationModal),window.$.ajax({url:"/api/organisation",context:this,success:e=>{this.moveWithinOrganisationOptions=[{label:"Välj skola",value:0},...e.map(o=>({label:o.namn,value:o.id}))]}})},loginAs(){window.location.href="/admin/impersonate/"+this.teacher.email},hasRole(e){return this.teacher?oe.hasRole(this.teacher.type,e):!1},report(){return R(this,arguments,function*(e={}){var u;const o={};((u=e.reason)==null?void 0:u.length)>0&&(o.metadata={reason:e.reason}),yield G.post(`/api/votes/report/${this.teacher.id}`,o),window.location.reload()})},promote(){window.$.ajax({method:"post",url:`/api/votes/promote/${this.teacher.id}`,success(){window.location.reload()}})},demote(){window.$.ajax({method:"post",url:`/api/votes/demote/${this.teacher.id}`,success(){window.location.reload()}})},moveWithinOrganisation(){this.selectedMoveSchool!==0&&(this.moveTarget=this.selectedMoveSchool,this.move())},move(){window.$.ajax({method:"post",url:`/api/votes/move/${this.teacher.id}/${this.moveTarget}`,success(){window.location.reload()}})},setTypeForUser(e){return R(this,null,function*(){yield G.post(`/api/site-admin/users/${this.teacher.id}/type`,{type:e}),window.location.reload()})}}},lo={key:0,class:"ColleagueListContext__header"},so={class:"ColleagueListContext__name"},no={class:"ColleagueListContext__email"},io={class:"modal-title"},ro={class:"text-center"},co={class:"ColleagueListContext__remove-reasons"},uo={class:"popup-footer-vertical"},mo={class:"modal-title"},ho={class:"text-center"},fo={class:"popup-footer"},go={class:"modal-title"},vo={class:"text-center"},yo={class:"popup-footer"},po={class:"modal-title"},bo={class:"text-center"},_o={class:"moveTeacher__footer"},wo={class:"modal-title"},xo={class:"text-center"},So={key:0},Co={class:"popup-footer",style:{"justify-content":"center"}},ko={class:"SetUserRoleModal__buttons text-center"},Ao={class:"popup-footer"};function Eo(e,o,u,w,g,m){var F;const p=N("IconSVG"),T=N("ContextMenu"),x=N("Checkbox"),_=N("SecondaryButton"),A=N("PrimaryButton"),$=N("ExamModal"),b=N("BaseDropdown"),V=N("ExamCoordinatorDialog");return r(),f("div",null,[l(T,{ref:"menu",model:m.actions,pt:w.menuPassThrough,onHide:m.onMenuHide},{item:d(({item:O,props:X})=>[O.key==="header"?(r(),f("div",lo,[s("h3",so,i(m.name),1),s("h5",no,i(m.email),1)])):(r(),f("a",Be({key:1},X.action,{style:O.danger?{color:"var(--exam-red-500)"}:void 0}),[l(p,{svg:O.svg,width:"var(--icon-size-default)"},null,8,["svg"]),s("span",null,i(O.label),1)],16))]),_:1},8,["model","pt","onHide"]),l($,{ref:"reportTeacherModal",size:"sm"},{title:d(()=>[s("h3",io,i(e.__("Remove teacher from school")),1)]),body:d(()=>[s("div",ro,[s("p",null,i(e.__("Are you sure you wish to remove this teacher from the school?")),1),s("div",null,[s("p",null,i(e.__("Why are you removing this person?")),1),s("div",co,[(r(!0),f(Z,null,Ae(g.removeReasonOptions,O=>
3(r(),S(x,{key:O.value,modelValue:g.removeReason,"onUpdate:modelValue":o[0]||(o[0]=X=>g.removeReason=X),value:O.value,label:O.label},null,8,["modelValue","value","label"]))),128))])])])]),footer:d(()=>[s("div",uo,[l(_,{"data-dismiss":"modal",label:e.__("Close")},null,8,["label"]),l(A,{severity:"danger","data-dismiss":"modal",label:e.__("Remove"),onClick:o[1]||(o[1]=O=>m.report({reason:g.removeReason}))},null,8,["label"])])]),_:1},512),l($,{ref:"promoteTeacherModal",size:"sm"},{title:d(()=>[s("h3",mo,i(m.promoteTitle),1)]),body:d(()=>[s("div",ho,[s("p",null,i(m.promoteInfo),1)])]),footer:d(()=>[s("div",fo,[l(_,{"data-dismiss":"modal",label:e.__("No")},null,8,["label"]),l(A,{"data-dismiss":"modal",label:e.__("Yes"),onClick:m.promote},null,8,["label","onClick"])])]),_:1},512),l($,{ref:"demoteTeacherModal",size:"sm"},{title:d(()=>[s("h3",go,i(e.__("Remove administrator status")),1)]),body:d(()=>[s("div",vo,[s("p",null,i(e.__("Are you sure you wish to remove the administrator status for this teacher?")),1)])]),footer:d(()=>[s("div",yo,[l(_,{"data-dismiss":"modal",label:e.__("No")},null,8,["label"]),l(A,{"data-dismiss":"modal",label:e.__("Remove"),onClick:m.demote},null,8,["label","onClick"])])]),_:1},512),l($,{ref:"moveTeacherModal",size:"sm"},{title:d(()=>[s("h3",po,i(e.__("Move teacher to another school")),1)]),body:d(()=>[s("div",bo,[o[8]||(o[8]=s("p",{style:{"font-size":"14px"}},[v(" I samband med flytten kommer lärarens prov följa med, "),s("b",null,"men inte provens elevsvar"),v(". Om det handlar om en felregistrering och eleverna ska följa med så kan Martin eller Erik uppdatera school_id manuellt. ")],-1)),o[9]||(o[9]=v(" Skolid: ",-1)),K(s("input",{"onUpdate:modelValue":o[2]||(o[2]=O=>g.moveTarget=O),name:"moveTarget",type:"text",placeholder:"Ange målskolans id"},null,512),[[ra,g.moveTarget]])])]),footer:d(()=>[s("div",_o,[l(_,{class:"moveTeacher__footer__button",label:e.__("Close"),"data-dismiss":"modal"},null,8,["label"]),l(A,{class:"moveTeacher__footer__button",label:e.__("Move"),"data-dismiss":"modal",onClick:m.move},null,8,["label","onClick"])])]),_:1},512),l($,{ref:"moveWithinOrganisationModal",size:"md"},{title:d(()=>[s("h3",wo,i(e.__("Move teacher to other school within the organization.")),1)]),body:d(()=>[s("div",xo,[g.teacher?(r(),f("h3",So,i(g.teacher.firstName)+" "+i(g.teacher.lastName),1)):y("",!0),o[10]||(o[10]=s("br",null,null,-1)),o[11]||(o[11]=s("p",{style:{"font-size":"14px"}},[v(" I samband med flytten kommer lärarens prov följa med, "),s("b",null,"men inte provens elevsvar"),v(" eftersom dessa tillhör den nuvarande skolan. Om det handlar om en felregistrering och elevinformation "),s("b",null,"ska"),v(" följa med, kontakta oss på [email protected]. ")],-1)),l(b,{modelValue:g.selectedMoveSchool,"onUpdate:modelValue":o[3]||(o[3]=O=>g.selectedMoveSchool=O),style:{margin:"auto"},name:"moveSchool",options:g.moveWithinOrganisationOptions},null,8,["modelValue","options"])])]),footer:d(()=>[s("div",Co,[l(_,{style:{"margin-right":"5px"},"data-dismiss":"modal",label:e.__("Close")},null,8,["label"]),l(A,{"data-dismiss":"modal",label:e.__("Perform move"),onClick:m.moveWithinOrganisation},null,8,["label","onClick"])])]),_:1},512),m.isSupportAdmin?(r(),S($,{key:0,ref:"setUserRoleModal",size:"sm"},{title:d(()=>[...o[12]||(o[12]=[s("h3",{class:"modal-title"},"Set user type",-1)])]),body:d(()=>[o[13]||(o[13]=s("div",{class:"text-center"},[s("p",null,"This feature is only available for Exam.net internal support administrators.")],-1)),s("div",ko,[l(A,{"data-dismiss":"modal",label:"Teacher",onClick:o[4]||(o[4]=O=>m.setTypeForUser("teacher"))}),l(A,{"data-dismiss":"modal",label:"School admin",onClick:o[5]||(o[5]=O=>m.setTypeForUser("school_admin"))}),l(A,{"data-dismiss":"modal",label:"Organization admin",onClick:o[6]||(o[6]=O=>m.setTypeForUser("organisation_admin"))})])]),footer:d(()=>[s("div",Ao,[l(_,{"data-dismiss":"modal",label:e.__("Cancel")},null,8,["label"])])]),_:1},512)):y("",!0),m.canManageExamCoordinator?(r(),S(V,{key:1,visible:g.showExamCoordinatorDialog,"onUpdate:visible":o[7]||(o[7]=O=>g.showExamCoordinatorDialog=O),teacher:g.teacher,action:(F=g.teacher)!=null&&F.is_exam_coordinator?"revoke":"grant",onUpdated:m.onExamCoordinatorUpdated},null,8,["visible","teacher","action","onUpdated"])):y("",!0)])}const To=me(oo,[["render",Eo],["__scopeId","data-v-d754c9c5"]]),Mo={class:"LicenseSection"},Io={key:0},Lo={key:1},$o={key:1}
3,Oo={key:2},Do={key:1,style:{"margin-top":"30px"}},Ro={key:2},No={key:0},Uo={key:1},Vo={key:0},Bo={key:0},Fo={key:0},zo={style:{margin:"15px",color:"#1d2d50","border-left":"3px solid black",padding:"5px"}},Yo={style:{margin:"15px",color:"#1d2d50","border-left":"3px solid black",padding:"5px"}},Po={key:1},Ho={key:2},qo={key:4},Wo={class:"product"},Go=!1,Ko=ve({__name:"LicenseSection",props:{teacher:{},accessTo:{},extendedUserAccess:{},dpaSignedAt:{},legalLink:{},adminInformation:{},internationalSchool:{},eligibleForExtendedUserAccess:{type:Boolean},isGaussOnly:{type:Boolean}},setup(e){const{copy:o}=Et(),u=Pe(),w=Ra(),g=I(null),m=I(!1);Je(()=>{e.adminInformation&&(g.value=Da.json(e.adminInformation.data)),Ea.register("stripebeta",()=>{m.value=!0},{description:"Enable the Stripe payment beta"})});const p=k(()=>ze.formatFromUTC(e.accessTo,"YYYY-MM-DD")),T=k(()=>ze.formatFromUTC(e.extendedUserAccess.access_to,"YYYY-MM-DD")),x=k(()=>{var P,C;return((C=(P=e.teacher)==null?void 0:P.school)==null?void 0:C.access_type)==="demo"}),_=k(()=>{var P,C;return((C=(P=e.teacher)==null?void 0:P.school)==null?void 0:C.international_school_id)>0}),A=k(()=>e.internationalSchool?`${window.location.origin}/teacher-registration/${e.internationalSchool.id}`:null),$=k(()=>{var j,te,H,ye;if(Number(e.adminInformation.user_id)===0)return"Exam.net administrator";const P=((te=(j=e.adminInformation)==null?void 0:j.user)==null?void 0:te.firstName)||"",C=((ye=(H=e.adminInformation)==null?void 0:H.user)==null?void 0:ye.lastName)||"";return`${P} ${C} (administrator)`}),b=I(void 0),V=()=>{window.location.href="/logout"},F=()=>R(null,null,function*(){if(_.value){window.open(`/booking/${e.teacher.school_id}`);return}b.value||(b.value=(yield G.post("/api/book/info")).data),window.open(b.value)}),O=()=>{window.open("/demo-access")},X=()=>R(null,null,function*(){yield G.post("/api/extended-user-accesses"),window.location.href="/admin/exams"}),le=I(!1),he=()=>{if(!oe.hasRole(e.teacher.type,"school_admin")){le.value=!0;return}window.open("/quote-information/school-admin-information")},se=()=>{A.value&&(o(A.value),u.add({severity:"info",summary:t("Link copied to clipboard")}))},ne=()=>R(null,null,function*(){const P=(yield G.get("/payment/token")).data;window.open(`/payment/perform/stripe/${P}`)});return(P,C)=>{const j=Ye("sanitized-html");return r(),f("div",Mo,[l(At,{title:a(t)("License")},{default:d(()=>[e.accessTo?(r(),f(Z,{key:0},[x.value?y("",!0):(r(),f("div",Io,[l(ae,null,{default:d(()=>[C[0]||(C[0]=s("i",{class:"fa fa-check-circle-o",style:{"font-size":"20px"}},null,-1)),v("  "+i(a(t)("License")),1)]),_:1}),a(w).isInTrial?(r(),S(Y,{key:0},{default:d(()=>[v(i(a(t)("Your school has a valid trial license until"))+" "+i(p.value)+". ",1)]),_:1})):(r(),S(Y,{key:1},{default:d(()=>[v(i(a(t)("Your school has a valid license until"))+" "+i(p.value)+".",1)]),_:1})),_.value?y("",!0):(r(),S(W,{key:2,label:a(t)("Show subscription"),onClick:F},null,8,["label"])),_.value?(r(),S(W,{key:3,label:a(t)("See pricing and purchase a license"),onClick:F},null,8,["label"])):y("",!0)])),x.value?(r(),f("div",Lo,[l(ae,null,{default:d(()=>[C[1]||(C[1]=s("i",{class:"fa fa-warning",style:{color:"#f99830","font-size":"20px"}},null,-1)),v("  "+i(a(t)("Demo license"))+" ("+i(p.value)+") ",1)]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("Your current license gives you access to a demo with most features of Exam.net"))+".",1)]),_:1}),l(W,{label:a(t)("Request a free trial of the full version of Exam.net"),onClick:O},null,8,["label"])])):y("",!0)],64)):e.isGaussOnly?(r(),f("div",$o,[l(ae,null,{default:d(()=>[C[2]||(C[2]=s("i",{class:"fa fa-exclamation-circle",style:{color:"var(--blue-600)","font-size":"20px"}},null,-1)),v("  "+i(a(t)("Signed in through KM")),1)]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("You are signed in to Exam.net through KM, which only gives access to the monitoring view.")),1)]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("To start using Exam.net, sign out and then sign in directly on Exam.net with the same email address.")),1)]),_:1}),l(W,{style:{"margin-top":"20px"},label:a(t)("Sign out"),onClick:V},null,8,["label"])])):(r(),f("div",Oo,[l(ae,null,{default:d(()=>[C[3]||(C[3]=s("i",{class:"fa fa-warning",style:{color:"red","font-size":"20px"}},null,-1)),v("  "+i(a(t)("License")),1)]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("Your school needs a license in order to use Exam.net."))+" "+i(a(t)("Click Purchase a license below to see pricing and to order.")),1)]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("You will get access as soon as the license is ordered.")),1)]),_:1}),a(Ct)("sv")?(r(),S(Y,{key:0},{default:d(()=>[...C[4]||(C[4]=[v(" (Alla nya skolor har rätt till en gratis utvärderingsperiod. Så om din skola inte har använt Exam.net tidigare - kontakta oss på [email protected] så hjälper vi er vidare.) ",-1)])]),_:1})):y("",!0),l(W,{style:{"margin-top":"20px"},label:a(t)("See pricing and purchase a license"),onClick:F},null,8,["label"]),e.eligibleForExtendedUserAccess?(r(),f("div",Do,[K(l(Y,null,null,512),[[j,a(t)("You can activate :days days of temporary access for your user to give you time to complete your purchase or save material before access is denied. If your schools needs more time to evaluate Exam.net, email :email",{days:"5",email:"<a href=mailto:[email protected]>[email protected]</a>"})]]),l(W,{label:a(t)("Activate :days days of temporary access",{days:"5"}),style:{"margin-top":"20px"},onClick:X},null,8,["label"])])):y("",!0),e.extendedUserAccess?(r(),f("div",Ro,[l(ae,null,{default:d(()=>[C[5]||(C[5]=s("i",{class:"fa fa-exclamation-circle",style:{color:"var(--green-600)","font-size":"20px","margin-top":"20px"}},null,-1)),v("  "+i(a(t)("Temporary extended access")),1)]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("You have temporarily extended access to :extendedAccessTo. During this time you can download or export your material. After this time a new school license will be required to continue using Exam.net.",{extendedAccessTo:T.value})),1)]),_:1}),l(Y,{class:"LicenseSection__trialRequest"},{default:d(()=>[v(i(a(t)("To get a new trial period for your school, please contact us at [email protected]")),1)]),_:1})])):y("",!0)])),e.teacher.country!=="Sweden"?(r(),f(Z,{key:3},[e.dpaSignedAt?(r(),f("div",No,[l(Ue),l(ae,null,{default:d(()=>[C[6]||(C[6]=s("i",{class:"fa fa-handshake-o",style:{"font-size":"var(--font-size-lg)"}},null,-1)),v("  "+i(a(t)("Data Processing Agreement"))+" ",1),C[7]||(C[7]=s("i",{class:"fa fa-check-circle-o",style:{color:"var(--green-600)","font-size":"var(--font-size-md)"}},null,-1))]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("Your school has a data processing agreement set up with Exam.net"))+"  (",1),l(He,{format:"YYYY-MM-DD",datetime:e.dpaSignedAt},null,8,["datetime"]),C[8]||(C[8]=v("). ",-1))]),_:1}),_.value&&e.legalLink?(r(),S(ge,{key:0,class:"LicenseSection__updatedAgreement",mode:"secondary",text:a(t)("See information above about the updated agreement.")},null,8,["text"])):y("",!0)])):y("",!0),Go?(r(),f("div",Uo,[l(Ue),l(ae,null,{default:d(()=>[C[9]||(C[9]=s("i",{class:"fa fa-building-o",style:{"font-size":"20px"}},null,-1)),v("  "+i(a(t)("School information")),1)]),_:1}),e.internationalSchool?(r(),f("div",Vo,[["school","university"].includes(e.internationalSchool.type)?(r(),f("div",Bo,[g.value&&g.value.funding&&g.value.funding.length>0?(r(),f("div",Fo,[l(Y,null,{default:d(()=>[v(i(a(t)("Administration/funding"))+":",1)]),_:1}),s("div",zo,[s("div",null,i(g.value.funding[0].toUpperCase()+g.value.funding.slice(1)),1)])])):y("",!0),l(Y,null,{default:d(()=>[v(i(a(t)("Total number of students in the entire school"))+":",1)]),_:1}),s("div",Yo,[s("div",null,i(e.internationalSchool.student_count),1)]),e.adminInformation?(r(),f("h4",Po," School information updated "+i(new Date(e.adminInformation.information_updated_at).toLocaleDateString())+" by "+i($.value),1)):y("",!0)])):y("",!0)])):y("",!0),s("div",null,[e.internationalSchool?(r(),S(Y,{key:0},{default:d(()=>[v(i(a(t)("In order to see pricing and order a license, the school administrator will need to provide some additional information.")),1)]),_:1})):y("",!0)]),s("div",null,[e.internationalSchool?(r(),S(W,{key:0,label:a(t)("Request to update"),faIcon:"lock",iconAfterLabel:"",onClick:he},null,8,["label"])):y("",!0),l(Y,null,{default:d(()=>[v("("+i(a(t)("Only school administrators can send update requests for verification"))+").",1)]),_:1}),le.value?(r(),S(Fe,{key:1,type:"warning"},{default:d(()=>[s("h2",null,i(a(t)("Only for school administrators")),1),s("p",null,i(a(t)("Only school administrators can update school information. You can view who is the school administrator in the list of colleagues below, so please ask him/her to update the school information.")),1),s("h3",null,i(a(t)("About school administrators")),1),s("p",null,i(a(t)("Each school can have no, one or several school administrators. A school administrator can for example remove a teacher account from the school should a teacher move from the school or should someone who is not a teacher register an account.")),1),s("p",null,i(a(t)("A school administrator can be appointed by an existing administrator. The first administrator, however, is appointed by being endorsed by a few colleagues in the system. This is done under the My school tab. As soon as two teachers vote for the same administrator, the role is assigned. Once the school has an administrator, no more voting can be done, instead, the administrator can assign additional administrators.")),1),s("p",null,i(a(t)("Please contact us on [email protected] if you have questions.")),1)]),_:1})):y("",!0)])])):y("",!0),A.value?(r(),f("div",Ho,[l(Ue),l(ae,null,{default:d(()=>[C[10]||(C[10]=s("i",{class:"fa fa-user-plus",style:{"font-size":"20px"}},null,-1)),v(" "+i(a(t)("Invite colleagues")),1)]),_:1}),l(Y,null,{default:d(()=>[v(i(a(t)("Click on the button below to copy a link which you can send to your colleagues to simplify their registration process.")),1)]),_:1}),l(W,{label:a(t)("Copy link"),onClick:se},null,8,["label"])])):y("",!0)],64)):y("",!0),m.value?(r(),f("div",qo,[l(Ue),l(ae,null,{default:d(()=>[C[11]||(C[11]=s("i",{class:"fa fa-credit-card",style:{"font-size":"20px"}},null,-1)),v(" "+i(a(t)("Payment")),1)]),_:1}),s("div",Wo,[C[12]||(C[12]=s("div",{class:"description"},[s("h3",null,"You have an outstanding payment to complete")],-1)),l(W,{label:"Complete payment",onClick:ne})])])):y("",!0)]),_:1},8,["title"])])}}}),jo=me(Ko,[["__scopeId","data-v-f02cc45f"]]);function Zo(e,o,u){return e.sort((w,g)=>{let m=w[o],p=g[o];return typeof m=="string"&&(m=m.toLowerCase()),typeof p=="string"&&(p=p.toLowerCase()),m<p?-1*u:m>p?Number(u):0})}const Xo=4,Jo=2,Qo=1,el={components:{FormatDate:He,SecondaryButton:W,TitleBar:et,StatusTag:Ua,InformationAlert:Qe},props:{colleagues:{type:Array,required:!0},teacher:{type:Object,required:!0},isAdmin:Boolean,school:{type:Object,required:!0},isSchoolAdmin:{type:Boolean,default:!1},showLicenseAction:{type:Boolean,default:!1}},emits:["show-license"],data(){return{excelIcon:Ta,allColleagues:[],highlightColleagueId:null,sorting:{key:null,order:1},downloadingUsageStatistics:!1}},computed:{colleaguesWithAdminRole(){return this.allColleagues.map(e=>Ie(q({},e),{adminRole:this.adminRole(e)}))}},mounted(){this.allColleagues=this.colleagues.filter(e=>Number(e.accepted_by)!==0),this.sortColleagues("firstName"),$e.$on("context-hide",()=>{this.highlightColleagueId=null})},methods:{downloadUsageStatistics(){return R(this,null,function*(){this.downloadingUsageStatistics=!0;const e=yield G.get(`/api/school-admin-statistics/${this.school.id}`),{rows:o,headers:u}=za(e.data,this.allColleagues,this.school.namn);this.downloadingUsageStatistics=!1,Va(o,u,`${this.school.namn} - ${ze.formatFromUTC(new Date,"YYYY-MM-DD")}`)}
3)},schoolVotes(){return this.isAdmin?[]:window.K$.school_votes},suggestedInfo(e){return Number(e.id)===Number(this.teacher.id)?this.__("You have been proposed as a school admin. Other teachers may confirm this."):this.schoolVotes().some(o=>o.type==="promote"&&Number(o.votee_id)===Number(e.id)&&Number(o.voter_id)===Number(this.teacher.id))?this.__("You have proposed that this teacher becomes administrator. Your colleagues may confirm this."):this.__("Suggested as school admin. Right click on the teacher to present options to act on this.")},isSuggested(e){return this.schoolVotes().some(o=>Number(o.votee_id)===Number(e.id)&&o.type==="promote")},adminRole(e){return this.isRole(e.type,"organisation_admin")?{tooltip:this.__("School group administrator at Exam.net"),text:this.__("Org admin"),color:"custom",customColor:{background:"var(--blue-gray-100)",color:"var(--blue-gray-800)"}}:this.isRole(e.type,"school_admin")?{tooltip:this.__("School administrator at Exam.net"),text:this.__("School admin"),color:"blue"}:null},isRole(e,o){return oe.hasRole(e,o)},showContextMenu(e,o){if(o===this.teacher.id){e.preventDefault();return}$e.$emit("context-show-colleague",e,{selectedTeacher:this.getColleague(o),schoolHasAdmin:this.colleagues.some(u=>oe.hasRole(u.type,"school_admin")),auth_teacher:this.teacher}),setTimeout(()=>{this.highlightColleagueId=o},10)},getColleague(e){for(let o=0;o<this.allColleagues.length;o++)if(this.allColleagues[o].id===e)return this.allColleagues[o];return null},roleWeight(e){let o=0;return this.isRole(e.type,"organisation_admin")?o=Xo:this.isRole(e.type,"school_admin")&&(o=Jo),e.is_exam_coordinator&&(o+=Qo),o},sortColleagues(e){this.sorting={order:this.sorting.key!==e?1:-this.sorting.order,key:e},e==="role"?this.allColleagues.sort((o,u)=>(this.roleWeight(u)-this.roleWeight(o))*this.sorting.order):Zo(this.allColleagues,e,this.sorting.order)}}},tl={class:"ColleagueList"},al={key:1,class:"ColleagueList__actions"},ol={class:"exam-list-main"},ll={class:"borderless ColleagueList__table-wrapper exam-list-table table-responsive table-scrollable"},sl={id:"testlist",ref:"table",class:"ColleagueList__table table table-hover",style:{"min-width":"800px"}},nl={ref:"tableHead"},il=["onContextmenu"],rl={class:"ColleagueList__role-labels"},dl={key:0},cl={key:1,class:"text-center",style:{width:"20px"}},ul=["onClick"],ml={key:2};function hl(e,o,u,w,g,m){const p=N("InformationAlert"),T=N("SecondaryButton"),x=N("TitleBar"),_=N("StatusTag"),A=N("FormatDate"),$=Ye("tooltip");return r(),f("div",tl,[u.teacher.type==="school_admin"?(r(),S(p,{key:0,allowHtml:"",mode:"secondary",text:e.__("You are a school administrator for")+" "+u.teacher.school.namn+" "+e.__("at Exam.net. This means that you can remove teachers who are no longer working at your school. You can also give other teachers administrator status.")+"<br><br>"+e.__("Any teacher may suggest that a teacher is removed, but only administrators may act on that request.")},null,8,["text"])):y("",!0),u.showLicenseAction||u.isSchoolAdmin?(r(),f("div",al,[u.showLicenseAction?(r(),S(T,{key:0,faIcon:"info-circle",size:"small",label:e.__("Show license information"),onClick:o[0]||(o[0]=b=>e.$emit("show-license"))},null,8,["label"])):y("",!0),u.isSchoolAdmin?(r(),S(T,{key:1,svgIcon:g.excelIcon,size:"small",loading:g.downloadingUsageStatistics,label:e.__("Download user statistics (Excel)"),onClick:m.downloadUsageStatistics},null,8,["svgIcon","loading","label","onClick"])):y("",!0)])):y("",!0),s("div",ol,[l(x,{title:u.school.namn,badge:u.isSchoolAdmin?e.__("School admin control"):""},null,8,["title","badge"]),s("div",ll,[s("table",sl,[s("thead",null,[s("tr",nl,[s("th",{class:"clickable-header",style:{width:"17%"},onClick:o[1]||(o[1]=b=>m.sortColleagues("role"))},i(e.__("Role")),1),s("th",{class:"clickable-header",style:{width:"20%"},onClick:o[2]||(o[2]=b=>m.sortColleagues("firstName"))},i(e.__("First name")),1),s("th",{class:"clickable-header",style:{width:"20%"},onClick:o[3]||(o[3]=b=>m.sortColleagues("lastName"))},i(e.__("Last name")),1),s("th",{class:"clickable-header",style:{width:"30%"},onClick:o[4]||(o[4]=b=>m.sortColleagues("email"))},i(e.__("Email")),1),s("th",{class:"clickable-header",onClick:o[5]||(o[5]=b=>m.sortColleagues("created_at"))},i(e.__("Registration date")),1),u.isSchoolAdmin?(r(),f("th",{key:0,class:"clickable-header",style:{"min-width":"100px"},onClick:o[6]||(o[6]=b=>m.sortColleagues("login_at"))},i(e.__("Last login")),1)):y("",!0),o[7]||(o[7]=s("th",null,null,-1))],512)]),l(xt,{id:"testlist-rows",name:"sort-list",tag:"tbody"},{default:d(()=>[(r(!0),f(Z,null,Ae(m.colleaguesWithAdminRole,b=>(r(),f("tr",{key:b.id,class:Le(["animation row-border",{highlightStyle:g.highlightColleagueId===b.id,own:u.teacher.id==b.id}]),onContextmenu:da(V=>m.showContextMenu(V,b.id),["right"])},[s("td",null,[s("div",rl,[b.adminRole?K((r(),S(_,{key:0,text:b.adminRole.text,color:b.adminRole.color,customColor:b.adminRole.customColor},null,8,["text","color","customColor"])),[[$,{content:b.adminRole.tooltip,theme:"tooltipClickable"}]]):y("",!0),m.isSuggested(b)?K((r(),S(_,{key:1,text:e.__("Suggested"),color:"green"},null,8,["text"])),[[$,{content:m.suggestedInfo(b),theme:"tooltipClickable"}]]):y("",!0),b.is_exam_coordinator?K((r(),S(_,{key:2,text:e.__("Coordinator"),color:"yellow"},null,8,["text"])),[[$,{content:e.__("Exam coordinator. This teacher has access to all exams created within the organisation. The teacher who created the exam can still reduce their access."),theme:"tooltipClickable"}]]):y("",!0)])]),s("td",null,i(b.firstName),1),s("td",null,i(b.lastName),1),s("td",null,i(b.email),1),s("td",null,[l(A,{format:"YYYY-MM-DD",datetime:b.created_at},null,8,["datetime"])]),u.isSchoolAdmin?(r(),f("td",dl,[l(A,{format:"YYYY-MM-DD",datetime:b.login_at}
3,null,8,["datetime"])])):y("",!0),b.id!=u.teacher.id?(r(),f("td",cl,[s("div",{class:"dropdown",onClick:V=>m.showContextMenu(V,b.id)},[...o[8]||(o[8]=[s("i",{style:{margin:"0 auto",width:"20px"},class:"fa fa-ellipsis-v"},null,-1)])],8,ul)])):(r(),f("td",ml))],42,il))),128))]),_:1})],512)])])])}const Tt=me(el,[["render",hl],["__scopeId","data-v-96aa86a8"]]),fl={components:{ColleagueList:Tt,PrimaryButton:Ee,BasicLicenseDialog:Ma},props:{schoolId:{type:[Number,String],required:!0},teacher:{type:Object,required:!0}},setup(){const{showDialog:e,bookingUrl:o,requiresLicenseUpgrade:u,isRestricted:w}=Ia();return{showBasicLicenseDialog:e,bookingUrl:o,requiresLicenseUpgrade:u,isRestricted:w}},data(){return{status:"closed",schools:[]}},computed:{isSchoolAdmin(){return this.teacher&&oe.hasRole(this.teacher.type,"school_admin")}},mounted(){window.location.hash==="#organisation"&&this.load()},methods:{load(){if(this.requiresLicenseUpgrade("showSchoolsInOrganization")){history.replaceState(null,"",window.location.pathname+window.location.search);return}this.status="loading",window.$.ajax({url:"/api/organisation",context:this,success(e){window.location.hash="organisation",this.status="loaded",this.schools=e.filter(o=>o.id!==this.schoolId)}})},openBookingForm(e){return R(this,null,function*(){if(e.international_school_id){window.open(`/booking/${e.id}`);return}window.open((yield axios.post(`/api/book/info/${e.id}`)).data)})}}},gl={class:"OrganisationSchools"},vl={key:0,class:"OrganisationSchools__load"},yl={key:1,class:"OrganisationSchools__list"};function pl(e,o,u,w,g,m){const p=N("PrimaryButton"),T=N("ColleagueList"),x=N("BasicLicenseDialog");return r(),f("div",gl,[g.status==="closed"||g.status==="loading"?(r(),f("div",vl,[l(p,{faIcon:"sitemap",label:e.__("Show schools in my organisation"),loading:g.status==="loading",showBasicLicenseLock:w.isRestricted("showSchoolsInOrganization"),onClick:m.load},null,8,["label","loading","showBasicLicenseLock","onClick"])])):y("",!0),g.schools.length?(r(),f("div",yl,[(r(!0),f(Z,null,Ae(g.schools,_=>(r(),f("div",{key:_.id},[l(T,{school:_,colleagues:_.teachers,teacher:u.teacher,isSchoolAdmin:m.isSchoolAdmin,showLicenseAction:"",onShowLicense:A=>m.openBookingForm(_)},null,8,["school","colleagues","teacher","isSchoolAdmin","onShowLicense"])]))),128))])):y("",!0),l(x,{visible:w.showBasicLicenseDialog,"onUpdate:visible":o[0]||(o[0]=_=>w.showBasicLicenseDialog=_),url:w.bookingUrl},null,8,["visible","url"])])}const bl=me(fl,[["render",pl],["__scopeId","data-v-5580187b"]]),_l={components:{FormatDate:He,PrimaryButton:Ee,SecondaryButton:W,TitleBar:et},props:{colleagues:{type:Array,default:()=>[]}},data(){return{allPending:[]}},mounted(){this.allPending=this.colleagues.filter(e=>Number(e.accepted_by)===0)},methods:{accept(e){G.post(`/api/pending-verifications/${e.id}/accept`).then(()=>{window.location.reload()}).catch(()=>{window.location.reload()})},deny(e){G.post(`/api/pending-verifications/${e.id}/deny`).then(()=>{window.location.reload()}).catch(()=>{window.location.reload()})},isRole(e,o){return oe.hasRole(e,o)}}},wl={class:"exam-list-main"},xl={class:"borderless exam-list-table table-responsive table-scrollable",style:{"margin-top":"0 !important","background-color":"var(--blue-gray-900)"}},Sl={id:"testlist",ref:"table",class:"table table-hover",style:{"min-width":"800px"}},Cl={ref:"tableHead",style:{"background-color":"var(--blue-gray-900)"}},kl={class:"clickable-header",style:{width:"30%"}},Al={class:"clickable-header",style:{width:"30%"}},El={class:"clickable-header",style:{width:"40%"}},Tl={class:"clickable-header",style:{width:"40%"}},Ml={class:"ActionButtons"};function Il(e,o,u,w,g,m){const p=N("TitleBar"),T=N("FormatDate"),x=N("PrimaryButton"),_=N("SecondaryButton");return K((r(),f("div",wl,[l(p,{title:e.__("Awaiting verification by organization administrator"),color:"var(--blue-gray-900)"},null,8,["title"]),s("div",xl,[s("table",Sl,[s("thead",null,[s("tr",Cl,[o[0]||(o[0]=s("th",{style:{width:"10px"}},null,-1)),o[1]||(o[1]=s("th",null,null,-1)),s("th",kl,i(e.__("First name")),1),s("th",Al,i(e.__("Last name")),1),s("th",El,i(e.__("Email")),1),s("th",Tl,i(e.__("Registration date")),1),o[2]||(o[2]=s("th",null,null,-1))],512)]),l(xt,{id:"testlist-rows",name:"sort-list",tag:"tbody"},{default:d(()=>[(r(!0),f(Z,null,Ae(g.allPending,A=>(r(),f("tr",{key:A.id,class:"animation row-border"},[o[3]||(o[3]=s("td",null,null,-1)),o[4]||(o[4]=s("td",null,null,-1)),s("td",null,i(A.firstName),1),s("td",null,i(A.lastName),1),s("td",null,i(A.email),1),s("td",null,[l(T,{format:"YYYY-MM-DD",datetime:A.created_at},null,8,["datetime"])]),s("td",Ml,[l(x,{label:e.__("Accept"),onClick:$=>m.accept(A)},null,8,["label","onClick"]),l(_,{label:e.__("Deny"),onClick:$=>m.deny(A)},null,8,["label","onClick"])])]))),128))]),_:1})],512)])],512)),[[ca,g.allPending.length>0]])}const Ll=me(_l,[["render",Il],["__scopeId","data-v-9d2afd4a"]]),$l=ve({__name:"NoSchoolConnectionNotification",props:{email:{}},setup(e){const o=e,u=`<a href="/admin/profile">${t("Profile")}</a>`,w=`<a href="/teacher-reconnect">${t("choose an organization to connect to")}</a>`,g=`<b>${o.email}</b>`;function m(){window.location.href="/admin/profile"}function p(){window.location.href="/teacher-reconnect"}return(T,x)=>{const _=Ye("sanitized-html");return r(),S(Ya,{headerText:a(t)("You are currently not connected to any school or organization."),mode:"danger",primaryButtonLabel:a(t)("Choose connection"),secondaryButtonLabel:a(t)("My profile"),noClosing:"",onPrimaryButtonClick:p,onSecondaryButtonClick:m},{icon:d(()=>[l(ee,{svg:a(eo),width:"2em"},null,8,["svg"])]),mainText:d(()=>[K(s("p",null,null,512),[[_,a(t)("Please ensure that your email :email is correct for your organization. If it's not, you can update this under :profileLink. If the issue remains, you can :organizationLink. An administrator at your organization will then need to approve you before you can get full access to your Exam.net account.",{email:g,profileLink:u,organizationLink:w})]])]),_:1},8,["headerText","primaryButtonLabel","secondaryButtonLabel"])}}}),Ol={props:{asLink:{type:Boolean,default:!1},type:{type:String,default:"primary"},disabled:{type:Boolean,default:!1},big:{type:Boolean,default:!1},box:{type:Boolean,default:!1},small:{type:Boolean,default:!1},lessPadding:{type:Boolean,default:!1},flex:{type:Boolean,default:!1}},emits:["click"]};function Dl(e,o,u,w,g,m){return r(),S(St(u.asLink?"a":"button"),{class:Le(["mainButton__button",{primaryStyle:u.type!=="secondary",secondaryStyle:u.type==="secondary",dangerStyle:u.type==="danger",disabledStyle:u.disabled,big:u.big,box:u.box,small:u.small,lessPadding:u.lessPadding,flex:u.flex}]),onClick:o[0]||(o[0]=p=>e.$emit("click",p))},{default:d(()=>[ua(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])}const Ze=me(Ol,[["render",Dl],["__scopeId","data-v-ccd6a19d"]]),Rl=["aria-label"],Nl=ve({__name:"ExamTransferSelectionBar",props:{count:{},teacherCount:{},sourceTeacherName:{}},emits:["clear","transfer"],setup(e,{emit:o}){const u=e,w=o,g=k(()=>u.teacherCount>1),m=k(()=>{const p=t(":count exam(s) selected",{count:u.count.toString()});if(g.value){const T=t("from :count teachers",{count:u.teacherCount.toString()});return`${p} ${T}. ${t("You can only transfer exams from one teacher at a time.")}`}return u.sourceTeacherName?`${p}, ${t("all created by :name",{name:u.sourceTeacherName})}`:p});return(p,T)=>(r(),f("div",{role:"region","aria-label":a(t)("Selected exams"),"aria-live":"polite"},[(r(),S(St(g.value?ge:Qe),{mode:"secondary",text:m.value,secondaryActionText:a(t)("Clear selection"),primaryActionText:g.value?"":a(t)("Transfer ownership"),onSecondaryAction:T[0]||(T[0]=x=>w("clear")),onPrimaryAction:T[1]||(T[1]=x=>w("transfer"))},null,40,["text","secondaryActionText","primaryActionText"]))],8,Rl))}});function Ul(){const e=I(new Map),o=k(()=>[...e.value.keys()]),u=k(()=>e.value.size),w=k(()=>
3new Set(e.value.values())),g=k(()=>w.value.size>1),m=k(()=>w.value.size===1?[...w.value][0]:null);function p(b){return e.value.has(b)}function T(b){p(b.id)?_([b]):x([b])}function x(b){const V=new Map(e.value);b.forEach(F=>V.set(F.id,F.teacher.id)),e.value=V}function _(b){const V=new Map(e.value);b.forEach(F=>V.delete(F.id)),e.value=V}function A(b){x(b.map(({id:V,teacherid:F})=>({id:V,teacher:{id:F}})))}function $(){e.value=new Map}return{selectedIds:o,count:u,teacherIds:w,isMixedTeachers:g,singleTeacherId:m,isSelected:p,toggle:T,selectMany:x,deselectMany:_,selectOwned:A,clear:$}}const Vl={key:0,class:"ExamCoordinatorExamsTable__selection"},Bl={key:1,class:"ExamCoordinatorExamsTable__header"},Fl={class:"ExamCoordinatorExamsTable__header__text"},zl=["href"],Yl={class:"ExamCoordinatorExamsTable__empty"},Pl={for:"exam-coordinator-filter-name"},Hl={for:"exam-coordinator-filter-examkey"},ql=["onClick"],Wl={class:"ExamCoordinatorExamsTable__created-by"},Gl=["aria-label","onMouseover","onFocus"],Kl={key:0},jl={key:1},Zl={key:2},Xl={class:"ExamCoordinatorExamsTable__groups"},Jl={key:0},Ql={key:1},es={key:2},ts={key:0,class:"ExamCoordinatorExamsTable__security-filter-value"},as={key:1},os={key:2},ls={key:0,class:"ExamCoordinatorExamsTable__access-filter-value"},ss={key:1},ns={key:2},is={class:"ExamCoordinatorExamsTable__student-access"},rs={class:"ExamCoordinatorExamsTable__filter-actions"},ds={class:"ExamCoordinatorExamsTable__actions"},cs="https://support.exam.net/s/article/automatic-exam-sharing-and-the-exam-coordinator-role?language=en_US",us="https://support.exam.net/s/article/automatisk-provdelning-och-rollen-provsamordnare?language=sv",ms=25,hs="#exam-directory",fs="coordinator",gs=200,vs="none",_t=50,ys=ve({__name:"ExamCoordinatorExamsTable",props:{user:{}},setup(e){const o={DESCENDING:-1},u={createdAtTimestamp:"created_at",name:"name",examKey:"examKey",security:"browserSecurityMode",access:"started"},w={selection:"4%",name:"18%",examKey:"10%",teacher:"13%",groups:"12%",security:"8%",access:"10%",createdAtTimestamp:"10%",actions:"15%"},g=ja(),m=[{label:t("Open:examState",{examState:""}),value:"open"},{label:t("Discoverable"),value:"discoverable"},{label:t("Closed"),value:"closed"}],p=Pe(),T=k(()=>Ct("sv")?us:cs),x=I([]),_=I(0),A=I(0),$=I(!1),b=I(0),V=I("createdAtTimestamp"),F=I(o.DESCENDING),O=I(null),X=I(!1),le=I(!1),he=I([]),se=I([]),ne=I([]),P=I(!1),C=I(!1);let j=0;const te=I(!1),H=I({name:{value:"",matchMode:ke.CONTAINS},examKey:{value:"",matchMode:ke.CONTAINS},teacher:{value:null,matchMode:ke.IN},groups:{value:null,matchMode:ke.IN},security:{value:null,matchMode:ke.IN},access:{value:null,matchMode:ke.IN}}),ye=["name","examKey","teacherIds","groupIds","security","access"],xe={name:"",examKey:"",teacherIds:null,groupIds:null,security:null,access:null},E=ga({draft:q({},xe),applied:q({},xe),isApplying:!1});let J=null,ie=null;function fe(n,h){return Array.isArray(n)&&n.length>0&&n.length<h}const Oe=k(()=>{var n,h;return!!(E.applied.name||E.applied.examKey||(n=E.applied.teacherIds)!=null&&n.length||(h=E.applied.groupIds)!=null&&h.length||fe(E.applied.security,g.length)||fe(E.applied.access,m.length))}),B=k(()=>ye.some(n=>!Ka(E.draft[n],E.applied[n]))),L=k(()=>x.value.length<_.value);function De(n){var h,M;return(M=(h=se.value.find(D=>D.id===n))==null?void 0:h.fullName)!=null?M:""}const re=k(()=>{var n;return((n=E.draft.teacherIds)==null?void 0:n.length)===1?E.draft.teacherIds[0]:null}),pe=k(()=>re.value===null?t("Select a single teacher to filter by group"):""),{selectedIds:be,count:de,teacherIds:Re,singleTeacherId:z,isSelected:qe,toggle:Mt,deselectMany:It,selectOwned:Lt,clear:We}=Ul(),Ge=k(()=>x.value.length>0&&x.value.every(n=>qe(n.id))),$t=k(()=>!Ge.value&&x.value.some(n=>qe(n.id))),tt=k(()=>z.value===null?"":De(z.value)),Ot=n=>t('Select exam ":name"',{name:n});function Dt(){return R(this,null,function*(){yield Ge.value?Kt():Gt()})}function Rt(n){var h,M;return(M=(h=ne.value.find(D=>D.id===n))==null?void 0:h.title)!=null?M:""}function Nt(){J&&clearTimeout(J),J=setTimeout(()=>{$.value=!0},gs)}function Ut(){J&&(clearTimeout(J),J=null),$.value=!1}const Se=I(new Map),{copy:Vt}=Et({legacy:!0});function Bt(n){Vt(n),p.add({severity:"success",summary:t("Exam key copied to clipboard"),detail:n,life:4e3})}function Ft(n){const h=Se.value.get(n);return h?Sa(`<b>${t("Shares")}
3</b><br>`+h.join("<br>")):`${t("Loading")}...`}function zt(n){var h,M;return{id:n.id,name:n.name,examKey:n.examkey,started:n.started,discoverable:n.discoverable,forPractice:n.for_practice,browserSecurityMode:n.browserSecurityMode,deviceSecurity:n.device_security,createdAt:n.created_at,teacher:n.teacher,groups:(h=n.groups)!=null?h:[],access:n.started?"open":n.discoverable?"discoverable":"closed",security:Ja(n.device_security,n.browserSecurityMode),createdAtTimestamp:new Date(n.created_at).getTime(),numShared:(M=n.num_shared)!=null?M:0}}function at(n){return R(this,null,function*(){if(!Se.value.has(n.id)){Se.value.set(n.id,null);try{const M=(yield Ga.get(n.id,{excludeColleagues:!0})).shared.filter(D=>D.teacher).map(D=>D.teacher.email).sort((D,Q)=>D.localeCompare(Q));Se.value.set(n.id,M)}catch(h){Se.value.delete(n.id),p.add({severity:"error",summary:t("Could not load share details")})}}})}function Ke(){var _e,Me,nt,it,rt,dt,ct,ut;const n={},h=(_e=H.value.name)==null?void 0:_e.value;h&&(n.filter_name=h);const M=(Me=H.value.examKey)==null?void 0:Me.value;M&&(n.filter_examkey=M);const D=(nt=H.value.teacher)==null?void 0:nt.value;D!=null&&D.length&&(n.filter_teacher_ids=[...D]);const Q=(it=H.value.groups)==null?void 0:it.value;Q!=null&&Q.length&&(n.filter_group_ids=[...Q]);const c=(dt=(rt=H.value.security)==null?void 0:rt.value)!=null?dt:null;fe(c,g.length)&&(n.filter_security=c.join(","));const U=(ut=(ct=H.value.access)==null?void 0:ct.value)!=null?ut:null;return fe(U,m.length)&&(n.filter_access=U.join(",")),n}function Ce(){return R(this,arguments,function*({append:n=!1}={}){var U;ie==null||ie.abort();const h=new AbortController;ie=h,Nt();const M=Ke(),D=n?b.value+1:1,Q=Ie(q({},M),{page:D,rows:ms,sort_field:(U=u[V.value])!=null?U:"created_at",sort_order:F.value}),c=Object.keys(M).length>0;try{const{data:_e}=yield G.get("/api/school/coordinator-exams",{params:Q,signal:h.signal}),Me=_e.data.map(zt);return x.value=n?[...x.value,...Me]:Me,b.value=D,_.value=_e.totalRecords,c||(A.value=_e.totalRecords),"loaded"}catch(_e){return h.signal.aborted?"superseded":(p.add({severity:"error",summary:t("Something went wrong, please try again.")}),"failed")}finally{h.signal.aborted||Ut()}})}function Yt(){return R(this,null,function*(){!L.value||$.value||(yield Ce({append:!0}))})}function Pt(n){return R(this,null,function*(){var h;typeof n.sortField=="string"&&(V.value=n.sortField),F.value=(h=n.sortOrder)!=null?h:o.DESCENDING,yield Ce()})}function Ne(){return R(this,null,function*(){if(!(!B.value||E.isApplying)){E.isApplying=!0,ot(E.draft,H.value);try{const n=yield Ce();n==="loaded"&&Object.assign(E.applied,structuredClone(va(E.draft))),n==="failed"&&ot(E.applied,H.value)}finally{E.isApplying=!1}}})}function ot(n,h){h.name.value=n.name,h.examKey.value=n.examKey,h.teacher.value=n.teacherIds?[...n.teacherIds]:null,h.groups.value=n.groupIds?[...n.groupIds]:null,h.security.value=n.security?[...n.security]:null,h.access.value=n.access?[...n.access]:null}function Ht(){return R(this,null,function*(){Object.assign(E.draft,q({},xe)),yield Ne()})}function qt(){return R(this,null,function*(){P.value=!0;try{const{data:n}=yield G.get("/api/school/coordinator-teachers");se.value=n.teachers.map(h=>Ie(q({},h),{fullName:`${h.firstName} ${h.lastName}`}))}catch(n){p.add({severity:"error",summary:t("The list of colleagues could not be loaded, please try again.")})}finally{P.value=!1}})}function Wt(n){return R(this,null,function*(){const h=++j;C.value=!0;try{const{data:M}=yield G.get(`/api/school/coordinator-teacher-groups/${n}`);if(h!==j)return;ne.value=[...M.groups,{id:vs,title:t("No group")}]}
3catch(M){if(h!==j)return;ne.value=[],p.add({severity:"error",summary:t("Something went wrong, please try again.")})}finally{h===j&&(C.value=!1)}})}ma(re,n=>R(null,null,function*(){j+=1,E.draft.groupIds=null,ne.value=[],n!==null&&(yield Wt(n))}));function Gt(){return R(this,null,function*(){yield lt(n=>Lt(n))})}function Kt(){return R(this,null,function*(){const n=Ke();if(Object.keys(n).length===0){We();return}yield lt(h=>It(h))})}function lt(n){return R(this,null,function*(){if(!te.value){te.value=!0;try{const{data:h}=yield G.get("/api/school/coordinator-exams",{params:Ie(q({},Ke()),{ids_only:1})});n(h.exams)}catch(h){p.add({severity:"error",summary:t("Something went wrong, please try again.")})}finally{te.value=!1}}})}function jt(){he.value=[...be.value],le.value=!0}const Zt=k(()=>{const n=new Set(he.value),h=x.value.filter(D=>n.has(D.id));if(h.length!==n.size||h.length===0)return null;const[M]=h;return M.groups.length!==1?null:h.every(D=>D.groups.length===1&&D.groups[0]===M.groups[0])?M.groups[0]:null});function Xt(M){return R(this,arguments,function*({toTeacherName:n,count:h}){p.add({severity:"success",summary:t("Transferring :count exam(s) to :name...",{count:h.toString(),name:n}),detail:t("This might take a moment"),life:1e4}),We(),yield Ce()})}function Jt(n){p.add({severity:"error",summary:n})}function Qt(n){O.value=n,X.value=!0}function ea(n){for(const h of n)Se.value.delete(h);Ce()}function ta(n){return n.access==="open"?"ExamCoordinatorExamsTable__student-access--open":n.access==="discoverable"?"ExamCoordinatorExamsTable__student-access--discoverable":"ExamCoordinatorExamsTable__student-access--closed"}function aa(n){return n.access==="open"?t("Open:examState",{examState:""}):n.access==="discoverable"?t("Discoverable"):t("Closed")}const st=gt("examCoordinatorExamsTable"),je=gt("loadMoreSentinel");let Te=null;return Je(()=>R(null,null,function*(){var n;yield Promise.all([Ce(),qt()]),Te=new IntersectionObserver(h=>{h.some(M=>M.isIntersecting)&&Yt()}),yield ha(),je.value&&Te.observe(je.value),window.location.hash===hs&&((n=st.value)==null||n.scrollIntoView({behavior:"smooth"}))})),fa(()=>{Te==null||Te.disconnect(),ie==null||ie.abort(),J&&(clearTimeout(J),J=null)}),(n,h)=>{var D,Q;const M=Ye("tooltip");return r(),f("div",{id:"exam-directory",ref_key:"examCoordinatorExamsTable",ref:st,class:"ExamCoordinatorExamsTable"},[l(et,{title:a(t)("Exam Directory")},null,8,["title"]),l(a(Pa),{filters:H.value,"onUpdate:filters":h[6]||(h[6]=c=>H.value=c),sortField:V.value,sortOrder:F.value,stripedRows:"",size:"Large",filterDisplay:"row",lazy:"",scrollable:"",tableStyle:"table-layout: fixed; min-width: 900px",loading:$.value,value:x.value,totalRecords:_.value,onSort:Pt},{footer:d(()=>[s("div",{ref_key:"loadMoreSentinel",ref:je,class:"ExamCoordinatorExamsTable__count"},[v(i(a(t)("Showing :from - :to of :count exams",{from:x.value.length>0?"1":"0",to:x.value.length.toString(),count:_.value.toString()}))+" ",1),Oe.value?(r(),f(Z,{key:0},[v(" ("+i(a(t)(":total total",{total:A.value.toString()}))+") ",1)],64)):y("",!0)],512)]),header:d(()=>[a(de)>0?(r(),f("div",Vl,[l(Nl,{count:a(de),teacherCount:a(Re).size,sourceTeacherName:tt.value,onClear:a(We),onTransfer:jt},null,8,["count","teacherCount","sourceTeacherName","onClear"])])):(r(),f("div",Bl,[l(ee,{svg:a(La),width:"16px"},null,8,["svg"]),s("span",Fl,[v(i(a(t)("Not finding the exam you're looking for? Keep in mind that the owner may have manually restricted your access."))+" ",1),s("a",{href:T.value,target:"_blank",rel:"noopener noreferrer"},i(a(t)("Read more")),9,zl)])]))]),empty:d(()=>[s("div",Yl,i($.value?a(t)("Loading exams..."):a(t)("No exams found")),1)]),default:d(()=>[l(a(ue),{showFilterMenu:!1,style:ce({width:w.selection})},{header:d(()=>[l(Xe,{modelValue:Ge.value,indeterminate:$t.value,disabled:_.value===0||te.value,label:a(t)("Select all :count exams matching your filters",{count:_.value.toString()}),srOnlyLabel:"","onUpdate:modelValue":Dt},null,8,["modelValue","indeterminate","disabled","label"])]),body:d(({data:c})=>[l(Xe,{modelValue:a(qe)(c.id),label:Ot(c.name),srOnlyLabel:"","onUpdate:modelValue":U=>a(Mt)(c)},null,8,["modelValue","label","onUpdate:modelValue"])]),_:1},8,["style"]),l(a(ue),{field:"name",header:a(t)("Name"),sortable:"",showFilterMenu:!1,style:ce({width:w.name,overflowWrap:"break-word",wordBreak:"break-word"})},{filter:d(()=>[l(bt,{variant:"on"},{default:d(()=>[l(pt,{id:"exam-coordinator-filter-name",modelValue:E.draft.name,"onUpdate:modelValue":h[0]||(h[0]=c=>E.draft.name=c),"aria-label":a(t)("Filter by exam name"),fluid:"",onKeyup:vt(Ne,["enter"])},null,8,["modelValue","aria-label"]),s("label",Pl,[l(ee,{svg:a(Ha),width:"var(--width-4)",height:"var(--height-4)"},null,8,["svg"])])]),_:1})]),_:1},8,["header","style"]),l(a(ue),{field:"examKey",header:a(t)("Key"),show
3FilterMenu:!1,style:ce({width:w.examKey})},{filter:d(()=>[l(bt,{variant:"on"},{default:d(()=>[l(pt,{id:"exam-coordinator-filter-examkey",modelValue:E.draft.examKey,"onUpdate:modelValue":h[1]||(h[1]=c=>E.draft.examKey=c),"aria-label":a(t)("Filter by exam key"),class:"ExamCoordinatorExamsTable__examkey-filter-input",maxlength:"10",fluid:"",onKeyup:vt(Ne,["enter"])},null,8,["modelValue","aria-label"]),s("label",Hl,[l(ee,{svg:a(Ba),width:"var(--width-4)",height:"var(--height-4)"},null,8,["svg"])])]),_:1})]),body:d(({data:c})=>[K((r(),f("button",{class:"ExamCoordinatorExamsTable__exam-key",onClick:U=>Bt(c.examKey)},[v(i(c.examKey),1)],8,ql)),[[M,a(t)("Copy exam key")]])]),_:1},8,["header","style"]),l(a(ue),{field:"teacher",header:a(t)("Created by"),showFilterMenu:!1,style:ce({width:w.teacher,overflowWrap:"break-word",wordBreak:"break-word"})},{body:d(({data:c})=>[s("div",Wl,[s("span",null,i(c.teacher.firstName)+" "+i(c.teacher.lastName),1),c.numShared>0?K((r(),f("span",{key:0,tabindex:"0",role:"status","aria-label":a(t)(":count shared",{count:c.numShared.toString()}),class:"ExamCoordinatorExamsTable__shared-with",onMouseover:U=>at(c),onFocus:U=>at(c)},[h[9]||(h[9]=s("i",{class:"fa fa-users","aria-hidden":"true"},null,-1)),v(" "+i(c.numShared),1)],40,Gl)),[[M,{content:Ft(c.id),html:!0}]]):y("",!0)])]),filter:d(()=>[l(Ve,{modelValue:E.draft.teacherIds,"onUpdate:modelValue":h[2]||(h[2]=c=>E.draft.teacherIds=c),options:se.value,optionValue:"id",optionLabel:"fullName","aria-label":a(t)("Filter by teacher"),placeholder:a(t)("All teachers"),loading:P.value,showToggleAll:!1,selectionLimit:_t,filter:"",autoFilterFocus:"",filterMatchMode:"contains",filterPlaceholder:a(t)("Search teacher"),emptyFilterMessage:a(t)("No teacher matches the search"),fluid:""},{value:d(({value:c,placeholder:U})=>[c!=null&&c.length?c.length===1?(r(),f("span",jl,i(De(c[0])),1)):(r(),f("span",Zl,i(a(t)(":count teachers selected",{count:c.length.toString()})),1)):(r(),f("span",Kl,i(U),1))]),_:1},8,["modelValue","options","aria-label","placeholder","loading","filterPlaceholder","emptyFilterMessage"])]),_:1},8,["header","style"]),l(a(ue),{field:"groups",header:a(t)("Group"),showFilterMenu:!1,style:ce({width:w.groups,overflowWrap:"break-word",wordBreak:"break-word"})},{body:d(({data:c})=>[s("span",Xl,i(c.groups.join(", ")||"â"),1)]),filter:d(()=>[K((r(),f("span",null,[l(Ve,{modelValue:E.draft.groupIds,"onUpdate:modelValue":h[3]||(h[3]=c=>E.draft.groupIds=c),disabled:re.value===null,options:ne.value,optionLabel:"title",optionValue:"id","aria-label":a(t)("Filter by group"),placeholder:a(t)("All groups"),loading:C.value,showToggleAll:!1,selectionLimit:_t,fluid:""},{value:d(({value:c,placeholder:U})=>[c!=null&&c.length?c.length===1?(r(),f("span",Ql,i(Rt(c[0])),1)):(r(),f("span",es,i(a(t)(":count groups selected",{count:c.length.toString()})),1)):(r(),f("span",Jl,i(U),1))]),_:1},8,["modelValue","disabled","options","aria-label","placeholder","loading"])])),[[M,pe.value]])]),_:1},8,["header","style"]),l(a(ue),{field:"security",header:a(t)("Security"),sortable:"",showFilterMenu:!1,style:ce({width:w.security})},{filter:d(()=>[l(Ve,{modelValue:E.draft.security,"onUpdate:modelValue":h[4]||(h[4]=c=>E.draft.security=c),"aria-label":a(t)("Filter by security level"),options:a(g),optionLabel:"label",showToggleAll:!1,optionValue:"value",maxSelectedLabels:0,fluid:""},{value:d(({value:c})=>[fe(c,a(g).length)?(r(),f("span",ts,[(r(!0),f(Z,null,Ae(a(g).filter(U=>c.includes(U.value)),U=>(r(),S(ee,Be({key:U.value},{ref_for:!0},U.icon,{width:"var(--width-4)"}),null,16))),128))])):c!=null&&c.length?(r(),f("span",as,i(a(t)("All")),1)):(r(),f("span",os,"Â "))]),option:d(({option:c})=>[l(ee,Be(c.icon,{width:"var(--width-4)"}),null,16),v(" "+i(c.label),1)]),_:1},8,["modelValue","aria-label","options"])]),body:d(({data:c})=>[K(l(ee,Be(a(Za)(c.deviceSecurity,c.browserSecurityMode),{width:"var(--width-5)"}),null,16),[[M,a(Xa)(c.deviceSecurity,c.browserSecurityMode)]])]),_:1},8,["header","style"]),l(a(ue),{header:a(t)("Access"),field:"access",sortable:"",showFilterMenu:!1,style:ce({width:w.access}
3)},{filter:d(()=>[l(Ve,{modelValue:E.draft.access,"onUpdate:modelValue":h[5]||(h[5]=c=>E.draft.access=c),"aria-label":a(t)("Filter by access level"),options:m,optionLabel:"label",optionValue:"value",showToggleAll:!1,maxSelectedLabels:0,fluid:""},{value:d(({value:c})=>[fe(c,m.length)?(r(),f("span",ls,[(r(!0),f(Z,null,Ae(m.filter(U=>c.includes(U.value)),U=>(r(),f("span",{key:U.value,class:Le(["ExamCoordinatorExamsTable__student-access__dot",`ExamCoordinatorExamsTable__student-access--${U.value}`])},null,2))),128))])):c!=null&&c.length?(r(),f("span",ss,i(a(t)("All")),1)):(r(),f("span",ns,"Â "))]),option:d(({option:c})=>[s("span",{class:Le(["ExamCoordinatorExamsTable__student-access__dot",`ExamCoordinatorExamsTable__student-access--${c.value}`])},null,2),v(" "+i(c.label),1)]),_:1},8,["modelValue","aria-label"])]),body:d(({data:c})=>[s("span",is,[s("span",{class:Le(["ExamCoordinatorExamsTable__student-access__dot",ta(c)])},null,2),v(" "+i(aa(c)),1)])]),_:1},8,["header","style"]),l(a(ue),{field:"createdAtTimestamp",header:a(t)("Created"),sortable:"",style:ce({width:w.createdAtTimestamp})},{body:d(({data:c})=>[l(He,{datetime:c.createdAt,format:"YYYY-MM-DD"},null,8,["datetime"])]),_:1},8,["header","style"]),l(a(ue),{field:"actions",showFilterMenu:!1,style:ce({width:w.actions})},{filter:d(()=>[s("div",rs,[l(W,{label:a(t)("Reset"),disabled:!Oe.value,loading:E.isApplying,onClick:Ht},null,8,["label","disabled","loading"]),l(Ee,{label:a(t)("Filter:verb",{verb:""}),disabled:!B.value,loading:E.isApplying,onClick:Ne},null,8,["label","disabled","loading"])])]),body:d(({data:c})=>[s("div",ds,[K((r(),S(Ze,{"aria-label":a(t)("Edit content and settings"),asLink:"",href:`/admin/exam-creator/${c.id}/edit?from=${fs}`,flex:"",lessPadding:"",small:"",type:"secondary"},{default:d(()=>[l(ee,{svg:a(qa),width:"16px"},null,8,["svg"])]),_:1},8,["aria-label","href"])),[[M,a(t)("Edit content and settings")]]),K((r(),S(Ze,{"aria-label":a(t)("Monitoring / Results"),asLink:"",href:`/admin/exams/${c.id}`,flex:"",lessPadding:"",small:"",type:"secondary"},{default:d(()=>[l(ee,{svg:a(Qa),width:"16px"},null,8,["svg"])]),_:1},8,["aria-label","href"])),[[M,a(t)("Monitoring / Results")]]),K((r(),S(Ze,{"aria-label":a(t)("Handle access"),flex:"",lessPadding:"",small:"",type:"secondary",onClick:U=>Qt(c.id)},{default:d(()=>[l(ee,{svg:a(Fa),width:"16px"},null,8,["svg"])]),_:1},8,["aria-label","onClick"])),[[M,a(t)("Handle access")]])])]),_:1},8,["style"])]),_:1},8,["filters","sortField","sortOrder","loading","value","totalRecords"]),O.value!==null?(r(),S(Wa,{key:0,visible:X.value,"onUpdate:visible":h[7]||(h[7]=c=>X.value=c),examIdsToShare:[O.value],user:e.user,examName:(Q=(D=x.value.find(c=>c.id===O.value))==null?void 0:D.name)!=null?Q:"",onShared:ea},null,8,["visible","examIdsToShare","user","examName"])):y("",!0),l(Na,{visible:le.value,"onUpdate:visible":h[8]||(h[8]=c=>le.value=c),examIds:he.value,ownerName:tt.value,groupTitle:Zt.value,excludeTeacherId:a(z),onTransferred:Xt,onError:Jt},null,8,["visible","examIds","ownerName","groupTitle","excludeTeacherId"])],512)}}}),ps=me(ys,[["__scopeId","data-v-b8b74afc"]]),bs={class:"SchoolSettingSSO"},_s=ve({__name:"SSOSettings",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(e){const o=wt(e,"modelValue"),u=[{value:"true",label:t("Yes")},{value:"false",label:t("No")}];return(w,g)=>(r(),f("div",bs,[s("label",null,[l(ae,null,{default:d(()=>[v(i(a(t)("Require all accounts to register and log in via SSO")),1)]),_:1}),l(kt,{modelValue:o.value,"onUpdate:modelValue":g[0]||(g[0]=m=>o.value=m),class:"SchoolSettingSSO__options",fullWidth:"",options:u},null,8,["modelValue"])]),l($a,{class:"SchoolSettingSSO__caption"},{default:d(()=>[v(i(a(t)("Select Yes if you require new and existing accounts to register/login via SSO.")),1)]),_:1})]))}}),ws=me(_s,[["__scopeId","data-v-7848e5c4"]]),xs={class:"SchoolInformation"},Ss=["href"],Cs={key:0},ks={key:0,style:{"margin-top":"10px","font-size":"var(--font-size-sm)",color:"red"}},As={href:"http://honor.exam.net/pilot-invitation",target:"_blank"},Es=3,Ts=ve({__name:"SchoolInformation",props:{adminInformation:{},internationalSchool:{}
3,colleges:{},teacher:{},school:{},organisationAdmin:{type:Boolean},isAdministrating:{type:Boolean},dpa:{},legalLink:{},schoolSettings:{},extendedUserAccess:{},eligibleForExtendedUserAccess:{type:Boolean},isGaussOnly:{type:Boolean},schoolCustomizations:{}},setup(e){const o=Pe(),u=I(""),w=I(""),g={manualVerification:"domain",customAttribute:"allow",sso:"false",requiredStudentInformation:"teachersDecide"},m=I(q({},g)),p=I("no"),T=I("no"),x=I(!1),_=I(q({},g)),A=I("no"),$=I("no");e.schoolCustomizations.some(B=>B.customization==="sebServicePolicyEnforced")&&(T.value="yes",$.value="yes");const b=[{value:"none",label:t("Accept new accounts automatically")},{value:"domain",label:t("Manual verification of new accounts with unknown email domain")},{value:"all",label:t("Manual verification of all new accounts")}],V=[{value:"deny",label:t("No")},{value:"allow",label:t("Yes")}],F=[{value:"teachersDecide",label:t("Teachers decide")},{value:"nameAndEmail",label:t("Always require first name, last name and email")}],O=[{value:"no",label:t("No")},{value:"yes",label:t("Yes")}],X=[{value:"no",label:t("Medium")},{value:"yes",label:t("High")}],le=k(()=>{var B;return(B=window.K$.static_notifications)==null?void 0:B.accessto}),he=k(()=>{var B,L;return((L=(B=e.teacher.school)==null?void 0:B.international_school_id)!=null?L:0)>0}),se=k(()=>oe.hasRole(e.teacher.type,"school_admin")),ne=k(()=>ze.differenceInCalendarDays(new Date,e.teacher.created_at)<Es),P=k(()=>e.schoolCustomizations.some(B=>B.customization==="aiCheck")),C=k(()=>e.schoolCustomizations.some(B=>B.customization==="aiCheckAdminToggle")),j=k(()=>m.value.manualVerification!==_.value.manualVerification),te=k(()=>m.value.sso!==_.value.sso),H=k(()=>m.value.customAttribute!==_.value.customAttribute),ye=k(()=>m.value.requiredStudentInformation!==_.value.requiredStudentInformation),xe=k(()=>p.value!==A.value),E=k(()=>T.value!==$.value),J=k(()=>j.value||te.value||H.value||ye.value||xe.value||E.value);Je(()=>{if(e.schoolSettings){const B=q(q({},g),JSON.parse(e.schoolSettings.settings));m.value=q({},B),_.value=q({},B);const L=P.value?"yes":"no";p.value=L,A.value=L}});function ie(){x.value=!0,G.post("/api/school-settings",{settings:JSON.stringify(m.value),aiCheck:p.value,sebServicePolicyEnforced:T.value}).then(()=>{_.value=q({},m.value),A.value=p.value,$.value=T.value,o.add({severity:"success",summary:t("School settings updated")})}).catch(()=>{o.add({severity:"error",summary:t("Could not be saved, please try again.")})}).finally(()=>{x.value=!1})}function fe(){window.$.ajax({method:"delete",url:"/api/gdpr-school-information",success:B=>{window.location.reload()}})}function Oe(){return R(this,null,function*(){w.value="loading";try{yield G.post("/api/gdpr-school-information",{email:u.value}),window.location.reload()}catch(B){window.location.reload()}})}return(B,L)=>{var Re;const De=N("ElInput"),re=N("ElHeader"),pe=N("BaseDropdown"),be=N("ElCaption"),de=N("ElDelimiter");return r(),f("div",xs,[he.value&&e.dpa?(r(),f(Z,{key:0},[e.dpa.signed_at&&e.legalLink?(r(),S(Fe,{key:0,type:"warning",style:{width:"100%"}},{default:d(()=>[L[7]||(L[7]=s("h2",null,"Updated Service Agreement",-1)),L[8]||(L[8]=s("p",null," We have updated the terms in our Service agreement and would kindly like to ask your organization to sign the updated agreement on the following link: ",-1)),s("p",null,[s("a",{target:"_blank",href:e.legalLink},i(e.legalLink),9,Ss)]),L[9]||(L[9]=s("p",null," Please send this link to whoever can sign this agreement in your organization. Once it has been signed and verified by us, this warning will be automatically removed. ",-1))]),_:1})):y("",!0),e.dpa.signed_at?y("",!0):(r(),S(Fe,{key:1,type:"success",style:{width:"100%"}},{default:d(()=>[L[10]||(L[10]=s("h2",null,"Taking care of legal requirements",-1)),s("p",null," In order to set up a Data Processing Agreement (DPA) regarding personal data collection and processing, we have sent an email with more information to "+i(e.dpa.email)+" on "+i(e.dpa.created_at.slice(0,10))+". ",1),L[11]||(L[11]=s("p",null,"Did we get the information wrong? Click below to reset the contact details.",-1)),l(W,{label:"Clear contact details",onClick:fe})]),_:1}))],64)):y("",!0),e.teacher.school?(r(),f(Z,{key:1},[he.value&&le.value&&!e.dpa&&!ne.value?(r(),f("div",Cs,[l(Fe,{type:"error",style:{width:"100%"}},{default:d(()=>[s("h2",null,i(a(t)("Using Exam.net with students")),1),s("p",null,i(a(t)("Ett personuppgiftsbiträdesavtal (PU
3BA) måste upprättas med din skola eftersom Exam.net behandlar dina elevdata.")),1),s("p",null,i(a(t)("A DPA should be signed by a representative of your school. Signing it does not commit your school to order, use or pay for Exam.net.")),1),s("p",null,i(a(t)("Who can we send more information to?")),1),l(De,{modelValue:u.value,"onUpdate:modelValue":L[0]||(L[0]=z=>u.value=z),placeholder:a(t)("Email address")},null,8,["modelValue","placeholder"]),l(Ee,{label:a(t)("Send information"),style:{"margin-top":"10px"},loading:w.value==="loading",onClick:Oe},null,8,["label","loading"]),w.value==="error"?(r(),f("p",ks,i(a(t)("Could not be sent. Check your input.")),1)):y("",!0)]),_:1})])):y("",!0),l(jo,{teacher:e.teacher,accessTo:le.value,extendedUserAccess:e.extendedUserAccess,dpaSignedAt:((Re=e.dpa)==null?void 0:Re.signed_at)||null,legalLink:e.legalLink,adminInformation:e.adminInformation,internationalSchool:e.internationalSchool,eligibleForExtendedUserAccess:e.eligibleForExtendedUserAccess,isGaussOnly:e.isGaussOnly},null,8,["teacher","accessTo","extendedUserAccess","dpaSignedAt","legalLink","adminInformation","internationalSchool","eligibleForExtendedUserAccess","isGaussOnly"]),se.value?(r(),S(At,{key:1,title:a(t)("School settings")},{default:d(()=>[s("div",null,[l(re,null,{default:d(()=>[v(i(a(t)("Verification of new accounts")),1)]),_:1}),l(pe,{modelValue:m.value.manualVerification,"onUpdate:modelValue":L[1]||(L[1]=z=>m.value.manualVerification=z),name:"manualVerification",style:{width:"400px","max-width":"400px"},fullWidth:"",options:b},null,8,["modelValue"]),l(be,{class:"SchoolSetting__caption"},{default:d(()=>[v(i(a(t)("Select if you require that new accounts are verified by the administrator before they can access the system.")),1)]),_:1}),j.value?(r(),S(ge,{key:0,class:"SchoolSetting__unsaved-alert",mode:"secondary",text:a(t)("You have unsaved changes. Make sure to click 'Save settings' below.")},null,8,["text"])):y("",!0),l(de),l(ws,{modelValue:m.value.sso,"onUpdate:modelValue":L[2]||(L[2]=z=>m.value.sso=z)},null,8,["modelValue"]),te.value?(r(),S(ge,{key:1,class:"SchoolSetting__unsaved-alert",mode:"secondary",text:a(t)("You have unsaved changes. Make sure to click 'Save settings' below.")},null,8,["text"])):y("",!0),l(de),l(re,null,{default:d(()=>[v(i(a(t)('Allow teachers to configure the name for the student attribute "Student number"')),1)]),_:1}),l(pe,{modelValue:m.value.customAttribute,"onUpdate:modelValue":L[3]||(L[3]=z=>m.value.customAttribute=z),name:"customAttribute",options:V,fullWidth:"",class:"SchoolSetting__options"},null,8,["modelValue"]),l(be,{class:"SchoolSetting__caption"},{default:d(()=>[v(i(a(t)('With this setting enabled, teachers can define the name of the student attribute that by default is called "Student number".')),1)]),_:1}),H.value?(r(),S(ge,{key:2,class:"SchoolSetting__unsaved-alert",mode:"secondary",text:a(t)("You have unsaved changes. Make sure to click 'Save settings' below.")},null,8,["text"])):y("",!0),l(de),l(re,null,{default:d(()=>[v(i(a(t)("Required student information")),1)]),_:1}),l(pe,{modelValue:m.value.requiredStudentInformation,"onUpdate:modelValue":L[4]||(L[4]=z=>m.value.requiredStudentInformation=z),name:"requiredStudentInformation",options:F,fullWidth:"",class:"SchoolSetting__options"},null,8,["modelValue"]),l(be,{class:"SchoolSetting__caption"},{default:d(()=>[v(i(a(t)("When enabled, every new exam at your school will require students to enter their first name, last name and email. Teachers cannot turn this off. Exams created before you enable this keep their current settings until they are edited or duplicated.")),1)]),_:1}),ye.value?(r(),S(ge,{key:3,class:"SchoolSetting__unsaved-alert",mode:"secondary",text:a(t)("You have unsaved changes. Make sure to click 'Save settings' below.")},null,8,["text"])):y("",!0),l(de),C.value?(r(),f(Z,{key:4},[l(re,null,{default:d(()=>[v(i(a(t)("Analysis of AI indicators in text (pilot test)")),1)]),_:1}),l(pe,{modelValue:p.value,"onUpdate:modelValue":L[5]||(L[5]=z=>p.value=z),name:"aiCheck",options:O,fullWidth:"",class:"SchoolSetting__options"},null,8,["modelValue"]),l(be,{class:"SchoolSetting__caption"},{default:d(()=>
3[v(i(a(t)("When this setting is enabled, teachers can pilot-test AI Check via the Export menu in the results view for exams created within the last 60 days and onward."))+" ",1),s("a",As,i(a(t)("Read more")),1)]),_:1}),xe.value?(r(),S(ge,{key:0,class:"SchoolSetting__unsaved-alert",mode:"secondary",text:a(t)("You have unsaved changes. Make sure to click 'Save settings' below.")},null,8,["text"])):y("",!0),l(de)],64)):y("",!0),l(re,null,{default:d(()=>[v(i(a(t)("SEB Service Policy level")),1)]),_:1}),l(pe,{modelValue:T.value,"onUpdate:modelValue":L[6]||(L[6]=z=>T.value=z),name:"hasEnforcedSEBServicePolicy",options:X,fullWidth:"",class:"SchoolSetting__options"},null,8,["modelValue"]),l(be,{class:"SchoolSetting__caption"},{default:d(()=>[v(i(a(t)("Controls how strictly the SEB Service is enforced. Medium (default) avoids conflicts with school-managed device policies. High provides stricter lockdown.")),1)]),_:1}),E.value?(r(),S(ge,{key:5,class:"SchoolSetting__unsaved-alert",mode:"secondary",text:a(t)("You have unsaved changes. Make sure to click 'Save settings' below.")},null,8,["text"])):y("",!0),l(de),J.value?(r(),S(Ee,{key:6,label:a(t)("Save settings"),loading:x.value,onClick:ie},null,8,["label","loading"])):(r(),S(W,{key:7,label:a(t)("Save settings"),disabled:""},null,8,["label"]))])]),_:1},8,["title"])):y("",!0),!e.isAdministrating&&e.organisationAdmin?(r(),S(bl,{key:2,teacher:e.teacher,schoolId:e.teacher.school.id},null,8,["teacher","schoolId"])):y("",!0),se.value?(r(),S(Ll,{key:3,colleagues:e.colleges,teacher:e.teacher},null,8,["colleagues","teacher"])):y("",!0),l(Tt,{colleagues:e.colleges,teacher:e.teacher,school:e.school||e.teacher.school,isSchoolAdmin:se.value},null,8,["colleagues","teacher","school","isSchoolAdmin"]),e.teacher.is_exam_coordinator?(r(),S(ps,{key:4,user:e.teacher},null,8,["user"])):y("",!0),e.teacher.type==="organisation_admin"?(r(),S(Qe,{key:5,allowHtml:"",mode:"secondary",text:a(t)("You are administrator for the school group belonging to :name at Exam.net. This means that you can remove teachers who are no longer working at your school. You can also give other teachers administrator status.",{name:e.teacher.school.namn})+"<br><br>"+a(t)("Any teacher may suggest that a teacher is removed, but only administrators may act on that request.")},null,8,["text"])):y("",!0)],64)):(r(),S($l,{key:2,email:e.teacher.email},null,8,["email"]))])}}}),Ms=me(Ts,[["__scopeId","data-v-679ed6f3"]]),vn=ve({__name:"SchoolPage",props:{adminInformation:{},internationalSchool:{},colleges:{},teacher:{},school:{},organisationAdmin:{type:Boolean},isAdministrating:{type:Boolean},dpa:{},legalLink:{},role:{},schoolSettings:{},schoolCustomizations:{},extendedUserAccess:{},eligibleForExtendedUserAccess:{type:Boolean},isGaussOnly:{type:Boolean}},setup(e){return(o,u)=>(r(),f("div",null,[l(Ms,{colleges:e.colleges,teacher:e.teacher,school:e.school,organisationAdmin:e.organisationAdmin,isAdministrating:e.isAdministrating,adminInformation:e.adminInformation,internationalSchool:e.internationalSchool,dpa:e.dpa,schoolSettings:e.schoolSettings,schoolCustomizations:e.schoolCustomizations,extendedUserAccess:e.extendedUserAccess,eligibleForExtendedUserAccess:e.eligibleForExtendedUserAccess,isGaussOnly:e.isGaussOnly,legalLink:e.legalLink},null,8,["colleges","teacher","school","organisationAdmin","isAdministrating","adminInformation","internationalSchool","dpa","schoolSettings","schoolCustomizations","extendedUserAccess","eligibleForExtendedUserAccess","isGaussOnly","legalLink"]),l(To,{role:e.role},null,8,["role"])]))}});export{vn as default}; 4//# sourceMappingURL=chunk.ciPPD_-J9huq.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.