!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).MagicAnswers=e()}(this,function(){"use strict";var n=function(){function n(n){const e=JSON.parse(decodeURIComponent(n.dataset.quotes));if(!e)return!1;n.querySelector(".ma-response");const t=n.querySelector(".ma-flex");let s=o(e),a=null;function o(n){return function(n){const e=atob(n),t=e.length,s=new Uint8Array(t);for(let n=0;n<t;n++)s[n]=e.charCodeAt(n);return(new TextDecoder).decode(s)}(n[Math.floor(Math.random()*n.length)])}function r(n,e){return n=Math.ceil(n),e=Math.floor(e),Math.floor(Math.random()*(e-n+1)+n)}function i(n){t.innerHTML=".";const e=[".",". .",". . ."];let s=1,o=0;a=setInterval(function(){s<7?(t.innerHTML=e[o],s++,o++,o=o>2?0:o):(clearInterval(a),a=null,function(n){t.innerHTML='"';const e=n.split(" ");let s=0,o=e.length;a=setInterval(function(){s<o?(t.innerHTML+=e[s]+" ",s++):(t.innerHTML+='"',clearInterval(a),a=null)},100)}(n))},500)}function c(n){const e=t.innerHTML;n.classList.contains("ma-ball")?function(n){n.classList.add("shake-hard","shake-constant"),setTimeout(function(){const e=r(-25,25),s=r(-22,22),a=r(-22,22);t.style.transform="rotate("+e+"deg) translateX("+s+"%) translateY("+a+"%)",n.classList.remove("shake-hard","shake-constant"),n.classList.add("show-answer")},2500)}(n):(n.classList.contains("ma-mouth")&&i(e),n.classList.add("show-answer"))}!function(n){const r=n.querySelector(".magic-answers");if(r.getAttribute("data-magic-answers"))return!1;r.classList.remove("ma-animate"),r.classList.add("magicanswer-hidden"),t.innerHTML=s,r.dataset.magicAnswers=!0;const i=r.querySelectorAll("img"),l=i.length;let u=0;i.forEach(function(n){const e=n.src;var t,s,a;t=e,s=function(){u++,u==l&&setTimeout(()=>{r.classList.add("ma-animate"),r.classList.remove("magicanswer-hidden")},400)},(a=new Image).onload=s,a.src=t}),n.addEventListener("click",function(){r.classList.contains("show-answer")?function(n){clearInterval(a),n.classList.remove("show-answer"),s=o(e),t.innerHTML=s}(r):c(r)})}(n)}return{init:function(){document.querySelectorAll(".magic-answers-wrap").forEach(function(e){n(e)})}}}();return function(){return n.init()}}),MagicAnswers();