!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.ScrambleText=i()}(this,function(){"use strict";function t(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function i(){var t=Date.now()-this._startTime,i=t-this._elapsedTime;if(!(1e3/this.fps<=i))return void requestAnimationFrame(this._anim);if(this._elapsedTime=t,this._position=this._idling?0:this._elapsedTime/this.timeOffset|0,this._running){if(this._position>=this._contents.length)return this._running=!1,this.el.innerHTML=this._contents.map(function(t){return t.content}).join(""),this.el.removeAttribute("data-scramble-text-running"),void this.callback();requestAnimationFrame(this._anim);var n=e(this._contents,this.chars,this._position);this.el.innerHTML=n.join("")}}function e(t,i,e){for(var s=[],r=0,a=t.length;r(\s*)?/i);if(e)i.push({type:"tag",content:e[0].replace(/^(\s*)(.+)(\s*)$/,"$1$2$3")}),t=t.replace(e[0],"");else{var n=t.match(/^\s+/);n?(i.push({type:"space",content:" "}),t=t.replace(n[0],"")):(i.push({type:"character",content:t[0]}),t=t.slice(1))}}return i}var r="data-scramble-text-idling";return function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t(this,e),this._startTime=0,this._elapsedTime=0,this._running=!1,this._idling=!0,this._position=0,this._contents=s(n.innerHTML),this._anim=i.bind(this),this.el=n,this.timeOffset=r.timeOffset||50,this.fps=r.fps||60,this.chars=r.chars||["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","!","#","$","%","&",":",";","?","@","[","]","^","_","{","|","}","~"],this.callback="function"==typeof r.callback?r.callback:function(){},this.play(),this}return e.prototype.play=function(){return this._running?this:(this._idling=!0,this._running=!0,this._position=0,this.el.setAttribute(r,""),this.el.setAttribute("data-scramble-text-running",""),this._anim(),this)},e.prototype.start=function(){return this._idling=!1,this._startTime=Date.now(),this._elapsedTime=0,this._position=0,this.el.removeAttribute(r),this},e.prototype.stop=function(){return this._running=!1,this.el.removeAttribute(r),this.el.removeAttribute("data-scramble-text-running"),this},e}()});var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,r,p){if(p.get||p.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[r]=p.value)},$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.SYMBOL_PREFIX="jscomp_symbol_",$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){},$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)},$jscomp.symbolCounter_=0,$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++},$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}}),$jscomp.initSymbolIterator=function(){}},$jscomp.arrayIterator=function(e){var r=0;return $jscomp.iteratorPrototype(function(){return rb&&(b+=1),1b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){return-1=g.currentTime)for(var G=0;G=w||!k)&&(g.began||(g.began=!0,f("begin")),f("run")),q>n&&q=k&&r!==k||!k)&&(b(k),x||e())),f("update"),a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);return g.reset=function(){var a=g.direction,c=g.loop;for(g.currentTime=0,g.progress=0,g.paused=!0,g.began=!1,g.completed=!1,g.reversed="reverse"===a,g.remaining="alternate"===a&&1===c?2:c,b(0),a=g.children.length;a--;)g.children[a].reset()},g.tick=function(a){h=a,t||(t=h),k((l+h-t)*q.speed)},g.seek=function(a){k(d(a))},g.pause=function(){var a=v.indexOf(g);-1=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h&&0!==(n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c);++h)var m=a(l,c,b)-k,l=l-m/n;k=l}else if(0===n)k=l;else{var l=h,h=h+.1,g=0;do{m=l+(h-l)/2,n=a(m,c,b)-k,0++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var e,c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={};for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)?d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]),b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;db&&(c.duration=d.duration),c.children.push(d)}),c.seek(0),c.reset(),c.autoplay&&c.restart(),c},c},q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a},q}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.reframe=t()}(this,function(){"use strict";function e(e,t){var i="string"==typeof e?document.querySelectorAll(e):e,n=t||"js-reframe";"length"in i||(i=[i]);for(var r=0;r-1||o.style.width.indexOf("%")>-1)return;var a=(d||o.offsetHeight)/(f||o.offsetWidth)*100,s=document.createElement("div");s.className=n;var l=s.style;l.position="relative",l.width="100%",l.paddingTop=a+"%";var u=o.style;u.position="absolute",u.width="100%",u.height="100%",u.left="0",u.top="0",o.parentNode.insertBefore(s,o),o.parentNode.removeChild(o),s.appendChild(o)}}return e});