window._tteInitEffectType=function(t){var e=0,n=t.querySelector(".tte_mid"),i=n.getAttribute("data-text").replace(/\s*,\s*/g,",");if(i){i=i.split(",");var r='<span class="tte-cursor">|</span>',s=0,a="right",o=0,l=t.getAttribute("data-speed");"slow"===l?l=100:"normal"===l?l=60:"fast"===l&&(l=30);var u=t.getAttribute("data-delay"),c=i[s].length;n.innerHTML=r;setInterval(function(){if(e===c+1){if(++o*l<=u)return;o=0}n.innerHTML="&nbsp;"+i[s].substr(0,e)+"&nbsp;"+r,"right"===a?e++:e--,e===c+1&&(a="left"),-1===e&&(a="right",e=0,++s===i.length&&(s=0),c=i[s].length)},l)}},window._tteInitEffectFade=function(t){var e=t.querySelector(".tte_mid"),n=e.getAttribute("data-text").split(","),i=parseInt(t.getAttribute("data-delay"),10),r=n.length,s=1;s>r-1&&(s=0),e.innerHTML="&nbsp;"+n[0]+"&nbsp;",e.classList.add("tte_show"),setInterval(function(){e.classList.remove("tte_show"),e.classList.add("tte_hide"),e.style.width="",setTimeout(function(){var t=e.getBoundingClientRect().width;e.innerHTML="&nbsp;"+n[s]+"&nbsp;";var i=e.getBoundingClientRect().width;e.style.width=t+"px",e.classList.remove("tte_hide"),e.style.transition="none",setTimeout(function(){e.style.width=i+"px",++s>r-1&&(s=0),e.style.transition="",e.classList.add("tte_show")},30)},410)},i)},window._tteInitEffectRandom=function(t){function e(){var s=t.getAttribute("data-delay");setTimeout(function(){++r>=i.length&&(r=0);var t=Object.assign({},a,{resolveString:i[r]});n.resolve(t,e)},s)}var n={resolve:function(t,e){function n(t,e){return Math.floor(Math.random()*(e-t+1))+t}function i(t){return t[n(0,t.length-1)]}function r(t,e){var n=t.characters,s=(t.timeout,t.element),a=t.partialString,o=t.iterations;setTimeout(function(){if(o>=0){var l=Object.assign({},t,{iterations:o-1});s.innerHTML=0===o?"&nbsp;"+a+"&nbsp;":"&nbsp;"+a.substring(0,a.length-1)+i(n)+"&nbsp;",r(l,e)}else"function"==typeof e&&e()},t.timeout)}function s(t,e){var n=t.resolveString,i=(t.characters,t.offset),a=n.substring(0,i);r(Object.assign({},t,{partialString:a}),function(){var r=Object.assign({},t,{offset:i+1});i<=n.length?s(r,e):"function"==typeof e&&e()})}var a=t.resolveString||t.element.getAttribute("data-text");s(Object.assign({},t,{resolveString:a}),e)}},i=t.querySelector(".tte_mid").getAttribute("data-text").split(","),r=0,s=t.getAttribute("data-speed");"slow"===s?s=50:"normal"===s?s=20:"fast"===s&&(s=9);var a={offset:0,timeout:s,iterations:5,characters:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"],resolveString:i[r],element:t.querySelector(".tte_mid")};n.resolve(a,e)},window._tteInitEffectScrambled=function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function n(t){e(this,n),this.el=t,this.chars="!<>-_\\/[]{}—=+*^?#________",this._lastTime=0,this.speed=t.parentNode.getAttribute("data-speed"),"fast"===this.speed?this.speed=5:"normal"===this.speed?this.speed=20:this.speed=40,this.update=this.update.bind(this)}return n.prototype.setText=function(t){var e=this,n=this.el.innerText,i=Math.max(n.length,t.length),r=new Promise(function(t){return e.resolve=t});this.queue=[];for(var s=0;s<i;s++){var a=n[s]||"",o=t[s]||"",l=Math.floor(40*Math.random()),u=l+Math.floor(40*Math.random());this.queue.push({from:a,to:o,start:l,end:u})}return cancelAnimationFrame(this.frameRequest),this.frame=0,this.update(),r},n.prototype.update=function(e){if(e-this._lastTime<this.speed)this.frameRequest=requestAnimationFrame(this.update);else{this._lastTime=e;for(var n="",i=0,r=0,s=this.queue.length;r<s;r++){var a=this.queue[r],o=a.from,l=a.to,u=a.start,c=a.end,h=a.char,f=t.getAttribute("char-color");this.frame>=c?(i++,n+=l):this.frame>=u?((!h||Math.random()<.28)&&(h=this.randomChar(),this.queue[r].char=h),n+='<span class="tte-scramble-symbol" style="color: '+f+';">'+h+"</span>"):n+=o}this.el.innerHTML="&nbsp;"+n+"&nbsp;",i===this.queue.length?this.resolve():(this.frameRequest=requestAnimationFrame(this.update),this.frame++)}},n.prototype.randomChar=function(){return this.chars[Math.floor(Math.random()*this.chars.length)]},n}(),i=t.querySelector(".tte_mid").getAttribute("data-text").split(","),r=t.querySelector(".tte_mid"),s=t.getAttribute("data-delay"),a=new n(r),o=0;!function t(){a.setText(i[o]).then(function(){setTimeout(t,s)}),o=(o+1)%i.length}()},function(){var t=document.querySelectorAll(".tte_wrapper");Array.prototype.forEach.call(t,function(t){var e=t.getAttribute("data-effect"),n=t.querySelector(".tte_mid");n.innerHTML="",n.style.opacity="","typing"===e?window._tteInitEffectType(t):"fade"===e||"top-to-bottom"===e||"vertical-flip"===e?window._tteInitEffectFade(t):"random-letters"===e?window._tteInitEffectRandom(t):"text-scrambled"===e&&window._tteInitEffectScrambled(t)})}();