// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later
import{PopStateHandlers as u,post as s}from"/static/js/utils/utils.js?v=de549338ff5782e1";var r=document.getElementById("text"),l=document.getElementById("config-textarea"),a=document.getElementById("output"),n=document.getElementById("error-msg");n.innerHTML.trim()&&alert(n.innerHTML.trim());function o(e,t=!1){if(e){if(e.error){i(e);return}t||(e.stateType="swappedWords",history.pushState(e,"Vertauschte Wörter",location.href)),r.value=e.text||"",l.value=e.config||"",a.innerText=e.replaced_text||"",n.innerText=""}}function i(e){let t=e;console.error(t),t.error?(alert(t.error),n.innerText="".concat(t.error," In line ").concat(t.line_num,': "').concat(t.line,'"')):(alert(t),n.innerText=JSON.stringify(t))}document.getElementById("form").onsubmit=e=>{e.preventDefault()},document.getElementById("reset").onclick=()=>s("/api/vertauschte-woerter",{text:r.value,minify_config:!1,return_config:!0},o,i),document.getElementById("submit").onclick=()=>s("/api/vertauschte-woerter",{text:r.value||"",config:l.value||"",minify_config:!1,return_config:!0},o,i),u.swappedWords=e=>{e.state&&o(e.state,!0)};
// @license-end
//# sourceMappingURL=swap.js.map
