function r(e){if(!e)return"";const n={ç:"c",Ç:"c",ğ:"g",Ğ:"g",ı:"i",I:"i",İ:"i",ö:"o",Ö:"o",ş:"s",Ş:"s",ü:"u",Ü:"u"};return String(e).replace(/[çÇğĞıIİöÖşŞüÜ]/g,function(t){return n[t]||t}).toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("[data-auto-submit]").forEach(function(e){e.addEventListener("change",function(){const n=e.closest("form");n&&n.submit()})}),document.querySelectorAll("form[data-confirm]").forEach(function(e){e.addEventListener("submit",function(n){const t=e.getAttribute("data-confirm")||"Are you sure?";window.confirm(t)||n.preventDefault()})}),window.TomSelect&&document.querySelectorAll("select[data-tom-select]").forEach(function(e){e.tomselect||new window.TomSelect(e,{plugins:["remove_button"],persist:!1,create:!1})}),document.querySelectorAll('input.translation-input[data-field="title"]').forEach(function(e){const n=e.dataset.lang,t=document.querySelector('input.translation-input[data-field="slug"][data-lang="'+n+'"]');t&&(t.value.trim()!==""&&(t.dataset.userEdited="true"),t.addEventListener("input",function(){t.dataset.userEdited="true"}),e.addEventListener("input",function(){t.dataset.userEdited!=="true"&&(t.value=r(e.value))}))})});
