
class ComponentScorm{constructor(){this.aulas=null;this.returnCheckProject=null;this.atividade=null;this.countElement=1;}
actionShowItens(objeto){console.log(objeto);document.querySelectorAll(`.${objeto.section} .hide-item`).forEach(elem=>{elem.classList.remove("item-ativo");});document.querySelector(`.${objeto.section} .${objeto.item}`).classList.add("item-ativo");}
removeClass(param){const classe=document.querySelector(`${param.class} .hide-item`);if(classe){classe.classList.value="card-body";}}
removeClassItens(objeto){document.querySelector(`.${objeto.section} .${objeto.item}`).classList.add("item-ativo");}
renderVideos(objeto){const url=objeto.url;const conteudo=`<video 
                              class="w-100" 
                              poster="./src/img/video.png"
                              preload="none"
                              controls>
                              <source src="./src/videos/${url}" type="video/mp4">
                              <source src="movie.ogg" type="video/ogg">
                          </video>`;$(`.${objeto.class}`).html(conteudo);}
indicador(params){var self=this;$(".button-action").click(function(e){e.preventDefault();const button=document.querySelectorAll(".button-action");const indicador=`<i class="far fa-hand-point-right animated heartBeat infinite indicador"></i>`;$(".button-action i").remove();$(button[self.countElement]).prepend(indicador);self.countElement=self.countElement+1;});}
renderModal(url){const img=`./src/img/modulos/modulo${config.id_modulo}/${url}`;Swal.fire({customClass:{content:"swal3-bg"},imageUrl:img,width:"100%",grow:"fullscreen",showCloseButton:true,showConfirmButton:false});}
renderModalText(param){Swal.fire({customClass:{content:param.class},html:`   <div class="card border-0 bg-transparent">
    <div class="card-body d-flex align-items-center p-5">
    <div class="card-text text-dark">
    ${param.text}

    </div>
</div>
</div>`,showCloseButton:true,showConfirmButton:false});}
async modulosCursos(){const listMenu=config.modulos.map((elem,i)=>{const statusMenu=this.controllTracker(i);var lista=`<a href="javaScript:void(0);" onclick="${statusMenu.action}" 
                           
                            class="list-group-item list-group-item-action ${statusMenu.class} font-18">
                            ${elem.titulo} 
                            <i class="${statusMenu.icon}"></i>
                        </a>`;return lista;});return true;}
renderListItemModulo(value){this.aulas=config.modulos[config.id_modulo].aulas;const articles_itens=document.querySelector(`.list-menu-aula-itens`);const countList=value-1;const item=this.aulas.map((elem,i)=>{return`<li class="list-group-item activ border-radius-20 mb-2 font-14 bg-roxo-curso text-white">
                            <span class="text-warning mr-2">${elem.sub_titulo}</span>${elem.titulo}
                        </li>
                    ${i == countList ? `<div class='list-group-item-container'id="style-1">${this.renderListItemModuloSubAula(i)}</div>` : ""}`;});if(articles_itens){articles_itens.innerHTML=`<ul class="list-group list-menu-aula">${item.join("")}</ul>`;document.querySelector(`.titulo-modulo b`).innerHTML=config.selected_modulo.sub_titulo;}}
renderListItemModuloSubAula(value){const item=this.aulas[value].paginas.map((elem,i)=>{if(elem.sumario){return`<li class="list-group-item activ border-radius-20 mb-2 font-14">${elem.titulo}</li>`;}});return item.join("");}
renderListaMenuHamburgue(checkProject){$(".menu-hamburg .menu").html("");this.returnCheckProject=checkProject;const listMenu=config.modulos.map((elem,i)=>{if(i>0){const statusMenu=this.controllTracker(i);var lista=`<li class="menu-item" id="menu_${i}">
                                <a href="${statusMenu.actionModulos}" class="btn ${statusMenu.class}" >
                                    <i class="${statusMenu.icon}"></i>
                                    ${elem.titulo}
                                </a>

                                ${statusMenu.class === "ativo" ? this.renderListaMenuPartes(i) : ""}
                          
                            </li>`;return lista;}});$(".menu-hamburg .menu").append(listMenu);document.querySelector(".menu").addEventListener("click",env=>{document.querySelectorAll(".menu-item__sub").forEach((elem,i)=>{elem.classList.remove("ativo");});});}
renderListaMenuPartes(value){const aulas=config.modulos[value].aulas;const checkSessao=this.returnCheckProject.sectionCheck[value];const article=this.returnCheckProject.controllArticle[config.id_modulo].article-1;var count=1;const listaSubMenu=checkSessao.map((elem,i)=>{const dados=aulas[i];const status=this.controllTrackerSubMenu(elem,count,value);var lista=` <a href="javaScript:void(0);" class="${status.classe} ${article == i ? "active" : ""}" onclick="${status.action}">
                        <span>
                          <i class="fas fa-angle-right"></i>
                          ${dados.sub_titulo}
                        </span>
                        <i class="${status.icon}"></i>
                      </a>`;count++;return lista;});return`<div class="menu-item__sub ${config.id_modulo == value ? "ativo" : ""}">${listaSubMenu.join("")}</div>`;}
renderNavArticle(obj){const{aula,aulaSub}=obj;const aulaSuba=aulaSub?`${aulaSub} - `:"";const nav=`<nav class="navbar navbar-light font-roboto" id="nav_4">
                        <div class="nav-left">
                           <img src="./src/img/logo_complaince.svg"/>
                    </div>
               
                    <div class="nav-right">
                    <a 
                      href="./src/anexo/apostila.pdf" 
                      target="_blank" 
                      class="btn one btn-outline-secondary rounded-pill">Apostila</a>

                    <a 
                      href="javascript:void(0)"
                      onclick="window.renderConteudo('modulos',0)" 
                      class="btn two btn-warning rounded-pill">
                      Home
                    </a>
                    <a 
                    class="navbar-brand" 
                    href="javaScript:void(0);" 
                    onclick="_this.toogleMenu();"
                    class="action-menu-hamburg">
                    <i class="fas fa-bars"></i>
                </a>
                    
                        </span>
                    </div>
                 
                  </nav>
                  
                  
                  <div class='container-modulos'>
                            <div class="nome-modulo">
                            ${config.selected_modulo.titulo}
                            </div>
                              <span> |</span>
                          <div class="nome-aula">
                          ${aulaSub != undefined ? `<b>${aulaSub}</b>${aula}` : ``}
                         </div>
                  </div>
                  
                  `;console.log(aulaSub);$(".conteudo").prepend(nav);}
controllTracker(vetor){const retorno=config.controlTrackModulo[vetor];const status={class:"ativo",icon:"fas fa-chevron-right",action:`window.renderConteudo('modulo',${parseInt(vetor)})`,actionModulos:`#menu_${vetor}`};if(config.producao===false){return status;}
if(retorno.trackModulo===retorno.sectionCheck.length||retorno.status===true){return status;}else{status.class="inativo";status.icon="fas fas fa-lock";status.action="javaScript:void(0)";status.actionModulos="javaScript:void(0)";return status;}}
controllTrackerSubMenu(elem,id,idModulo){const status={action:`window.renderSectionModulo({id:${id},update:false,idModulo:${idModulo}})`,classe:"",icon:"fas fa-lock-open"};if(config.producao===false){return status;}
if(elem.sessao==true){return status;}else{status.action="";status.classe="inativo";status.icon="fas fa-lock";return status;}}}