(()=>{"use strict";const e=e=>{let t=e.querySelector(".ablocks-coupon-clipboard"),o=t;const c=e.getAttribute("data-coupon-code"),l=e.getAttribute("data-clipboard-text"),a=e.getAttribute("data-clipped-text"),d=e.getAttribute("data-coupon-style");let n=l;"default"===d||"style2"===d?(t=e.querySelector(".ablocks-coupon-clipboard"),o=e.querySelector(".ablocks-coupon-clipboard-text"),n=l):"style4"===d?(t=e.querySelector(".ablocks-coupon-clipboard"),o=t,n=l):(t=e.querySelector(".ablocks-coupon-code"),o=e.querySelector(".ablocks-coupon-code-text"),n=c),t?.addEventListener("click",()=>{((e,t,o,c,l)=>{((e,t,o,c=3e3)=>{const l=document.createElement("textarea");l.value=e,document.body.appendChild(l),l.select(),document.execCommand("copy"),document.body.removeChild(l),t&&t(),o&&setTimeout(()=>{o()},c)})(t,()=>{"style4"===c?e.style.opacity=0:e.textContent=o},()=>("style4"!==c&&(e.textContent=l),e.style.opacity=1),3e3)})(o,c,a,d,n)})};document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".ablocks-block--coupon").forEach(t=>{e(t)})})})();