1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7609],{93005:function(e,t){t.Z={src:"/_next/static/media/CloseProblemIcon.4217f8ed.svg",height:60,width:60,blurWidth:0,blurHeight:0}},81010:function(e,t,i){var n=i(85893),r=i(67294),o=i(41664),a=i.n(o),l=i(99226),s=i(38333),d=i(67720),c=i(18972),h=i(93946),u=i(63730),p=i(23918);let x=e=>{let{children:t,option:i}=e;return i.href?(0,n.jsx)(l.Z,{component:a(),href:i.href,...i.linkProps,sx:{px:4,py:1.5,width:"100%",display:"flex",color:"inherit",alignItems:"center",textDecoration:"none"},children:t}):(0,n.jsx)(n.Fragment,{children:t})},g=e=>{let{icon:t,options:i,menuProps:o,iconProps:a,leftAlignMenu:l,iconButtonProps:g}=e,[m,f]=(0,r.useState)(null),{settings:j}=(0,p.r)(),{direction:b}=j,v=e=>{f(e.currentTarget)},w=()=>{f(null)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.Z,{"aria-haspopup":"true",onClick:v,...g,children:t||(0,n.jsx)(u.Z,{icon:"mdi:dots-vertical",...a})}),(0,n.jsx)(s.Z,{keepMounted:!0,anchorEl:m,onClose:w,open:!!m,...!l&&{anchorOrigin:{vertical:"bottom",horizontal:"ltr"===b?"right":"left"},transformOrigin:{vertical:"top",horizontal:"ltr"===b?"right":"left"}},...o,children:i.map((e,t)=>"string"==typeof e?(0,n.jsx)(c.Z,{onClick:w,children:e},t):"divider"in e?e.divider&&(0,n.jsx)(d.Z,{...e.dividerProps},t):(0,n.jsx)(c.Z,{...e.menuItemProps,...e.href&&{sx:{p:0}},onClick:t=>{w(),e.menuItemProps&&e.menuItemProps.onClick&&e.menuItemProps.onClick(t)},children:(0,n.jsxs)(x,{option:e,children:[e.icon?e.icon:null,e.text]})},t))})]})};t.Z=g},50591:function(e,t,i){var n=i(2734),r=i(25812);let o=()=>{let e=(0,n.Z)();return{primaryFilled:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main},primaryLight:{color:e.palette.primary.main,backgroundColor:(0,r.E)(e.palette.primary.main,.12)},secondaryFilled:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main},secondaryLight:{color:e.palette.secondary.main,backgroundColor:(0,r.E)(e.palette.secondary.main,.12)},successFilled:{color:e.palette.success.contrastText,backgroundColor:e.palette.success.main},successLight:{color:e.palette.success.main,backgroundColor:(0,r.E)(e.palette.success.main,.12)},errorFilled:{color:e.palette.error.contrastText,backgroundColor:e.palette.error.main},errorLight:{color:e.palette.error.main,backgroundColor:(0,r.E)(e.palette.error.main,.12)},warningFilled:{color:e.palette.warning.contrastText,backgroundColor:e.palette.warning.main},warningLight:{color:e.palette.warning.main,backgroundColor:(0,r.E)(e.palette.warning.main,.12)},infoFilled:{color:e.palette.info.contrastText,backgroundColor:e.palette.info.main},infoLight:{color:e.palette.info.main,backgroundColor:(0,r.E)(e.palette.info.main,.12)}}};t.Z=o},18152:function(e,t,i){i.d(t,{Rs:function(){return c},XJ:function(){return h},tr:function(){return o},v3:function(){return s},xH:function(){return d}});var n=i(85893),r=i(85321);let o={container:{hidden:{opacity:1,scale:0},visible:{opacity:1,scale:1,transition:{delayChildren:.05,staggerChildren:.05}}},item:{hidden:{y:20,opacity:0},visible:{y:0,opacity:1}}},a={containerVariants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.05}}},cardVariants:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.2}}}},l={scale:.85,borderRadius:"100%"},s=e=>(0,n.jsx)(r.E.div,{variants:a.containerVariants,initial:"hidden",animate:"visible",children:e.children}),d=e=>(0,n.jsx)(r.E.div,{variants:e.variants||a.cardVariants,children:e.children}),c=e=>(0,n.jsx)(r.E.div,{whileTap:l,children:e.children}),h=e=>(0,n.jsx)(r.E.div,{...e,initial:{scale:.9},animate:{scale:1},transition:{type:"spring",stiffness:260,damping:20},children:e.children})},80176:function(e,t,i){i.d(t,{x:function(){return o}});var n=i(85946),r=i(55008);let o=e=>{switch(e){case r.Ns.InappropriateLanguage:return(0,n.t)("misconductStrings.inappropriateLanguage");case r.Ns.InappropriateContent:return(0,n.t)("misconductStrings.inappropriateContent");case r.Ns.InappropriateBehavior:return(0,n.t)("misconductStrings.inappropriateBehavior");case r.Ns.Other:return(0,n.t)("misconductStrings.other");default:return""}}},31535:function(e,t,i){var n=i(63805),r=i.n(n);let o=()=>{let e=r()({tablet:!0,featureDetect:!0}),t=!!navigator.userAgent.match(/CriOS/),i=!!navigator.userAgent.match(/FxiOS/),n=!!navigator.userAgent.match(/OPT/),o=!!navigator.userAgent.match(/Android/i);return{isMobileOrTablet:e,isChromeOnAppleDevice:t,isFirefoxOnAppleDevice:i,isOperaTouchOnAppleDevice:n,isAndroidDevice:o}};t.Z=o},61042:function(e,t,i){i.d(t,{k:function(){return l}});var n=i(85893),r=i(99226),o=i(87952),a=i(15861);let l=e=>(0,n.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,n.jsx)(o.Z,{alt:e.name||"",sx:{width:"1.875rem",he
1ight:"1.875rem",borderRadius:5},src:e.avatarSrc||""}),(0,n.jsxs)(r.Z,{sx:{display:"flex",alignItems:"flex-start",flexDirection:"column",ml:2},children:[(0,n.jsx)(a.Z,{variant:"subtitle1",children:e.name}),(0,n.jsx)(a.Z,{noWrap:!0,variant:"caption",children:e.subText})]})]})},9354:function(e,t,i){i.d(t,{o:function(){return u}});var n=i(85893);i(67294);var r=i(37645),o=i(50657),a=i(99226),l=i(93946),s=i(6514),d=i(98456),c=i(50594);let h={spinner:{position:"absolute",top:"50%",left:"50%",marginTop:"-12px",marginLeft:"-12px"}},u=e=>{let{children:t,open:i,title:u,showSpinner:p=!1,containerStyles:x,onClose:g}=e,m=()=>{g()};return(0,n.jsx)(o.Z,{onClose:m,open:i,children:(0,n.jsxs)(a.Z,{sx:x,children:[(0,n.jsxs)(r.Z,{sx:{textAlign:"center",marginTop:"16px"},children:[u,(0,n.jsx)(l.Z,{onClick:g,sx:{position:"absolute",right:"8px",top:"8px",color:e=>e.palette.grey[500]},children:(0,n.jsx)(c.Z,{})})]}),(0,n.jsx)(s.Z,{children:p?(0,n.jsx)(d.Z,{sx:h.spinner}):t})]})})}},87609:function(e,t,i){i.r(t),i.d(t,{default:function(){return ir}});var n,r,o,a,l=i(85893),s=i(67294),d=i(11163),c={src:"/_next/static/media/Mic.ad6385bf.svg",height:60,width:60,blurWidth:0,blurHeight:0},h={src:"/_next/static/media/Camera.625de40f.svg",height:60,width:60,blurWidth:0,blurHeight:0},u={src:"/_next/static/media/MicOff.abe7c5e4.svg",height:60,width:60,blurWidth:0,blurHeight:0},p={src:"/_next/static/media/ChatOff.afbf80e5.svg",height:60,width:60,blurWidth:0,blurHeight:0},x={src:"/_next/static/media/ChatOn.e17faf33.svg",height:60,width:60,blurWidth:0,blurHeight:0},g={src:"/_next/static/media/SettingsOff.6ee90b1f.svg",height:60,width:60,blurWidth:0,blurHeight:0},m={src:"/_next/static/media/Participents.6572fdd1.svg",height:60,width:60,blurWidth:0,blurHeight:0},f={src:"/_next/static/media/ParticipentsOn.6f34c621.svg",height:60,width:60,blurWidth:0,blurHeight:0},j={src:"/_next/static/media/LeaveCall.ccd0f481.svg",height:60,width:60,blurWidth:0,blurHeight:0},b={src:"/_next/static/media/CameraOff.f6dcc59e.svg",height:60,width:60,blurWidth:0,blurHeight:0},v={src:"/_next/static/media/CallTeacher.190091a2.svg",height:60,width:60,blurWidth:0,blurHeight:0},w={src:"/_next/static/media/ScreenShare.4394e367.svg",height:60,width:60,blurWidth:0,blurHeight:0},C={src:"/_next/static/media/ScreenShareOn.46182fc1.svg",height:60,width:60,blurWidth:0,blurHeight:0},y={src:"/_next/static/media/CallTeacherDisabled.cb5ff687.svg",height:60,width:60,blurWidth:0,blurHeight:0},Z={src:"/_next/static/media/whiteboardOn.ece1812b.svg",height:60,width:60,blurWidth:0,blurHeight:0},S={src:"/_next/static/media/whiteboardOff.b234e3d4.svg",height:60,width:60,blurWidth:0,blurHeight:0},k=i(2734),T=i(93946),I=i(90263),P=i(25675),O=i.n(P),N=i(7631),R=i(99226),E=i(63730),D=i(19294),L=i(98619),_=i(18987),M=i(59334),A=i(15861),W=i(93395),U=i(38333),B=i(50135),F=i(87109),z=i(78462),V=i(87952),G=i(81010),H=i(22120),J=i(41796),q=i(50591);let $=(0,s.forwardRef)((e,t)=>{let{sx:i,src:n,skin:r,color:o}=e,a=(0,k.Z)(),s=(0,q.Z)(),d=(e,t)=>"light"===e?{...s["".concat(t,"Light")]}:"light-static"===e?{color:s["".concat(t,"Light")].color,backgroundColor:(0,J.$n)(a.palette[t].main,.88)}:{...s["".concat(t,"Filled")]},c={primary:d(r,"primary"),secondary:d(r,"secondary"),success:d(r,"success"),error:d(r,"error"),warning:d(r,"warning"),info:d(r,"info")};return(0,l.jsx)(V.Z,{ref:t,...e,sx:!n&&r&&o?Object.assign(c[o],i):i})});$.defaultProps={skin:"filled",color:"primary"};var Q=i(51964),X=i.n(Q);let K=e=>e.split(/\s/).reduce((e,t)=>e+=t.slice(0,1),"");var Y=i(67218),ee=i(16310),et=i(87536),ei=i(9354),en=i(47533),er=i(86886),eo=i(94054),ea=i(33841),el=i(18360),es=i(18972),ed=i(31425),ec=i(83321),eh=i(51049),eu=i(61042),ep=i(86501),ex=i(55008),eg=i(80176);let em={type:ex.Ns.InappropriateBehavior,description:""},ef=Object.entries(ex.Ns).filter(e=>{let[t,i]=e;return"number"==typeof i}),ej=e=>{var t,i;let n=(0,N.m)(),{t:r}=(0,H.$G)(),o=(0,s.useMemo)(()=>ee.Ry().shape({type:ee.Rx().required(r("reportUserDialog.errorMessages.reason")),description:ee.Z_()}),[r]),{control:a,setError:d,reset:c,handleSubmit:h,formState:{errors:u}}=(0,et.cI)({defaultValues:em,mode:"onBlur",resolver:(0,en.X)(o)}),p=async t=>{try{var i;
1let o=await n.misconduct.save({...t,reportedUserEmail:null===(i=e.targetUser)||void 0===i?void 0:i.email});if(!o.ok)throw Error(o.message);ep.ZP.success(r("reportUserDialog.successMessage"))}catch(e){ep.ZP.error(e.message)}e.onClose()},x=()=>{e.onClose(),c(em)};return(0,l.jsxs)(ei.o,{open:e.open,onClose:x,title:r("reportUserDialog.title"),children:[(0,l.jsx)(R.Z,{sx:{display:"flex",width:"100%",justifyContent:"center",marginBottom:"20px"},children:(0,l.jsx)(eu.k,{avatarSrc:(null===(t=e.targetUser)||void 0===t?void 0:t.avatarURL)||"",name:(null===(i=e.targetUser)||void 0===i?void 0:i.formattedDisplayName)||"",subText:""})}),(0,l.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:h(p),children:(0,l.jsxs)(R.Z,{sx:{marginTop:2},children:[(0,l.jsxs)(er.ZP,{container:!0,columnSpacing:2,rowGap:5,direction:"row",children:[(0,l.jsx)(er.ZP,{item:!0,xs:12,md:6,children:(0,l.jsx)(eo.Z,{fullWidth:!0,children:(0,l.jsx)(et.Qr,{name:"type",control:a,rules:{required:!0},render:e=>{let{field:{value:t,onChange:i,onBlur:n}}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ea.Z,{htmlFor:"reason-select",children:r("reportUserDialog.misconductTypeLabel")}),(0,l.jsx)(el.Z,{defaultValue:em.type,label:r("reportUserDialog.misconductTypeLabel"),error:!!u.type,inputProps:{id:"reason-select"},onChange:e=>{i(e.target.value)},children:ef.map(e=>{let[t,i]=e;return(0,l.jsx)(es.Z,{value:i,children:(0,eg.x)(i)},i)})})]})}})})}),(0,l.jsx)(er.ZP,{item:!0,xs:12,md:12,children:(0,l.jsx)(eo.Z,{fullWidth:!0,children:(0,l.jsx)(et.Qr,{name:"description",control:a,rules:{required:!0},render:e=>{var t;let{field:{value:i,onChange:n}}=e;return(0,l.jsx)(B.Z,{label:r("reportUserDialog.description"),multiline:!0,rows:5,defaultValue:em.description,error:!!u.description,helperText:!!u.description&&(null===(t=u.description)||void 0===t?void 0:t.message),onChange:e=>{n(e.target.value)}})}})})})]}),(0,l.jsxs)(ed.Z,{children:[(0,l.jsx)(ec.Z,{onClick:x,children:r("common.cancel")}),(0,l.jsx)(eh.KM,{type:"submit",children:r("common.confirm")})]})]})})]})},eb=e=>{let{children:t,hidden:i}=e;return i?(0,l.jsx)(R.Z,{sx:{height:"100%",overflow:"auto"},children:t}):(0,l.jsx)(X(),{options:{wheelPropagation:!1},children:t})},ev=e=>{var t;let{api:i}=e;(0,N.m)();let{user:n}=(0,Y.a)(),{t:r}=(0,H.$G)(),[o,a]=s.useState([]),[d,c]=s.useState(""),[h,u]=s.useState({open:!1,targetUser:void 0}),p=s.useRef(null),x=s.useMemo(()=>{let e=o.filter(e=>e.email!==(null==n?void 0:n.email));return d?e.filter(e=>e.email!==(null==n?void 0:n.email)||e.formattedDisplayName.toLowerCase().includes(d.toLowerCase())):[...e]},[o,d,n]),g=e=>{u({open:!0,targetUser:e})},m=e=>{c(e.target.value)},f=e=>{},j=s.useCallback(()=>x.map((e,t)=>(0,l.jsxs)(D.ZP,{disablePadding:!0,sx:{"&:not(:last-child)":{mb:1.5}},children:[(0,l.jsxs)(L.Z,{disableRipple:!0,onClick:()=>f(e),sx:{px:3,py:2.5,width:"100%",borderRadius:1,alignItems:"flex-start"},children:[(0,l.jsx)(_.Z,{sx:{m:0},children:(0,l.jsx)(I.Z,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},badgeContent:(0,l.jsx)(R.Z,{component:"span",sx:{width:8,height:8,borderRadius:"50%"}}),children:e.avatarURL?(0,l.jsx)(V.Z,{src:e.avatarURL,alt:e.formattedDisplayName,sx:{width:38,height:38}}):(0,l.jsx)($,{sx:{width:38,height:38,fontSize:"1rem"},children:K(e.displayName)})})}),(0,l.jsx)(M.Z,{sx:{ml:4,mr:1.5},primary:(0,l.jsx)(A.Z,{noWrap:!0,sx:{fontWeight:500,fontSize:"0.875rem"},children:e.formattedDisplayName})})]}),(0,l.jsx)(W.Z,{children:(0,l.jsx)(G.Z,{iconProps:{fontSize:20},iconButtonProps:{size:"small"},menuProps:{sx:{"& .MuiMenuItem-root svg":{mr:2}}},options:[...e.email!==(null==n?void 0:n.email)?[{text:r("participantsList.reportUserButtonLabel"),icon:(0,l.jsx)(E.Z,{icon:"mdi:report",fontSize:20,color:"red"}),menuItemProps:{onClick:()=>{g(e)}}}]:[]]})})]},t)),[x,null==n?void 0:n.email,r]),b=e=>{e.forEach(e=>{i.executeCommand("sendEndpointTextMessage",e.participantId,null==n?void 0:n.email)})},v=s.useCallback(()=>{let e=i.getParticipantsInfo();a(t=>{let i=e.filter(e=>!t.some(t=>t.participantId===e.participantId)),n=t.filter(t=>!e.some(e=>e.participantId===t.participantId)),r=t.filter(e=>!n.includes(e));return[...r,...i]})},[i]),w=(e,t)=>{let i=e.find(e=>e.participantId===t.data.senderInfo.id);if(!i){console.error("Failed providing new participant (".concat(t.data.senderInfo.id,") with email metadata"));return}b([i])},C=e=>{var t;if(!e)return;let i=[...o];null!==(t=i.find(t=>t.participantId===e.data.senderInfo.id))&&void 0!==t&&t.email||(a(i=i.map(t=>t.participantId===e.data.senderInfo.id?{...t,email:e.data.eventData.text}:t)),w(i,e))},y=()=>{let e=i.getParticipantsInfo();b(e=e.filter(e=>e.email!==(null==n?void 0:n.email)))};return s.useEffect(()=>{p.current&&p.current.updatePosition()},[x]),s.useEffect(()=>(i.on("endpointTextMessageReceived",C),()=>{i.off("endpointTextMessageReceived",C)}),[o,i]),s.useEffect(()=>(i.on("participantJoined",v),i.on("participantLeft",v),i.on("dataChannelOpened",y),v(),(
1)=>{i.off("participantJoined",v),i.off("participantLeft",v),i.off("dataChannelOpened",y)}),[i,v]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(U.Z,{open:!!e.anchorEl,onClose:e.onClose,anchorEl:e.anchorEl,action:p,sx:{top:"-5rem"},children:[(0,l.jsxs)(R.Z,{sx:{px:5,py:3.125,display:"flex",alignItems:"center",borderBottom:e=>"1px solid ".concat(e.palette.divider)},children:[(0,l.jsx)(V.Z,{src:(null==n?void 0:null===(t=n.avatar)||void 0===t?void 0:t.src)||"",alt:(null==n?void 0:n.firstName)||"",sx:{width:"2.375rem",height:"2.375rem",cursor:"pointer"}}),(0,l.jsx)(B.Z,{fullWidth:!0,size:"small",value:d,onChange:m,placeholder:r("participantsList.searchBoxPlaceholder"),sx:{"& .MuiInputBase-root":{borderRadius:5},marginLeft:4},InputProps:{startAdornment:(0,l.jsx)(F.Z,{position:"start",sx:{color:"text.secondary"},children:(0,l.jsx)(E.Z,{icon:"mdi:magnify",fontSize:20})})}})]}),(0,l.jsx)(R.Z,{sx:{height:"calc(100% - 4.125rem)"},children:(0,l.jsx)(eb,{hidden:!0,children:(0,l.jsxs)(R.Z,{sx:{p:e=>e.spacing(7,3,3)},children:[(0,l.jsx)(A.Z,{variant:"h6",sx:{ml:3,mb:3,color:"primary.main"},children:r("participantsList.listTitle")}),(0,l.jsx)(z.Z,{sx:{mb:4,p:0},children:j()})]})})})]}),(0,l.jsx)(ej,{...h,onClose:()=>u({open:!1,targetUser:void 0})})]})};var ew=i(85946),eC=i(31535),ey=i(96514),eZ=i(90629),eS=i(68155),ek=i(84118),eT=i(23926),eI=i(34386),eP=i(57976);let eO=()=>(0,l.jsx)(O(),{src:g,alt:"Settings",width:45,height:45}),eN=()=>(0,l.jsx)(O(),{src:m,alt:"Participants",width:45,height:45}),eR=()=>(0,l.jsx)(O(),{src:f,alt:"Participants",width:45,height:45}),eE=()=>(0,l.jsx)(O(),{src:Z,alt:"Whiteboard On",width:45,height:45}),eD=()=>(0,l.jsx)(O(),{src:S,alt:"Whiteboard Off",width:45,height:45}),eL=e=>{let{toggleSettings:t,toggleParticipantsPane:i,participantsPaneAnchorEl:n,roomFeatures:r,toggleWhiteboard:o,showWhiteboard:a,toggleDrawer:d,hasBookedPass:c}=e,[h,u]=(0,s.useState)(!1),p=(0,s.useRef)(null),x=()=>{u(e=>!e)},g=()=>{u(!1)};return(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(T.Z,{"aria-haspopup":"menu",onClick:x,"aria-label":"select merge strategy",ref:p,children:(0,l.jsx)(eP.Z,{sx:{backgroundColor:"#44484ACC",width:"45px",height:"45px",color:"white",borderRadius:"50px"}})}),(0,l.jsx)(eS.Z,{sx:{zIndex:"99"},open:h,anchorEl:p.current,role:void 0,transition:!0,disablePortal:!0,children:e=>{let{TransitionProps:s,placement:d}=e;return(0,l.jsx)(ey.Z,{...s,style:{transformOrigin:"bottom"===d?"center top":"center bottom"},children:(0,l.jsx)(eZ.Z,{children:(0,l.jsx)(eT.Z,{onClickAway:g,children:(0,l.jsxs)(ek.Z,{id:"split-button-menu",children:[(0,l.jsx)(es.Z,{children:(0,l.jsx)(eI.Z,{title:"Inst\xe4llningar",placement:"top",children:(0,l.jsx)(T.Z,{onClick:()=>{g(),t()},children:(0,l.jsx)(eO,{})})})}),(0,l.jsx)(es.Z,{children:(0,l.jsx)(eI.Z,{title:"\xd6vriga deltagare",placement:"top",children:(0,l.jsx)(T.Z,{onClick:e=>{g(),i(e)},disabled:!(null==r?void 0:r.participantList),children:n?(0,l.jsx)(eR,{}):(0,l.jsx)(eN,{})})})}),(0,l.jsx)(es.Z,{children:(0,l.jsx)(eI.Z,{title:"Whiteboard",placement:"top",children:(0,l.jsx)(T.Z,{onClick:()=>{g(),o()},children:a?(0,l.jsx)(eE,{}):(0,l.jsx)(eD,{})})})})]})})})})}})]})};var e_=i(18152),eM=i(77533),eA=i(46901),eW=i(92401),eU=i(50594),eB=i(90948),eF=i(8523);(0,eB.ZP)("img")(e=>{let{theme:t}=e;return{[t.breakpoints.up("md")]:{marginRight:t.spacing(15.75)},[t.breakpoints.down("md")]:{marginBottom:t.spacing(4)},[t.breakpoints.down("sm")]:{width:160}}});let ez=(0,eB.ZP)(A.Z)(e=>{let{theme:t}=e;return{marginBottom:t.spacing(5),[t.breakpoints.down("sm")]:{marginBottom:t.spacing(4)}}}),eV=e=>{let[t,i]=(0,s.useState)([]),{getRootProps:n,getInputProps:r}=(0,eF.uI)({maxFiles:2,maxSize:1e7,onDrop:e=>{i(e.map(e=>Object.assign(e)))}}),o=e=>e.type.startsWith("image")?(0,l.jsx)("img",{width:38,height:38,alt:e.name,src:URL.createObjectURL(e)}):(0,l.jsx)(E.Z,{icon:"mdi:file-document-outline"}),a=e=>{let n=t.filter(t=>t.name!==e.name);i([...n])},d=t.map(t=>(0,l.jsxs)(D.ZP,{children:[(0,l.jsxs)(R.Z,{className:"file-details",sx:{width:"100%"},children:[(0,l.jsx)("div",{className:"file-preview",children:o(t)}),(0,l.jsxs)("div",{children:[(0,l.jsx)(A.Z,{className:"file-name",children:t.name}),(0,l.jsx)(A.Z,{className:"file-size",variant:"body2",children:Math.round(t.size/100)/10>1e3?"".concat((Math.round(t.size/100)/10/1e3).toFixed(1)," mb"):"".concat(Math.round(t.size/100)/10," kb")})]})]}),(0,l.jsx)(T.Z,{disabled:e.disabled,onClick:()=>a(t),children:(0,l.jsx)(E.Z,{icon:"mdi:close",fontSize:20})})]},t.name)),c=()=>{i([])};return(0,s.useEffect)(()=>{e.onFilesChanged(t)},[t]),(0,l.jsxs)(s.Fragment,{children:[!e.disabled&&(0,l.jsxs)("div",{...n({className:"dropzone"}),children:[(0,l.jsx)("input",{...r()}),(0,l.jsx)(R.Z,{sx:{display:"flex",flexDirection:["column","column"],alignItems:"center",padding:10,borderRadius:1,border:"1px dashed #bab9be"},children:(0,l.jsxs)(R.Z,{sx:{display:"flex",flexDirection:"column",textAlign:["center","center","inherit"]},children:[(0,l.jsx)(ez,{variant:"h5",children:"Bifoga filer"}),(0,l.jsx)(A.Z,{color:"textSecondary",children:"Drag och sl\xe4pp filer eller klicka f\xf6r att ladda upp"})]})})]}),t.length?(0,l.jsxs)(s.Fragment,{children:[(0,l.jsx)(z.Z,{children:d}),!e.disabled&&(0,l.jsx)("div",{className:"buttons",children:(0,l.jsx)(ec.Z,{color:"error",variant:"outlined",onClick:c,children:"Ta bort filer"})})]}):null]})},eG=e=>{let{isDrawerOpen:t,toggleDrawer:i,onJoinQueue:n}=e,[r,o]=s.useState(""),[a,c]=s.useState(!1),[h,u]=s.useState(!1),[p,x]=s.useState(null),[g,m]=s.useState([]),[f,j]=s.useState(),{t:b}=(0,H.$G)(),v=(0,N.m)(),w=(0,d.useRouter)(),C=(0,k.Z)();s.useEffect(()=>{if(p){let e=setInterval(()=>{Z(p)},3e4);return()=>clearInterval(e)}},[p]);let y=(e,t)=>{("backdropClick"===t||"escapeKeyDown"===t)&&i(!1)},Z=async e=>{if(null!==e)try{let t=await v.problem.getQueueNumber(Number(e));if(t.error)throw Error(t.error.message);t.data&&t.data&&j(t.data.toString())}catch(e){"no-problem-found"===e.error.message&&(j(null),x(null))}},S=e=>{let t=e.map(e=>new Promise((t,i)=>{let n=new FileReader;n.onload=()=>{let e=n.result;t(e)},n.onerror=e=>{i(e)},n.readAsDataURL(e)}));return Promise.all(t)},I=async()=>{u(!0);let e=null;try{var t;if(null!==p){let e=await v.problem.get(Number(p)),t=await v.problem.update({...e.data,description:r,attachments:""});if(!t.ok)throw Error(t.error.message);return}let i=await v.problem.saveAsync({files:await S(g),description:r,roomKey:w.query.roomId});if(e=(null===(t=i.data.id)||void 0===t?void 0:t.toString())||null,x(e),n(e),!i.ok)throw Error(i.error.message)}catch(e){console.error(e)}finally{c(!0),Z(e)}},P=async()=>{u(!1)},O=async()=>
1{if(null!==p){let e=await v.problem.get(Number(p));e.data&&(await v.problem.update({...e.data,id:Number(p),status:ex.TT.ClosedByStudent}),E())}},E=()=>{j(void 0),i(!1),x(null),c(!1),u(!1),o("")},D=e=>{m(e)};return a&&null===f?(0,l.jsx)(eM.ZP,{anchor:"right",open:t,onClose:y,children:(0,l.jsx)(R.Z,{sx:{padding:"20px",width:"360px",backgroundColor:"#fff",height:"100%"},children:(0,l.jsxs)(R.Z,{style:{marginTop:"10px"},children:[(0,l.jsxs)(eA.Z,{severity:"success",children:[(0,l.jsx)(eW.Z,{children:b("callTeacherDrawer.successAlertTitle")}),b("callTeacherDrawer.successAlertMessage")]}),(0,l.jsx)(ec.Z,{onClick:()=>{i(!1),E()},variant:"contained",color:"primary",fullWidth:!0,style:{marginTop:"10px",backgroundColor:C.palette.green[500]},children:b(null===f?"callTeacherDrawer.backButtonLabel":"callTeacherDrawer.leaveQueueButtonLabel")})]})})}):(0,l.jsx)(eM.ZP,{anchor:"right",open:t,onClose:y,children:(0,l.jsxs)(R.Z,{sx:{padding:"20px",width:"360px",backgroundColor:"#fff",height:"100%"},children:[(0,l.jsx)(R.Z,{style:{display:"flex",justifyContent:"end"},children:(0,l.jsx)(T.Z,{onClick:()=>i(!1),children:(0,l.jsx)(eU.Z,{})})}),(0,l.jsx)(R.Z,{className:"messageBox"}),(0,l.jsx)("label",{children:b("callTeacherDrawer.questionInputLabel")}),(0,l.jsx)(B.Z,{multiline:!0,rows:3,maxRows:50,fullWidth:!0,placeholder:b("callTeacherDrawer.questionInputPlaceholder"),value:r,onChange:e=>o(e.target.value),disabled:h}),(0,l.jsx)(R.Z,{mt:5,children:(0,l.jsx)(eV,{onFilesChanged:D,disabled:h||null!=f})}),(0,l.jsxs)(R.Z,{style:{display:"flex",paddingTop:"20px"},children:[(0,l.jsx)(ec.Z,{onClick:I,variant:"contained",color:"primary",fullWidth:!0,style:{marginTop:"10px",backgroundColor:h?"#BEC0C0":C.palette.green[500]},disabled:h,children:(0,l.jsx)(A.Z,{sx:{fontSize:"12px",color:"white"},children:b("common.send")})}),(0,l.jsx)(ec.Z,{onClick:P,variant:"contained",color:"secondary",fullWidth:!0,style:{marginTop:"10px",marginLeft:"10px",width:"150 px",height:"40px",paddingRight:"0px",paddingLeft:"0px",backgroundColor:h?"#fff":"#BEC0C0",border:"1px solid #BEC0C0"},disabled:!h,children:(0,l.jsx)(A.Z,{sx:{fontSize:"12px",color:"#000"},children:b("callTeacherDrawer.editQuestionButtonLabel")})})]}),a?(0,l.jsx)(R.Z,{children:null!==f&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(R.Z,{style:{marginTop:"10px",paddingTop:"20px"},children:[(0,l.jsx)(A.Z,{variant:"h5",textAlign:"center",children:b("callTeacherDrawer.queueNumber")}),(0,l.jsx)(A.Z,{variant:"h3",textAlign:"center",children:f})]}),(0,l.jsxs)(R.Z,{style:{marginTop:"10px"},children:[(0,l.jsx)("p",{children:b("callTeacherDrawer.queueDescription")}),(0,l.jsx)(ec.Z,{onClick:O,variant:"contained",color:"primary",fullWidth:!0,style:{marginTop:"10px",backgroundColor:C.palette.green[500]},children:b(null===f?"callTeacherDrawer.backButtonLabel":"callTeacherDrawer.leaveQueueButtonLabel")})]})]})}):null]})})};(n=o||(o={})).Camera="camera",n.Chat="chat",n.ClosedCaptions="closedcaptions",n.Desktop="desktop",n.Download="download",n.EmbedMeeting="embedmeeting",n.Etherpad="etherpad",n.Feedback="feedback",n.Filmstrip="filmstrip",n.Fullscreen="fullscreen",n.Hangup="hangup",n.Help="help",n.Highlight="highlight",n.Invite="invite",n.LinkToSalesforce="linktosalesforce",n.Livestreaming="livestreaming",n.Microphone="microphone",n.NoiseSuppression="noisesuppression",n.ParticipantsPane="participants-pane",n.Profile="profile",n.RaiseHand="raisehand",n.Recording="recording",n.Security="security",n.SelectBackground="select-background",n.Settings="settings",n.ShareAudio="shareaudio",n.SharedVideo="sharedvideo",n.Shortcuts="shortcuts",n.Stats="stats",n.TileView="tileview",n.ToggleCamera="toggle-camera",n.VideoQuality="videoquality",n.Whiteboard="whiteboard";let eH=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:c,alt:"Mic",width:t,height:i})},eJ=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:h,alt:"Camera",width:t,height:i})},eq=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:x,alt:"Chat On",width:t,height:i})},e$=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:p,alt:"Chat Off",width:t,height:i})},eQ=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:m,alt:"Participants Off",width:t,height:i})},eX=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:f,alt:"Participants On",width:t,height:i})},eK=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:j,alt:"Leave Call",width:t,height:i})},eY=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:v,alt:"Call Teacher",width:t,height:i})},e0=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:y,alt:"Call Teacher Disabled",width:t,height:i})},e1=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:w,alt:"Screen Share",width:t,height:i})},e5=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:C,alt:"Screen Share On",width:t,height:i})},e6=e=>{let{width:t,height:i}=e;
1return(0,l.jsx)(O(),{src:Z,alt:"Whiteboard On",width:t,height:i})},e4=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:S,alt:"Whiteboard Off",width:t,height:i})},e2=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:b,alt:"Camera Off",width:t,height:i})},e8=e=>{let{width:t,height:i}=e;return(0,l.jsx)(O(),{src:u,alt:"Mic Off",width:t,height:i})},e3={iconButton:{width:"60px",height:"60px"},tooltip:{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",backgroundColor:"rgba(0, 0, 0, 0.7)",color:"white",padding:"5px",borderRadius:"4px",zIndex:2,display:"none",whiteSpace:"nowrap"},iconContainer:{position:"relative","&:hover .tooltip":{display:"block"}},mobileIConContainer:{}},e9=e=>{var t;let[i,n]=(0,s.useState)(!1),[r,o]=s.useState(!1),[a,d]=(0,s.useState)(null),c=!!(e.api&&(null===(t=e.api)||void 0===t?void 0:t.getNumberOfParticipants())<=1),h=(0,N.m)(),[u,p]=(0,s.useState)(null),x=(0,eC.Z)();s.useEffect(()=>{let e=async()=>{var e,t,i,n;let r=await h.bookedPass.getActivePass();r.data.length>0&&d(r.data[0]);let a=!!(null===(e=r.data[0])||void 0===e?void 0:null===(t=e.shift)||void 0===t?void 0:t.started),l=!!(null===(i=r.data[0])||void 0===i?void 0:null===(n=i.shift)||void 0===n?void 0:n.ended);o(a&&!l)};e();let t=setInterval(()=>{e()},6e4);return()=>clearInterval(t)},[]);let g=()=>{var t,i,n;return(null===(t=e.roomFeatures)||void 0===t?void 0:t.callTeacher)?a?!a||(null===(i=a.shift)||void 0===i?void 0:i.started)?a&&(null===(n=a.shift)||void 0===n?void 0:n.started)?(0,ew.t)("videoToolbar.callTeacherTooltips.callTeacher"):void 0:(0,ew.t)("videoToolbar.callTeacherTooltips.noTeacherAvailable"):(0,ew.t)("videoToolbar.callTeacherTooltips.noReservation"):(0,ew.t)("videoToolbar.callTeacherTooltips.notInRoom")},m=e=>{p(e.currentTarget)},f=e=>{n(e)};if(!e.api)return null;let j={...e,isSolo:c,toggleParticipantsPane:m,toggleDrawer:f,isDrawerOpen:i,toggleWhiteboard:e.toggleWhiteboard,showWhiteboard:e.showWhiteboard,getCallTeacherTooltip:g,hasBookedPass:r,participantsPaneAnchorEl:u,setParticipantsPaneAnchorEl:p};return x.isMobileOrTablet?(0,l.jsx)(te,{...j}):(0,l.jsx)(e7,{...j})},e7=e=>{let{api:t,roomFeatures:i,numberOfParticipants:n,roomId:r,isMicOn:o,onToggleMic:a,onToggleVideo:s,isVideoOn:d,onToggleChat:c,isSolo:h,chatState:u,toggleParticipantsPane:p,onToggleShareScreen:x,onToggleSettings:g,toggleDrawer:m,isDrawerOpen:f,toggleWhiteboard:j,isScreenSharing:b,showWhiteboard:v,onLeaveRoom:w,getCallTeacherTooltip:C,hasBookedPass:y,participantsPaneAnchorEl:Z,setParticipantsPaneAnchorEl:S,onJoinQueue:P}=e,O=(0,k.Z)();return t?(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"center",marginLeft:"auto",marginRight:"auto"},children:[(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:(null==i?void 0:i.microphone)?(0,ew.t)("videoToolbar.microphone"):(0,ew.t)("videoToolbar.callTeacherTooltips.noMicInFocusRoom")}),(0,l.jsx)(T.Z,{onClick:a,disabled:!(null==i?void 0:i.microphone),children:o?(0,l.jsx)(eH,{width:60,height:60}):(0,l.jsx)(e8,{width:60,height:60})})]})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:(0,ew.t)("videoToolbar.camera")}),(0,l.jsx)(T.Z,{onClick:s,disabled:!(null==i?void 0:i.camera),children:d?(0,l.jsx)(eJ,{width:60,height:60}):(0,l.jsx)(e2,{width:60,height:60})})]})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:(0,ew.t)("videoToolbar.chat")}
1),(0,l.jsx)(T.Z,{onClick:c,style:{opacity:!h&&(null==i?void 0:i.chat)?1:.5},disabled:h||!(null==i?void 0:i.chat),children:(0,l.jsx)(I.Z,{badgeContent:null==u?void 0:u.unreadCount,sx:{"& .MuiBadge-badge":{backgroundColor:O.palette.green[500],color:"white",marginRight:2,marginTop:2}},children:(null==u?void 0:u.isOpen)?(0,l.jsx)(eq,{width:60,height:60}):(0,l.jsx)(e$,{width:60,height:60})})})]})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:(0,ew.t)("videoToolbar.participants")}),(0,l.jsx)(T.Z,{onClick:p,disabled:!(null==i?void 0:i.participantList),children:Z?(0,l.jsx)(eX,{width:60,height:60}):(0,l.jsx)(eQ,{width:60,height:60})})]})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:(0,ew.t)("videoToolbar.shareScreen")}),(null==i?void 0:i.shareScreen)&&(0,l.jsx)(T.Z,{onClick:x,children:b?(0,l.jsx)(e5,{width:60,height:60}):(0,l.jsx)(e1,{width:60,height:60})})]})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:(0,ew.t)("videoToolbar.whiteboard")}),(0,l.jsx)(T.Z,{onClick:j,children:v?(0,l.jsx)(e6,{width:60,height:60}):(0,l.jsx)(e4,{width:60,height:60})})]})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:(0,ew.t)("videoToolbar.leave")}),(0,l.jsx)(T.Z,{onClick:w,children:(0,l.jsx)(eK,{width:60,height:60})})]})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:C()}),(0,l.jsx)(T.Z,{onClick:()=>m(!0),children:y&&(null==i?void 0:i.callTeacher)?(0,l.jsx)(eY,{width:60,height:60}):(0,l.jsx)(e0,{width:60,height:60})})]})}),(0,l.jsx)(ev,{api:t,open:!!Z,anchorEl:Z,onClose:()=>S(null)}),y&&(null==i?void 0:i.callTeacher)&&(0,l.jsx)(eG,{isDrawerOpen:f,toggleDrawer:m,onJoinQueue:P})]}):null},te=e=>{let{api:t,roomFeatures:i,numberOfParticipants:n,roomId:r,isMicOn:o,onToggleMic:a,onToggleVideo:s,isVideoOn:d,onToggleChat:c,isSolo:h,chatState:u,toggleParticipantsPane:p,onToggleSettings:x,toggleDrawer:g,onLeaveRoom:m,isDrawerOpen:f,toggleWhiteboard:j,showWhiteboard:b,getCallTeacherTooltip:v,hasBookedPass:w,participantsPaneAnchorEl:C,setParticipantsPaneAnchorEl:y}=e;return t?(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:"0 10px"},children:[(0,l.jsx)(R.Z,{sx:e3.iconContainer,children:(0,l.jsx)(T.Z,{onClick:a,disabled:!(null==i?void 0:i.microphone),children:o?(0,l.jsx)(eH,{width:45,height:45}):(0,l.jsx)(e8,{width:45,height:45})})}),(0,l.jsx)(R.Z,{sx:e3.iconContainer,children:(0,l.jsx)(T.Z,{onClick:s,disabled:!(null==i?void 0:i.camera),children:d?(0,l.jsx)(eJ,{width:45,height:45}):(0,l.jsx)(e2,{width:45,height:45})})}),(0,l.jsx)(R.Z,{sx:e3.iconContainer,children:(0,l.jsx)(T.Z,{onClick:c,style:{opacity:!h&&(null==i?void 0:i.chat)?1:.5},disabled:h||!(null==i?void 0:i.chat),children:(0,l.jsx)(I.Z,{badgeContent:null==u?void 0:u.unreadCount,children:(null==u?void 0:u.isOpen)?(0,l.jsx)(eq,{width:45,height:45}):(0,l.jsx)(e$,{width:45,height:45})})})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsxs)(R.Z,{sx:e3.iconContainer,children:[(0,l.jsx)(R.Z,{sx:e3.tooltip,className:"tooltip",children:v()}),(0,l.jsx)(T.Z,{onClick:()=>g(!0),children:w&&(null==i?void 0:i.callTeacher)?(0,l.jsx)(eY,{width:45,height:45}):(0,l.jsx)(e0,{width:45,height:45})})]})}),(0,l.jsx)(R.Z,{sx:e3.iconContainer,children:(0,l.jsx)(T.Z,{onClick:m,children:(0,l.jsx)(eK,{width:45,height:45})})}),(0,l.jsx)(R.Z,{sx:e3.iconContainer,children:(0,l.jsx)(eL,{toggleSettings:x,participantsPaneAnchorEl:C,roomFeatures:i,toggleParticipantsPane:p,showWhiteboard:b,toggleWhiteboard:j,leaveCall:m,toggleDrawer:g,hasBookedPass:w})}),(0,l.jsx)(ev,{api:t,open:!!C,anchorEl:C,onClose:()=>y(null)}),w&&(null==i?void 0:i.callTeacher)&&(0,l.jsx)(eG,{isDrawerOpen:f,toggleDrawer:g,onJoinQueue:e=>console.log})]})}):null};var tt=i(50657),ti=i(37645),tn=i(6514),tr=i(85321);(r=a||(a={}))[r.Image=0]="Image",r[r.Video=1]="Video";let to=e=>{let{open:t,onClose:i,onSubmit:n,backgroundImageOptions:r}=e,{t:o}
1=(0,H.$G)(),[a,d]=(0,s.useState)([]),c=(e,t)=>{e.stopPropagation(),n(t)};return(0,l.jsxs)(tt.Z,{open:t,onClose:i,sx:{"& .MuiDialog-paper":{backgroundColor:"#44484A",justifyContent:"flex-end",marginLeft:"auto"}},slotProps:{backdrop:{sx:{backgroundColor:"transparent"}}},PaperProps:{style:{height:"77%"}},children:[(0,l.jsxs)(er.ZP,{container:!0,spacing:2,children:[(0,l.jsx)(er.ZP,{item:!0,xs:8,children:(0,l.jsx)(ti.Z,{sx:{color:"white"},children:o("common.background")})}),(0,l.jsx)(er.ZP,{item:!0,xs:4,children:(0,l.jsx)(ed.Z,{children:(0,l.jsx)(T.Z,{onClick:i,children:(0,l.jsx)(E.Z,{icon:"mdi:close",color:"white",fontSize:20})})})})]}),(0,l.jsx)(tn.Z,{sx:{paddingTop:"0px"},children:(0,l.jsx)(tr.E.ul,{style:{display:"flex",flexDirection:"column",flexWrap:"wrap",alignContent:"flex-start",listStyle:"none",margin:0,padding:0},initial:"hidden",animate:"visible",variants:e_.tr.container,children:(0,l.jsx)("div",{style:{flex:1,columnCount:2},children:null==r?void 0:r.map((e,t)=>{var i;return(0,l.jsx)(tr.E.li,{variants:e_.tr.item,children:(0,l.jsxs)("div",{style:{position:"relative"},onClick:t=>c(t,e),children:[e.type===ex.Bf.Video&&(0,l.jsx)(E.Z,{icon:"mdi:video-image",style:{position:"absolute",color:"white",textShadow:"0px 1px 4px black",background:"#0000003d",borderRadius:"22px",margin:4,padding:4,height:30,width:30}}),(0,l.jsx)("img",{src:e.thumbnailSrc||"",alt:(null===(i=e.type)||void 0===i?void 0:i.toString())||"",loading:"lazy",style:{width:"150px",height:"90px",objectFit:"cover"}})]})},"img_".concat(t))})})})})]})};var ta={src:"/_next/static/media/Background.a5ec5a46.svg",height:60,width:60,blurWidth:0,blurHeight:0},tl={src:"/_next/static/media/Music.3a57b9ac.svg",height:60,width:60,blurWidth:0,blurHeight:0},ts=i(26447),td=i(45929),tc=i(88085);let th=e=>{let{audio:t,category:i,sliderValue:n,onToggleAudio:r,onSliderChange:o,onNextSound:a,isPlaying:d}=e,{t:c}=(0,H.$G)(),[h,u]=(0,s.useState)();return(0,l.jsxs)("div",{style:{minWidth:400},children:[(0,l.jsx)(tc.Z,{sx:{display:"flex",alignItems:"center"},direction:"row",spacing:2,children:(0,l.jsx)(A.Z,{color:"white",variant:"subtitle1",children:c((e=>{switch(e){case ex.uO.Lofi:return"soundCategory.lofi";case ex.uO.CafeAmbience:return"soundCategory.cafeAmbience";case ex.uO.Rain:return"soundCategory.rain";case ex.uO.Nature:return"soundCategory.nature";default:return""}})(i))})}),(0,l.jsxs)(tc.Z,{spacing:2,direction:"row",sx:{mb:1},alignItems:"center",children:[(0,l.jsx)(T.Z,{onClick:r,children:(0,l.jsx)(E.Z,{color:"white",icon:d?"mdi:pause":"mdi:play",fontSize:20})}),(0,l.jsx)(td.ZP,{sx:{"& .MuiSlider-thumb":{color:"white"},"& .MuiSlider-track":{color:"white"},"& .MuiSlider-rail":{color:"#acc4e4"},"& .MuiSlider-active":{color:"green"}},"aria-label":"Volume",value:n,onChange:(e,t)=>
1o(t)}),(()=>{if(!t)return;let e="";return t.volume<.02||t.muted?e="mdi:volume-off":t.volume<.25?e="mdi:volume-low":t.volume<.5?e="mdi:volume-medium":t.volume>=.5&&(e="mdi:volume-high"),(0,l.jsx)(T.Z,{onClick:()=>{t.muted=!t.muted,u(e=>!e)},children:(0,l.jsx)(E.Z,{color:"white",icon:e,fontSize:20})})})(),(0,l.jsx)(T.Z,{onClick:a,children:(0,l.jsx)(E.Z,{color:"white",icon:"mdi:skip-forward",fontSize:20})})]})]})},tu=e=>{let{open:t,onClose:i,soundGroups:n}=e,{t:r}=(0,H.$G)(),[o,a]=(0,s.useState)({}),[d,c]=(0,s.useState)({}),[h,u]=(0,s.useState)({}),[p,x]=(0,s.useState)({}),[g,m]=(0,s.useState)();(0,s.useEffect)(()=>{let e={},t={};return n.forEach(i=>{if(void 0!==i.category&&i.sources&&i.sources.length>0){let n=new Audio(i.sources[0]);n.addEventListener("ended",()=>{var e;let r=null!==(e=t[i.category])&&void 0!==e?e:0,o=(r+1)%i.sources.length;t[i.category]=o,n.src=i.sources[o],n.play()}),e[i.category]=n}}),a(e),u(t),()=>{for(let t of(console.log("cleanup function - clear sounds",Object.entries(e)),Object.entries(e))){let e=t[1];e.pause(),e.removeAttribute("src"),e.load()}}},[n]);let f=e=>{if(o[e]){let t=o[e],i=d[e]||0;t.paused?(t.volume=i/100,t.play().catch(e=>{console.error("Error playing audio:",e)})):t.pause(),a({...o,[e]:t}),x(i=>({...i,[e]:!t.paused}))}},j=e=>{if(void 0!==e&&void 0!==n&&o[e]){var t;let i=o[e],r=null!==(t=h[e])&&void 0!==t?t:0,a=(r+1)%n.find(t=>t.category===e).sources.length;h[e]=a,i.src=n.find(t=>t.category===e).sources[a],i.play(),m(e=>!e)}},b=(e,t)=>{if(c({...d,[e]:t}),o[e]){let t=o[e],i=d[e]||0;t.volume=i/100}};return(0,s.useEffect)(()=>{console.log("playing status",p)},[p]),(0,l.jsxs)(tt.Z,{open:t,onClose:i,sx:{"& .MuiDialog-paper":{backgroundColor:"#44484A",justifyContent:"flex-end",marginLeft:"auto"}},slotProps:{backdrop:{sx:{backgroundColor:"transparent"}}},PaperProps:{style:{height:"77%"}},children:[(0,l.jsxs)(er.ZP,{container:!0,spacing:2,children:[(0,l.jsx)(er.ZP,{item:!0,xs:8,children:(0,l.jsx)(ti.Z,{sx:{color:"white"},children:r("common.sound")})}),(0,l.jsx)(er.ZP,{item:!0,xs:4,children:(0,l.jsx)(ed.Z,{children:(0,l.jsx)(T.Z,{onClick:i,children:(0,l.jsx)(E.Z,{icon:"mdi:close",color:"white",fontSize:20})})})})]}),(0,l.jsx)(tn.Z,{sx:{paddingTop:"0px"},children:(0,l.jsx)(ts.Z,{spacing:4,children:null==n?void 0:n.map((e,t)=>{var i;return(0,l.jsx)(th,{audio:o[e.category],category:e.category,sliderValue:d[e.category]||0,onToggleAudio:()=>f(e.category),onSliderChange:t=>b(e.category,t),onNextSound:()=>j(e.category),isPlaying:!(null===(i=o[e.category])||void 0===i?void 0:i.paused)},t)})})})]})},tp=()=>(0,l.jsx)(O(),{src:ta,alt:"FocusRoom",width:60,height:60}),tx=()=>(0,l.jsx)(O(),{src:tl,alt:"FocusRoom",width:60,height:60}),tg=e=>{let{isBackgroundDialogOpen:t,handleOpenBackgroundDialog:i,handleBackgroundDialogClose:n,handleBackgroundChange:r,backgroundImageOptions:o,soundGroups:a}=e,[d,c]=(0,s.useState)(!1),h=()=>{c(!1)},u=()=>{c(!0)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tu,{open:d,onClose:h,soundGroups:a}),(0,l.jsxs)(er.ZP,{container:!0,spacing:1,sx:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,l.jsx)(er.ZP,{item:!0}),(0,l.jsx)(er.ZP,{item:!0,children:(0,l.jsxs)(er.ZP,{container:!0,gap:4,children:[(0,l.jsxs)(er.ZP,{item:!0,xs:0,children:[(0,l.jsx)(e_.Rs,{children:(0,l.jsx)(R.Z,{onClick:i,sx:{paddingTop:"0px",cursor:"pointer"},children:(0,l.jsx)(tp,{})})}),(0,l.jsx)(e_.XJ,{children:(0,l.jsx)(to,{open:t,onClose:n,onSubmit:r,backgroundImageOptions:o})})]}),(0,l.jsx)(er.ZP,{item:!0,xs:0,children:(0,l.jsx)(e_.Rs,{children:(0,l.jsx)(R.Z,{sx:{paddingTop:"0px",paddingRight:"0px",cursor:"pointer"},onClick:u,children:(0,l.jsx)(tx,{})})})})]})})]})]})};var tm=i(55250),tf=i(74981),tj=i(66242),tb=i(98456),tv=i(7504);let tw=e=>{switch(e){case ex.nW.Course:return tZ;case ex.nW.Focus:return ty;case ex.nW.Private:return tC;default:throw Error("no-room-features")}},tC={callTeacher:!0,camera:!0,defaultCameraEnabled:!1,chat:!0,microphone:!0,participantList:!0,settings:!0,shareScreen:!0},ty={callTeacher:!1,camera:!0,defaultCameraEnabled:!1,chat:!0,microphone:!1,participantList:!0,settings:!0,shareScreen:!1},tZ={callTeacher:!0,camera:!0,defaultCameraEnabled:!1,chat:!0,microphone:!0,participantList:!0,settings:!0,shareScreen:!0};var tS=i(70655),tk=i(53247),tT=i(59994),tI=i(90244),tP=i(96540),tO=i(94895),tN=i(21023),tR=i(77957);let tE={smallCard:{width:"150px",height:"70px",background:"rgb(0 0 0 / 54%)",borderRadius:"16px",boxShadow:"0 4px 30px rgba(0, 0, 0, 0.1)",backdropFilter:"blur(5.5px)",textAlign:"center",padding:"4px"},numberInput:{width:"50px",border:"none",fontSize:"20px","& input
1::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":{"-webkit-appearance":"none",margin:0},"& input":{textAlign:"center",color:"white",fontSize:"34px",padding:0},"& fieldset":{border:"none"}},iconButton:{color:"white"}},tD=e=>"".concat(Math.floor(e/60).toString().padStart(2,"0"),":").concat((e%60).toString().padStart(2,"0")),tL=e=>{let{timer:t,isBreak:i}=e,{t:n}=(0,H.$G)();return(0,l.jsxs)(tj.Z,{sx:tE.smallCard,children:[(0,l.jsxs)(A.Z,{variant:"overline",color:"white",sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%"},children:[(0,l.jsx)(tI.Z,{sx:{color:"white",fontSize:"20px",marginRight:"4px"}}),n(i?"pomodoroTimerComponent.break":"pomodoroTimerComponent.study")]}),(0,l.jsx)(A.Z,{color:"white",children:tD(t)})]})},t_=e=>{let{isBreak:t,timer:i,isActive:n,onResetTimer:r,onToggleTimer:o,onChangeTimer:a,studyTimeMinutes:d,breakTimeMinutes:c,onClose:h}=e,{t:u}=(0,H.$G)(),[p,x]=(0,s.useState)(!1),[g,m]=(0,s.useState)(d),[f,j]=(0,s.useState)(c),b={color:"white",backgroundColor:"transparent"},v=()=>{a({newWorkTime:g,newPauseTime:f}),x(!1)},w=e=>e<1?1:e>60?60:e,C=e=>{if(isNaN(e))return;let t=w(e);m(t)},y=e=>{if(isNaN(e))return;let t=w(e);j(t)};return(0,l.jsxs)(tj.Z,{style:{background:"rgb(0 0 0 / 70%)",borderRadius:"16px",boxShadow:"0 4px 30px rgba(0, 0, 0, 0.1)",backdropFilter:"blur(5.5px)"},sx:{backgroundColor:"#181818",width:300,padding:6},children:[(0,l.jsxs)(R.Z,{style:{position:"absolute",top:0,right:0},children:[p?(0,l.jsx)(T.Z,{style:b,onClick:()=>x(!1),children:(0,l.jsx)(tN.Z,{})}):(0,l.jsx)(T.Z,{style:b,onClick:()=>x(!0),children:(0,l.jsx)(tR.Z,{})}),(0,l.jsx)(T.Z,{style:b,onClick:h,children:(0,l.jsx)(eU.Z,{})})]}),(0,l.jsx)(A.Z,{variant:"overline",color:"white",children:u(t?"pomodoroTimerComponent.break":"pomodoroTimerComponent.study")}),(0,l.jsx)(er.ZP,{container:!0,children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(R.Z,{sx:{width:"100%"},children:(0,l.jsx)(tM,{title:"Fokustid (min)",value:g,onChange:C})}),(0,l.jsx)(R.Z,{sx:{marginTop:2,width:"100%"},children:(0,l.jsx)(tM,{title:"Paustid (min)",value:f,onChange:y})}),(0,l.jsx)(R.Z,{sx:{paddingTop:"8px",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(ec.Z,{sx:{background:"white",width:"200px"},onClick:v,children:(0,l.jsx)(A.Z,{sx:{color:"#44484A",fontWeight:500},children:"Starta!"})})})]}):(0,l.jsxs)(ts.Z,{direction:"row",justifyContent:"space-between",sx:{width:"100%"},children:[(0,l.jsx)(A.Z,{variant:"h4",color:"white",children:tD(i)}),(0,l.jsx)(R.Z,{children:(0,l.jsxs)(ts.Z,{direction:"row",spacing:1,sx:{width:"100%"},children:[(0,l.jsx)(T.Z,{style:b,onClick:r,children:(0,l.jsx)(tT.Z,{})}),(0,l.jsx)(T.Z,{style:b,onClick:o,children:n?(0,l.jsx)(tk.Z,{}):(0,l.jsx)(tS.Z,{})})]})})]})})]})},tM=e=>(0,l.jsxs)(ts.Z,{sx:{width:"100%"},alignItems:"center",children:[(0,l.jsx)(A.Z,{variant:"overline",color:"white",children:e.title}),(0,l.jsx)(R.Z,{children:(0,l.jsxs)(ts.Z,{direction:"row",spacing:1,justifyContent:"center",children:[(0,l.jsx)(T.Z,{sx:tE.iconButton,onClick:()=>e.onChange(e.value-1),children:(0,l.jsx)(tO.Z,{})}),(0,l.jsx)(B.Z,{type:"number",sx:tE.numberInput,value:e.value,onChange:t=>e.onChange(Number(t.target.value))}),(0,l.jsx)(T.Z,{sx:tE.iconButton,onClick:()=>e.onChange(e.value+1),children:(0,l.jsx)(tP.Z,{})})]})})]});var tA=i(81458),tW=i(51776),tU=i(18037),tB=i(59462);let tF={closeTaskButton:{color:"white",backgroundColor:"transparent",position:"absolute",top:2,right:2},closeTaskIcon:{height:16,width:16},smallCard:{width:"150px",height:"70px",background:"rgb(0 0 0 / 54%)",borderRadius:"16px",boxShadow:"0 4px 30px rgba(0, 0, 0, 0.1)",backdropFilter:"blur(5.5px)",textAlign:"center",padding:"4px"},markIcon:{display:"flex",alignItems:"center",justifyContent:"center",alignContent:"center",color:"white",cursor:"pointer"},list:{overflow:"auto",maxHeight:"60vh","&::-webkit-scrollbar":{display:"none"}}},tz=e=>{let{t}=(0,H.$G)();return(0,l.jsxs)(tj.Z,{sx:tF.smallCard,children:[(0,l.jsxs)(A.Z,{variant:"overline",color:"white",sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%"},children:[(0,l.jsx)(tW.Z,{sx:{color:"white",fontSize:"20px",marginRight:"4px"}}),t("todoListComponent.title")]}),(0,l.jsxs)(A.Z,{color:"white",children:[e.goals.filter(e=>e.completed).length,"/",e.goals.length]})]})},tV=e=>{let{goals:t,onClose:i}=e,{t:n}
1=(0,H.$G)(),[r,o]=(0,s.useState)(),a={color:"white",backgroundColor:"transparent"},d={background:"rgb(0 0 0 / 54%)",borderRadius:"16px",boxShadow:"0 4px 30px rgba(0, 0, 0, 0.1)",backdropFilter:"blur(5.5px)"},c={background:"rgb(28 89 50 / 54%)",borderRadius:"16px",boxShadow:"0 4px 30px rgba(0, 0, 0, 0.1)",backdropFilter:"blur(5.5px)"},h=t=>{t&&""!==t&&(e.onAddGoal({text:t,completed:!1}),o(""))},u=t=>{e.onRemoveGoal(t)},p=e=>{e.preventDefault(),h(r)},x=t=>{e.onToggleGoal(t)};return(0,l.jsx)(er.ZP,{container:!0,direction:"column",rowGap:2.5,children:(0,l.jsxs)(tj.Z,{className:"no-select",style:d,sx:{backgroundColor:"#181818",width:300,padding:5},children:[(0,l.jsx)(R.Z,{style:{position:"absolute",top:0,right:0},children:(0,l.jsx)(T.Z,{style:a,onClick:i,children:(0,l.jsx)(eU.Z,{})})}),(0,l.jsx)(A.Z,{variant:"overline",color:"white",children:n("todoListComponent.title")}),(0,l.jsx)("form",{onSubmit:p,children:(0,l.jsxs)(er.ZP,{container:!0,xs:12,children:[(0,l.jsx)(er.ZP,{item:!0,xs:10,children:(0,l.jsx)(B.Z,{value:r,inputProps:{style:{color:"white"}},margin:"none",size:"small",variant:"outlined",placeholder:n("todoListComponent.goalInputPlaceholder"),onChange:e=>o(e.target.value)})}),(0,l.jsx)(er.ZP,{item:!0,xs:2,children:(0,l.jsx)(T.Z,{style:a,onClick:()=>h(r),type:"submit",children:(0,l.jsx)(tP.Z,{})})}),(0,l.jsx)(er.ZP,{xs:12,children:(0,l.jsxs)(R.Z,{children:[(0,l.jsxs)(A.Z,{variant:"overline",color:"white",children:[t.filter(e=>e.completed).length,"/",t.length," ",n("todoListComponent.completed")]}),(0,l.jsx)(tA.Z,{variant:"determinate",value:t.filter(e=>e.completed).length/t.length*100})]})})]})}),(0,l.jsx)(z.Z,{sx:tF.list,children:null==t?void 0:t.map((e,t)=>(0,l.jsx)(e_.XJ,{children:(0,l.jsxs)(R.Z,{className:"no-select",style:e.completed?c:d,sx:{backgroundColor:"#181818",width:"100%",padding:5,marginTop:2},children:[(0,l.jsxs)(ts.Z,{direction:"row",children:[(0,l.jsx)(R.Z,{onClick:()=>x(t),sx:tF.markIcon,children:e.completed?(0,l.jsx)(tU.Z,{}):(0,l.jsx)(tB.Z,{})}),(0,l.jsx)(R.Z,{sx:{marginLeft:2},children:(0,l.jsxs)(A.Z,{variant:"overline",color:"white",children:[t+1,". ",e.text]})})]}),(0,l.jsx)(T.Z,{sx:tF.closeTaskButton,onClick:()=>u(t),children:(0,l.jsx)(eU.Z,{sx:tF.closeTaskIcon})})]})},"todo-item-".concat(t)))})]})})},tG=()=>{let[e,t]=s.useState([]),[i,n]=s.useState(!1),[r,o]=s.useState(!1),[a,d]=s.useState(!1),[c,h]=s.useState(25),[u,p]=s.useState(5),[x,g]=s.useState(60*c),[m,f]=s.useState(!1);(0,s.useEffect)(()=>{let e;return m&&x>0?e=setInterval(()=>{g(x-1)},1e3):m&&0===x&&(d(!a),f(!1),g(a?60*c:60*u),f(!0)),()=>clearInterval(e)},[m,x,a,c,u]);let j=()=>{f(!m)},b=()=>{f(!1),d(!1),g(60*c)},v=i=>{t([...e,i])},w=i=>{t(e.filter((e,t)=>t!==i))},C=i=>{t(e.map((e,t)=>t===i?{...e,completed:!e.completed}:e))};return(0,l.jsxs)(R.Z,{children:[(0,l.jsxs)(ts.Z,{direction:"row",spacing:2,children:[(0,l.jsx)(e_.Rs,{children:(0,l.jsx)(R.Z,{onClick:()=>n(!i),sx:{"&:hover":{cursor:"pointer"}},children:(0,l.jsx)(tL,{timer:x,isBreak:a})})}),(0,l.jsx)(e_.Rs,{children:(0,l.jsx)(R.Z,{onClick:()=>o(!r),sx:{"&:hover":{cursor:"pointer"}},children:(0,l.jsx)(tz,{goals:e})})})]}),(0,l.jsxs)(ts.Z,{spacing:2,sx:{marginTop:2,position:"absolute",zIndex:"99"},children:[i&&(0,l.jsx)(e_.XJ,{children:(0,l.jsx)(t_,{isBreak:a,isActive:m,timer:x,onToggleTimer:j,onResetTimer:b,onChangeTimer:e=>{h(e.newWorkTime),p(e.newPauseTime),g(60*e.newWorkTime)},studyTimeMinutes:c,breakTimeMinutes:u,onClose:()=>n(!1)})}),r&&(0,l.jsx)(e_.XJ,{children:(0,l.jsx)(tV,{goals:e,onAddGoal:v,onRemoveGoal:w,onToggleGoal:C,onClose:()=>o(!1)})})]})]})};var tH=i(33489),tJ=i(93005),tq=i(25743),t$={src:"/_next/static/media/StudyCafeWhite.821da3d3.svg",height:41,width:195,blurWidth:0,blurHeight:0},tQ=i(59692),tX=i(30152);let tK=["connection.CONNFAIL","dialog.cameraNotSendingData","dialog.kickTitle","dialog.liveStreaming","dialog.lockTitle","dialog.maxUsersLimitReached","dialog.micNotSendingData","dialog.passwordNotSupportedTitle","dialog.recording","dialog.remoteControlTitle","dialog.reservationError","dialog.serviceUnavailable","dialog.sessTerminated","dialog.sessionRestarted","dialog.tokenAuthFailed","dialog.tokenAuthFailedWithReasons","dialog.transcribing","dialOut.statusMessage","liveStreaming.busy","liveStreaming.failedToStart","liveStreaming.unavailableTitle","lobby.joinRejectedMessage","lobby.notificationTitle","notify.chatMessages","notify.disconnected","notify.connectedOneMember","notify.connectedTwoMembers","notify.connectedThreePlusMembers","notify.leftOneMember","notify.leftTwoMembers","notify.leftThreePlusMembers","notify.grantedTo","notify.hostAskedUnmute","notify.invitedOneMember","notify.invitedThreePlusMembers","notify.invitedTwoMembers","notify.kickParticipant","notify.linkToSalesforce","notify.moderationStartedTitle","notify.moderationStoppedTitle","notify.moderationInEffectTitle","notify.moderationInEffectVideoTitle","notify.moderationInEffectCSTitle","notify.mutedRemotelyTitle","notify.mutedTitle","notify.newDeviceAudioTitle","notify.newDeviceCameraTitle","notify.participantWantsToJoin","notify.passwordRemovedRemotely","notify.passwordSetRemotely","notify.raisedHand","notify.startSilentTitle","notify.unmute","notify.videoMutedRemotelyTitle","prejoin.errorDialOut","prejoin.errorDialOutDisconnected","prejoin.errorDialOutFailed","prejoin.errorDialOutStatus","prejoin.errorStatusCode","prejoin.errorValidation","recording.busy","recording.failedToStart","recording.unavailableTitle","toolbar.noAudioSignalTitle","toolbar.noisyAudioInputTitle","toolbar.talkWhileMutedPopup","transcribing.failedToStart"];var tY=i(98887);let t0=e=>{let{roomId:t,roomToken:i,roomFeatures:n,setApi:r,videoRef:o,toolbarButtons:a}=e;
1return(0,l.jsx)(tX.h,{appId:"vpaas-magic-cookie-e81bf016f99740f79c6c9c8455e547de",roomName:t,onApiReady:e=>{r(e)},getIFrameRef:e=>{o.current=e,e.style.height="100%",e.style.width="100%",e.style.rowGap="20px"},jwt:(null==i?void 0:i.token)||"",configOverwrite:{apiLogLevels:[],toolbarButtons:a||[],defaultLanguage:(0,tY.r)(),backgroundAlpha:0,disableTileEnlargement:!0,disableTileView:!1,startSilent:!(null==n?void 0:n.microphone),disableModeratorIndicator:!0,disabledNotifications:tK,prejoinConfig:{enabled:!0,hideDisplayName:!0},readOnlyName:!0,filmstrip:{disableResizable:!0,disableStageFilmstrip:!0},conferenceInfo:{autoHide:["video-quality","participants-count"]},disableAddingBackgroundImages:!0,recordings:{showPrejoinWarning:!1,suggestRecording:!1},hideConferenceSubject:!0,hideConferenceTimer:!0,hideRecordingLabel:!0,hideParticipantsStats:!0,connectionIndicators:{disabled:!0,disableDetails:!0},disabledSounds:["ASKED_TO_UNMUTE_SOUND","E2EE_OFF_SOUND","E2EE_ON_SOUND","INCOMING_MSG_SOUND","KNOCKING_PARTICIPANT_SOUND","LIVE_STREAMING_OFF_SOUND","LIVE_STREAMING_ON_SOUND","NO_AUDIO_SIGNAL_SOUND","NOISY_AUDIO_INPUT_SOUND","OUTGOING_CALL_EXPIRED_SOUND","OUTGOING_CALL_REJECTED_SOUND","OUTGOING_CALL_RINGING_SOUND","OUTGOING_CALL_START_SOUND","PARTICIPANT_JOINED_SOUND","PARTICIPANT_LEFT_SOUND","RAISE_HAND_SOUND","REACTION_SOUND","RECORDING_OFF_SOUND","_ON_SOUND","TALK_WHILE_MUTED_SOUND"],disableSelfView:!1,disableSelfViewSettings:!0,disableLocalVideoFlip:!0,disableShortcuts:!0,participantMenuButtonsWithNotifyClick:[{key:"hide-self-view",preventExecution:!0}],fileSharing:{enabled:!1},transcription:{enabled:!1},disablePolls:!0},interfaceConfigOverwrite:{VERTICAL_FILMSTRIP:!0,VIDEO_QUALITY_LABEL_DISABLED:!0,AUTO_PIN_LATEST_SCREEN_SHARE:!1,SETTINGS_SECTIONS:["devices"]}})};var t1=i(85342),t5=i(28555);let t6=e=>new t1.s().withUrl(e,{skipNegotiation:!0,transport:t5.n.WebSockets}).configureLogging("information").build();var t4=i(96486),t2=i.n(t4),t8=i(74474);let t3=e=>{let{user:t}=(0,Y.a)(),i=(0,s.useRef)(),n=(0,s.useRef)(!1),r=(0,s.useRef)(),o=(0,s.useRef)(new Map),a=(0,s.useRef)(new Map);(0,s.useEffect)(()=>{console.log("start Connection");let r=t6("https://studycafe-api.azurewebsites.net/whiteboardhub");return i.current=r,r.on("userJoined",d),r.on("userLeft",e=>{console.log("User ".concat(e," left the room."))}),r.on("receiveCanvasUpdate",h),r.on("receivePointerUpdate",c),r.start().then(()=>{console.log("Connected to SignalR."),n.current=!0,r.send("joinRoom",e.roomId,null==t?void 0:t.id).catch(e=>{console.error("Error joining room:",e)})}).catch(e=>{console.error("Error starting SignalR connection:",e)}),()=>{r&&(console.log("Stopping SignalR connection..."),r.stop().catch(e=>{console.error("Error stopping SignalR connection:",e)}))}},[e.roomId,null==t?void 0:t.id]);let d=(e,t)=>{var i;console.log("User ".concat(e,"/").concat(t," joined the room."));let n=[...(null===(i=r.current)||void 0===i?void 0:i.getSceneElementsIncludingDeleted())||[]];for(let e of n)p(JSON.stringify(e),t)},c=e=>{var t,i;let n=JSON.parse(e);a.current.set(n.userId.toString(),{pointer:n.pointer,username:n.username,id:n.userId.toString()}),null===(t=r.current)||void 0===t||t.updateScene({elements:null===(i=r.current)||void 0===i?void 0:i.getSceneElementsIncludingDeleted(),collaborators:a.current})},h=e=>{var t,i;let n=JSON.parse(e);null==o||o.current.set(n.id,n);let a=[...(null===(t=r.current)||void 0===t?void 0:t.getSceneElementsIncludingDeleted())||[]],l=a.findIndex(e=>e.id===n.id);-1!==l?a[l]=n:a.push(n),null===(i=r.current)||void 0===i||i.updateScene({elements:a})},u=t=>{if(!i.current||!n.current){console.error("sendDrawingUpdate - Connection not established");return}i.current.send("UpdateCanvas",e.roomId,t).catch(e=>{console.error("Error sending drawing update:",e)})},p=(e,t)=>{if(!i.current||!n.current){console.error("sendDrawingUpdateToUser - Connection not established");return}i.current.send("UpdateCanvasForUser",t,e).catch(e=>{console.error("Error sending drawing update:",e)})},x=r=>{if(!i.current||!n.current){console.error("handlePointerUpdate - Connection not established");return}let o=t2().cloneDeep(r),a={pointer:o.pointer,userId:t.id,username:t.firstName};i.current.send("UpdatePointer",e.roomId,JSON.stringify(a)).catch(e=>{console.error("Error sending pointer update:",e)})},g=(e,t,i)=>{let n=t2().cloneDeep(e);
1for(let e of n){let t=o.current.get(e.id);t&&e.version===t.version||u(JSON.stringify(e))}o.current=new Map(n.map(e=>[e.id,e]))};return s.useLayoutEffect(()=>{t9(e.isOpen)},[e.isOpen]),(0,l.jsx)(t8.Excalidraw,{onChange:g,onPointerUpdate:x,excalidrawAPI:e=>r.current=e,autoFocus:!0,UIOptions:{canvasActions:{saveToActiveFile:!1,export:!1,saveAsImage:!1,loadScene:!1},tools:{image:!1}},isCollaborating:!0,initialData:{appState:{activeTool:{type:"freedraw",customType:null,lastActiveTool:null,locked:!1}},libraryItems:[]},renderTopRightUI:()=>(0,l.jsx)(T.Z,{onClick:e.onDismiss,children:(0,l.jsx)(E.Z,{icon:"mdi:close"})}),children:(0,l.jsxs)(t8.MainMenu,{children:[(0,l.jsx)(t8.MainMenu.DefaultItems.ToggleTheme,{}),(0,l.jsx)(t8.MainMenu.DefaultItems.ChangeCanvasBackground,{})]})})},t9=e=>{let t=document.querySelector("div.layer-ui__wrapper__footer-left.zen-mode-transition");t&&(t.style.display=e?"block":"none");let i=document.querySelector("footer.App-toolbar");i&&(i.style.display=e?"block":"none")},t7=()=>(0,l.jsx)(O(),{src:tJ.Z,alt:"Close",width:40,height:40}),ie={spinner:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},it=e=>{let{roomCode:t}=e,{t:i}=(0,H.$G)(),n=(0,eC.Z)();return t?(0,l.jsx)(tj.Z,{sx:{minWidth:n.isMobileOrTablet?"100px":"150px",height:n.isMobileOrTablet?"30px":"70px",background:"rgb(0 0 0 / 54%)",borderRadius:n.isMobileOrTablet?"0px":"16px",boxShadow:"0 4px 30px rgba(0, 0, 0, 0.1)",backdropFilter:"blur(5.5px)",display:"flex",justifyContent:"center",alignItems:"center",padding:n.isMobileOrTablet?"0px 8px":"8px"},children:n.isMobileOrTablet?(0,l.jsxs)(A.Z,{color:"white",variant:"body2",sx:{fontSize:"12px"},children:[i("roomIdPage.roomCodeLabel"),": ",t]}):(0,l.jsxs)(R.Z,{sx:{textAlign:"center"},children:[(0,l.jsx)(A.Z,{color:"white",variant:"overline",children:i("roomIdPage.roomCodeLabel")}),(0,l.jsx)(A.Z,{color:"white",sx:{fontSize:"20px"},children:t})]})}):null},ii=()=>{let{t:e}=(0,H.$G)(),t=(0,N.m)(),i=(0,d.useRouter)(),{user:n}=(0,Y.a)(),{mediaGroups:r,soundGroups:a}
1=(0,tH.b)(),[c,h]=(0,s.useState)(!1),[u,p]=(0,s.useState)(),[x,g]=(0,s.useState)(""),[m,f]=(0,s.useState)(null),[j,b]=(0,s.useState)(!1),[v,w]=(0,s.useState)(),[C,y]=(0,s.useState)(0),[Z,S]=(0,s.useState)(!1),[k,T]=(0,s.useState)(!1),[I,P]=(0,s.useState)(!1),[O,E]=(0,s.useState)(!1),[D,L]=(0,s.useState)(!1),[_,M]=(0,s.useState)(),[A,W]=(0,s.useState)(!1),U=(0,s.useRef)(null),[B,F]=(0,s.useState)(),[z,V]=(0,s.useState)(),[G,J]=(0,s.useState)(),q=(0,eC.Z)(),[$,Q]=(0,s.useState)(!1),[X,K]=(0,s.useState)(null),ee=()=>{b(!0)},et=()=>{b(!1)},ei=e=>{try{if(!e.mediaSrc)return;e.type===ex.Bf.Video&&J(!0),w(e),localStorage.setItem(tQ.B.VideoRoomBackground,JSON.stringify(e))}catch(e){console.error("Failed changing background")}finally{b(!1)}},en=()=>{Q(e=>!e)},er=async()=>{var e;if(1===C){null==m||m.executeCommand("setTileView",!1);return}let t=await (null==m?void 0:m.getContentSharingParticipants());(null==t?void 0:null===(e=t.sharingParticipantIds)||void 0===e?void 0:e.length)===0&&(null==m||m.executeCommand("setTileView",!0))},eo=()=>{null==m||m.executeCommand("setTileView",!0)},ea=e=>{K(e)},el=e=>{m&&y(m.getNumberOfParticipants())},es=e=>{m&&y(m.getNumberOfParticipants())},ed=async e=>{m&&(W(!0),m.executeCommand("overwriteConfig",{toolbarButtons:["settings"]}),y(m.getNumberOfParticipants()))},ec=e=>{let{muted:t}=e;S(!t)},eh=e=>{let{muted:t}=e;T(!t)},eu=e=>{let{enabled:t}=e;V(!t),null==m||m.executeCommand("overwriteConfig",{backgroundAlpha:t?0:1})},ep=e=>{let{isOpen:t}=e;L(t)},eg=e=>{let{isOpen:t,unreadCount:i}=e;M({isOpen:t,unreadCount:i})},em=e=>{let{on:t}=e;P(t)},ef=()=>{null==m||m.executeCommand("toggleShareScreen")},ej=()=>{console.log("Toggling settings dialog. Current state:",O),E(e=>!e),null==m||m.executeCommand("toggleVirtualBackgroundDialog"),console.log("Executed Jitsi command to toggle virtual background dialog")},eb=()=>{window.history.length>=2?i.back():i.push("/dashboard")},ev=()=>{null==m||m.executeCommand("toggleVideo")},ew=()=>{null==m||m.executeCommand("toggleAudio")},ey=()=>{null==m||m.executeCommand("toggleChat")};if((0,s.useEffect)(()=>{let e=localStorage.getItem(tQ.B.VideoRoomBackground);if(e){w(JSON.parse(e));return}w(r.filter(e=>e.type===ex.Bf.Image)[0])},[r]),(0,s.useEffect)(()=>{if(i.query.roomId){let e=async()=>{let e=i.query.roomId;try{let i=await t.room.join(e);if(200!==i.status||!i.data.token)throw Error("Failed to join room");p(i.data),F(tw(i.data.roomType)),i.data.roomType===ex.nW.Private&&g(i.data.roomCode)}catch(e){i.push("/404")}};e()}},[i,i.query,t.room,null==n?void 0:n.id]),(0,s.useEffect)(()=>{if(m)return y(m.getNumberOfParticipants()),m.on("videoConferenceJoined",ed),null==m||m.on("participantJoined",el),null==m||m.on("participantLeft",es),null==m||m.on("videoMuteStatusChanged",ec),null==m||m.on("tileViewChanged",eu),null==m||m.on("participantsPaneChanged",ep),null==m||m.on("audioMuteStatusChanged",eh),null==m||m.on("screenSharingStatusChanged",eh),null==m||m.on("chatUpdated",eg),()=>{m.off("videoConferenceJoined",ed),null==m||m.off("participantJoined",el),null==m||m.off("participantLeft",es),null==m||m.off("videoMuteStatusChanged",ec),null==m||m.off("tileViewChanged",eu),null==m||m.off("participantsPaneChanged",ep),null==m||m.off("audioMuteStatusChanged",eh),null==m||m.off("screenSharingStatusChanged",em),null==m||m.off("chatUpdated",eg)}},[m]),(0,s.useEffect)(()=>{er()},[C]),(0,s.useEffect)(()=>{let t=i.asPath,n=t=>(t.preventDefault(),t.returnValue=X?e("roomIdPage.leaveRoomAndQueueConfirmation"):e("roomIdPage.leaveRoomConfirmation")),r=n=>{if(t!==n&&"/404/"!==n&&!confirm(X?e("roomIdPage.leaveRoomAndQueueConfirmation"):e("roomIdPage.leaveRoomConfirmation")))throw i.events.emit("routeChangeError"),window.history.pushState(null,"",t),"routeChange aborted."};return window.addEventListener("beforeunload",n),i.events.on("routeChangeStart",r),()=>{window.removeEventListener("beforeunload",n),i.events.off("routeChangeStart",r)}},[i,C,X]),!u)return(0,l.jsx)(R.Z,{sx:ie.spinner,children:(0,l.jsx)(tb.Z,{})});let eZ={api:m,isVideoOn:Z,isMicOn:k,chatState:_,isPartipantInfoOn:D,isScreenSharing:I,isSettingsOpen:O,numberOfParticipants:C,roomFeatures:B,roomId:i.query.roomId,showWhiteboard:$,onLeaveRoom:eb,onToggleVideo:ev,onToggleChat:ey,onToggleMic:ew,onToggleSettings:ej,onToggleShareScreen:ef,toggleWhiteboard:en,onJoinQueue:ea},eS={roomId:i.query.roomId,roomToken:u,roomFeatures:B,setApi:f,videoRef:U,toolbarButtons:[o.Camera,o.Microphone,o.SelectBackgroun
1d,o.Settings]},ek={jitsiProps:eS,toolbarProps:eZ,selectedBackground:v,numberOfParticipants:C,handleOpenBackgroundDialog:ee,handleBackgroundDialogClose:et,handleBackgroundChange:ei,isBackgroundDialogOpen:j,loadingVideo:G,setLoadingVideo:J,isLargeVideoMode:z,onCloseLargeVideo:eo,conferenceJoined:A,roomCode:x,showWhiteboard:$,toggleWhiteboard:en,onJoinQueue:ea};return q.isMobileOrTablet?(0,l.jsx)(ia,{...ek}):(0,l.jsx)(io,{...ek,setNavVisible:h,navVisible:c,mediaGroups:r,soundGroups:a})};var ir=ii;let io=e=>{var t,i,n;let r=(0,k.Z)(),o={width:"100%",height:"100%",flexGrow:1,borderRadius:20,transition:"width 0.2s ease-in-out, height 0.2s ease-in-out"},a={width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",opacity:e.conferenceJoined?e.toolbarProps.isVideoOn?1:0:1},s=e.numberOfParticipants>1?o:a,d=e.numberOfParticipants>1?o:{height:"100%",width:"100%",maxHeight:600,maxWidth:800,borderRadius:20,overflow:"hidden",transition:"width 0.2s ease-in-out, height 0.2s ease-in-out",background:"rgb(0 0 0 / 57%)"};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,l.jsx)(tf.Z,{navWidth:300,navVisible:!1,collapsedNavWidth:80,hidden:!1,navigationBorderWidth:10,toggleNavVisibility:()=>null,settings:{skin:"default",mode:"dark",appBar:void 0,footer:void 0,navHidden:void 0,appBarBlur:!1,direction:"ltr",navCollapsed:!e.navVisible,themeColor:"error",contentWidth:"full",layout:void 0,lastLayout:void 0,verticalNavToggleType:"collapse",toastPosition:void 0},setNavVisible:e.setNavVisible,saveSettings:function(e){throw Error("Function not implemented.")},navMenuContent:void 0,navMenuBranding:e=>e.navHover?(0,l.jsx)(O(),{src:t$,alt:"StudyCafe Logo",style:{width:"120px",height:"33px"}}):(0,l.jsx)(O(),{src:tq.Z,alt:"StudyCafe Logo",style:{marginLeft:10}}),menuLockedIcon:void 0,verticalNavItems:(0,tm.f)("dark"),navMenuProps:void 0,menuUnlockedIcon:void 0,afterNavMenuContent:void 0,beforeNavMenuContent:void 0,children:(0,l.jsx)(l.Fragment,{})}),(0,l.jsx)(er.ZP,{container:!0,direction:"row",style:{padding:"20px 40px"},children:(0,l.jsxs)(er.ZP,{container:!0,direction:"column",children:[e.conferenceJoined&&(0,l.jsx)(er.ZP,{item:!0,children:(0,l.jsxs)(tc.Z,{direction:"row",spacing:2,children:[(0,l.jsx)(tG,{}),(0,l.jsx)(it,{roomCode:e.roomCode}),(0,l.jsx)(tg,{isBackgroundDialogOpen:e.isBackgroundDialogOpen,handleOpenBackgroundDialog:e.handleOpenBackgroundDialog,handleBackgroundDialogClose:e.handleBackgroundDialogClose,handleBackgroundChange:e.handleBackgroundChange,backgroundImageOptions:e.mediaGroups,soundGroups:e.soundGroups})]})}),(0,l.jsxs)(er.ZP,{container:!0,direction:"column",flex:1,flexGrow:1,sx:{height:"100%",position:"relative"},children:[(0,l.jsxs)(er.ZP,{item:!0,flex:1,flexGrow:1,id:"video-container",style:{...s},children:[e.isLargeVideoMode&&e.numberOfParticipants>1&&(0,l.jsx)(R.Z,{sx:{position:"relative",zIndex:11},children:(0,l.jsx)(T.Z,{sx:{position:"absolute",top:"-20px",right:"-20px",zIndex:12,overflow:"visible"},onClick:e.onCloseLargeVideo,children:(0,l.jsx)(t7,{})})}),(0,l.jsx)(e_.XJ,{id:"video-section",style:d,children:(0,l.jsx)(t0,{...e.jitsiProps})})]}),e.conferenceJoined&&(0,l.jsx)(e_.XJ,{children:(0,l.jsx)(er.ZP,{item:!0,children:(0,l.jsx)(e9,{...e.toolbarProps})})})]})]})}),(0,l.jsx)("div",{id:"bg",style:{position:"absolute",filter:e.conferenceJoined?"":"blur(10px)",backgroundImage:"url(".concat(null===(t=e.selectedBackground)||void 0===t?void 0:t.mediaSrc,")"),backgroundColor:r.palette.grey[900],height:"100%",width:"100%",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",zIndex:-1,top:0},children:(null===(i=e.selectedBackground)||void 0===i?void 0:i.type)===ex.Bf.Video&&(0,l.jsxs)("div",{children:[!e.loadingVideo&&(0,l.jsx)("div",{id:"video-placeholder-bg",style:{position:"absolute",backgroundImage:"url(".concat(null===(n=e.selectedBackground)||void 0===n?void 0:n.thumbnailSrc,")"),backgroundColor:r.palette.common.black,height:"100%",width:"100%",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",zIndex:-1,top:0,filter:"blur(9px)"}}
1),(0,l.jsx)("video",{src:e.selectedBackground.mediaSrc||"",autoPlay:!0,onLoadedData:()=>e.setLoadingVideo(!1),muted:!0,loop:!0,style:{objectFit:"cover",width:"100vw",height:"100vh",position:"fixed",top:0,left:0}})]})})]}),(0,l.jsx)(tv.Z,{open:e.showWhiteboard,onClose:e.toggleWhiteboard,component:"div",keepMounted:!0,sx:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",borderRadius:"8px",width:"80%",height:"80%",zIndex:98,overflow:"hidden"},children:(0,l.jsx)(t3,{roomId:e.jitsiProps.roomId,onDismiss:e.toggleWhiteboard,isOpen:e.showWhiteboard})})]})},ia=e=>{var t;let i=(0,d.useRouter)();return s.useEffect(()=>{let e=()=>{let e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh","".concat(e,"px"))};return e(),window.addEventListener("resize",e),document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",()=>{window.removeEventListener("resize",e),document.body.style.overflow="auto",document.documentElement.style.overflow="auto"}},[]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(R.Z,{className:"fullscreen-container",sx:{height:"calc(var(--vh, 1vh) * 100)",overflow:"hidden",backgroundImage:"url(".concat(null===(t=e.selectedBackground)||void 0===t?void 0:t.thumbnailSrc,")"),backgroundRepeat:"no-repeat",backgroundSize:"cover",position:"relative"},children:[(0,l.jsx)(it,{roomCode:e.roomCode}),(0,l.jsx)(T.Z,{sx:{position:"absolute",top:"5px",left:"0px",zIndex:12,overflow:"visible"},onClick:()=>{window.history.length>=2?i.back():window.close()}}),(0,l.jsx)(R.Z,{sx:{height:"calc(100% - 100px)",padding:"10% 5%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,l.jsx)(R.Z,{sx:{flex:1,width:"100%"},children:(0,l.jsx)(t0,{...e.jitsiProps})})}),e.conferenceJoined&&(0,l.jsx)(e9,{...e.toolbarProps})]}),e.conferenceJoined&&(0,l.jsx)(tv.Z,{open:e.showWhiteboard,onClose:e.toggleWhiteboard,component:"div",keepMounted:!0,children:(0,l.jsx)(t3,{roomId:e.jitsiProps.roomId,onDismiss:e.toggleWhiteboard,isOpen:e.showWhiteboard})})]})}}}]);
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.