1"use strict";(self.webpackChunkrefactor=self.webpackChunkrefactor||[]).push([[1033],{65303:(e,s,n)=>{n.d(s,{n:()=>c});var o=n(89379),t=n(9950),l=n(17119);const d="hint_tooltip_hint_tooltip__9Hp2I",i="hint_tooltip_cursor_tooltip_above__bnhas";var r=n(44414);function a(e,s){if(e.endsWith("%")){const n=Number.parseFloat(e);return Number.isNaN(n)?0:s*n/100}const n=Number.parseFloat(e);return Number.isNaN(n)?0:n}const c=e=>{var s,n,c,u;let{hint:v,gapPx:m=4,leftPx:h="0",renderInPortal:p=!1,anchorRef:g,cursorPosition:x,minWidthPx:f}=e;const[y,j]=(0,t.useState)(null),[I,L]=(0,t.useState)(null),w=(0,t.useRef)(null),C=Boolean(null===v||void 0===v?void 0:v.length),_=Boolean(x),A=(0,t.useMemo)((()=>(0,o.A)({"--gap":"".concat(m,"px"),"--left":h},f?{minWidth:"".concat(f,"px")}:{})),[m,h,f]),b=(0,t.useMemo)((()=>(0,o.A)({"--gap":"0px","--left":"0px"},f?{minWidth:"".concat(f,"px")}:{})),[f]);if((0,t.useLayoutEffect)((()=>{if(!C||!p||_||null===g||void 0===g||!g.current)return void j(null);let e=0;const s=()=>{const e=g.current;if(!e)return;const s=e.getBoundingClientRect();j({top:s.bottom+m,left:s.left+a(h,s.width)})},n=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(s)};return n(),window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}}),[g,m,_,C,h,p]),(0,t.useLayoutEffect)((()=>{var e,s,n;if(!C||!p||!x||!w.current)return void L(null);const o=w.current.getBoundingClientRect(),t=null===g||void 0===g||null===(e=g.current)||void 0===e?void 0:e.getBoundingClientRect(),l=x.x-o.width/2,d=Math.max(8,window.innerWidth-o.width-8),i=Math.min(Math.max(l,8),d),r=Math.min(Math.max(x.x-i,16),o.width-16),a=(null!==(s=null===t||void 0===t?void 0:t.bottom)&&void 0!==s?s:x.y)+m,c=a+o.height+8<=window.innerHeight,u=c?"below":"above",v=c?a:Math.max(8,(null!==(n=null===t||void 0===t?void 0:t.top)&&void 0!==n?n:x.y)-o.height-m);L({top:v,left:i,arrowLeft:r,placement:u})}),[g,x,m,C,v,f,p]),!C)return null;const M=(0,r.jsx)("div",{className:d,style:A,children:v.map((e=>(0,r.jsx)("li",{children:e},e)))});return p&&(x||null!==g&&void 0!==g&&g.current)&&"undefined"!==typeof document?(0,l.createPortal)((0,r.jsx)("div",{className:x&&"above"===(null===I||void 0===I?void 0:I.placement)?i:void 0,style:{position:"fixed",top:x?null!==(s=null===I||void 0===I?void 0:I.top)&&void 0!==s?s:-9999:null!==(n=null===y||void 0===y?void 0:y.top)&&void 0!==n?n:-9999,left:x?null!==(c=null===I||void 0===I?void 0:I.left)&&void 0!==c?c:-9999:null!==(u=null===y||void 0===y?void 0:y.left)&&void 0!==u?u:-9999,zIndex:1e4,pointerEvents:x?"none":void 0},children:(0,r.jsx)("div",{ref:w,className:d,style:I?(0,o.A)((0,o.A)({},b),{},{"--arrow-left":"".concat(I.arrowLeft,"px")}):b,children:v.map((e=>(0,r.jsx)("li",{children:e},e)))})}),document.body):M}},83988:(e,s,n)=>{n.d(s,{I:()=>v});var o=n(9950),t=n(55491),l=n(26197),d=n(65303);const i="profile_search_field_search_wrapper__suqL5",r="profile_search_field_search_container__wH9Wr",a="profile_search_field_search_input__Uz+xM",c="profile_search_field_search_button__vJa6Q";var u=n(44414);const v=e=>{let{value:s,onChange:n,placeholder:v="Search profiles...",hint:m=["Name","ID"],onSubmit:h,submitLabel:p="Search",disabled:g=!1}=e;const[x,f]=(0,o.useState)(!1);return(0,u.jsxs)("div",{className:i,children:[(0,u.jsxs)("div",{className:r,children:[(0,u.jsx)("input",{type:"text",value:s,onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key&&h&&!g&&(e.preventDefault(),h())},placeholder:v,className:a,onFocus:()=>f(!0),onBlur:()=>f(!1)}),h&&(0,u.jsxs)("button",{type:"button",onClick:h,className:c,"aria-label":p,disabled:g,children:[(0,u.jsx)("span",{children:p}),(0,u.jsx)(l.gc,{icon:t.HYz,size:"lg"})]})]}),x&&(0,u.jsx)(d.n,{hint:m,gapPx:10})]})}},71033:(e,s,n)=>{n.d(s,{W:()=>N});var o=n(9950),t=n(26197),l=n(42074),d=n(39324),i=n(96142),r=n(95379),a=n(63479),c=n(74465),u=n(50717),v=n(89379),m=n(44414);const h=e=>{let{styles:s,item:n,status:t,results:l,setModulesPageSt:d}=e;const i=(0,o.useRef)(null),r="Finished"===t,a=null===l||void 0===l?void 0:l.find((e=>(null===e||void 0===e?void 0:e.id)===(null===n||void 0===n?void 0:n.id))),c=()=>{i.current&&(i.current.style.height="auto",i.current.style.height="".concat(i.current.scrollHeight,"px"))};(0,o.useEffect)((()=>{c()}
1),[a]),(0,o.useEffect)((()=>{const e=sessionStorage.getItem("textAnswer_".concat(n.id));return null!==e&&u(e),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)}),[]);const u=e=>{sessionStorage.setItem("textAnswer_".concat(null===n||void 0===n?void 0:n.id),e),d((s=>{const{openLesson:o}=s||{},{results:t=[]}=o||{},l=t.some((e=>{let{id:s}=e;return s===n.id}))?t.map((s=>s.id===n.id?(0,v.A)((0,v.A)({},s),{},{answer:e}):s)):[...t,{id:n.id,answer:e}];return(0,v.A)((0,v.A)({},s),{},{openLesson:(0,v.A)((0,v.A)({},o),{},{results:l})})}))};return(0,m.jsxs)("div",{className:s.tests,children:[(0,m.jsx)("h4",{dangerouslySetInnerHTML:{__html:n.question.text.replace(/\n/g,"<br>")}}),n.question.img&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:n.question.img}}),(0,m.jsxs)("ul",{children:["text"!==n.question.type&&n.answers.map(((e,s)=>{var o;return(0,m.jsxs)("li",{children:[(0,m.jsx)("input",{type:n.question.type,checked:!(null===a||void 0===a||null===(o=a.answers)||void 0===o||!o.includes(null===e||void 0===e?void 0:e.id)),onChange:()=>(e=>{var s;null!==n&&void 0!==n&&null!==(s=n.question)&&void 0!==s&&s.type&&d((s=>{const{openLesson:o}=s||{},{results:t=[]}=o||{},l="radio"===n.question.type,d=t.some((e=>{let{id:s}=e;return s===n.id}))?t.map((s=>s.id===n.id?(0,v.A)((0,v.A)({},s),{},{answers:l?[e]:s.answers.includes(e)?s.answers.filter((s=>s!==e)):[...s.answers,e]}):s)):[...t,{id:n.id,answers:[e]}];return(0,v.A)((0,v.A)({},s),{},{openLesson:(0,v.A)((0,v.A)({},o),{},{results:d})})}))})(null===e||void 0===e?void 0:e.id),disabled:r}),e.text,e.img&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:e.img}})]},s)})),"text"===n.question.type&&(0,m.jsx)("textarea",{rows:1,ref:i,spellCheck:!1,readOnly:r,placeholder:"Enter your answer...",value:(null===a||void 0===a?void 0:a.answer)||"",onChange:e=>u(e.target.value)})]})]})},p=e=>{var s,n,t,l;let{styles:d,openLesson:i,traineeId:v,getModulesOfCourse:p,setModulesPageSt:g}=e;const x=(0,o.useRef)(null),f=(null===i||void 0===i||null===(s=i.content)||void 0===s||null===(n=s.filter((e=>"test"===(null===e||void 0===e?void 0:e.type))))||void 0===n?void 0:n.length)!==(null===i||void 0===i||null===(t=i.results)||void 0===t?void 0:t.length);(0,o.useEffect)((()=>{x.current&&(x.current.scrollTop=0)}),[null===i||void 0===i?void 0:i.lessonId]);return(0,m.jsxs)("div",{className:d.content_container,children:[!(null!==i&&void 0!==i&&i.content)&&(0,m.jsx)("div",{className:d.text_clue,children:"No content. Select the lesson you need."}),"On moderation"===(null===i||void 0===i?void 0:i.status)&&(0,m.jsxs)("div",{className:d.checking_body,children:[(0,m.jsx)("img",{src:"https://i.ibb.co/nQ8nFNJ/photo-2023-06-14-00-31-26copy-removebg-preview.png",alt:""}),(0,m.jsx)("p",{children:"Your answers on moderation."})]}),(null===i||void 0===i?void 0:i.content)&&"On moderation"!==(null===i||void 0===i?void 0:i.status)&&(0,m.jsx)("div",{className:d.content_div,ref:x,children:null===i||void 0===i||null===(l=i.content)||void 0===l?void 0:l.map(((e,s)=>["text","image","media"].includes(null===e||void 0===e?void 0:e.type)?(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:null===e||void 0===e?void 0:e.content}},s):"test"===(null===e||void 0===e?void 0:e.type)?(0,m.jsx)(h,{styles:d,item:e,status:null===i||void 0===i?void 0:i.status,results:null===i||void 0===i?void 0:i.results,setModulesPageSt:g},s):null))}),"In progress"===(null===i||void 0===i?void 0:i.status)&&(0,m.jsx)("div",{onClick:async()=>{if(!f)try{(0,a.ZH)(!0);const{data:e}=await c.LV.post(u.KZ,{lessonId:null===i||void 0===i?void 0:i.lessonId,traineeId:v,results:null===i||void 0===i?void 0:i.results});if(!e.success)throw new Error(null===e||void 0===e?void 0:e.message);Object.keys(sessionStorage).forEach((e=>{e.startsWith("textAnswer_")&&sessionStorage.removeItem(e)})),await p()}catch(e){(0,r.FX)({success:!1,text:(null===e||void 0===e?void 0:e.message)||"ERROR: Failed to set lesson answer."})}finally{(0,a.ZH)(!1)}},className:"".concat(d.next_lesson_btn," ").concat(f&&d.disabled),children:"Next lesson"})]})},g=e=>{let{styles:s,openLessonContent:n}=e;const t=(0,o.useRef)(null);(0,o.useEffect)((()=>{t.current&&(t.current.scrollTop=0),document.querySelectorAll(".courses_tust_block img").forEach((e=>
1{e.src.includes("files.besocial.tech")||(e.style.border="2px solid red")}))}),[n]);return(0,m.jsxs)("div",{className:s.content_container,children:[!n&&(0,m.jsx)("div",{className:s.text_clue,children:"No content. Select the lesson you need."}),n&&(0,m.jsx)("div",{className:s.content_div,ref:t,children:null===n||void 0===n?void 0:n.map(((e,n)=>{return["text","image","media"].includes(null===e||void 0===e?void 0:e.type)?(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:null===e||void 0===e?void 0:e.content}},n):"test"===(null===e||void 0===e?void 0:e.type)?(0,m.jsxs)("div",{className:s.tests,children:[(0,m.jsx)("h4",{dangerouslySetInnerHTML:{__html:(i=null===e||void 0===e||null===(o=e.question)||void 0===o?void 0:o.text,i.replace(/\n/g,"<br>"))}}),(null===e||void 0===e||null===(t=e.question)||void 0===t?void 0:t.img)&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:null===e||void 0===e||null===(l=e.question)||void 0===l?void 0:l.img}}),(0,m.jsx)("ul",{children:"text"!==(null===e||void 0===e||null===(d=e.question)||void 0===d?void 0:d.type)?null===e||void 0===e?void 0:e.answers.map(((n,o)=>{var t;return(0,m.jsxs)("div",{className:s.div_one_answer,children:[(0,m.jsx)("input",{style:{margin:"0 5px 0 0",pointerEvents:"none"},type:null===e||void 0===e||null===(t=e.question)||void 0===t?void 0:t.type,checked:null===n||void 0===n?void 0:n.isCorrectAnswer,readOnly:!0}),(0,m.jsx)("li",{children:n.text}),(null===n||void 0===n?void 0:n.img)&&(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:null===n||void 0===n?void 0:n.img}})]},o)})):(0,m.jsx)("textarea",{rows:1,readOnly:!0,placeholder:"Trainee must enter own answer..."})})]},n):null;var o,t,l,d,i}))})]})};var x=n(28429);const f=(e,s)=>"mentor"===e?{modules:[],showHiddenLesson:!1,searchLesson:"",openLesson:{},importLesson:null,updateModule:null,updateLesson:null,editAccess:!s||null,courseId:null}:{modules:[],openLesson:{},courseId:null},y=e=>{let{mode:s,requiresEditingAccess:n=!0}=e;const{id:t}=(0,x.g)(),l=(0,o.useMemo)((()=>(e=>"mentor"===e?u.mU:u.p5)(s)),[s]),d="mentor"===s,[i,m]=(0,o.useState)(f(s,n)),h=(0,o.useRef)(t),p=(0,o.useRef)(null),g=(0,o.useRef)(0),y=(0,o.useRef)(0),j=(0,o.useRef)(!0);h.current=t;const I=(0,o.useCallback)((async()=>{if(!d||!n)return;const e=t;try{const{data:s}=await c.LV.post(u.eY,{courseId:e});if(!s.success)throw new Error(null===s||void 0===s?void 0:s.message);if(!j.current||h.current!==e)return;m((e=>(0,v.A)((0,v.A)({},e),{},{editAccess:null===s||void 0===s?void 0:s.data})))}catch(s){if(!j.current||h.current!==e)return;(0,r.FX)({success:!1,text:(null===s||void 0===s?void 0:s.message)||"ERROR: Failed to retrieve lesson content."})}}),[t,d,n]),L=(0,o.useCallback)((async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;const n=++g.current,o=(null===e||void 0===e?void 0:e.lessonId)||e;try{(0,a.ZH)(!0);const{data:t}=await c.LV.post(u.J4,{lessonId:o});if(!t.success)throw new Error(null===t||void 0===t?void 0:t.message);if(!j.current||h.current!==s||g.current!==n)return;let i=[];if(!d&&"Finished"===(null===e||void 0===e?void 0:e.status)){var l;const{data:t}=await c.LV.post(u.iF,{lessonId:o,answerId:null===e||void 0===e?void 0:e.answerId});if(!t.success)throw new Error(null===t||void 0===t?void 0:t.message);if(!j.current||h.current!==s||g.current!==n)return;i=null===t||void 0===t||null===(l=t.data)||void 0===l?void 0:l.results}p.current=o,m((s=>(0,v.A)((0,v.A)({},s),{},{openLesson:(0,v.A)((0,v.A)((0,v.A)({},null===t||void 0===t?void 0:t.data),e),{},{results:i,id:o})})))}catch(i){if(!j.current||h.current!==s||g.current!==n)return;(0,r.FX)({success:!1,text:(null===i||void 0===i?void 0:i.message)||"ERROR: Failed to retrieve lesson content."})}finally{(0,a.ZH)(!1)}}),[t,d]),w=(0,o.useCallback)((async function(){let{refreshOpenLesson:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=t,n=++y.current;try{var o;(0,a.ZH)(!0);const{data:t}=await c.LV.post(l,{courseId:s});if(!t.success)throw new Error(null===t||void 0===t?void 0:t.message);if(!j.current||h.current!==s||y.current!==n)return;const i=(null===t||void 0===t||null===(o=t.data)||void 0===o?void 0:o.modules)||[],r=e?p.current:null;if(r&&await L(r,s),!d&&e&&r)for(const e of i){const n=(e.lessons||[]).find((e=>{let{status:s}=e;return["In progress","On moderation"].includes(s)}));if(n){await L(n,s);break}}if(!j.current||h.current!==s||y.current!==n)return;m((e=>(0,v.A)((0,v.A)({},e),{},{modules:i,courseId:s})))}catch(i){if(!j.current||h.current!==s||y.current!==n)return;(0,r.FX)({success:!1,text:(null===i||void 0===i?void 0:i.message)||"ERROR: Failed to retrieve the trainee list."})}finally{(0,a.ZH)(!1)}}),[t,l,d,L]);(0,o.useEffect)((()=>(j.current=!0,()=>{j.current=!1,g.current+=1,y.current+=1})),[]),(0,o.useEffect)((()=>{p.current=null,g.current+=1,y.current+=1,m(f(s,n)),w({refreshOpenLesson:!1})}),[t,w,s,n]),(0,o.useEffect)((()=>{m((e=>(0,v.A)((0,v.A)({},e),{},{editAccess:!n||null,courseId:t}))),n&&I()}),[t,I,n]);const C=d?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").trim().toLowerCase();return e.filter((e=>s||!e.isHidden)).map((e=>(0,v.A)((0,v.A)({},e),{},{lessons:(e.lessons||[]).filter((e=>{var o;const t=s||!e.isHidden,l=!n||(null===(o=e.name)||void 0===o?void 0:o.toLowerCase().includes(n));return t&&l}))})))}(null===i||void 0===i?void 0:i.modules,null===i||void 0===i?void 0:i.searchLesson,null===i||void 0===i?void 0:i.showHiddenLesson):null===i||void 0===i?void 0:i.modules;return{modulesPageSt:i,setModulesPageSt:m,getContentOfLesson:L,getModulesOfCourse:w,visibleModules:C,courseId:t}};var j=n(83988);const I=e=>{let{styles:s,coursesPath:n,courseId:o,editAccess:i,showHiddenLesson:r,searchLesson:a,setModulesPageSt:c}=e;return(0,m.jsxs)("div",{className:s.header,children:[(0,m.jsxs)(l.k2,{to:n,className:s.back_arrow,children:[(0,m.jsx)(t.gc,{icon:d.Uec,size:"lg"}),"Return"]}),i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("button",{className:s.director_btn,onClick:()=>c((e=>(0,v.A)((0,v.A)({},e),{},{updateModule:{name:"",courseId:o}}))),children:[(0,m.jsx)(t.gc,{icon:d.QLR,size:"lg",style:{marginRight:"5px"}}),"Module"]}),(0,m.jsxs)("button",{className:s.common_btn,onClick:()=>c((e=>(0,v.A)((0,v.A)({},e),{},{showHiddenLesson:!e.showHiddenLesson}))),children:[(0,m.jsx)(t.gc,{icon:r?d.npb:d.tKC,size:"lg"}),(0,m.jsx)("span",{children:"Hidden"})]})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{}),(0,m.jsx)("div",{})]}),(0,m.jsx)("div",{}),(0,m.jsx)(j.I,{value:a,onChange:e=>c((s=>(0,v.A)((0,v.A)({},s),{},{searchLesson:e}))),placeholder:"Search lessons...",hint:["Name"]})]})};var L=n(68553);const w=e=>{var s;let{styles:n,mode:o,ls:l,editAccess:d,lessonArray:i,openLessonId:a,setModulesPageSt:h,handleAutoScroll:p,getContentOfLesson:g}=e;const x="mentor"===o,f=async e=>{try{const{data:s}=await c.LV.post(u.Wd,{moduleId:null===l||void 0===l?void 0:l.moduleId,lessonPositions:e.map((e=>{let{lessonId:s}=e;return s}))});if(!s.success)throw new Error(null===s||void 0===s?void 0:s.message);h((s=>{var n;return(0,v.A)((0,v.A)({},s),{},{modules:null===s||void 0===s||null===(n=s.modules)||void 0===n?void 0:n.map((s=>(null===s||void 0===s?void 0:s.courseId)===(null===l||void 0===l?void 0:l.courseId)&&(null===s||void 0===s?void 0:s.moduleId)===(null===l||void 0===l?void 0:l.moduleId)?(0,v.A)((0,v.A)({},s),{},{lessons:e}):s))})}))}catch(s){(0,r.FX)({success:!1,text:(null===s||void 0===s?void 0:s.message)||"ERROR: Failed to update lesson position."})}};return(0,m.jsxs)("div",{className:"".concat(n.lesson_wrapper," ").concat((null===l||void 0===l?void 0:l.lessonId)===a&&n.selected),children:[(0,m.jsx)("div",{className:n.circle_status_lesson,children:(0,m.jsx)("div",{className:"".concat(n.big_circle," ").concat(x?"":n[null===l||void 0===l||null===(s=l.status)||void 0===s?void 0:s.toLowerCase()]),children:(0,m.jsx)("div",{className:n.small_circle})})}),(0,m.jsx)("div",{className:n.lesson_item,draggable:x&&d,onDragStart:e=>{x&&d&&e.dataTransfer.setData("lessonId",null===l||void 0===l?void 0:l.lessonId)},onDragOver:e=>{x&&d&&(e.preventDefault(),null===p||void 0===p||p(e))},onDrop:x&&d?e=>((e,s)=>{if(!x||!d)return;e.preventDefault(),e.stopPropagation();const n=e.dataTransfer.getData("lessonId");if(!n||n===s)return;const o=i.findIndex((e=>e.lessonId===n)),t=i.findIndex((e=>e.lessonId===s));if(-1===o||-1===t)return;const l=[...i],[r]=l.splice(o,1);l.splice(t,0,r),f(l)})(e,null===l||void 0===l?void 0:l.lessonId):void 0,onClick:()=>g(l),children:(0,m.jsx)("p",{title:null===l||void 0===l?void 0:l.name,children:null===l||void 0===l?void 0:l.name})}),x&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("span",{children:d&&(0,m.jsx)(t.gc,{icon:L.LFz,size:"lg",style:{cursor:"pointer"},onClick:()=>h((e=>(0,v.A)((0,v.A)({},e),{},{updateLesson:{lessonId:null===l||void 0===l?void 0:l.lessonId,name:null===l||void 0===l?void 0:l.name,isHidden:null===l||void 0===l?void 0:l.isHidden}})))})}),(0,m.jsx)("div",{})]})]})},C=e=>{var s;let{styles:n,mode:l,courseId:i,item:a,modules:h,editAccess:p,openLessonId:g,setModulesPageSt:x,getContentOfLesson:f}=e;const[y,j]=(0,o.useState)(!1),I="mentor"===l,C=e=>{if(!I||!p)return;const s=document.getElementById("container_module");if(!s)return;const{clientY:n}=e,{top:o,height:t}=s.getBoundingClientRect();n<o+100?s.scrollBy({top:-20,behavior:"smooth"}):n>o+t-100&&s.scrollBy({top:20,behavior:"smooth"})},_=async e=>{try{const{data:s}=await c.LV.post(u.Wv,{courseId:null===a||void 0===a?void 0:a.courseId,modulePositions:e.map((e=>{let{moduleId:s}=e;return s}))});if(!s.success)throw new Error(null===s||void 0===s?void 0:s.message);x((s=>(0,v.A)((0,v.A)({},s),{},{modules:e})))}catch(s){(0,r.FX)({success:!1,text:(null===s||void 0===s?void 0:s.message)||"ERROR: Failed to update module position."})}},A=y?d.dzk:d.ivC;return(0,m.jsxs)("div",{className:"".concat(n.module_block," ").concat(y&&n.active),draggable:I&&p,onDragStart:e=>{I&&p&&e.dataTransfer.setData("moduleId",a.moduleId)},onDragOver:e=>{I&&p&&(e.preventDefault(),C(e))},onDrop:I&&p?e=>((e,s)=>{if(!I||!p)return;const n=e.dataTransfer.getData("moduleId");if(!n)return;const o=[...h||[]],t=o.findIndex((e=>{let{moduleId:s}=e;return s===n})),l=o.findIndex((e=>{let{moduleId:n}=e;return n===s}));if(-1===t||-1===l)return;const[d]=o.splice(t,1);o.splice(l,0,d),_(o)})(e,a.moduleId):void 0,children:[(0,m.jsxs)("div",{className:n.modules_item,onClick:()=>j(!y),children:[(0,m.jsx)("div",{className:n.svg_block,children:(0,m.jsx)(t.gc,{icon:A,size:"xl"})}),(0,m.jsx)("p",{title:null===a||void 0===a?void 0:a.name,children:null===a||void 0===a?void 0:a.name}),I&&(p?(0,m.jsx)(t.gc,{icon:L.LFz,size:"lg",onClick:()=>x((e=>(0,v.A)((0,v.A)({},e),{},{updateModule:{moduleId:a.moduleId,name:null===a||void 0===a?void 0:a.name,isHidden:null===a||void 0===a?void 0:a.isHidden}})))}):(0,m.jsx)("span",{})),(0,m.jsx)("span",{children:(null===a||void 0===a||null===(s=a.lessons)||void 0===s?void 0:s.length)||0})]}),y&&(0,m.jsxs)("div",{className:n.item_lessons_block,children:[((null===a||void 0===a?void 0:a.lessons)||[]).map((e=>(0,m.jsx)(w,{styles:n,mode:l,ls:e,lessonArray:null===a||void 0===a?void 0:a.lessons,editAccess:p,openLessonId:g,setModulesPageSt:x,handleAutoScroll:C,getContentOfLesson:f},null===e||void 0===e?void 0:e.lessonId))),I&&p&&(0,m.jsxs)("div",{className:n.add_lesson_btn,children:[(0,m.jsx)("span",{title:"import lesson",children:(0,m.jsx)(t.gc,{icon:d.$MS,size:"lg",onClick:()=>x((e=>(0,v.A)((0,v.A)({},e),{},{importLesson:null===a||void 0===a?void 0:a.moduleId})))})}),(0,m.jsxs)("div",{className:n.add_lesson,onClick:()=>x((e=>(0,v.A)((0,v.A)({},e),{},{updateLesson:{moduleId:null===a||void 0===a?void 0:a.moduleId,courseId:i}}))),children:[(0,m.jsx)(t.gc,{icon:d.QLR,size:"sm"}),(0,m.jsx)("span",{children:"Lesson"})]})]})]})]})},_=e=>{let{styles:s,mode:n,courseId:o,modules:t,editAccess:l,openLessonId:d,setModulesPageSt:i=()=>{},getContentOfLesson:r}=e;return(0,m.jsx)("div",{id:"container_module",className:s.modules_list,children:(t||[]).map((e=>(0,m.jsx)(C,{styles:s,mode:n,courseId:o,modules:t,editAccess:l,item:e,openLessonId:d,setModulesPageSt:i,getContentOfLesson:r},null===e||void 0===e?void 0:e.moduleId)))})},A=e=>{let{styles:s,mode:n,courseId:o,modules:t,visibleModules:l,editAccess:d,openLesson:i,setModulesPageSt:r,getContentOfLesson:a,contentNode:c}=e;return(0,m.jsxs)("div",{className:s.body,children:[(0,m.jsx)(_,{mode:n,styles:s,courseId:o,modules:l||t,editAccess:d,openLessonId:(null===i||void 0===i?void 0:i.id)||(null===i||void 0===i?void 0:i.lessonId),setModulesPageSt:r,getContentOfLesson:a}),c]})},b=(0,o.lazy)((()=>n.e(616).then(n.bind(n,50616)).then((e=>({default:e.ImportLesson}))))),M=(0,o.lazy)((()=>n.e(7244).then(n.bind(n,7244)).then((e=>({default:e.UpdateModuleDialog}
1))))),S=(0,o.lazy)((()=>Promise.all([n.e(5131),n.e(7132)]).then(n.bind(n,97132)).then((e=>({default:e.UpdateLessonDialog}))))),N=e=>{var s;let{styles:n,coursesPath:r,mode:a="trainee",requiresEditingAccess:c=!0,tinyCommentsMode:u="embedded"}=e;const{user:v}=(0,i.As)(),{modulesPageSt:h,setModulesPageSt:x,getContentOfLesson:f,getModulesOfCourse:j,visibleModules:L,courseId:w}=y({mode:a,requiresEditingAccess:c}),C="mentor"===a,_=C?(0,m.jsx)(g,{styles:n,openLessonContent:null===h||void 0===h||null===(s=h.openLesson)||void 0===s?void 0:s.content}):(0,m.jsx)(p,{styles:n,openLesson:null===h||void 0===h?void 0:h.openLesson,traineeId:null===v||void 0===v?void 0:v.id,getModulesOfCourse:j,setModulesPageSt:x});return w?(0,m.jsxs)("div",{className:n.page,children:[!(null!==h&&void 0!==h&&h.updateLesson)&&(0,m.jsx)(m.Fragment,{children:C?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(I,{styles:n,coursesPath:r,courseId:w,editAccess:null===h||void 0===h?void 0:h.editAccess,showHiddenLesson:null===h||void 0===h?void 0:h.showHiddenLesson,searchLesson:null===h||void 0===h?void 0:h.searchLesson,setModulesPageSt:x}),(0,m.jsx)(A,{mode:a,styles:n,courseId:w,modules:null===h||void 0===h?void 0:h.modules,visibleModules:L,editAccess:null===h||void 0===h?void 0:h.editAccess,openLesson:null===h||void 0===h?void 0:h.openLesson,setModulesPageSt:x,getContentOfLesson:f,contentNode:_}),(null===h||void 0===h?void 0:h.importLesson)&&(0,m.jsx)(o.Suspense,{fallback:null,children:(0,m.jsx)(b,{styles:n,moduleId:null===h||void 0===h?void 0:h.importLesson,setModulesPageSt:x,getModulesOfCourse:j})}),(null===h||void 0===h?void 0:h.updateModule)&&(0,m.jsx)(o.Suspense,{fallback:null,children:(0,m.jsx)(M,{styles:n,updateModule:null===h||void 0===h?void 0:h.updateModule,setModulesPageSt:x,getModulesOfCourse:j})})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:n.header,children:(0,m.jsxs)(l.k2,{to:r,className:n.back_arrow,children:[(0,m.jsx)(t.gc,{icon:d.Uec,size:"lg"}),"Return"]})}),(0,m.jsx)(A,{mode:a,styles:n,courseId:w,modules:null===h||void 0===h?void 0:h.modules,visibleModules:L,openLesson:null===h||void 0===h?void 0:h.openLesson,setModulesPageSt:x,getContentOfLesson:f,contentNode:_})]})}),!(null===h||void 0===h||!h.updateLesson)&&(0,m.jsx)(o.Suspense,{fallback:null,children:(0,m.jsx)(S,{styles:n,updateLesson:null===h||void 0===h?void 0:h.updateLesson,setModulesPageSt:x,getModulesOfCourse:j,tinyCommentsMode:u})})]}):null}},50717:(e,s,n)=>{n.d(s,{E8:()=>C,Er:()=>O,J4:()=>I,Js:()=>t,KZ:()=>E,MI:()=>S,MY:()=>A,O8:()=>b,Tq:()=>d,UC:()=>c,Vx:()=>p,Wd:()=>j,Wv:()=>y,Xu:()=>v,ZW:()=>h,cQ:()=>P,eY:()=>k,eq:()=>r,ge:()=>g,i1:()=>R,iF:()=>L,jQ:()=>_,kg:()=>u,mU:()=>x,mp:()=>m,ng:()=>a,oV:()=>N,p5:()=>f,uu:()=>w,vb:()=>M,zV:()=>l,zW:()=>i});var o=n(20412);const t="".concat(o.C,"/academy/course/getAll"),l="".concat(o.C,"/academy/course/getById"),d="".concat(o.C,"/academy/mentor/getFree"),i="".concat(o.C,"/academy/mentor/getByCourse"),r="".concat(o.C,"/academy/course/update"),a="".concat(o.C,"/academy/course/uploadAvatar"),c="".concat(o.C,"/academy/course/delete"),u="".concat(o.C,"/academy/trainee/getAll"),v="".concat(o.C,"/academy/trainee/getFree"),m="".concat(o.C,"/academy/trainee/changeStatus"),h="".concat(o.C,"/academy/course/addTrainee"),p="".concat(o.C,"/academy/lesson/getByTrainee"),g="".concat(o.C,"/academy/lesson/changeStatus"),x="".concat(o.C,"/academy/course/getMentorContent"),f="".concat(o.C,"/academy/course/getTraineeContent"),y="".concat(o.C,"/academy/course/updateModulePositions"),j="".concat(o.C,"/academy/module/updateLessonPositions"),I="".concat(o.C,"/academy/lesson/getById"),L="".concat(o.C,"/academy/answer/getById"),w="".concat(o.C,"/academy/lesson/lessonsToImport"),C="".concat(o.C,"/academy/lesson/copy"),_="".concat(o.C,"/academy/lesson/create"),A="".concat(o.C,"/academy/lesson/update"),b="".concat(o.C,"/academy/lesson/delete"),M="".concat(o.C,"/academy/module/create"),S="".concat(o.C,"/academy/module/update"),N="".concat(o.C,"/academy/module/delete"),E="".concat(o.C,"/academy/answer/setAnswers"),P="".concat(o.C,"/academy/answer/checkAnswers"),k="".concat(o.C,"/academy/mentor/getEditingAccess"),R="".concat(o.C,"/academy/trainee/getTraineeProgress"),O="".concat(o.C,"/file/uploadFile")}}]);
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.