"use strict";constMAX_INPUT_SIZE=1048576;'serviceWorker'innavigator&&(console.log("Registering service worker"),navigator.serviceWorker.register('/sw.js'));classQaPage{lang;tls;domWrapper;domUploaderWrapper;domUploaderCurrentWrapper;domMainWrapper;parser;selectedActivity;selectedApi;constructor(d,e){this.lang=d,this.tls=Object.freeze(e);letb=document.createElement("div");b.id="contentWrapper",this.domWrapper=b;leta=document.createElement("div");a.id="uploader",a.classList.add("uploader"),this.domUploaderWrapper=a;letc=document.createElement("div");c.id="uploaderMenu",this.domUploaderCurrentWrapper=c;letf=document.createElement("main");this.domMainWrapper=f}goForwardInMenuPages(b){consta=this;switch(b){case"parserSelection":a.drawUpActivitySelection();break;case"activityTypeSelection":a.drawUpApiTypeSelection();break;case"apiTypeSelection":a.drawUpUploadTypeSelection();break;default:console.log("Invalid page to go forward from selected.")}}generateDialogueCloseButton(){consta=document.createElement("a");returna.classList.add("icons"),a.classList.add("iconsClose"),a.classList.add("dialogueCloseX"),a.id="dialogueClose",a.textContent="X",a.title=this.tls.close,a.href="#"+location.href,a.addEventListener('click',QaDialogue.closeDialogue),a}setSelectedActivity(a){['evaluate','convert_to_xml'].includes(a)?this.selectedActivity=a:window.alert("Invalid activity selected")}setSelectedApi(b){leta;switch(this.selectedActivity){case"evaluate":a=['object','count_vocabulary_entries_to_be_added','minimaldatensatz'];break;case"convert_to_xml":constb=document.documentElement.getAttribute("data-allowed-xml-conversion-targets").split(',');a=b;break;default:window.alert("Invalid activity set: "+this.selectedActivity)}a.includes(b)?this.selectedApi=b:window.alert("Invalid activity selected")}downloadFromString(b,c){constd=newBlob([c],{type:"text/plain"}),a=document.createElement("a");a.download=b,a.href=window.URL.createObjectURL(d),a.dataset.downloadurl=["text/plain",a.download,a.href].join(":");conste=newMouseEvent("click",{view:window,bubbles:!0,cancelable:!0});a.dispatchEvent(e),a.remove()}generateValidationOutputsForCountNewToVocabs(c){constb=document.getElementById("validation_overlay_intro");b!==void0&&b!==null&&b.parentElement.removeChild(b);consta=document.createElement("div"),d=document.createElement("h5");d.textContent=this.tls.count_new_to_vocabs,a.appendChild(d);conste=document.createElement("table");functionf(d,e){consta=document.createElement("tr"),b=document.createElement("th");b.textContent=d,a.appendChild(b);constc=document.createElement("td");returnc.textContent=e,a.appendChild(c),a}for(letaofc.count)e.appendChild(f(a.category_name,a.count));a.appendChild(e);constg=document.createElement("h6");g.textContent=this.tls.samples,a.appendChild(g);consth=document.createElement("table");for(letaofc.samples)h.appendChild(f(a.category_name,a.entries.join(", ")));returna.appendChild(h),a}generateValidationOutputsForMinimaldatensatz(b){consta=document.createElement("div");for(letdofb){constc=document.createElement("div"),e=document.createElement("h5");e.textContent=this.tls.inventory_number+': '+d.invno,c.appendChild(e);constf=document.createElement("table");for(letcofd.evaluations){constb=document.createElement("tr"),a=document.createElement("td");a.style.width="40px",c.passed===!0?a.style.background="var(--color-green)":a.style.background="var(--color-red)",b.appendChild(a);conste=document.createElement("td");e.textContent=c.text,b.appendChild(e),f.appendChild(b)}c.appendChild(f),a.appendChild(c)}returna}generateRegularValidationOutputs(c){constb=document.createElement("div");functiona(d,e){consta=document.createElement("tr"),b=document.createElement("th");b.textContent=d,a.appendChild(b);constc=document.createElement("td");returnc.appendChild(e),a.appendChild(c),a}for(letdofc){constg=document.createElement("div"),j=document.createElement("h5");j.textContent=this.tls.inventory_number+': '+d.invno,g.appendChild(j);conste=document.createElement("div"),f=document.createElement("tab