",uploadfile=""},displayerrmsg=function(e){let t=document.querySelector(".form-error-msg");t.style.padding="8px 0",t.style.color="red",t.style["text-align"]="center",t.style["margin-top"]="10px",t.textContent=e},clearerrmsg=function(){let e=document.querySelector(".form-error-msg");e.style.padding="0 0",e.style["margin-top"]="0",e.textContent=""};function handleStart(e){e.preventDefault();const t=document.getElementById("linkname").value?document.getElementById("linkname").value.toLowerCase():"";let n=null===t.match(/^[a-z_]/),a=t.replace(/^[a-z_][a-z0-9_.-]{4,31}$/gi,"");if(!t||t.length<1||t.length>32)displayerrmsg("The name length should be between 5 and 32 characters.");else if(n)displayerrmsg("The first character must be an alphabet or an underscore(_).");else{if(""!==a)return a=t.replace(/[a-z0-9_.-]/gi,""),void displayerrmsg("The name cannot contain these characters: "+a);if(uploadfile)if(uploadfile.size>1e7)displayerrmsg("The size of the file you uploaded exceeds the 10MB limit.");else{var l=new FileReader;l.onload=function(e){let n=document.getElementById("email")?document.getElementById("email").value:"";n&&n.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)?fetch("/api/v1/internal/checklinkname",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({linkname:t})}).then(e=>e.json()).then(e=>{if("OK"!==e.status||e.duplicate)"OK"===e.status&&e.duplicate?displayerrmsg("This name has been taken. Please choose another name."):displayerrmsg("An unexpected error occured. If this problem persists, please kindly contact our support.");else{let e=document.querySelector(".start-form");e.innerHTML="
Login to manage your webpates.
Login to manage your webpates.
Login to manage your webpates.
Login to manage your webpates.