!function(e){"use strict";var t=function(t,o){this.el=e(t),this.options=e.extend({},e.fn.typed.defaults,o),this.isInput=this.el.is("input"),this.attr=this.options.attr,this.showCursor=this.isInput?!1: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()};t.prototype={constructor:t,init:function(){var e=this;e.timeout=setTimeout(function(){for(var t=0;t'+this.cursorChar+""),this.el.after(this.cursor)),this.stringsElement){this.strings=[],this.stringsElement.hide(),console.log(this.stringsElement.children());var o=this.stringsElement.children();e.each(o,function(o,l){t.strings.push(e(l).html())})}this.init()},typewrite:function(e,t){if(this.stop!==!0){var o=Math.round(70*Math.random())+this.typeSpeed,l=this;l.timeout=setTimeout(function(){var o=0,a=e.substr(t);if("^"===a.charAt(0)){var i=1;/^\^\d+/.test(a)&&(a=/\d+/.exec(a)[0],i+=a.length,o=parseInt(a)),e=e.substring(0,t)+e.substring(t+i)}if("html"===l.contentType){var s=e.substr(t).charAt(0);if("<"===s||"&"===s){var n="",r="";for(r="<"===s?">":";";e.substr(t+1).charAt(0)!==r&&(n+=e.substr(t).charAt(0),t++,!(t+1>e.length)););t++,n+=r}}l.timeout=setTimeout(function(){if(t===e.length){if(l.options.onStringTyped(l.arrayPos),l.arrayPos===l.strings.length-1&&(l.options.callback(),l.curLoop++,l.loop===!1||l.curLoop===l.loopCount))return;l.timeout=setTimeout(function(){l.backspace(e,t)},l.backDelay)}else{0===t&&l.options.preStringTyped(l.arrayPos);var o=e.substr(0,t+1);l.attr?l.el.attr(l.attr,o):l.isInput?l.el.val(o):"html"===l.contentType?l.el.html(o):l.el.text(o),t++,l.typewrite(e,t)}},o)},o)}},backspace:function(e,t){if(this.stop!==!0){var o=Math.round(70*Math.random())+this.backSpeed,l=this;l.timeout=setTimeout(function(){if("html"===l.contentType&&">"===e.substr(t).charAt(0)){for(var o="";"<"!==e.substr(t-1).charAt(0)&&(o-=e.substr(t).charAt(0),t--,!(0>t)););t--,o+="<"}var a=e.substr(0,t);l.attr?l.el.attr(l.attr,a):l.isInput?l.el.val(a):"html"===l.contentType?l.el.html(a):l.el.text(a),t>l.stopNum?(t--,l.backspace(e,t)):t<=l.stopNum&&(l.arrayPos++,l.arrayPos===l.strings.length?(l.arrayPos=0,l.shuffle&&(l.sequence=l.shuffleArray(l.sequence)),l.init()):l.typewrite(l.strings[l.sequence[l.arrayPos]],t))},o)}},shuffleArray:function(e){var t,o,l=e.length;if(l)for(;--l;)o=Math.floor(Math.random()*(l+1)),t=e[o],e[o]=e[l],e[l]=t;return e},reset:function(){var e=this;clearInterval(e.timeout);this.el.attr("id");this.el.empty(),"undefined"!=typeof this.cursor&&this.cursor.remove(),this.strPos=0,this.arrayPos=0,this.curLoop=0,this.options.resetCallback()}},e.fn.typed=function(o){return this.each(function(){var l=e(this),a=l.data("typed"),i="object"==typeof o&&o;a&&a.reset(),l.data("typed",a=new t(this,i)),"string"==typeof o&&a[o]()})},e.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:function(){},preStringTyped:function(){},onStringTyped:function(){},resetCallback:function(){}}}(window.jQuery);