Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typeit

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeit - npm Package Compare versions

Comparing version 7.0.0-rc1 to 7.0.0-rc2

4

dist/typeit.es.min.js
/**
* TypeIt - The most versatile animated typing utility on the planet.
* Author: Alex MacArthur <alex@macarthur.me> (https://macarthur.me)
* Version: v6.5.1
* Version: v7.0.0-rc1
* License: GPL-2.0
* URL: https://typeitjs.com
*/
var e={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},t=e=>e.map(e=>(void 0===e[1]&&e.push(null),void 0===e[2]&&e.push({}),e)),n=(e,t)=>Object.assign({},e,t),r=(e,t)=>(e[2]=n(e[2],t)||t,e),i=(e,t)=>Array.isArray(e[0])?e.map(e=>r(e,t)):r(e,t),o=(e,t,n,r)=>{r=r||!1,n=n||{};var o=!Array.isArray(e),a=e.length;return(e=o?new Array(e).fill(0):e).map((e,u)=>{if(o)return t;var s=[t,e,n];return r&&(0===u&&(s=i(s,{isFirst:!0})),u+1===a&&(s=i(s,{isLast:!0}))),s})};function a(e){this.insert=function(e,t){n.splice(e,0,t)},this.add=function(e,t,r){return e=Array.isArray(e)?e:[e,null],r=r||!1,t=t||1,Array.isArray(e[0])||(e=o(t,e)),n=r?e.concat(n):n.concat(e),this},this.delete=function(e){return n.splice(e,1),this},this.reset=function(){return n=t(n).map(e=>(e[2].executed=!1,e)),this},this.getItems=function(){return t(n).filter(e=>!e.executed)};var n=[];e&&this.add(e)}var u=e=>Array.from(e),s=e=>{var t=[];return t.concat.apply(t,e)},c=e=>{var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body},l=e=>3===e.nodeType||"BR"===e.tagName,f=(e,t,n)=>{t=t||null,n=void 0!==n&&n;var r=u(e.childNodes).map(e=>l(e)?e:f(e));return r=s(r),t&&(r=r.filter(e=>!e.parentNode.isEqualNode(t))),n?r.reverse():r},d=(e,t)=>{t=t||null;var n=e instanceof HTMLElement;return{node:t,isTopLevelText:!(t&&"BODY"!==t.parentNode.tagName||n),isHTMLElement:n,content:e}};function h(e){var t,n=c(e);return t=f(n).map(e=>e.nodeValue?u(e.nodeValue).map(t=>d(t,e)):d(e)),s(t)}function v(e,t){return(t=void 0===t||t)?h(e):u(e).map(e=>d(e))}var p=e=>document.createElement(e),m=(e,t)=>{var n=p("style");n.id=t||"",n.appendChild(document.createTextNode(e)),document.head.appendChild(n)},y=e=>(Array.isArray(e)||(e=[e/2,e/2]),{before:e[0],after:e[1],total:e[0]+e[1]}),g=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));var b=e=>["textarea","input"].indexOf(e.tagName.toLowerCase())>-1,S=(e,t)=>{var n=t.querySelectorAll("*");return[t].concat(u(n).reverse()).find(t=>t.cloneNode().outerHTML===e.outerHTML)},N=(e,t,n,r)=>{n=n||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(b(e))e.value="".concat(e.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var a=t.node.parentNode,u=S(a.cloneNode(),e);if(((e,t)=>{if(!e)return!1;var n=e.nextSibling;return!n||n.isEqualNode(t)})(u,n))e=u;else if((o=a.cloneNode()).innerText=t.content,"BODY"!==a.parentNode.tagName){for(var s=a.parentNode,c=s.cloneNode(),l=S(c,e);!l&&"BODY"!==s.tagName;)c.innerHTML=o.outerHTML,o=c,c=s.parentNode.cloneNode(),s=s.parentNode,l=S(c,e);l&&(e=l)}}var d=f(e,n,!0);d=d[r-1],d=e.querySelector(".ti-cursor")||d,e.insertBefore(o,d||null)}},T=e=>e&&e.parentNode.removeChild(e),L=e=>!e.firstChild&&!l(e),A=e=>e.some(e=>L(e));var D=(e,t,n)=>{var r,i="string"==typeof e,o=!1,a=-1*e;return i&&(a=(r="END"===e.toUpperCase())?-1:1,o=r?t+a>0:t+a<n.length),{isString:i,numberOfSteps:a,canKeepMoving:o}};function M(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function x(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function w(){}function E(e,t){if(!t)return e&&e.then?e.then(w):Promise.resolve()}function C(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function H(e,t,n){if(!e.s){if(n instanceof O){if(!n.s)return void(n.o=H.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(H.bind(null,e,t),H.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var O=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{H(r,1,o(this.v))}catch(e){H(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?H(r,1,t?t(i):i):n?H(r,1,n(i)):H(r,2,i)}catch(e){H(r,2,e)}},r},e}();function P(e,t){return e&&e.then?e.then(t):t(e)}export default function(t,r){var i=this;r=r||{};var s=(e,t)=>(ie.add(e,t),this),l=e=>{e=e||{};var t=n({},_),r=n(t,e);return[[Y,r,{force:!0}],[Y,t,{force:!0}]]},S=()=>G?u(Q.value):f(Q,oe,!0),k=(e,t)=>{t=t||1;var n=_.nextStringDelay;ie.insert(e,[R,n.before]),ie.insert(e+t+1,[R,n.after])},z=e=>{oe&&(oe.classList.toggle("disabled",e),oe.classList.toggle("with-delay",!e))},B=x((function(e,t){return W.push(setTimeout(e,t)),M()})),q=x((function(e){return C((function(){if(X)return E(move(-1*X))}),(function(){ie.reset().delete(0).add([R,e.before],!0),S().forEach(e=>{ie.add([F,null,{isPhantom:!0}],1,!0)})}))})),I=x((function(){$.started=!0;var e=ie.getItems();return P(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return P(function(e,t,n){var r,i,o=-1;return function a(u){try{for(;++o<e.length&&(!n||!n());)if((u=t(o))&&u.then){if(!((s=u)instanceof O&&1&s.s))return void u.then(a,i||(i=H.bind(null,r=new O,2)));u=u.v}r?H(r,1,u):r=u}catch(e){H(r||(r=new O),2,e)}var s}(),r}(e,(function(t){if($.frozen||$.destroyed)throw"";var n,r,o,a,u=e[t],s=u[2],c=[u,ie,i];return s.freezeCursor&&z(!0),n=_.speed,r=_.deleteSpeed,o=_.lifeLike,a=(r=null!==r?r:n/3)/2,J=o?[g(n,n/2),g(r,a)]:[n,r],C((function(){var e;if(null==s?void 0:s.isFirst)return E((e=_).beforeString.apply(e,c))}),(function(){var e;return M((e=_).beforeStep.apply(e,c),(function(){return M(u[0].call(i,u[1],s),(function(){return C((function(){if(!s||!s.isPhantom)return C((function(){var e,t;if(null===(e=u[2])||void 0===e?void 0:e.isLast)return E((t=_).afterString.apply(t,c))}),(function(){var e;return M((e=_).afterStep.apply(e,c),(function(){u[2].executed=!0}))}))}),(function(){z(!1)}))}))}))}))}),(function(){return!1})),(function(e){return $.completed=!0,M(_.afterComplete(i),(function(){if(_.loop){var e=_.loopDelay||_.nextStringDelay;B((function(){return M(q(e),(function(){I()}))}),e.after)}}))}))}),w),(function(e){return i}))})),R=e=>new Promise(t=>{B(()=>t(),e||_.nextStringDelay.total)}),V=e=>{var t=S(),n=D(e,X,t);return X+=n.numberOfSteps,new Promise(e=>{B(x((function(){return((e,t,n,r)=>{if(n){var i=r,o=t[(i=i>t.length?t.length:i)-1];e.insertBefore(n,o||null)}})(Q,S(),oe,X),C((function(){if(n.isString&&n.canKeepMoving)return E(V(n.numberOfSteps>0?"START":"END"))}),(function(){return e()}))})),J[0])})},U=e=>new Promise(t=>{B(()=>(N(Q,e,oe,X),t()),J[0])}),Y=x((function(e){_=n(_,e)})),j=x((function(){G?Q.value="":S().forEach(e=>{T(e)})})),F=e=>(e=!0===e,new Promise(t=>{B(x((function(){var n=!1,r=S();return r.length&&(G?Q.value=Q.value.slice(0,-1):T(r[X])),(e=>{for(var t=u(e.querySelectorAll("*")),n=A(t);t.length&&n;){var r=!1;t.forEach(e=>{L(e)&&(T(e),r=!0)}),r&&(t=u(e.querySelectorAll("*"))),n=A(t)}})(Q),C((function(){if(e&&r.length-1>0)return M(F(!0),(function(){return n=!0,t()}))}),(function(e){return n?e:t()}))})),J[1])}));this.break=function(){return ie.add([U,p("BR")])},this.delete=function(e,t){var n=l(t);return ie.add(n[0]),ie.add([F,!e,Z],e||1),ie.add(n[1]),this},this.destroy=function(e){e=void 0===e||e,W.forEach(e=>{clearTimeout(e)}),W=[],e&&T(oe),$.destroyed=!0},this.empty=function(){return s(j)},this.exec=function(e,t){var n=l(t);return s([n[0],[e,null],n[1]])},this.is=function(e){return $[e]},this.move=function(e,t){var n=D(e,X,S()),r=l(t);return ie.add(r[0]),ie.add([V,n.isString?e:Math.sign(e),Z],Math.abs(e)),ie.add(r[1]),this},this.freeze=function(){$.frozen=!0},this.unfreeze=function(){$.frozen=!1,!$.frozen&&I()},this.options=function(e){return s([Y,e])},this.pause=function(e){return s([R,e||null])},this.type=function(e,t){var n=l(t),r=v(e,_.html),i=[n[0]].concat(o(r,U,Z,!0),[n[1]]);return s(i)},this.getQueue=function(){return ie},this.getOptions=function(){return _},this.reset=function(){for(var e in!this.is("destroyed")&&this.destroy(),ie.reset(),$)$[e]=!1;return this},this.go=function(){return $.started?this:((()=>{if(oe){var e="[data-typeit-id='".concat(re,"'] .ti-cursor");m("@keyframes blink-".concat(re," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(e," { animation: blink-").concat(re," ").concat(_.cursorSpeed/1e3,"s infinite; } ").concat(e,".with-delay { animation-delay: 500ms; } ").concat(e,".disabled { animation: none; }"),re),Q.appendChild(oe)}})(),_.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Q,I.bind(this)),this):(I(),this))};var K,Q="string"==typeof(K=t)?document.querySelector(K):K,G=b(Q),J=[],W=[],X=0,Z={freezeCursor:!0},$={started:!1,completed:!1,frozen:!1,destroyed:!1},_=n(e,r);_=n(_,{html:!G&&_.html,nextStringDelay:y(_.nextStringDelay),loopDelay:y(_.loopDelay)});var ee,te,ne,re=Math.random().toString().substring(2,9),ie=new a([R,_.startDelay]);Q.setAttribute("data-typeit-id",re),m("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}"),_.strings=(ne=_.strings,ee=Array.isArray(ne)?ne:[ne],(te=(e=>e.innerHTML.replace(/<\!--.*?-->/g,"").trim())(Q))?(Q.innerHTML="",_.startDelete?(h(te).forEach(e=>{N(Q,e,oe,X)}),ie.add([F,!0]),k(1),ee):[te.trim()].concat(ee)):ee);var oe=(()=>{if(G||!_.cursor)return null;var e=p("span");return e.innerHTML=c(_.cursorChar).innerHTML,e.className="ti-cursor",e.setAttribute("style","display:inline;position:absolute;font:inherit;color:inherit;line-height:inherit;margin-left:-.1em;"),e})();_.strings.length&&(()=>{var e=_.strings;e.forEach((t,n)=>{var r=v(t,_.html);ie.add(o(r,U,Z,!0));var i=ie.getItems().length;if(n+1!==e.length){if(_.breakLines){var a=d(p("BR"));return ie.add([U,a,Z]),void k(i)}ie.add(o(r,F,Z)),k(i,t.length)}})})()}
var e={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},t=e=>e.map(e=>(void 0===e[1]&&e.push(null),void 0===e[2]&&e.push({}),e)),n=(e,t)=>Object.assign({},e,t),r=e=>Array.isArray(e),i=(e,t)=>(e[2]=n(e[2],t)||t,e),o=(e,t)=>r(e[0])?e.map(e=>i(e,t)):i(e,t),a=(e,t,n,i)=>{i=i||!1,n=n||{};var a=!r(e),u=e.length;return(e=a?new Array(e).fill(0):e).map((e,r)=>{if(a)return t;var s=[t,e,n];return i&&(0===r&&(s=o(s,{isFirst:!0})),r+1===u&&(s=o(s,{isLast:!0}))),s})};function u(e){this.insert=function(e,t){n.splice(e,0,t)},this.add=function(e,t,i){return e=r(e)?e:[e,null],i=i||!1,t=t||1,r(e[0])||(e=a(t,e)),n=i?e.concat(n):n.concat(e),this},this.delete=function(e){return n.splice(e,1),this},this.reset=function(){return n=t(n).map(e=>(e[2].executed=!1,e)),this},this.getItems=function(){return t(n).filter(e=>!e.executed)};var n=[];e&&this.add(e)}var s=e=>Array.from(e),c=e=>{var t=[];return t.concat.apply(t,e)},l=e=>{var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body},f=e=>3===e.nodeType||"BR"===e.tagName,d=(e,t,n)=>{t=t||null,n=void 0!==n&&n;var r=s(e.childNodes).map(e=>f(e)?e:d(e));return r=c(r),t&&(r=r.filter(e=>!e.parentNode.isEqualNode(t))),n?r.reverse():r},h=e=>"BODY"===e.tagName,v=(e,t)=>{t=t||null;var n=e instanceof HTMLElement;return{node:t,isTopLevelText:(!t||h(t.parentNode))&&!n,isHTMLElement:n,content:e}};function p(e){var t,n=l(e);return t=d(n).map(e=>e.nodeValue?s(e.nodeValue).map(t=>v(t,e)):v(e)),c(t)}function m(e,t){return(t=void 0===t||t)?p(e):s(e).map(e=>v(e))}var y=e=>document.createElement(e),g=(e,t)=>{var n=y("style");n.id=t||"",n.appendChild(document.createTextNode(e)),document.head.appendChild(n)},b=e=>(r(e)||(e=[e/2,e/2]),{before:e[0],after:e[1],total:e[0]+e[1]}),S=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));var N=e=>["textarea","input"].indexOf(e.tagName.toLowerCase())>-1,T=(e,t)=>{var n=t.querySelectorAll("*");return[t].concat(s(n).reverse()).find(t=>t.cloneNode().outerHTML===e.outerHTML)},L=(e,t,n,r)=>{n=n||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(N(e))e.value="".concat(e.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var a=t.node.parentNode,u=T(a.cloneNode(),e);if(((e,t)=>{if(!e)return!1;var n=e.nextSibling;return!n||n.isEqualNode(t)})(u,n))e=u;else if((o=a.cloneNode()).innerText=t.content,!h(a.parentNode)){for(var s=a.parentNode,c=s.cloneNode(),l=T(c,e);!l&&!h(s);)c.innerHTML=o.outerHTML,o=c,c=s.parentNode.cloneNode(),s=s.parentNode,l=T(c,e);e=l||e}}var f=d(e,n,!0)[r-1],v=f?f.parentNode:e;v.insertBefore(o,v.contains(n)?n:null)}},x=e=>e&&e.parentNode.removeChild(e),M=e=>!e.firstChild&&!f(e),w=e=>e.some(e=>M(e));var D=(e,t,n)=>{var r,i="string"==typeof e,o=!1,a=-1*e;return i&&(a=(r="END"===e.toUpperCase())?-1:1,o=r?t+a>0:t+a<n.length),{isString:i,numberOfSteps:a,canKeepMoving:o}};function E(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function C(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function H(){}function P(e,t){if(!t)return e&&e.then?e.then(H):Promise.resolve()}function A(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function k(e,t,n){if(!e.s){if(n instanceof z){if(!n.s)return void(n.o=k.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(k.bind(null,e,t),k.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var z=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var o=1&i?t:n;if(o){try{k(r,1,o(this.v))}catch(e){k(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?k(r,1,t?t(i):i):n?k(r,1,n(i)):k(r,2,i)}catch(e){k(r,2,e)}},r},e}();function O(e,t){return e&&e.then?e.then(t):t(e)}export default function(t,i){var o=this;i=i||{};var c=(e,t)=>(oe.add(e,t),this),f=e=>{e=e||{};var t=n({},ee),r=n(t,e);return[[F,r,{force:!0}],[F,t,{force:!0}]]},h=()=>J?s(G.value):d(G,ae,!0),T=(e,t)=>{t=t||1;var n=ee.nextStringDelay;oe.insert(e,[V,n.before]),oe.insert(e+t+1,[V,n.after])},q=e=>{ae&&(ae.classList.toggle("disabled",e),ae.classList.toggle("with-delay",!e))},B=C((function(e,t){return X.push(setTimeout(e,t)),E()})),I=C((function(e){return A((function(){if(Z)return P(move(-1*Z))}),(function(){oe.reset().delete(0).add([V,e.before],!0),h().forEach(e=>{oe.add([Q,null,{isPhantom:!0}],1,!0)})}))})),R=C((function(){_.started=!0;var e=oe.getItems();return O(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return O(function(e,t,n){var r,i,o=-1;return function a(u){try{for(;++o<e.length&&(!n||!n());)if((u=t(o))&&u.then){if(!((s=u)instanceof z&&1&s.s))return void u.then(a,i||(i=k.bind(null,r=new z,2)));u=u.v}r?k(r,1,u):r=u}catch(e){k(r||(r=new z),2,e)}var s}(),r}(e,(function(t){if(_.frozen||_.destroyed)throw"";var n,r,i,a,u=e[t],s=u[2],c=[u,oe,o];return s.freezeCursor&&q(!0),n=ee.speed,r=ee.deleteSpeed,i=ee.lifeLike,a=(r=null!==r?r:n/3)/2,W=i?[S(n,n/2),S(r,a)]:[n,r],A((function(){var e;if(null==s?void 0:s.isFirst)return P((e=ee).beforeString.apply(e,c))}),(function(){var e;return E((e=ee).beforeStep.apply(e,c),(function(){return E(u[0].call(o,u[1],s),(function(){return A((function(){if(!s||!s.isPhantom)return A((function(){var e,t;if(null===(e=u[2])||void 0===e?void 0:e.isLast)return P((t=ee).afterString.apply(t,c))}),(function(){var e;return E((e=ee).afterStep.apply(e,c),(function(){u[2].executed=!0}))}))}),(function(){q(!1)}))}))}))}))}),(function(){return!1})),(function(e){return _.completed=!0,E(ee.afterComplete(o),(function(){if(ee.loop){var e=ee.loopDelay||ee.nextStringDelay;B((function(){return E(I(e),(function(){R()}))}),e.after)}}))}))}),H),(function(e){return o}))})),V=e=>new Promise(t=>{B(()=>t(),e||ee.nextStringDelay.total)}),U=e=>{var t=h(),n=D(e,Z,t);return Z+=n.numberOfSteps,new Promise(e=>{B(C((function(){return((e,t,n,r)=>{if(n){var i=r,o=t[(i=i>t.length?t.length:i)-1];(e=o?o.parentNode:e).insertBefore(n,o||null)}})(G,h(),ae,Z),A((function(){if(n.isString&&n.canKeepMoving)return P(U(n.numberOfSteps>0?"START":"END"))}),(function(){return e()}))})),W[0])})},j=e=>new Promise(t=>{B(()=>(L(G,e,ae,Z),t()),W[0])}),F=C((function(e){ee=n(ee,e)})),K=C((function(){J?G.value="":h().forEach(e=>{x(e)})})),Q=e=>(e=!0===e,new Promise(t=>{B(C((function(){var n=!1,r=h();return r.length&&(J?G.value=G.value.slice(0,-1):x(r[Z])),(e=>{for(var t=s(e.querySelectorAll("*")),n=w(t);t.length&&n;){var r=!1;t.forEach(e=>{M(e)&&(x(e),r=!0)}),r&&(t=s(e.querySelectorAll("*"))),n=w(t)}})(G),A((function(){if(e&&r.length-1>0)return E(Q(!0),(function(){return n=!0,t()}))}),(function(e){return n?e:t()}))})),W[1])}));this.break=function(){return oe.add([j,y("BR")])},this.delete=function(e,t){var n=f(t);return oe.add(n[0]),oe.add([Q,!e,$],e||1),oe.add(n[1]),this},this.destroy=function(e){e=void 0===e||e,X.forEach(e=>{clearTimeout(e)}),X=[],e&&x(ae),_.destroyed=!0},this.empty=function(){return c(K)},this.exec=function(e,t){var n=f(t);return c([n[0],[e,null],n[1]])},this.is=function(e){return _[e]},this.move=function(e,t){var n=D(e,Z,h()),r=f(t);return oe.add(r[0]),oe.add([U,n.isString?e:Math.sign(e),$],Math.abs(e)),oe.add(r[1]),this},this.freeze=function(){_.frozen=!0},this.unfreeze=function(){_.frozen=!1,!_.frozen&&R()},this.options=function(e){return c([F,e])},this.pause=function(e){return c([V,e||null])},this.type=function(e,t){var n=f(t),r=m(e,ee.html),i=[n[0]].concat(a(r,j,$,!0),[n[1]]);return c(i)},this.getQueue=function(){return oe},this.getOptions=function(){return ee},this.reset=function(){for(var e in!this.is("destroyed")&&this.destroy(),oe.reset(),_)_[e]=!1;return this},this.go=function(){return _.started?this:((()=>{if(ae){var e="[data-typeit-id='".concat(ie,"'] .ti-cursor");g("@keyframes blink-".concat(ie," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(e," { animation: blink-").concat(ie," ").concat(ee.cursorSpeed/1e3,"s infinite; } ").concat(e,".with-delay { animation-delay: 500ms; } ").concat(e,".disabled { animation: none; }"),ie),G.appendChild(ae)}})(),ee.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(G,R.bind(this)),this):(R(),this))};var Y,G="string"==typeof(Y=t)?document.querySelector(Y):Y,J=N(G),W=[],X=[],Z=0,$={freezeCursor:!0},_={started:!1,completed:!1,frozen:!1,destroyed:!1},ee=n(e,i);ee=n(ee,{html:!J&&ee.html,nextStringDelay:b(ee.nextStringDelay),loopDelay:b(ee.loopDelay)});var te,ne,re,ie=Math.random().toString().substring(2,9),oe=new u([V,ee.startDelay]);G.setAttribute("data-typeit-id",ie),g("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}"),ee.strings=(re=ee.strings,te=r(re)?re:[re],(ne=(e=>e.innerHTML.replace(/<\!--.*?-->/g,"").trim())(G))?(G.innerHTML="",ee.startDelete?(p(ne).forEach(e=>{L(G,e,ae,Z)}),oe.add([Q,!0]),T(1),te):[ne.trim()].concat(te)):te);var ae=(()=>{if(J||!ee.cursor)return null;var e=y("span");return e.innerHTML=l(ee.cursorChar).innerHTML,e.className="ti-cursor",e.style.cssText="position:absolute;display:inline;margin-left:-.025em;".concat((e=>{var t=["font","lineHeight","color"],n=y("SPAN"),r=window.getComputedStyle(e,null);for(var i in r)t.indexOf(i)>-1&&r[i]&&(n.style[i]=r[i]);return n.style.cssText})(G)),e})();ee.strings.length&&(()=>{var e=ee.strings;e.forEach((t,n)=>{var r=m(t,ee.html);oe.add(a(r,j,$,!0));var i=oe.getItems().length;if(n+1!==e.length){if(ee.breakLines){var o=v(y("BR"));return oe.add([j,o,$]),void T(i)}oe.add(a(r,Q,$)),T(i,t.length)}})})()}
/**
* TypeIt - The most versatile animated typing utility on the planet.
* Author: Alex MacArthur <alex@macarthur.me> (https://macarthur.me)
* Version: v6.5.1
* Version: v7.0.0-rc1
* License: GPL-2.0
* URL: https://typeitjs.com
*/
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).TypeIt=t()}(this,(function(){"use strict";var n={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:function(){},afterString:function(){},beforeStep:function(){},afterStep:function(){},afterComplete:function(){}},t=function(n){return n.map((function(n){return void 0===n[1]&&n.push(null),void 0===n[2]&&n.push({}),n}))},e=function(n,t){return Object.assign({},n,t)},r=function(n,t){return n[2]=e(n[2],t)||t,n},i=function(n,t){return Array.isArray(n[0])?n.map((function(n){return r(n,t)})):r(n,t)},o=function(n,t,e,r){r=r||!1,e=e||{};var o=!Array.isArray(n),u=n.length;return(n=o?new Array(n).fill(0):n).map((function(n,a){if(o)return t;var c=[t,n,e];return r&&(0===a&&(c=i(c,{isFirst:!0})),a+1===u&&(c=i(c,{isLast:!0}))),c}))};function u(n){this.insert=function(n,t){e.splice(n,0,t)},this.add=function(n,t,r){return n=Array.isArray(n)?n:[n,null],r=r||!1,t=t||1,Array.isArray(n[0])||(n=o(t,n)),e=r?n.concat(e):e.concat(n),this},this.delete=function(n){return e.splice(n,1),this},this.reset=function(){return e=t(e).map((function(n){return n[2].executed=!1,n})),this},this.getItems=function(){return t(e).filter((function(n){return!n.executed}))};var e=[];n&&this.add(n)}var a=function(n){return Array.from(n)},c=function(n){var t=[];return t.concat.apply(t,n)},f=function(n){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=n,t.body},s=function(n){return 3===n.nodeType||"BR"===n.tagName},l=function n(t,e,r){e=e||null,r=void 0!==r&&r;var i=a(t.childNodes).map((function(t){return s(t)?t:n(t)}));return i=c(i),e&&(i=i.filter((function(n){return!n.parentNode.isEqualNode(e)}))),r?i.reverse():i},d=function(n,t){t=t||null;var e=n instanceof HTMLElement;return{node:t,isTopLevelText:!(t&&"BODY"!==t.parentNode.tagName||e),isHTMLElement:e,content:n}};function h(n){var t,e=f(n);return t=l(e).map((function(n){return n.nodeValue?a(n.nodeValue).map((function(t){return d(t,n)})):d(n)})),c(t)}function v(n,t){return(t=void 0===t||t)?h(n):a(n).map((function(n){return d(n)}))}var p=function(n){return document.createElement(n)},y=function(n,t){var e=p("style");e.id=t||"",e.appendChild(document.createTextNode(n)),document.head.appendChild(e)},m=function(n){return Array.isArray(n)||(n=[n/2,n/2]),{before:n[0],after:n[1],total:n[0]+n[1]}},g=function(n,t){return Math.abs(Math.random()*(n+t-(n-t))+(n-t))};var b=function(n){return["textarea","input"].indexOf(n.tagName.toLowerCase())>-1},S=function(n,t){var e=t.querySelectorAll("*");return[t].concat(a(e).reverse()).find((function(t){return t.cloneNode().outerHTML===n.outerHTML}))},N=function(n,t,e,r){e=e||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(b(n))n.value="".concat(n.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var u=t.node.parentNode,a=S(u.cloneNode(),n);if(function(n,t){if(!n)return!1;var e=n.nextSibling;return!e||e.isEqualNode(t)}(a,e))n=a;else if((o=u.cloneNode()).innerText=t.content,"BODY"!==u.parentNode.tagName){for(var c=u.parentNode,f=c.cloneNode(),s=S(f,n);!s&&"BODY"!==c.tagName;)f.innerHTML=o.outerHTML,o=f,f=c.parentNode.cloneNode(),c=c.parentNode,s=S(f,n);s&&(n=s)}}var d=l(n,e,!0);d=d[r-1],d=n.querySelector(".ti-cursor")||d,n.insertBefore(o,d||null)}},T=function(n){return n&&n.parentNode.removeChild(n)},L=function(n){return!n.firstChild&&!s(n)},x=function(n){return n.some((function(n){return L(n)}))};var A=function(n,t,e){var r,i="string"==typeof n,o=!1,u=-1*n;return i&&(u=(r="END"===n.toUpperCase())?-1:1,o=r?t+u>0:t+u<e.length),{isString:i,numberOfSteps:u,canKeepMoving:o}};function D(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function M(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}function w(){}function E(n,t){if(!t)return n&&n.then?n.then(w):Promise.resolve()}function C(n,t){var e=n();return e&&e.then?e.then(t):t(e)}function H(n,t,e){if(!n.s){if(e instanceof O){if(!e.s)return void(e.o=H.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(H.bind(null,n,t),H.bind(null,n,2));n.s=t,n.v=e;var r=n.o;r&&r(n)}}var O=function(){function n(){}return n.prototype.then=function(t,e){var r=new n,i=this.s;if(i){var o=1&i?t:e;if(o){try{H(r,1,o(this.v))}catch(n){H(r,2,n)}return r}return this}return this.o=function(n){try{var i=n.v;1&n.s?H(r,1,t?t(i):i):e?H(r,1,e(i)):H(r,2,i)}catch(n){H(r,2,n)}},r},n}();function P(n,t){return n&&n.then?n.then(t):t(n)}return function(t,r){var i=this,c=this;r=r||{};var s=function(n,t){return un.add(n,t),c},S=function(n){n=n||{};var t=e({},nn),r=e(t,n);return[[Y,r,{force:!0}],[Y,t,{force:!0}]]},k=function(){return J?a(G.value):l(G,an,!0)},z=function(n,t){t=t||1;var e=nn.nextStringDelay;un.insert(n,[V,e.before]),un.insert(n+t+1,[V,e.after])},B=function(n){an&&(an.classList.toggle("disabled",n),an.classList.toggle("with-delay",!n))},q=M((function(n,t){return X.push(setTimeout(n,t)),D()})),I=M((function(n){return C((function(){if(Z)return E(move(-1*Z))}),(function(){un.reset().delete(0).add([V,n.before],!0),k().forEach((function(n){un.add([K,null,{isPhantom:!0}],1,!0)}))}))})),R=M((function(){_.started=!0;var n=un.getItems();return P(function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}((function(){return P(function(n,t,e){var r,i,o=-1;return function u(a){try{for(;++o<n.length&&(!e||!e());)if((a=t(o))&&a.then){if(!((c=a)instanceof O&&1&c.s))return void a.then(u,i||(i=H.bind(null,r=new O,2)));a=a.v}r?H(r,1,a):r=a}catch(n){H(r||(r=new O),2,n)}var c}(),r}(n,(function(t){if(_.frozen||_.destroyed)throw"";var e,r,o,u,a=n[t],c=a[2],f=[a,un,i];return c.freezeCursor&&B(!0),e=nn.speed,r=nn.deleteSpeed,o=nn.lifeLike,u=(r=null!==r?r:e/3)/2,W=o?[g(e,e/2),g(r,u)]:[e,r],C((function(){var n;if(null==c?void 0:c.isFirst)return E((n=nn).beforeString.apply(n,f))}),(function(){var n;return D((n=nn).beforeStep.apply(n,f),(function(){return D(a[0].call(i,a[1],c),(function(){return C((function(){if(!c||!c.isPhantom)return C((function(){var n,t;if(null===(n=a[2])||void 0===n?void 0:n.isLast)return E((t=nn).afterString.apply(t,f))}),(function(){var n;return D((n=nn).afterStep.apply(n,f),(function(){a[2].executed=!0}))}))}),(function(){B(!1)}))}))}))}))}),(function(){return!1})),(function(n){return _.completed=!0,D(nn.afterComplete(i),(function(){if(nn.loop){var n=nn.loopDelay||nn.nextStringDelay;q((function(){return D(I(n),(function(){R()}))}),n.after)}}))}))}),w),(function(n){return i}))})),V=function(n){return new Promise((function(t){q((function(){return t()}),n||nn.nextStringDelay.total)}))},j=function n(t){var e=k(),r=A(t,Z,e);return Z+=r.numberOfSteps,new Promise((function(t){q(M((function(){return function(n,t,e,r){if(e){var i=r,o=t[(i=i>t.length?t.length:i)-1];n.insertBefore(e,o||null)}}(G,k(),an,Z),C((function(){if(r.isString&&r.canKeepMoving)return E(n(r.numberOfSteps>0?"START":"END"))}),(function(){return t()}))})),W[0])}))},U=function(n){return new Promise((function(t){q((function(){return N(G,n,an,Z),t()}),W[0])}))},Y=M((function(n){nn=e(nn,n)})),F=M((function(){J?G.value="":k().forEach((function(n){T(n)}))})),K=function n(t){return t=!0===t,new Promise((function(e){q(M((function(){var r=!1,i=k();return i.length&&(J?G.value=G.value.slice(0,-1):T(i[Z])),function(n){for(var t=a(n.querySelectorAll("*")),e=x(t);t.length&&e;){var r=!1;t.forEach((function(n){L(n)&&(T(n),r=!0)})),r&&(t=a(n.querySelectorAll("*"))),e=x(t)}}(G),C((function(){if(t&&i.length-1>0)return D(n(!0),(function(){return r=!0,e()}))}),(function(n){return r?n:e()}))})),W[1])}))};this.break=function(){return un.add([U,p("BR")])},this.delete=function(n,t){var e=S(t);return un.add(e[0]),un.add([K,!n,$],n||1),un.add(e[1]),this},this.destroy=function(n){n=void 0===n||n,X.forEach((function(n){clearTimeout(n)})),X=[],n&&T(an),_.destroyed=!0},this.empty=function(){return s(F)},this.exec=function(n,t){var e=S(t);return s([e[0],[n,null],e[1]])},this.is=function(n){return _[n]},this.move=function(n,t){var e=A(n,Z,k()),r=S(t);return un.add(r[0]),un.add([j,e.isString?n:Math.sign(n),$],Math.abs(n)),un.add(r[1]),this},this.freeze=function(){_.frozen=!0},this.unfreeze=function(){_.frozen=!1,!_.frozen&&R()},this.options=function(n){return s([Y,n])},this.pause=function(n){return s([V,n||null])},this.type=function(n,t){var e=S(t),r=v(n,nn.html),i=[e[0]].concat(o(r,U,$,!0),[e[1]]);return s(i)},this.getQueue=function(){return un},this.getOptions=function(){return nn},this.reset=function(){for(var n in!this.is("destroyed")&&this.destroy(),un.reset(),_)_[n]=!1;return this},this.go=function(){return _.started?this:(function(){if(an){var n="[data-typeit-id='".concat(on,"'] .ti-cursor");y("@keyframes blink-".concat(on," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(n," { animation: blink-").concat(on," ").concat(nn.cursorSpeed/1e3,"s infinite; } ").concat(n,".with-delay { animation-delay: 500ms; } ").concat(n,".disabled { animation: none; }"),on),G.appendChild(an)}}(),nn.waitUntilVisible?(function(n,t){new IntersectionObserver((function(e,r){e.forEach((function(e){e.isIntersecting&&(t(),r.unobserve(n))}))}),{threshold:1}).observe(n)}(G,R.bind(this)),this):(R(),this))};var Q,G="string"==typeof(Q=t)?document.querySelector(Q):Q,J=b(G),W=[],X=[],Z=0,$={freezeCursor:!0},_={started:!1,completed:!1,frozen:!1,destroyed:!1},nn=e(n,r);nn=e(nn,{html:!J&&nn.html,nextStringDelay:m(nn.nextStringDelay),loopDelay:m(nn.loopDelay)});var tn,en,rn,on=Math.random().toString().substring(2,9),un=new u([V,nn.startDelay]);G.setAttribute("data-typeit-id",on),y("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}"),nn.strings=(rn=nn.strings,tn=Array.isArray(rn)?rn:[rn],(en=function(n){return n.innerHTML.replace(/<\!--.*?-->/g,"").trim()}(G))?(G.innerHTML="",nn.startDelete?(h(en).forEach((function(n){N(G,n,an,Z)})),un.add([K,!0]),z(1),tn):[en.trim()].concat(tn)):tn);var an=function(){if(J||!nn.cursor)return null;var n=p("span");return n.innerHTML=f(nn.cursorChar).innerHTML,n.className="ti-cursor",n.setAttribute("style","display:inline;position:absolute;font:inherit;color:inherit;line-height:inherit;margin-left:-.1em;"),n}();nn.strings.length&&function(){var n=nn.strings;n.forEach((function(t,e){var r=v(t,nn.html);un.add(o(r,U,$,!0));var i=un.getItems().length;if(e+1!==n.length){if(nn.breakLines){var u=d(p("BR"));return un.add([U,u,$]),void z(i)}un.add(o(r,K,$)),z(i,t.length)}}))}()}}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).TypeIt=t()}(this,(function(){"use strict";var n={strings:[],speed:100,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,lifeLike:!0,breakLines:!0,startDelay:250,startDelete:!1,nextStringDelay:750,loop:!1,loopDelay:750,html:!0,waitUntilVisible:!1,beforeString:function(){},afterString:function(){},beforeStep:function(){},afterStep:function(){},afterComplete:function(){}},t=function(n){return n.map((function(n){return void 0===n[1]&&n.push(null),void 0===n[2]&&n.push({}),n}))},e=function(n,t){return Object.assign({},n,t)},r=function(n){return Array.isArray(n)},i=function(n,t){return n[2]=e(n[2],t)||t,n},o=function(n,t){return r(n[0])?n.map((function(n){return i(n,t)})):i(n,t)},u=function(n,t,e,i){i=i||!1,e=e||{};var u=!r(n),c=n.length;return(n=u?new Array(n).fill(0):n).map((function(n,r){if(u)return t;var a=[t,n,e];return i&&(0===r&&(a=o(a,{isFirst:!0})),r+1===c&&(a=o(a,{isLast:!0}))),a}))};function c(n){this.insert=function(n,t){e.splice(n,0,t)},this.add=function(n,t,i){return n=r(n)?n:[n,null],i=i||!1,t=t||1,r(n[0])||(n=u(t,n)),e=i?n.concat(e):e.concat(n),this},this.delete=function(n){return e.splice(n,1),this},this.reset=function(){return e=t(e).map((function(n){return n[2].executed=!1,n})),this},this.getItems=function(){return t(e).filter((function(n){return!n.executed}))};var e=[];n&&this.add(n)}var a=function(n){return Array.from(n)},f=function(n){var t=[];return t.concat.apply(t,n)},s=function(n){var t=document.implementation.createHTMLDocument("");return t.body.innerHTML=n,t.body},l=function(n){return 3===n.nodeType||"BR"===n.tagName},d=function n(t,e,r){e=e||null,r=void 0!==r&&r;var i=a(t.childNodes).map((function(t){return l(t)?t:n(t)}));return i=f(i),e&&(i=i.filter((function(n){return!n.parentNode.isEqualNode(e)}))),r?i.reverse():i},h=function(n){return"BODY"===n.tagName},v=function(n,t){t=t||null;var e=n instanceof HTMLElement;return{node:t,isTopLevelText:(!t||h(t.parentNode))&&!e,isHTMLElement:e,content:n}};function p(n){var t,e=s(n);return t=d(e).map((function(n){return n.nodeValue?a(n.nodeValue).map((function(t){return v(t,n)})):v(n)})),f(t)}function m(n,t){return(t=void 0===t||t)?p(n):a(n).map((function(n){return v(n)}))}var y=function(n){return document.createElement(n)},g=function(n,t){var e=y("style");e.id=t||"",e.appendChild(document.createTextNode(n)),document.head.appendChild(e)},b=function(n){return r(n)||(n=[n/2,n/2]),{before:n[0],after:n[1],total:n[0]+n[1]}},S=function(n,t){return Math.abs(Math.random()*(n+t-(n-t))+(n-t))};var T=function(n){return["textarea","input"].indexOf(n.tagName.toLowerCase())>-1},N=function(n,t){var e=t.querySelectorAll("*");return[t].concat(a(e).reverse()).find((function(t){return t.cloneNode().outerHTML===n.outerHTML}))},L=function(n,t,e,r){e=e||null;var i=t.isHTMLElement,o=i?t.content:document.createTextNode(t.content);if(T(n))n.value="".concat(n.value).concat(t.content);else{if(!t.isTopLevelText&&!i){var u=t.node.parentNode,c=N(u.cloneNode(),n);if(function(n,t){if(!n)return!1;var e=n.nextSibling;return!e||e.isEqualNode(t)}(c,e))n=c;else if((o=u.cloneNode()).innerText=t.content,!h(u.parentNode)){for(var a=u.parentNode,f=a.cloneNode(),s=N(f,n);!s&&!h(a);)f.innerHTML=o.outerHTML,o=f,f=a.parentNode.cloneNode(),a=a.parentNode,s=N(f,n);n=s||n}}var l=d(n,e,!0)[r-1],v=l?l.parentNode:n;v.insertBefore(o,v.contains(e)?e:null)}},x=function(n){return n&&n.parentNode.removeChild(n)},M=function(n){return!n.firstChild&&!l(n)},w=function(n){return n.some((function(n){return M(n)}))};var D=function(n,t,e){var r,i="string"==typeof n,o=!1,u=-1*n;return i&&(u=(r="END"===n.toUpperCase())?-1:1,o=r?t+u>0:t+u<e.length),{isString:i,numberOfSteps:u,canKeepMoving:o}};function E(n,t,e){return e?t?t(n):n:(n&&n.then||(n=Promise.resolve(n)),t?n.then(t):n)}function C(n){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(n.apply(this,t))}catch(n){return Promise.reject(n)}}}function H(){}function P(n,t){if(!t)return n&&n.then?n.then(H):Promise.resolve()}function A(n,t){var e=n();return e&&e.then?e.then(t):t(e)}function k(n,t,e){if(!n.s){if(e instanceof z){if(!e.s)return void(e.o=k.bind(null,n,t));1&t&&(t=e.s),e=e.v}if(e&&e.then)return void e.then(k.bind(null,n,t),k.bind(null,n,2));n.s=t,n.v=e;var r=n.o;r&&r(n)}}var z=function(){function n(){}return n.prototype.then=function(t,e){var r=new n,i=this.s;if(i){var o=1&i?t:e;if(o){try{k(r,1,o(this.v))}catch(n){k(r,2,n)}return r}return this}return this.o=function(n){try{var i=n.v;1&n.s?k(r,1,t?t(i):i):e?k(r,1,e(i)):k(r,2,i)}catch(n){k(r,2,n)}},r},n}();function O(n,t){return n&&n.then?n.then(t):t(n)}return function(t,i){var o=this,f=this;i=i||{};var l=function(n,t){return cn.add(n,t),f},h=function(n){n=n||{};var t=e({},tn),r=e(t,n);return[[K,r,{force:!0}],[K,t,{force:!0}]]},N=function(){return W?a(J.value):d(J,an,!0)},q=function(n,t){t=t||1;var e=tn.nextStringDelay;cn.insert(n,[j,e.before]),cn.insert(n+t+1,[j,e.after])},B=function(n){an&&(an.classList.toggle("disabled",n),an.classList.toggle("with-delay",!n))},I=C((function(n,t){return Z.push(setTimeout(n,t)),E()})),R=C((function(n){return A((function(){if($)return P(move(-1*$))}),(function(){cn.reset().delete(0).add([j,n.before],!0),N().forEach((function(n){cn.add([Y,null,{isPhantom:!0}],1,!0)}))}))})),V=C((function(){nn.started=!0;var n=cn.getItems();return O(function(n,t){try{var e=n()}catch(n){return t(n)}return e&&e.then?e.then(void 0,t):e}((function(){return O(function(n,t,e){var r,i,o=-1;return function u(c){try{for(;++o<n.length&&(!e||!e());)if((c=t(o))&&c.then){if(!((a=c)instanceof z&&1&a.s))return void c.then(u,i||(i=k.bind(null,r=new z,2)));c=c.v}r?k(r,1,c):r=c}catch(n){k(r||(r=new z),2,n)}var a}(),r}(n,(function(t){if(nn.frozen||nn.destroyed)throw"";var e,r,i,u,c=n[t],a=c[2],f=[c,cn,o];return a.freezeCursor&&B(!0),e=tn.speed,r=tn.deleteSpeed,i=tn.lifeLike,u=(r=null!==r?r:e/3)/2,X=i?[S(e,e/2),S(r,u)]:[e,r],A((function(){var n;if(null==a?void 0:a.isFirst)return P((n=tn).beforeString.apply(n,f))}),(function(){var n;return E((n=tn).beforeStep.apply(n,f),(function(){return E(c[0].call(o,c[1],a),(function(){return A((function(){if(!a||!a.isPhantom)return A((function(){var n,t;if(null===(n=c[2])||void 0===n?void 0:n.isLast)return P((t=tn).afterString.apply(t,f))}),(function(){var n;return E((n=tn).afterStep.apply(n,f),(function(){c[2].executed=!0}))}))}),(function(){B(!1)}))}))}))}))}),(function(){return!1})),(function(n){return nn.completed=!0,E(tn.afterComplete(o),(function(){if(tn.loop){var n=tn.loopDelay||tn.nextStringDelay;I((function(){return E(R(n),(function(){V()}))}),n.after)}}))}))}),H),(function(n){return o}))})),j=function(n){return new Promise((function(t){I((function(){return t()}),n||tn.nextStringDelay.total)}))},U=function n(t){var e=N(),r=D(t,$,e);return $+=r.numberOfSteps,new Promise((function(t){I(C((function(){return function(n,t,e,r){if(e){var i=r,o=t[(i=i>t.length?t.length:i)-1];(n=o?o.parentNode:n).insertBefore(e,o||null)}}(J,N(),an,$),A((function(){if(r.isString&&r.canKeepMoving)return P(n(r.numberOfSteps>0?"START":"END"))}),(function(){return t()}))})),X[0])}))},F=function(n){return new Promise((function(t){I((function(){return L(J,n,an,$),t()}),X[0])}))},K=C((function(n){tn=e(tn,n)})),Q=C((function(){W?J.value="":N().forEach((function(n){x(n)}))})),Y=function n(t){return t=!0===t,new Promise((function(e){I(C((function(){var r=!1,i=N();return i.length&&(W?J.value=J.value.slice(0,-1):x(i[$])),function(n){for(var t=a(n.querySelectorAll("*")),e=w(t);t.length&&e;){var r=!1;t.forEach((function(n){M(n)&&(x(n),r=!0)})),r&&(t=a(n.querySelectorAll("*"))),e=w(t)}}(J),A((function(){if(t&&i.length-1>0)return E(n(!0),(function(){return r=!0,e()}))}),(function(n){return r?n:e()}))})),X[1])}))};this.break=function(){return cn.add([F,y("BR")])},this.delete=function(n,t){var e=h(t);return cn.add(e[0]),cn.add([Y,!n,_],n||1),cn.add(e[1]),this},this.destroy=function(n){n=void 0===n||n,Z.forEach((function(n){clearTimeout(n)})),Z=[],n&&x(an),nn.destroyed=!0},this.empty=function(){return l(Q)},this.exec=function(n,t){var e=h(t);return l([e[0],[n,null],e[1]])},this.is=function(n){return nn[n]},this.move=function(n,t){var e=D(n,$,N()),r=h(t);return cn.add(r[0]),cn.add([U,e.isString?n:Math.sign(n),_],Math.abs(n)),cn.add(r[1]),this},this.freeze=function(){nn.frozen=!0},this.unfreeze=function(){nn.frozen=!1,!nn.frozen&&V()},this.options=function(n){return l([K,n])},this.pause=function(n){return l([j,n||null])},this.type=function(n,t){var e=h(t),r=m(n,tn.html),i=[e[0]].concat(u(r,F,_,!0),[e[1]]);return l(i)},this.getQueue=function(){return cn},this.getOptions=function(){return tn},this.reset=function(){for(var n in!this.is("destroyed")&&this.destroy(),cn.reset(),nn)nn[n]=!1;return this},this.go=function(){return nn.started?this:(function(){if(an){var n="[data-typeit-id='".concat(un,"'] .ti-cursor");g("@keyframes blink-".concat(un," { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } ").concat(n," { animation: blink-").concat(un," ").concat(tn.cursorSpeed/1e3,"s infinite; } ").concat(n,".with-delay { animation-delay: 500ms; } ").concat(n,".disabled { animation: none; }"),un),J.appendChild(an)}}(),tn.waitUntilVisible?(function(n,t){new IntersectionObserver((function(e,r){e.forEach((function(e){e.isIntersecting&&(t(),r.unobserve(n))}))}),{threshold:1}).observe(n)}(J,V.bind(this)),this):(V(),this))};var G,J="string"==typeof(G=t)?document.querySelector(G):G,W=T(J),X=[],Z=[],$=0,_={freezeCursor:!0},nn={started:!1,completed:!1,frozen:!1,destroyed:!1},tn=e(n,i);tn=e(tn,{html:!W&&tn.html,nextStringDelay:b(tn.nextStringDelay),loopDelay:b(tn.loopDelay)});var en,rn,on,un=Math.random().toString().substring(2,9),cn=new c([j,tn.startDelay]);J.setAttribute("data-typeit-id",un),g("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}"),tn.strings=(on=tn.strings,en=r(on)?on:[on],(rn=function(n){return n.innerHTML.replace(/<\!--.*?-->/g,"").trim()}(J))?(J.innerHTML="",tn.startDelete?(p(rn).forEach((function(n){L(J,n,an,$)})),cn.add([Y,!0]),q(1),en):[rn.trim()].concat(en)):en);var an=function(){if(W||!tn.cursor)return null;var n=y("span");return n.innerHTML=s(tn.cursorChar).innerHTML,n.className="ti-cursor",n.style.cssText="position:absolute;display:inline;margin-left:-.025em;".concat(function(n){var t=["font","lineHeight","color"],e=y("SPAN"),r=window.getComputedStyle(n,null);for(var i in r)t.indexOf(i)>-1&&r[i]&&(e.style[i]=r[i]);return e.style.cssText}(J)),n}();tn.strings.length&&function(){var n=tn.strings;n.forEach((function(t,e){var r=m(t,tn.html);cn.add(u(r,F,_,!0));var i=cn.getItems().length;if(e+1!==n.length){if(tn.breakLines){var o=v(y("BR"));return cn.add([F,o,_]),void q(i)}cn.add(u(r,Y,_)),q(i,t.length)}}))}()}}));
{
"name": "typeit",
"version": "7.0.0-rc1",
"version": "7.0.0-rc2",
"description": "The most versatile animated typing utility on the planet.",

@@ -5,0 +5,0 @@ "author": "Alex MacArthur <alex@macarthur.me> (https://macarthur.me)",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc