"use strict";constMAX_INPUT_SIZE=1048576;'serviceWorker'innavigator&&(console.log("Registering service worker"),navigator.serviceWorker.register('/sw.js'));classConcPage{lang;tls;domWrapper;domUploaderWrapper;domResultsWrapper;domMainWrapper;constructor(d,e){this.lang=d,this.tls=Object.freeze(e);letc=document.createElement("div");c.id="contentWrapper",this.domWrapper=c;leta=document.createElement("div");a.id="uploader",a.classList.add("uploader"),this.domUploaderWrapper=a;letb=document.createElement("div");b.id="results",b.classList.add("results"),this.domResultsWrapper=b;letf=document.createElement("main");this.domMainWrapper=f}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()}renderGenHeader(){constb=document.createElement("header");b.id="mainHeader";consta=document.createElement("a");a.id="logoArea",a.href="https://www.museum-digital.org/";constd=document.createElement("img");d.src="/static/img/mdlogo-code.svg",d.alt="Logo of museum-digital",a.appendChild(d);constl=document.createElement("h2");l.textContent="museum-digital",a.appendChild(l),b.appendChild(a);constc=document.createElement("nav"),f=document.createElement("a");f.href="https://en.about.museum-digital.org/about",f.textContent=this.tls.about,c.appendChild(f);constg=document.createElement("div"),h=document.createElement("a");h.textContent=this.tls.contact,h.href="https://en.about.museum-digital.org/contact/",g.appendChild(h);consti=document.createElement("div"),e=document.createElement("a");e.textContent=this.tls.imprint,e.href="https://en.about.museum-digital.org/impressum",i.appendChild(e);constj=document.createElement("a");j.textContent=this.tls.privacy_policy,j.href="https://en.about.museum-digital.org/privacy/",i.appendChild(j),g.appendChild(i),c.appendChild(g);constk=document.createElement("a");k.textContent=this.tls.news,k.href="https://blog.museum-digital.org/",c.appendChild(k),b.appendChild(c),document.body.appendChild(b)}renderHeader(){constb=document.createElement("header");b.id="appHeader";constc=document.createElement("h1"),a=document.createElement("img");a.width="70",a.height="70",a.src="/static/img/mdlogo-code.svg",a.alt="",c.appendChild(a),c.appendChild(this.createPlainTextElem("span","museum-digital:"+this.tls.concordance_checker)),b.appendChild(c),document.body.appendChild(b)}createP(b){consta=document.createElement("p");returna.textContent=b,a}createPlainTextElem(b,c){consta=document.createElement(b);returna.textContent=c,a}renderText(){consta=document.createElement("h2");a.textContent=this.tls.quality_assessment_tools,this.domMainWrapper.appendChild(a),this.domMainWrapper.appendChild(this.createP(this.tls.intro)),this.domWrapper.appendChild(this.domMainWrapper)}generateBoilerplateForTableSection(f){consta=document.createElement("div"),c=document.createElement("h3");c.textContent=f,a.appendChild(c);constb=document.createElement("table"),d=document.createElement("thead");b.appendChild(d);conste=document.createElement("tbody");returnb.appendChild(e),a.appendChild(b),{section:a,thead:d,tbody:e}}generateListResponse(d,e,a,b){while(this.domResultsWrapper.firstChild)this.domResultsWrapper.removeChild(this.domResultsWrapper.firstChild);if(b.passed.length===void0){constc=this.generateBoilerplateForTableSection(this.tls.passed),d=document.createElement("tr");for(constbof['Input','Match']){consta=document.createElement("th");a.textContent=b,d.appendChild(a)}c.thead.appendChild(d);for(constfinb.passed){constd=b.passed[f],e=document.createElement("tr");e.appendChild(this.createPlainTextElem("td",f)),a[d]?e.appendChild(this.createPlainTextElem("td",a[d])):(valueTd.textContent=d,e.appendChild(this.createPlainTextElem("td",d))),c.tbody.appendChild(e)}this.domResultsWrapper.appendChild(c.section)}constc=this;if(b.not_passed.length!==0){constf=this.generateBoile