File: /home/adventp/www/wp-content/themes/brooklyn/js/typewriter/typewriter.min.js
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Typewriter",[],t):"object"==typeof exports?exports.Typewriter=t():e.Typewriter=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,n){(function(t){for(var r=n(3),o="undefined"==typeof window?t:window,i=["moz","webkit"],a="AnimationFrame",s=o["request"+a],u=o["cancel"+a]||o["cancelRequest"+a],l=0;!s&&l<i.length;l++)s=o[i[l]+"Request"+a],u=o[i[l]+"Cancel"+a]||o[i[l]+"CancelRequest"+a];if(!s||!u){var c=0,p=0,d=[];s=function(e){if(0===d.length){var t=r(),n=Math.max(0,1e3/60-(t-c));c=n+t,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(c)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return d.push({handle:++p,callback:e,cancelled:!1}),p},u=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}e.exports=function(e){return s.call(o,e)},e.exports.cancel=function(){u.apply(o,arguments)},e.exports.polyfill=function(e){e||(e=o),e.requestAnimationFrame=s,e.cancelAnimationFrame=u}}).call(this,n(2))},function(e,t,n){"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){a(e,t,n[t])})}return e}function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.r(t);var s=n(0),u=n.n(s),l=function(e){return new RegExp(/<[a-z][\s\S]*>/i).test(e)},c=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes},p=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},d={TYPE_CHARACTER:"TYPE_CHARACTER",REMOVE_CHARACTER:"REMOVE_CHARACTER",REMOVE_ALL:"REMOVE_ALL",REMOVE_LAST_VISIBLE_NODE:"REMOVE_LAST_VISIBLE_NODE",PAUSE_FOR:"PAUSE_FOR",CALL_FUNCTION:"CALL_FUNCTION",ADD_HTML_TAG_ELEMENT:"ADD_HTML_TAG_ELEMENT",REMOVE_HTML_TAG_ELEMENT:"REMOVE_HTML_TAG_ELEMENT",CHANGE_DELETE_SPEED:"CHANGE_DELETE_SPEED",CHANGE_DELAY:"CHANGE_DELAY",CHANGE_CURSOR:"CHANGE_CURSOR"},f={HTML_TAG:"HTML_TAG",TEXT_NODE:"TEXT_NODE"},E=function(){function e(t,n){var i=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"state",{cursorAnimation:null,lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null,elements:{container:null,wrapper:document.createElement("span"),cursor:document.createElement("span")}}),a(this,"options",{strings:null,cursor:"|",delay:"natural",deleteSpeed:"natural",loop:!1,autoStart:!1,devMode:!1,skipAddStyles:!1,wrapperClassName:"Typewriter__wrapper",cursorClassName:"Typewriter__cursor",stringSplitter:null}),a(this,"setupWrapperElement",function(){i.state.elements.wrapper.className=i.options.wrapperClassName,i.state.elements.cursor.className=i.options.cursorClassName,i.state.elements.cursor.innerHTML=i.options.cursor,i.state.elements.container.innerHTML="",i.state.elements.container.appendChild(i.state.elements.wrapper),i.state.elements.container.appendChild(i.state.elements.cursor)}),a(this,"start",function(){return i.state.eventLoopPaused=!1,i.runEventLoop(),i}),a(this,"pause",function(){return i.state.eventLoopPaused=!0,i}),a(this,"stop",function(){return i.state.eventLoop&&(Object(s.cancel)(i.state.eventLoop),i.state.eventLoop=null),i}),a(this,"pauseFor",function(e){return i.addEventToQueue(d.PAUSE_FOR,{ms:e}),i}),a(this,"typeOutAllStrings",function(){return"string"==typeof i.options.strings?(i.typeString(i.options.strings).pauseFor(1500),i):(i.options.strings.forEach(function(e){i.typeString(e).pauseFor(1500).deleteAll()}),i)}),a(this,"typeString",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(l(e))return i.typeOutHTMLString(e,t);if(e){var n=(i.options||{}).stringSplitter,r="function"==typeof n?n(e):e.split("");i.typeCharacters(r,t)}return i}),a(this,"typeOutHTMLString",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=c(e);if(n.length>0)for(var r=0;r<n.length;r++){var o=n[r],a=o.innerHTML;o&&3!==o.nodeType?(o.innerHTML="",i.addEventToQueue(d.ADD_HTML_TAG_ELEMENT,{node:o,parentNode:t}),i.typeString(a,o)):o.textContent&&i.typeString(o.textContent,t)}return i}),a(this,"deleteAll",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"natural";return i.addEventToQueue(d.REMOVE_ALL,{speed:e}),i}),a(this,"changeDeleteSpeed",function(e){if(!e)throw new Error("Must provide new delete speed");return i.addEventToQueue(d.CHANGE_DELETE_SPEED,{speed:e}),i}),a(this,"changeDelay",function(e){if(!e)throw new Error("Must provide new delay");return i.addEventToQueue(d.CHANGE_DELAY,{delay:e}),i}),a(this,"changeCursor",function(e){if(!e)throw new Error("Must provide new cursor");return i.addEventToQueue(d.CHANGE_CURSOR,{cursor:e}),i}),a(this,"deleteChars",function(e){if(!e)throw new Error("Must provide amount of characters to delete");for(var t=0;t<e;t++)i.addEventToQueue(d.REMOVE_CHARACTER);return i}),a(this,"callFunction",function(e,t){if(!e||"function"!=typeof e)throw new Error("Callbak must be a function");return i.addEventToQueue(d.CALL_FUNCTION,{cb:e,thisArg:t}),i}),a(this,"typeCharacters",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach(function(e){i.addEventToQueue(d.TYPE_CHARACTER,{character:e,node:t})}),i}),a(this,"removeCharacters",function(e){if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach(function(){i.addEventToQueue(d.REMOVE_CHARACTER)}),i}),a(this,"addEventToQueue",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.addEventToStateProperty(e,t,n,"eventQueue")}),a(this,"addReverseCalledEvent",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i.options.loop?i.addEventToStateProperty(e,t,n,"reverseCalledEvents"):i}),a(this,"addEventToStateProperty",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,a={eventName:e,eventArgs:t||{}};return i.state[r]=n?[a].concat(o(i.state[r])):[].concat(o(i.state[r]),[a]),i}),a(this,"runEventLoop",function(){i.state.lastFrameTime||(i.state.lastFrameTime=Date.now());var e=Date.now(),t=e-i.state.lastFrameTime;if(!i.state.eventQueue.length){if(!i.options.loop)return;i.state.eventQueue=o(i.state.calledEvents),i.state.calledEvents=[],i.options=r({},i.state.initialOptions)}if(i.state.eventLoop=u()(i.runEventLoop),!i.state.eventLoopPaused){if(i.state.pauseUntil){if(e<i.state.pauseUntil)return;i.state.pauseUntil=null}var n=o(i.state.eventQueue),a=n.shift(),s=0;if(!(t<=(s=a.eventName===d.REMOVE_LAST_VISIBLE_NODE||a.eventName===d.REMOVE_CHARACTER?"natural"===i.options.deleteSpeed?p(40,80):i.options.deleteSpeed:"natural"===i.options.delay?p(120,160):i.options.delay))){var l=a.eventName,c=a.eventArgs;switch(i.logInDevMode({currentEvent:a,state:i.state,delay:s}),l){case d.TYPE_CHARACTER:var E=c.character,v=c.node,h=document.createTextNode(E);v?v.appendChild(h):i.state.elements.wrapper.appendChild(h),i.state.visibleNodes=[].concat(o(i.state.visibleNodes),[{type:f.TEXT_NODE,node:h}]);break;case d.REMOVE_CHARACTER:n.unshift({eventName:d.REMOVE_LAST_VISIBLE_NODE,eventArgs:{removingCharacterNode:!0}});break;case d.PAUSE_FOR:var m=a.eventArgs.ms;i.state.pauseUntil=Date.now()+parseInt(m);break;case d.CALL_FUNCTION:var T=a.eventArgs,_=T.cb,y=T.thisArg;_.call(y,{elements:i.state.elements});break;case d.ADD_HTML_TAG_ELEMENT:var A=a.eventArgs,g=A.node,w=A.parentNode;w?w.appendChild(g):i.state.elements.wrapper.appendChild(g),i.state.visibleNodes=[].concat(o(i.state.visibleNodes),[{type:f.HTML_TAG,node:g,parentNode:w||i.state.elements.wrapper}]);break;case d.REMOVE_ALL:var L=i.state.visibleNodes,C=c.speed,N=[];C&&N.push({eventName:d.CHANGE_DELETE_SPEED,eventArgs:{speed:C,temp:!0}});for(var b=0,O=L.length;b<O;b++)N.push({eventName:d.REMOVE_LAST_VISIBLE_NODE,eventArgs:{removingCharacterNode:!1}});C&&N.push({eventName:d.CHANGE_DELETE_SPEED,eventArgs:{speed:i.options.deleteSpeed,temp:!0}}),n.unshift.apply(n,N);break;case d.REMOVE_LAST_VISIBLE_NODE:var S=a.eventArgs.removingCharacterNode;if(i.state.visibleNodes.length){var R=i.state.visibleNodes.pop(),M=R.type,D=R.node;D.parentNode.removeChild(D),M===f.HTML_TAG&&S&&n.unshift({eventName:d.REMOVE_LAST_VISIBLE_NODE,eventArgs:{}})}break;case d.CHANGE_DELETE_SPEED:i.options.deleteSpeed=a.eventArgs.speed;break;case d.CHANGE_DELAY:i.options.delay=a.eventArgs.delay;break;case d.CHANGE_CURSOR:i.options.cursor=a.eventArgs.cursor,i.state.elements.cursor.innerHTML=a.eventArgs.cursor}i.options.loop&&(a.eventName===d.REMOVE_LAST_VISIBLE_NODE||a.eventArgs&&a.eventArgs.temp||(i.state.calledEvents=[].concat(o(i.state.calledEvents),[a]))),i.state.eventQueue=n,i.state.lastFrameTime=e}}}),!t)throw new Error("No container element was provided");if("string"==typeof t){var E=document.querySelector(t);if(!E)throw new Error("Could not find container element");this.state.elements.container=E}else this.state.elements.container=t;n&&(this.options=r({},this.options,n)),this.state.initialOptions=r({},this.options),this.init()}var t,n;return t=e,(n=[{key:"init",value:function(){this.setupWrapperElement(),this.addEventToQueue(d.CHANGE_CURSOR,{cursor:this.options.cursor},!0),this.addEventToQueue(d.REMOVE_ALL,null,!0),!window||window.___TYPEWRITER_JS_STYLES_ADDED___||this.options.skipAddStyles||(function(e){var t=document.createElement("style");t.appendChild(document.createTextNode(e)),document.head.appendChild(t)}(".Typewriter__cursor{-webkit-animation:Typewriter-cursor 1s infinite;animation:Typewriter-cursor 1s infinite;margin-left:1px}@-webkit-keyframes Typewriter-cursor{0%{opacity:0}50%{opacity:1}100%{opacity:0}}@keyframes Typewriter-cursor{0%{opacity:0}50%{opacity:1}100%{opacity:0}}"),window.___TYPEWRITER_JS_STYLES_ADDED___=!0),!0===this.options.autoStart&&this.options.strings&&this.typeOutAllStrings().start()}},{key:"logInDevMode",value:function(e){this.options.devMode&&console.log(e)}}])&&i(t.prototype,n),e}();n.d(t,"default",function(){return E})},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(t){(function(){var n,r,o,i,a,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,i=(n=function(){var e;return 1e9*(e=r())[0]+e[1]})(),s=1e9*t.uptime(),a=i-s):Date.now?(e.exports=function(){return Date.now()-o},o=Date.now()):(e.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,n(4))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(){E&&d&&(E=!1,d.length?f=d.concat(f):v=-1,f.length&&a())}function a(){if(!E){var e=o(i);E=!0;for(var t=f.length;t;){for(d=f,f=[];++v<t;)d&&d[v].run();v=-1,t=f.length}d=null,E=!1,function(e){if(c===clearTimeout)return clearTimeout(e);if((c===r||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}(e)}}function s(e,t){this.fun=e,this.array=t}function u(){}var l,c,p=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{c="function"==typeof clearTimeout?clearTimeout:r}catch(e){c=r}}();var d,f=[],E=!1,v=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];f.push(new s(e,t)),1!==f.length||E||o(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.prependListener=u,p.prependOnceListener=u,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}}]).default});