");return[n,t.join("")]},resurrectText=(e,t)=>{for(var n=0;n",t[n]);return e},getStc=o=>{var s=500;if(o.split("").length<=s)return[o];{console.log(encodePunc(o).puncArr);for(var[o,a]=encodePunc(o),c=a.split("<#*/>"),i=0;is){let e=c[i].split(" "),t="",n=[];for(var p=0;p"),t=(e=(e=e.replaceAll(";<#*/>","<#*/>")).replaceAll("<#*/>;","<#*/>"),console.log(o),[]),n=0,l="",r=(e=(e=resurrectText(e,o)).replaceAll(" "," ")).split("");for(i=0;i{if(l.split("").length<=500)return[l];{let e=(l=l.replaceAll("...","etc")).split(".").filter(e=>""!==e.trim()),t=[],n="";for(var r=0;r""!==e.trim()),e=(0===p.length&&(p=[g]),diffArr=[],document.getElementById("diff").textContent="",document.getElementById("output").innerHTML="",13*Math.ceil(g.split("").length/500)),t=startTimer(e,null),n=(showPb(e),document.getElementById("choosen").textContent),l=!0;for(var m=0;me.text()).then(e=>{var t=JSON.parse(e);console.log(e);let n=t[0],l=t[0];n=(n=(n=n.replace(/.*<\/ins>/g,"")).replace(//g,""),l=(l=(l=l.replace(/.*<\/del>/g,"")).replace(//g,"");var r=document.createElement("div");r.innerHTML=t[0],r.style.display="none",document.getElementById("output").append(r);let o=r.querySelectorAll("del");console.log("elts length: "+o.length);for(let e=o.length-1;0<=e;e--)o[e].remove(),console.log("removed");o=r.querySelectorAll("ins"),r.innerHTML=r.innerHTML.split(" ").map(e=>e=e.includes("")?''+e.replace(//g,"").replace(/<\/ins>/g,"").replace(//g,"").replace(/<\/span>/g,"")+"":e).filter(e=>""!==e.trim()).join(" ");let s=0,a=p[m].split(" ");a.filter(e=>""!==e.trim()).length;for(let e=0;e""!==e.trim()).length),c=(document.getElementById("diff").textContent=e,[]);for(let e=6;e<=14;e++)c.push(5*e);document.getElementById("struct").textContent=c[Math.floor(Math.random()*c.length)];var t=r.innerHTML,e=(r.remove(),document.getElementById("input").innerHTML),i=g.indexOf(p[m].trim());console.log("ind1: "+i),"\n"===e[i-1]&&"\n"!==e[i-2]?(document.getElementById("output").innerHTML+="
"+t,console.log("in1")):"\n"===e[i-1]&&"\n"===e[i-2]?(document.getElementById("output").innerHTML+="
"+t,console.log("in2")):(document.getElementById("output").innerHTML+=" "+t,console.log("in3"))}).catch(e=>{console.log(e),alert("Unexpected error! Please retry the current operation by clicking again on the button."),l=!1,clearInterval(t)});hidePb(),clearInterval(t)}}}