const e=document.getElementById("user-input"),n=document.getElementById("rendered-text");e.addEventListener("input",()=>{i(e.value)});const t={danyao:"777m234888p4568s_8s",iipee:"334455s55m5m*123p3z_3z",pinho:"45678p123s34599m_9p",sansyoku:"7z123m123p123s678m_7z",sandookoo:"666m666p66s789s99m_6s",sankantsu:"567s99m_0880m 222p-2p= 3s-333s",syousan:"77666555z678s88m_8m",ittsuu:"234m123456789s7z_7z",chanta:"99123m123999p77z_9m",toitoi:"444m222s7z_4z4z-4z 99m-9m_7z",sananko:"111m111p444p34s11z_5s*",chitoi:"11m44m88m99m44p22s4z_4z",honroo:"666z222z999s1m_1p-11p_1m",honiisoo:"11222567p22233z_1p",jyunchan:"1112378p123999s_9p",ryopee:"223344s667788p6z_6z",chinitsu:"2344466777999m_1m",kokushi:"19m19p19s1234567z_1m",chulen:"1112345678999m_2m",suuan:"111m111p444p333s1z_1z",suukantsu:"44s_2m-22m2m 222p2p- 22s2s-2s 555z5z-",daisangen:"555666777z678s5m_5m*",daishushi:"11122233344z22s_4z",syoushushi:"1112223344z333s_3z",tsuiso:"1133344477755z_5z",ryuiso:"22234666888s66z_2s",chinroo:"1119m111999p999s_9m"};function o(e){return e.replaceAll(" ",".")}function s(e){return e.replaceAll("."," ")}function i(e){n.innerHTML=s(a(e)),window.location.hash=o(a(e))}function a(e){let n=e.trim().split(""),t=[];var o,s=[];for(let e=0;e<n.length;e++)if(/([A-Za-z])/.test(n[e])){o=n[e];for(let e=0;e<s.length;e++)t.push(`${s[e]}${o}`);s=[]}else/\d/.test(n[e])?s.push(n[e]):t.push(`${n[e]}`);return console.log(t.concat(s).join("")),t.concat(s).join("")}document.getElementById("selectOptions").addEventListener("change",function(){let n=this.selectedOptions[0].id;e.value=t[n]||"",i(e.value)}),document.getElementById("colorOptions").addEventListener("change",function(){let e=this.selectedOptions[0].id;console.log(e),"mono"===e?(n.classList.remove("font-mj-color"),n.classList.add("font-mj-mono")):"color"===e&&(n.classList.add("font-mj-color"),n.classList.remove("font-mj-mono"))}),Array.from(document.getElementsByClassName("copy-link-btn")).forEach(function(e){e.addEventListener("click",function(){var e=document.createElement("input");document.body.appendChild(e),e.value=window.location.href,e.select(),document.execCommand("copy"),document.body.removeChild(e)})}),Array.from(document.getElementsByClassName("share-on-facebook")).forEach(function(e){e.addEventListener("click",function(){let e=`https://www.facebook.com/sharer.php?u=${encodeURIComponent(window.location.href)}`;window.open(e,"_blank")})}),Array.from(document.getElementsByClassName("share-on-x")).forEach(function(e){e.addEventListener("click",function(){let e=`${window.location.href}`,n=`https://twitter.com/intent/tweet?text=${encodeURIComponent(e)}`;window.open(n,"_blank")})}),Array.from(document.getElementsByClassName("save-png-btn")).forEach(function(t){t.addEventListener("click",function(){(function(e,t){let o=document.createElement("canvas"),s=o.getContext("2d");console.log(s.measureText(e),n.offsetWidth);let i=window.getComputedStyle(n).fontFamily,a=5*parseFloat(window.getComputedStyle(n).fontSize);s.font=`${a}px ${i}`,o.width=s.measureText(e).width+200,o.height=5*parseInt(window.getComputedStyle(n).fontSize)+200,s.font=`${a}px ${i}`,s.fillText(e,100,5*parseInt(window.getComputedStyle(n).fontSize)+170);let c=o.toDataURL("image/png"),l=document.createElement("a");l.href=c,l.download=t,l.click()})(n.innerText,`${e.value}.png`)})}),function(){if(window.location.hash)try{e.value=s(window.location.hash.substring(1)),n.innerText=a(s(window.location.hash.substring(1))),console.log(`\u{2192} Url Get: ${window.location.hash}`)}catch(e){console.log("→ Get Invalid Url, Random Select an Emoji \uD83C\uDFB0",e)}else console.log("→ Get Basic URL"),window.location.hash=o("45p*345m*88m_0220m_33s3s-3s=_6p"),e.value=s(window.location.hash.substring(1)),n.innerText=a(s(window.location.hash.substring(1)))}();
//# sourceMappingURL=index.0cb6f12c.js.map
