import{Q as r}from"./quill-B-P71w5s.js";import"./vendor-C0v32J92.js";const d=[["bold","italic","underline"],[{header:[2,3,!1]}],[{list:"ordered"},{list:"bullet"}],[{align:[]}],["link"],["clean"]];document.addEventListener("DOMContentLoaded",()=>{const o=document.getElementById("thankYouContentModal");if(!o)return;const a={};o.querySelectorAll(".thankyou-quill").forEach(n=>{const l=n.dataset.lang,t=document.getElementById(`thankyou-hidden-${l}`),e=new r(n,{theme:"snow",modules:{toolbar:d}});t&&t.value.trim()!==""&&e.clipboard.dangerouslyPasteHTML(t.value),e.on("text-change",()=>{t&&(t.value=e.getText().trim()===""?"":e.root.innerHTML)}),a[l]=e}),o.querySelectorAll(".thankyou-merge-btn").forEach(n=>{n.addEventListener("click",()=>{const l=n.dataset.field,t=o.querySelector(".tab-pane.show.active");if(!t)return;const e=a[t.dataset.language];if(!e)return;const i=e.getSelection(!0)||{index:e.getLength()};e.insertText(i.index,l),e.setSelection(i.index+l.length)})})});
