!function(r){function o(t,s){this.el=r(t),this.options=r.extend({},r.fn.typed.defaults,s),this.isInput=this.el.is("input"),this.attr=this.options.attr,this.showCursor=!this.isInput&&this.options.showCursor,this.elContent=this.attr?this.el.attr(this.attr):this.el.text(),this.contentType=this.options.contentType,this.typeSpeed=this.options.typeSpeed,this.startDelay=this.options.startDelay,this.backSpeed=this.options.backSpeed,this.backDelay=this.options.backDelay,this.stringsElement=this.options.stringsElement,this.strings=this.options.strings,this.strPos=0,this.arrayPos=0,this.stopNum=0,this.loop=this.options.loop,this.loopCount=this.options.loopCount,this.curLoop=0,this.stop=!1,this.cursorChar=this.options.cursorChar,this.shuffle=this.options.shuffle,this.sequence=[],this.build()}o.prototype={constructor:o,init(){let s=this;s.timeout=setTimeout(function(){for(let t=0;t'+this.cursorChar+""),this.el.after(this.cursor)),this.stringsElement&&(this.strings=[],this.stringsElement.hide(),console.log(this.stringsElement.children()),t=this.stringsElement.children(),r.each(t,function(t,s){e.strings.push(r(s).html())})),this.init()},typewrite(o,n){if(!0!==this.stop){var t=Math.round(70*Math.random())+this.typeSpeed;let r=this;r.timeout=setTimeout(function(){let s=0,e=o.substr(n);if("^"===e.charAt(0)){let t=1;/^\^\d+/.test(e)&&(e=/\d+/.exec(e)[0],t+=e.length,s=parseInt(e)),o=o.substring(0,n)+o.substring(n+t)}if("html"===r.contentType){var i=o.substr(n).charAt(0);if("<"===i){let t="",s="";for(s="<"===i?">":";";o.substr(n+1).charAt(0)!==s&&(t+=o.substr(n).charAt(0),!(++n+1>o.length)););n++,t+=s}}r.timeout=setTimeout(function(){var t;n===o.length?(r.options.onStringTyped(r.arrayPos),r.arrayPos===r.strings.length-1&&(r.options.callback(),r.curLoop++,!1===r.loop||r.curLoop===r.loopCount)||(r.timeout=setTimeout(function(){r.backspace(o,n)},r.backDelay))):(0===n&&r.options.preStringTyped(r.arrayPos),t=o.substr(0,n+1),r.attr?r.el.attr(r.attr,t):r.isInput?r.el.val(t):"html"===r.contentType?r.el.html(t):r.el.text(t),n++,r.typewrite(o,n))},s)},t)}},backspace(e,i){if(!0!==this.stop){var t=Math.round(70*Math.random())+this.backSpeed;let s=this;s.timeout=setTimeout(function(){if("html"===s.contentType&&">"===e.substr(i).charAt(0)){let t="";for(;"<"!==e.substr(i-1).charAt(0)&&(t-=e.substr(i).charAt(0),!(--i<0)););i--,t+="<"}var t=e.substr(0,i);s.attr?s.el.attr(s.attr,t):s.isInput?s.el.val(t):"html"===s.contentType?s.el.html(t):s.el.text(t),i>s.stopNum?(i--,s.backspace(e,i)):i<=s.stopNum&&(s.arrayPos++,s.arrayPos===s.strings.length?(s.arrayPos=0,s.shuffle&&(s.sequence=s.shuffleArray(s.sequence)),s.init()):s.typewrite(s.strings[s.sequence[s.arrayPos]],i))},t)}},shuffleArray(t){let s,e,i=t.length;if(i)for(;--i;)s=t[e=Math.floor(Math.random()*(i+1))],t[e]=t[i],t[i]=s;return t},reset(){clearInterval(this.timeout),this.el.attr("id");this.el.empty(),void 0!==this.cursor&&this.cursor.remove(),this.strPos=0,this.arrayPos=0,this.curLoop=0,this.options.resetCallback()}},r.fn.typed=function(i){return this.each(function(){let t=r(this),s=t.data("typed"),e="object"==typeof i&&i;s&&s.reset(),t.data("typed",s=new o(this,e)),"string"==typeof i&&s[i]()})},r.fn.typed.defaults={strings:["These are the default values...","You know what you should do?","Use your own!","Have a great day!"],stringsElement:null,typeSpeed:0,startDelay:0,backSpeed:0,shuffle:!1,backDelay:500,loop:!1,loopCount:!1,showCursor:!0,cursorChar:"|",attr:null,contentType:"html",callback(){},preStringTyped(){},onStringTyped(){},resetCallback(){}}}(window.jQuery);