Socket
Socket
Sign inDemoInstall

typeit-react

Package Overview
Dependencies
10
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0-rc.0 to 2.0.0-rc.1

2

dist/index.esm.js
// TypeIt - React by Alex MacArthur - https://typeitjs.com
import*as e from"react";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const n=[null,null,{}];var r=(e,t)=>Object.assign({},e,t),o=e=>Array.from(e),i=e=>(new DOMParser).parseFromString(e,"text/html").body;const s=(e,t=null,n=!1)=>{let r=o(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:s(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},u=(e,t=null)=>({node:t,content:e});function c(e){let t=i(e);return s(t).flatMap(e=>e.nodeValue?o(e.nodeValue).map(t=>u(t,e)):u(e))}function l(e,t=!0){return t?c(e):o(e).map(e=>u(e))}var a=e=>document.createElement(e),f=e=>document.createTextNode(e),h=(e,t="")=>{let n=a("style");n.id=t,n.appendChild(f(e)),document.head.appendChild(n)},d=e=>Array.isArray(e);const m=e=>Number.isInteger(e),v=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),p={started:!1,completed:!1,frozen:!1,destroyed:!1},y={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},g=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=v(".ti-cursor",t),i=e?v(e,t):t,u=s(i,o,!0),c=u[0],l=u[u.length-1],a=r&&!e?0:s(t,o,!0).findIndex(e=>e.isSameNode(r?c:l));return r&&a--,a+1};var P=e=>(d(e)||(e=[e/2,e/2]),e),b=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let S=e=>e/2;var N=e=>"value"in e;const w=e=>"function"==typeof e?e():e;var M=e=>"BODY"===e.tagName;const T=(e,t)=>{let n=o(v("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},E=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,u=null==i?void 0:i.parentNode,c=o?t.content:f(t.content);if(N(e))return void(e.value=""+e.value+t.content);if(!o&&u&&!M(u)){let r=T(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{c=u.cloneNode(),c.appendChild(f(t.content));let n=u.parentNode,r=n.cloneNode();if(!M(n)){let t=T(r,e);for(;!t&&!M(n);){let o=r;o.innerHTML=c.outerHTML,c=o,n=n.parentNode,r=n.cloneNode(),t=T(r,e)}e=t||e}}}let l=s(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(c,a.contains(n)?n:null)};var j=e=>e&&e.remove();const x=["font-family","font-weight","font-size","font-style","line-height","color"];function L(e,t,n){if(!e.s){if(n instanceof k){if(!n.s)return void(n.o=L.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(L.bind(null,e,t),L.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const k=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{L(r,1,e(this.v))}catch(e){L(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?L(r,1,t?t(o):o):n?L(r,1,n(o)):L(r,2,o)}catch(e){L(r,2,e)}},r},e}();function D(e){return e instanceof k&&1&e.s}function C(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!D(u))return void u.then(s,o||(o=L.bind(null,r=new k,2)));u=u.v}r?L(r,1,u):r=u}catch(e){L(r||(r=new k),2,e)}}(),r}function I(e,t,n){for(var r;;){var o=e();if(D(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!D(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!D(s)){r=2;break}}}var u=new k,c=L.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(l):s.then(f)).then(void 0,c),u;function l(r){i=r;do{if(t&&(s=t())&&s.then&&!D(s))return void s.then(f).then(void 0,c);if(!(o=e())||D(o)&&!o.v)return void L(u,1,i);if(o.then)return void o.then(a).then(void 0,c);D(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):L(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):L(u,1,i)}}function A(e,t={}){const f=this,M=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},T=()=>N(Y),L=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[b(t,S(t)),b(n,S(n))]:[t,n]}(Z)[e],k=(e,t=0)=>e?L(t):0,D=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[z,t]])})(t),this),A=()=>(e=>N(e)?o(e.value):s(e,v(".ti-cursor",e),!0))(Y),B=(e={})=>[[F,e],[F,Z]],O=e=>{let t=Z.nextStringDelay;_.add([[z,t[0]],...e,[z,t[1]]])},H=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},R=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;M(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[z,e,{}]),Promise.resolve(Q({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(q({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){R()})}catch(e){return Promise.reject(e)}},e[1])})}const o=C(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,f],o.freezeCursor&&H(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(f,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),H(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:f}):e?r:f)}catch(e){return Promise.reject(e)}},z=(e=0)=>M(()=>{},e),q=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>m(t)?-1*t:g(t,e,r)-n)({el:Y,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Y,A(),te,K)};return Promise.resolve(M(function(){try{let e=0;const t=I(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(M(o,L(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},k(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>M(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=C(e,function(n){return t?void o(e[n]):Promise.resolve(M(()=>{o(e[n])},L(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>E(Y,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},k(t)),F=function(e){try{return Z=r(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},U=function(){try{return T()?(Y.value="",Promise.resolve()):(A().forEach(e=>{j(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Q=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>m(e)?e:g(e,Y,n);return Promise.resolve(M(function(){try{let n=r(e);const o=()=>{let e=A();var t;e.length&&(T()?Y.value=Y.value.slice(0,-1):(j(e[K]),t=te,v("*",Y,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;j(t)}})))};let i=0;const s=I(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(M(o,L(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},k(t,1))).then(function(){const t=function(){if(null===e&&A().length-1>0)return Promise.resolve(Q({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=u(a("BR"));return D([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=w(e);let n=B(t),r=e,{instant:o,to:i}=t;return D([n[0],[Q,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return D([[U]],e)},this.exec=function(e,t){let n=B(t);return D([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=w(e);let n=B(t),{instant:r,to:o}=t;return D([n[0],[q,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=w(e),D([[F,e]],e)},this.pause=function(e,t={}){return D([[z,w(e)]],t)},this.type=function(e,t={}){e=w(e);let n=B(t),r=l(e,Z.html),{instant:o}=t;return D([n[0],[V,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],w(e)&&j(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,R()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return Y[T()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{function e(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=te.getBoundingClientRect().width/2;te.style.margin="0 -"+(e+2)+"px 0 -"+(e-2)+"px"})})}if(!T()&&Y.appendChild(te),!ee)return Promise.resolve();((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=x.reduce((e,t)=>e+" "+t+": var(--ti-"+t+", "+o[t]+");","");h("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,Y);const t="loaded"===document.fonts.status;Promise.resolve(t?e():Promise.resolve(document.fonts.ready).then(e))}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Y,R.bind(this)),this):(R(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return Y};let Y="string"==typeof(G=e)?v(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=r({},p),Z=r(y,t);Z=r(Z,{html:!T()&&Z.html,nextStringDelay:P(Z.nextStringDelay),loopDelay:P(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(e){const t=function(e){return o=o.concat(e.map(e=>n.map((t,n)=>e[n]?e[n]:t))),this};let o=[];return t(e),{add:t,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,t){o[e][2]=r(o[e][2],t)}}}([[z,Z.startDelay]]);Y.dataset.typeitId=$,h("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!T(),te=(()=>{if(T())return;let e=a("span");return e.className="ti-cursor",ee?(e.innerHTML=i(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=Y.innerHTML;return t?(Y.innerHTML="",Z.startDelete?(c(t).forEach(e=>{E(Y,e,te,K)}),O([[Q,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(d(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=l(t,Z.html);if(_.add([[V,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[V,{chars:[u(a("BR"))]},W]]:[[Q,{num:r.length},W]];O(o)})})()}var B=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],O=["options","as","children","getBeforeInit","getAfterInit"],H=e.useRef,R=e.useEffect,z=e.useState,q=e.useMemo,V=function(n){var r=z(!0),o=r[0],i=r[1],s=H(null),u=n.options,c=n.as,l=n.children,a=n.getBeforeInit,f=n.getAfterInit,h=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(n,O),d=c,m=q(function(){return B.indexOf(d.toLowerCase())>-1},[d]);return R(function(){l&&(u.strings=s.current.innerHTML),i(!1)},[]),R(function(){if(!o){var e=new A(s.current,t({},u));return(e=a(e)).go(),e=f(e),function(){e.destroy()}}},[o]),e.createElement("div",{style:{opacity:o?0:1}},m?e.createElement(d,t({ref:s},h)):e.createElement(d,t({ref:s},h),o&&l))};V.defaultProps={as:"span",options:{},getBeforeInit:function(e){return e},getAfterInit:function(e){return e}};export{V as default};
import*as e from"react";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const n=[null,null,{}];var r=(e,t)=>Object.assign({},e,t),o=e=>Array.from(e),i=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const s=(e,t=null,n=!1)=>{let r=o(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:s(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},u=(e,t=null)=>({node:t,content:e});function c(e){let t=i(e);return s(t).flatMap(e=>e.nodeValue?o(e.nodeValue).map(t=>u(t,e)):u(e))}function l(e,t=!0){return t?c(e):o(e).map(e=>u(e))}var a=e=>document.createElement(e),f=e=>document.createTextNode(e),h=(e,t="")=>{let n=a("style");n.id=t,n.appendChild(f(e)),document.head.appendChild(n)},d=e=>Array.isArray(e);const m=e=>Number.isInteger(e),v=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),p={started:!1,completed:!1,frozen:!1,destroyed:!1},y={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},g=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=v(".ti-cursor",t),i=e?v(e,t):t,u=s(i,o,!0),c=u[0],l=u[u.length-1],a=r&&!e?0:s(t,o,!0).findIndex(e=>e.isSameNode(r?c:l));return r&&a--,a+1};var P=e=>(d(e)||(e=[e/2,e/2]),e),b=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let S=e=>e/2;var N=e=>"value"in e;const M=e=>"function"==typeof e?e():e;var T=e=>"BODY"===e.tagName;const w=(e,t)=>{let n=o(v("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},j=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,u=null==i?void 0:i.parentNode,c=o?t.content:f(t.content);if(N(e))return void(e.value=""+e.value+t.content);if(!o&&u&&!T(u)){let r=w(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{c=u.cloneNode(),c.appendChild(f(t.content));let n=u.parentNode,r=n.cloneNode();if(!T(n)){let t=w(r,e);for(;!t&&!T(n);){let o=r;o.innerHTML=c.outerHTML,c=o,n=n.parentNode,r=n.cloneNode(),t=w(r,e)}e=t||e}}}let l=s(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(c,a.contains(n)?n:null)};var E=e=>e&&e.remove();const L={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function k(e,t,n){if(!e.s){if(n instanceof x){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;const r=e.o;r&&r(e)}}const x=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{k(r,1,e(this.v))}catch(e){k(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?k(r,1,t?t(o):o):n?k(r,1,n(o)):k(r,2,o)}catch(e){k(r,2,e)}},r},e}();function D(e){return e instanceof x&&1&e.s}function I(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!D(u))return void u.then(s,o||(o=k.bind(null,r=new x,2)));u=u.v}r?k(r,1,u):r=u}catch(e){k(r||(r=new x),2,e)}}(),r}function C(e,t,n){for(var r;;){var o=e();if(D(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!D(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!D(s)){r=2;break}}}var u=new x,c=k.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(l):s.then(f)).then(void 0,c),u;function l(r){i=r;do{if(t&&(s=t())&&s.then&&!D(s))return void s.then(f).then(void 0,c);if(!(o=e())||D(o)&&!o.v)return void k(u,1,i);if(o.then)return void o.then(a).then(void 0,c);D(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):k(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):k(u,1,i)}}function H(e,t={}){const f=this,T=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},w=()=>N(F),k=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[b(t,S(t)),b(n,S(n))]:[t,n]}(Z)[e],x=(e,t=0)=>e?k(t):0,D=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[R,t]])})(t),this),H=()=>(e=>N(e)?o(e.value):s(e,v(".ti-cursor",e),!0))(F),O=(e={})=>[[U,e],[U,Z]],A=e=>{let t=Z.nextStringDelay;_.add([[R,t[0]],...e,[R,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},z=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;T(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[R,e,{}]),Promise.resolve(Y({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(V({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){z()})}catch(e){return Promise.reject(e)}},e[1])})}const o=I(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,f],o.freezeCursor&&B(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(f,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:f}):e?r:f)}catch(e){return Promise.reject(e)}},R=(e=0)=>T(()=>{},e),V=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>m(t)?-1*t:g(t,e,r)-n)({el:F,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(F,H(),te,K)};return Promise.resolve(T(function(){try{let e=0;const t=C(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(T(o,k(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},x(n))).then(function(){})}catch(e){return Promise.reject(e)}},q=({chars:e,instant:t,silent:n})=>T(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=I(e,function(n){return t?void o(e[n]):Promise.resolve(T(()=>{o(e[n])},k(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>j(F,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},x(t)),U=function(e){try{return Z=r(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},Q=function(){try{return w()?(F.value="",Promise.resolve()):(H().forEach(e=>{E(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Y=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>m(e)?e:g(e,F,n);return Promise.resolve(T(function(){try{let n=r(e);const o=()=>{let e=H();var t;e.length&&(w()?F.value=F.value.slice(0,-1):(E(e[K]),t=te,v("*",F,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;E(t)}})))};let i=0;const s=C(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(T(o,k(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},x(t,1))).then(function(){const t=function(){if(null===e&&H().length-1>0)return Promise.resolve(Y({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=u(a("BR"));return D([[q,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=M(e);let n=O(t),r=e,{instant:o,to:i}=t;return D([n[0],[Y,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return D([[Q]],e)},this.exec=function(e,t){let n=O(t);return D([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=M(e);let n=O(t),{instant:r,to:o}=t;return D([n[0],[V,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=M(e),D([[U,e]],e)},this.pause=function(e,t={}){return D([[R,M(e)]],t)},this.type=function(e,t={}){e=M(e);let n=O(t),r=l(e,Z.html),{instant:o}=t;return D([n[0],[q,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],M(e)&&E(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,z()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return F[w()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{!w()&&F.appendChild(te),ee?(((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=Object.entries(L).reduce((e,[t,n])=>e+" "+t+": var(--ti-"+t+", "+(n||o[t])+");","");h("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; letter-spacing: -1em; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,F),Promise.resolve()):Promise.resolve()}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(F,z.bind(this)),this):(z(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return F};let F="string"==typeof(G=e)?v(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=r({},p),Z=r(y,t);Z=r(Z,{html:!w()&&Z.html,nextStringDelay:P(Z.nextStringDelay),loopDelay:P(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(e){const t=function(e){return o=o.concat(e.map(e=>n.map((t,n)=>e[n]?e[n]:t))),this};let o=[];return t(e),{add:t,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,t){o[e][2]=r(o[e][2],t)}}}([[R,Z.startDelay]]);F.dataset.typeitId=$,h("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!w(),te=(()=>{if(w())return;let e=a("span");return e.className="ti-cursor",ee?(e.innerHTML=i(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=F.innerHTML;return t?(F.innerHTML="",Z.startDelete?(c(t).forEach(e=>{j(F,e,te,K)}),A([[Y,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(d(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=l(t,Z.html);if(_.add([[q,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[q,{chars:[u(a("BR"))]},W]]:[[Y,{num:r.length},W]];A(o)})})()}var O=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],A=["options","as","children","getBeforeInit","getAfterInit"],B=e.useRef,z=e.useEffect,R=e.useState,V=e.useMemo,q=function(n){var r=R(!0),o=r[0],i=r[1],s=B(null),u=n.options,c=n.as,l=n.children,a=n.getBeforeInit,f=n.getAfterInit,h=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(n,A),d=c,m=V(function(){return O.indexOf(d.toLowerCase())>-1},[d]);return z(function(){l&&(u.strings=s.current.innerHTML),i(!1)},[]),z(function(){if(!o){var e=new H(s.current,t({},u));return(e=a(e)).go(),e=f(e),function(){e.destroy()}}},[o]),e.createElement("div",{style:{opacity:o?0:1}},m?e.createElement(d,t({ref:s},h)):e.createElement(d,t({ref:s},h),o&&l))};q.defaultProps={as:"span",options:{},getBeforeInit:function(e){return e},getAfterInit:function(e){return e}};export{q as default};
// TypeIt - React by Alex MacArthur - https://typeitjs.com
function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var t=e(require("react"));function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const r=[null,null,{}];var o=(e,t)=>Object.assign({},e,t),i=e=>Array.from(e),s=e=>(new DOMParser).parseFromString(e,"text/html").body;const u=(e,t=null,n=!1)=>{let r=i(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:u(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},c=(e,t=null)=>({node:t,content:e});function l(e){let t=s(e);return u(t).flatMap(e=>e.nodeValue?i(e.nodeValue).map(t=>c(t,e)):c(e))}function a(e,t=!0){return t?l(e):i(e).map(e=>c(e))}var f=e=>document.createElement(e),h=e=>document.createTextNode(e),d=(e,t="")=>{let n=f("style");n.id=t,n.appendChild(h(e)),document.head.appendChild(n)},m=e=>Array.isArray(e);const v=e=>Number.isInteger(e),p=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),y={started:!1,completed:!1,frozen:!1,destroyed:!1},g={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},P=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=p(".ti-cursor",t),i=e?p(e,t):t,s=u(i,o,!0),c=s[0],l=s[s.length-1],a=r&&!e?0:u(t,o,!0).findIndex(e=>e.isSameNode(r?c:l));return r&&a--,a+1};var b=e=>(m(e)||(e=[e/2,e/2]),e),S=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let w=e=>e/2;var N=e=>"value"in e;const j=e=>"function"==typeof e?e():e;var M=e=>"BODY"===e.tagName;const E=(e,t)=>{let n=i(p("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},T=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,s=null==i?void 0:i.parentNode,c=o?t.content:h(t.content);if(N(e))return void(e.value=""+e.value+t.content);if(!o&&s&&!M(s)){let r=E(s,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{c=s.cloneNode(),c.appendChild(h(t.content));let n=s.parentNode,r=n.cloneNode();if(!M(n)){let t=E(r,e);for(;!t&&!M(n);){let o=r;o.innerHTML=c.outerHTML,c=o,n=n.parentNode,r=n.cloneNode(),t=E(r,e)}e=t||e}}}let l=u(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(c,a.contains(n)?n:null)};var x=e=>e&&e.remove();const L=["font-family","font-weight","font-size","font-style","line-height","color"];function k(e,t,n){if(!e.s){if(n instanceof D){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;const r=e.o;r&&r(e)}}const D=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{k(r,1,e(this.v))}catch(e){k(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?k(r,1,t?t(o):o):n?k(r,1,n(o)):k(r,2,o)}catch(e){k(r,2,e)}},r},e}();function O(e){return e instanceof D&&1&e.s}function C(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!O(u))return void u.then(s,o||(o=k.bind(null,r=new D,2)));u=u.v}r?k(r,1,u):r=u}catch(e){k(r||(r=new D),2,e)}}(),r}function I(e,t,n){for(var r;;){var o=e();if(O(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!O(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!O(s)){r=2;break}}}var u=new D,c=k.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(l):s.then(f)).then(void 0,c),u;function l(r){i=r;do{if(t&&(s=t())&&s.then&&!O(s))return void s.then(f).then(void 0,c);if(!(o=e())||O(o)&&!o.v)return void k(u,1,i);if(o.then)return void o.then(a).then(void 0,c);O(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):k(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):k(u,1,i)}}function A(e,t={}){const n=this,h=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,G))}catch(e){return Promise.reject(e)}},M=()=>N(Q),E=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[S(t,w(t)),S(n,w(n))]:[t,n]}(X)[e],k=(e,t=0)=>e?E(t):0,D=(e,t)=>($.add(e),((e={})=>{let t=e.delay;t&&$.add([[z,t]])})(t),this),O=()=>(e=>N(e)?i(e.value):u(e,p(".ti-cursor",e),!0))(Q),A=(e={})=>[[F,e],[F,X]],B=e=>{let t=X.nextStringDelay;$.add([[z,t[0]],...e,[z,t[1]]])},H=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},R=function(){try{let e;W.started=!0;let t,r=$.getItems();const o=function(o,i){try{var s=function(){function o(e){return W.completed=!0,Promise.resolve(X.afterComplete(...t)).then(function(){if(!X.loop)throw"";let e=X.loopDelay;h(function(){try{return Promise.resolve(function(e){try{function t(t){return $.reset(),$.set(0,[z,e,{}]),Promise.resolve(_({num:null})).then(function(){})}return Promise.resolve(J?Promise.resolve(q({value:J})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){R()})}catch(e){return Promise.reject(e)}},e[1])})}const i=C(r,function(e){if(W.frozen||W.destroyed)throw"";let o=r[e],i=o[2];return t=[o,n],i.freezeCursor&&H(!0),Promise.resolve(X.beforeStep(...t)).then(function(){return Promise.resolve(o[0].call(n,o[1],i)).then(function(){return Promise.resolve(X.afterStep(...t)).then(function(){$.setMeta(e,{executed:!0}),H(!1)})})})},function(){return e});return i&&i.then?i.then(o):o()}()}catch(e){return}return s&&s.then?s.then(void 0,function(){}):s}();return Promise.resolve(o&&o.then?o.then(function(t){return e?t:n}):e?o:n)}catch(e){return Promise.reject(e)}},z=(e=0)=>h(()=>{},e),q=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>v(t)?-1*t:P(t,e,r)-n)({el:Q,move:e,cursorPos:J,to:t}),o=()=>{J+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Q,O(),te,J)};return Promise.resolve(h(function(){try{let e=0;const t=I(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(h(o,E(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},k(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>h(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(X.afterString(e)).then(function(e){})}const s=C(e,function(n){return t?void o(e[n]):Promise.resolve(h(()=>{o(e[n])},E(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>T(Q,e,te,J);return Promise.resolve(n?r():Promise.resolve(X.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},k(t)),F=function(e){try{return X=o(X,e),Promise.resolve()}catch(e){return Promise.reject(e)}},U=function(){try{return M()?(Q.value="",Promise.resolve()):(O().forEach(e=>{x(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},_=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>v(e)?e:P(e,Q,n);return Promise.resolve(h(function(){try{let n=r(e);const o=()=>{let e=O();var t;e.length&&(M()?Q.value=Q.value.slice(0,-1):(x(e[J]),t=te,p("*",Q,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;x(t)}})))};let i=0;const s=I(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(h(o,E(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},k(t,1))).then(function(){const t=function(){if(null===e&&O().length-1>0)return Promise.resolve(_({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=c(f("BR"));return D([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=j(e);let n=A(t),r=e,{instant:o,to:i}=t;return D([n[0],[_,{num:r,instant:o,to:i},K],n[1]],t)},this.empty=function(e={}){return D([[U]],e)},this.exec=function(e,t){let n=A(t);return D([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=j(e);let n=A(t),{instant:r,to:o}=t;return D([n[0],[q,{value:null===e?"":e,to:o,instant:r},K],n[1]],t)},this.options=function(e){return e=j(e),D([[F,e]],e)},this.pause=function(e,t={}){return D([[z,j(e)]],t)},this.type=function(e,t={}){e=j(e);let n=A(t),r=a(e,X.html),{instant:o}=t;return D([n[0],[V,{chars:r,instant:o},K],n[1]],t)},this.is=function(e){return W[e]},this.destroy=function(e=!0){G.forEach(e=>clearTimeout(e)),G=[],j(e)&&x(te),W.destroyed=!0},this.freeze=function(){W.frozen=!0},this.unfreeze=function(){W.frozen=!1,R()},this.reset=function(){!this.is("destroyed")&&this.destroy(),$.reset(),J=0;for(let e in W)W[e]=!1;return Q[M()?"value":"innerHTML"]="",this},this.go=function(){return W.started?this:(function(){try{function e(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=te.getBoundingClientRect().width/2;te.style.margin="0 -"+(e+2)+"px 0 -"+(e-2)+"px"})})}if(!M()&&Q.appendChild(te),!ee)return Promise.resolve();((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=L.reduce((e,t)=>e+" "+t+": var(--ti-"+t+", "+o[t]+");","");d("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})(Z,X,Q);const t="loaded"===document.fonts.status;Promise.resolve(t?e():Promise.resolve(document.fonts.ready).then(e))}catch(e){return Promise.reject(e)}}(),X.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Q,R.bind(this)),this):(R(),this))},this.getQueue=function(){return $},this.getOptions=function(){return X},this.getElement=function(){return Q};let Q="string"==typeof(Y=e)?p(Y):Y;var Y;let G=[],J=0,K={freezeCursor:!0},W=o({},y),X=o(g,t);X=o(X,{html:!M()&&X.html,nextStringDelay:b(X.nextStringDelay),loopDelay:b(X.loopDelay)});let Z=Math.random().toString().substring(2,9),$=function(e){const t=function(e){return n=n.concat(e.map(e=>r.map((t,n)=>e[n]?e[n]:t))),this};let n=[];return t(e),{add:t,set:function(e,t){n[e]=t},reset:function(){n=n.map(e=>(e[2].executed=!1,e))},getItems:function(){return n.filter(e=>!e[2].executed)},setMeta:function(e,t){n[e][2]=o(n[e][2],t)}}}([[z,X.startDelay]]);Q.dataset.typeitId=Z,d("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=X.cursor&&!M(),te=(()=>{if(M())return;let e=f("span");return e.className="ti-cursor",ee?(e.innerHTML=s(X.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;X.strings=(e=>{let t=Q.innerHTML;return t?(Q.innerHTML="",X.startDelete?(l(t).forEach(e=>{T(Q,e,te,J)}),B([[_,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(m(ne=X.strings)?ne:[ne]),X.strings.length&&(()=>{let e=X.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=a(t,X.html);if($.add([[V,{chars:r},K]]),n+1===e.length)return;const o=X.breakLines?[[V,{chars:[c(f("BR"))]},K]]:[[_,{num:r.length},K]];B(o)})})()}var B=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],H=["options","as","children","getBeforeInit","getAfterInit"],R=t.useRef,z=t.useEffect,q=t.useState,V=t.useMemo,F=function(e){var r=q(!0),o=r[0],i=r[1],s=R(null),u=e.options,c=e.as,l=e.children,a=e.getBeforeInit,f=e.getAfterInit,h=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,H),d=c,m=V(function(){return B.indexOf(d.toLowerCase())>-1},[d]);return z(function(){l&&(u.strings=s.current.innerHTML),i(!1)},[]),z(function(){if(!o){var e=new A(s.current,n({},u));return(e=a(e)).go(),e=f(e),function(){e.destroy()}}},[o]),t.createElement("div",{style:{opacity:o?0:1}},m?t.createElement(d,n({ref:s},h)):t.createElement(d,n({ref:s},h),o&&l))};F.defaultProps={as:"span",options:{},getBeforeInit:function(e){return e},getAfterInit:function(e){return e}},module.exports=F;
function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var t=e(require("react"));function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const r=[null,null,{}];var o=(e,t)=>Object.assign({},e,t),i=e=>Array.from(e),u=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const s=(e,t=null,n=!1)=>{let r=i(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:s(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},c=(e,t=null)=>({node:t,content:e});function l(e){let t=u(e);return s(t).flatMap(e=>e.nodeValue?i(e.nodeValue).map(t=>c(t,e)):c(e))}function a(e,t=!0){return t?l(e):i(e).map(e=>c(e))}var f=e=>document.createElement(e),h=e=>document.createTextNode(e),d=(e,t="")=>{let n=f("style");n.id=t,n.appendChild(h(e)),document.head.appendChild(n)},m=e=>Array.isArray(e);const v=e=>Number.isInteger(e),p=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),y={started:!1,completed:!1,frozen:!1,destroyed:!1},g={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},b=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=p(".ti-cursor",t),i=e?p(e,t):t,u=s(i,o,!0),c=u[0],l=u[u.length-1],a=r&&!e?0:s(t,o,!0).findIndex(e=>e.isSameNode(r?c:l));return r&&a--,a+1};var P=e=>(m(e)||(e=[e/2,e/2]),e),S=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let j=e=>e/2;var M=e=>"value"in e;const N=e=>"function"==typeof e?e():e;var T=e=>"BODY"===e.tagName;const w=(e,t)=>{let n=i(p("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},E=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,u=null==i?void 0:i.parentNode,c=o?t.content:h(t.content);if(M(e))return void(e.value=""+e.value+t.content);if(!o&&u&&!T(u)){let r=w(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{c=u.cloneNode(),c.appendChild(h(t.content));let n=u.parentNode,r=n.cloneNode();if(!T(n)){let t=w(r,e);for(;!t&&!T(n);){let o=r;o.innerHTML=c.outerHTML,c=o,n=n.parentNode,r=n.cloneNode(),t=w(r,e)}e=t||e}}}let l=s(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(c,a.contains(n)?n:null)};var L=e=>e&&e.remove();const k={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function D(e,t,n){if(!e.s){if(n instanceof O){if(!n.s)return void(n.o=D.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(D.bind(null,e,t),D.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const O=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{D(r,1,e(this.v))}catch(e){D(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?D(r,1,t?t(o):o):n?D(r,1,n(o)):D(r,2,o)}catch(e){D(r,2,e)}},r},e}();function x(e){return e instanceof O&&1&e.s}function I(e,t,n){var r,o,i=-1;return function u(s){try{for(;++i<e.length&&(!n||!n());)if((s=t(i))&&s.then){if(!x(s))return void s.then(u,o||(o=D.bind(null,r=new O,2)));s=s.v}r?D(r,1,s):r=s}catch(e){D(r||(r=new O),2,e)}}(),r}function C(e,t,n){for(var r;;){var o=e();if(x(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!x(i)){r=1;break}i=i.s}if(t){var u=t();if(u&&u.then&&!x(u)){r=2;break}}}var s=new O,c=D.bind(null,s,2);return(0===r?o.then(a):1===r?i.then(l):u.then(f)).then(void 0,c),s;function l(r){i=r;do{if(t&&(u=t())&&u.then&&!x(u))return void u.then(f).then(void 0,c);if(!(o=e())||x(o)&&!o.v)return void D(s,1,i);if(o.then)return void o.then(a).then(void 0,c);x(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):D(s,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):D(s,1,i)}}function H(e,t={}){const n=this,h=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,G))}catch(e){return Promise.reject(e)}},T=()=>M(Y),w=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[S(t,j(t)),S(n,j(n))]:[t,n]}(X)[e],D=(e,t=0)=>e?w(t):0,O=(e,t)=>($.add(e),((e={})=>{let t=e.delay;t&&$.add([[R,t]])})(t),this),x=()=>(e=>M(e)?i(e.value):s(e,p(".ti-cursor",e),!0))(Y),H=(e={})=>[[U,e],[U,X]],A=e=>{let t=X.nextStringDelay;$.add([[R,t[0]],...e,[R,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},z=function(){try{let e;W.started=!0;let t,r=$.getItems();const o=function(o,i){try{var u=function(){function o(e){return W.completed=!0,Promise.resolve(X.afterComplete(...t)).then(function(){if(!X.loop)throw"";let e=X.loopDelay;h(function(){try{return Promise.resolve(function(e){try{function t(t){return $.reset(),$.set(0,[R,e,{}]),Promise.resolve(Q({num:null})).then(function(){})}return Promise.resolve(J?Promise.resolve(q({value:J})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){z()})}catch(e){return Promise.reject(e)}},e[1])})}const i=I(r,function(e){if(W.frozen||W.destroyed)throw"";let o=r[e],i=o[2];return t=[o,n],i.freezeCursor&&B(!0),Promise.resolve(X.beforeStep(...t)).then(function(){return Promise.resolve(o[0].call(n,o[1],i)).then(function(){return Promise.resolve(X.afterStep(...t)).then(function(){$.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return i&&i.then?i.then(o):o()}()}catch(e){return}return u&&u.then?u.then(void 0,function(){}):u}();return Promise.resolve(o&&o.then?o.then(function(t){return e?t:n}):e?o:n)}catch(e){return Promise.reject(e)}},R=(e=0)=>h(()=>{},e),q=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>v(t)?-1*t:b(t,e,r)-n)({el:Y,move:e,cursorPos:J,to:t}),o=()=>{J+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Y,x(),te,J)};return Promise.resolve(h(function(){try{let e=0;const t=C(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(h(o,w(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},D(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>h(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(X.afterString(e)).then(function(e){})}const u=I(e,function(n){return t?void o(e[n]):Promise.resolve(h(()=>{o(e[n])},w(0))).then(function(e){})});return u&&u.then?u.then(i):i()}const o=e=>E(Y,e,te,J);return Promise.resolve(n?r():Promise.resolve(X.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},D(t)),U=function(e){try{return X=o(X,e),Promise.resolve()}catch(e){return Promise.reject(e)}},_=function(){try{return T()?(Y.value="",Promise.resolve()):(x().forEach(e=>{L(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Q=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>v(e)?e:b(e,Y,n);return Promise.resolve(h(function(){try{let n=r(e);const o=()=>{let e=x();var t;e.length&&(T()?Y.value=Y.value.slice(0,-1):(L(e[J]),t=te,p("*",Y,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;L(t)}})))};let i=0;const u=C(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(h(o,w(1))).then(function(e){})});return Promise.resolve(u&&u.then?u.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},D(t,1))).then(function(){const t=function(){if(null===e&&x().length-1>0)return Promise.resolve(Q({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=c(f("BR"));return O([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=N(e);let n=H(t),r=e,{instant:o,to:i}=t;return O([n[0],[Q,{num:r,instant:o,to:i},K],n[1]],t)},this.empty=function(e={}){return O([[_]],e)},this.exec=function(e,t){let n=H(t);return O([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=N(e);let n=H(t),{instant:r,to:o}=t;return O([n[0],[q,{value:null===e?"":e,to:o,instant:r},K],n[1]],t)},this.options=function(e){return e=N(e),O([[U,e]],e)},this.pause=function(e,t={}){return O([[R,N(e)]],t)},this.type=function(e,t={}){e=N(e);let n=H(t),r=a(e,X.html),{instant:o}=t;return O([n[0],[V,{chars:r,instant:o},K],n[1]],t)},this.is=function(e){return W[e]},this.destroy=function(e=!0){G.forEach(e=>clearTimeout(e)),G=[],N(e)&&L(te),W.destroyed=!0},this.freeze=function(){W.frozen=!0},this.unfreeze=function(){W.frozen=!1,z()},this.reset=function(){!this.is("destroyed")&&this.destroy(),$.reset(),J=0;for(let e in W)W[e]=!1;return Y[T()?"value":"innerHTML"]="",this},this.go=function(){return W.started?this:(function(){try{!T()&&Y.appendChild(te),ee?(((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=Object.entries(k).reduce((e,[t,n])=>e+" "+t+": var(--ti-"+t+", "+(n||o[t])+");","");d("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; letter-spacing: -1em; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})(Z,X,Y),Promise.resolve()):Promise.resolve()}catch(e){return Promise.reject(e)}}(),X.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Y,z.bind(this)),this):(z(),this))},this.getQueue=function(){return $},this.getOptions=function(){return X},this.getElement=function(){return Y};let Y="string"==typeof(F=e)?p(F):F;var F;let G=[],J=0,K={freezeCursor:!0},W=o({},y),X=o(g,t);X=o(X,{html:!T()&&X.html,nextStringDelay:P(X.nextStringDelay),loopDelay:P(X.loopDelay)});let Z=Math.random().toString().substring(2,9),$=function(e){const t=function(e){return n=n.concat(e.map(e=>r.map((t,n)=>e[n]?e[n]:t))),this};let n=[];return t(e),{add:t,set:function(e,t){n[e]=t},reset:function(){n=n.map(e=>(e[2].executed=!1,e))},getItems:function(){return n.filter(e=>!e[2].executed)},setMeta:function(e,t){n[e][2]=o(n[e][2],t)}}}([[R,X.startDelay]]);Y.dataset.typeitId=Z,d("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=X.cursor&&!T(),te=(()=>{if(T())return;let e=f("span");return e.className="ti-cursor",ee?(e.innerHTML=u(X.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;X.strings=(e=>{let t=Y.innerHTML;return t?(Y.innerHTML="",X.startDelete?(l(t).forEach(e=>{E(Y,e,te,J)}),A([[Q,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(m(ne=X.strings)?ne:[ne]),X.strings.length&&(()=>{let e=X.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=a(t,X.html);if($.add([[V,{chars:r},K]]),n+1===e.length)return;const o=X.breakLines?[[V,{chars:[c(f("BR"))]},K]]:[[Q,{num:r.length},K]];A(o)})})()}var A=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],B=["options","as","children","getBeforeInit","getAfterInit"],z=t.useRef,R=t.useEffect,q=t.useState,V=t.useMemo,U=function(e){var r=q(!0),o=r[0],i=r[1],u=z(null),s=e.options,c=e.as,l=e.children,a=e.getBeforeInit,f=e.getAfterInit,h=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,B),d=c,m=V(function(){return A.indexOf(d.toLowerCase())>-1},[d]);return R(function(){l&&(s.strings=u.current.innerHTML),i(!1)},[]),R(function(){if(!o){var e=new H(u.current,n({},s));return(e=a(e)).go(),e=f(e),function(){e.destroy()}}},[o]),t.createElement("div",{style:{opacity:o?0:1}},m?t.createElement(d,n({ref:u},h)):t.createElement(d,n({ref:u},h),o&&l))};U.defaultProps={as:"span",options:{},getBeforeInit:function(e){return e},getAfterInit:function(e){return e}},module.exports=U;
// TypeIt - React by Alex MacArthur - https://typeitjs.com
import*as e from"react";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const n=[null,null,{}];var r=(e,t)=>Object.assign({},e,t),o=e=>Array.from(e),i=e=>(new DOMParser).parseFromString(e,"text/html").body;const s=(e,t=null,n=!1)=>{let r=o(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:s(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},u=(e,t=null)=>({node:t,content:e});function c(e){let t=i(e);return s(t).flatMap(e=>e.nodeValue?o(e.nodeValue).map(t=>u(t,e)):u(e))}function l(e,t=!0){return t?c(e):o(e).map(e=>u(e))}var a=e=>document.createElement(e),f=e=>document.createTextNode(e),h=(e,t="")=>{let n=a("style");n.id=t,n.appendChild(f(e)),document.head.appendChild(n)},d=e=>Array.isArray(e);const m=e=>Number.isInteger(e),v=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),p={started:!1,completed:!1,frozen:!1,destroyed:!1},y={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},g=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=v(".ti-cursor",t),i=e?v(e,t):t,u=s(i,o,!0),c=u[0],l=u[u.length-1],a=r&&!e?0:s(t,o,!0).findIndex(e=>e.isSameNode(r?c:l));return r&&a--,a+1};var P=e=>(d(e)||(e=[e/2,e/2]),e),b=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let S=e=>e/2;var N=e=>"value"in e;const w=e=>"function"==typeof e?e():e;var M=e=>"BODY"===e.tagName;const T=(e,t)=>{let n=o(v("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},E=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,u=null==i?void 0:i.parentNode,c=o?t.content:f(t.content);if(N(e))return void(e.value=""+e.value+t.content);if(!o&&u&&!M(u)){let r=T(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{c=u.cloneNode(),c.appendChild(f(t.content));let n=u.parentNode,r=n.cloneNode();if(!M(n)){let t=T(r,e);for(;!t&&!M(n);){let o=r;o.innerHTML=c.outerHTML,c=o,n=n.parentNode,r=n.cloneNode(),t=T(r,e)}e=t||e}}}let l=s(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(c,a.contains(n)?n:null)};var j=e=>e&&e.remove();const x=["font-family","font-weight","font-size","font-style","line-height","color"];function L(e,t,n){if(!e.s){if(n instanceof k){if(!n.s)return void(n.o=L.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(L.bind(null,e,t),L.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const k=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{L(r,1,e(this.v))}catch(e){L(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?L(r,1,t?t(o):o):n?L(r,1,n(o)):L(r,2,o)}catch(e){L(r,2,e)}},r},e}();function D(e){return e instanceof k&&1&e.s}function C(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!D(u))return void u.then(s,o||(o=L.bind(null,r=new k,2)));u=u.v}r?L(r,1,u):r=u}catch(e){L(r||(r=new k),2,e)}}(),r}function I(e,t,n){for(var r;;){var o=e();if(D(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!D(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!D(s)){r=2;break}}}var u=new k,c=L.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(l):s.then(f)).then(void 0,c),u;function l(r){i=r;do{if(t&&(s=t())&&s.then&&!D(s))return void s.then(f).then(void 0,c);if(!(o=e())||D(o)&&!o.v)return void L(u,1,i);if(o.then)return void o.then(a).then(void 0,c);D(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):L(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):L(u,1,i)}}function A(e,t={}){const f=this,M=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},T=()=>N(Y),L=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[b(t,S(t)),b(n,S(n))]:[t,n]}(Z)[e],k=(e,t=0)=>e?L(t):0,D=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[z,t]])})(t),this),A=()=>(e=>N(e)?o(e.value):s(e,v(".ti-cursor",e),!0))(Y),B=(e={})=>[[F,e],[F,Z]],O=e=>{let t=Z.nextStringDelay;_.add([[z,t[0]],...e,[z,t[1]]])},H=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},R=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;M(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[z,e,{}]),Promise.resolve(Q({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(q({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){R()})}catch(e){return Promise.reject(e)}},e[1])})}const o=C(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,f],o.freezeCursor&&H(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(f,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),H(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:f}):e?r:f)}catch(e){return Promise.reject(e)}},z=(e=0)=>M(()=>{},e),q=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>m(t)?-1*t:g(t,e,r)-n)({el:Y,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Y,A(),te,K)};return Promise.resolve(M(function(){try{let e=0;const t=I(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(M(o,L(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},k(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>M(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=C(e,function(n){return t?void o(e[n]):Promise.resolve(M(()=>{o(e[n])},L(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>E(Y,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},k(t)),F=function(e){try{return Z=r(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},U=function(){try{return T()?(Y.value="",Promise.resolve()):(A().forEach(e=>{j(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Q=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>m(e)?e:g(e,Y,n);return Promise.resolve(M(function(){try{let n=r(e);const o=()=>{let e=A();var t;e.length&&(T()?Y.value=Y.value.slice(0,-1):(j(e[K]),t=te,v("*",Y,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;j(t)}})))};let i=0;const s=I(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(M(o,L(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},k(t,1))).then(function(){const t=function(){if(null===e&&A().length-1>0)return Promise.resolve(Q({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=u(a("BR"));return D([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=w(e);let n=B(t),r=e,{instant:o,to:i}=t;return D([n[0],[Q,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return D([[U]],e)},this.exec=function(e,t){let n=B(t);return D([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=w(e);let n=B(t),{instant:r,to:o}=t;return D([n[0],[q,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=w(e),D([[F,e]],e)},this.pause=function(e,t={}){return D([[z,w(e)]],t)},this.type=function(e,t={}){e=w(e);let n=B(t),r=l(e,Z.html),{instant:o}=t;return D([n[0],[V,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],w(e)&&j(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,R()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return Y[T()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{function e(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=te.getBoundingClientRect().width/2;te.style.margin="0 -"+(e+2)+"px 0 -"+(e-2)+"px"})})}if(!T()&&Y.appendChild(te),!ee)return Promise.resolve();((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=x.reduce((e,t)=>e+" "+t+": var(--ti-"+t+", "+o[t]+");","");h("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,Y);const t="loaded"===document.fonts.status;Promise.resolve(t?e():Promise.resolve(document.fonts.ready).then(e))}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Y,R.bind(this)),this):(R(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return Y};let Y="string"==typeof(G=e)?v(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=r({},p),Z=r(y,t);Z=r(Z,{html:!T()&&Z.html,nextStringDelay:P(Z.nextStringDelay),loopDelay:P(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(e){const t=function(e){return o=o.concat(e.map(e=>n.map((t,n)=>e[n]?e[n]:t))),this};let o=[];return t(e),{add:t,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,t){o[e][2]=r(o[e][2],t)}}}([[z,Z.startDelay]]);Y.dataset.typeitId=$,h("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!T(),te=(()=>{if(T())return;let e=a("span");return e.className="ti-cursor",ee?(e.innerHTML=i(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=Y.innerHTML;return t?(Y.innerHTML="",Z.startDelete?(c(t).forEach(e=>{E(Y,e,te,K)}),O([[Q,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(d(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=l(t,Z.html);if(_.add([[V,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[V,{chars:[u(a("BR"))]},W]]:[[Q,{num:r.length},W]];O(o)})})()}const B=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],O=["options","as","children","getBeforeInit","getAfterInit"],{useRef:H,useEffect:R,useState:z,useMemo:q}=e,V=n=>{const[r,o]=z(!0),i=H(null),{options:s,as:u,children:c,getBeforeInit:l,getAfterInit:a}=n,f=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(n,O),h=u,d=q(()=>B.indexOf(h.toLowerCase())>-1,[h]);return R(()=>{c&&(s.strings=i.current.innerHTML),o(!1)},[]),R(()=>{if(r)return;let e=new A(i.current,t({},s));return e=l(e),e.go(),e=a(e),()=>{e.destroy()}},[r]),e.createElement("div",{style:{opacity:r?0:1}},d?e.createElement(h,t({ref:i},f)):e.createElement(h,t({ref:i},f),r&&c))};V.defaultProps={as:"span",options:{},getBeforeInit:e=>e,getAfterInit:e=>e};export{V as default};
import*as e from"react";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const n=[null,null,{}];var r=(e,t)=>Object.assign({},e,t),o=e=>Array.from(e),i=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const s=(e,t=null,n=!1)=>{let r=o(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:s(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},u=(e,t=null)=>({node:t,content:e});function c(e){let t=i(e);return s(t).flatMap(e=>e.nodeValue?o(e.nodeValue).map(t=>u(t,e)):u(e))}function l(e,t=!0){return t?c(e):o(e).map(e=>u(e))}var a=e=>document.createElement(e),f=e=>document.createTextNode(e),h=(e,t="")=>{let n=a("style");n.id=t,n.appendChild(f(e)),document.head.appendChild(n)},d=e=>Array.isArray(e);const m=e=>Number.isInteger(e),v=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),p={started:!1,completed:!1,frozen:!1,destroyed:!1},y={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},g=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=v(".ti-cursor",t),i=e?v(e,t):t,u=s(i,o,!0),c=u[0],l=u[u.length-1],a=r&&!e?0:s(t,o,!0).findIndex(e=>e.isSameNode(r?c:l));return r&&a--,a+1};var P=e=>(d(e)||(e=[e/2,e/2]),e),b=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let S=e=>e/2;var N=e=>"value"in e;const M=e=>"function"==typeof e?e():e;var T=e=>"BODY"===e.tagName;const w=(e,t)=>{let n=o(v("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},j=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,u=null==i?void 0:i.parentNode,c=o?t.content:f(t.content);if(N(e))return void(e.value=""+e.value+t.content);if(!o&&u&&!T(u)){let r=w(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{c=u.cloneNode(),c.appendChild(f(t.content));let n=u.parentNode,r=n.cloneNode();if(!T(n)){let t=w(r,e);for(;!t&&!T(n);){let o=r;o.innerHTML=c.outerHTML,c=o,n=n.parentNode,r=n.cloneNode(),t=w(r,e)}e=t||e}}}let l=s(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(c,a.contains(n)?n:null)};var E=e=>e&&e.remove();const L={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function k(e,t,n){if(!e.s){if(n instanceof x){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;const r=e.o;r&&r(e)}}const x=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{k(r,1,e(this.v))}catch(e){k(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?k(r,1,t?t(o):o):n?k(r,1,n(o)):k(r,2,o)}catch(e){k(r,2,e)}},r},e}();function D(e){return e instanceof x&&1&e.s}function I(e,t,n){var r,o,i=-1;return function s(u){try{for(;++i<e.length&&(!n||!n());)if((u=t(i))&&u.then){if(!D(u))return void u.then(s,o||(o=k.bind(null,r=new x,2)));u=u.v}r?k(r,1,u):r=u}catch(e){k(r||(r=new x),2,e)}}(),r}function C(e,t,n){for(var r;;){var o=e();if(D(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!D(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!D(s)){r=2;break}}}var u=new x,c=k.bind(null,u,2);return(0===r?o.then(a):1===r?i.then(l):s.then(f)).then(void 0,c),u;function l(r){i=r;do{if(t&&(s=t())&&s.then&&!D(s))return void s.then(f).then(void 0,c);if(!(o=e())||D(o)&&!o.v)return void k(u,1,i);if(o.then)return void o.then(a).then(void 0,c);D(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):k(u,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):k(u,1,i)}}function H(e,t={}){const f=this,T=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,J))}catch(e){return Promise.reject(e)}},w=()=>N(F),k=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[b(t,S(t)),b(n,S(n))]:[t,n]}(Z)[e],x=(e,t=0)=>e?k(t):0,D=(e,t)=>(_.add(e),((e={})=>{let t=e.delay;t&&_.add([[R,t]])})(t),this),H=()=>(e=>N(e)?o(e.value):s(e,v(".ti-cursor",e),!0))(F),O=(e={})=>[[U,e],[U,Z]],A=e=>{let t=Z.nextStringDelay;_.add([[R,t[0]],...e,[R,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},z=function(){try{let e;X.started=!0;let t,n=_.getItems();const r=function(r,o){try{var i=function(){function r(e){return X.completed=!0,Promise.resolve(Z.afterComplete(...t)).then(function(){if(!Z.loop)throw"";let e=Z.loopDelay;T(function(){try{return Promise.resolve(function(e){try{function t(t){return _.reset(),_.set(0,[R,e,{}]),Promise.resolve(Y({num:null})).then(function(){})}return Promise.resolve(K?Promise.resolve(V({value:K})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){z()})}catch(e){return Promise.reject(e)}},e[1])})}const o=I(n,function(e){if(X.frozen||X.destroyed)throw"";let r=n[e],o=r[2];return t=[r,f],o.freezeCursor&&B(!0),Promise.resolve(Z.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(f,r[1],o)).then(function(){return Promise.resolve(Z.afterStep(...t)).then(function(){_.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return o&&o.then?o.then(r):r()}()}catch(e){return}return i&&i.then?i.then(void 0,function(){}):i}();return Promise.resolve(r&&r.then?r.then(function(t){return e?t:f}):e?r:f)}catch(e){return Promise.reject(e)}},R=(e=0)=>T(()=>{},e),V=function({value:e,to:t="START",instant:n=!1}){try{let r=(({el:e,move:t,cursorPos:n,to:r})=>m(t)?-1*t:g(t,e,r)-n)({el:F,move:e,cursorPos:K,to:t}),o=()=>{K+=r<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(F,H(),te,K)};return Promise.resolve(T(function(){try{let e=0;const t=C(function(){return e<Math.abs(r)},function(){return e++},function(){return n?void o():Promise.resolve(T(o,k(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},x(n))).then(function(){})}catch(e){return Promise.reject(e)}},q=({chars:e,instant:t,silent:n})=>T(function(){try{function r(r){function i(){return n?void 0:Promise.resolve(Z.afterString(e)).then(function(e){})}const s=I(e,function(n){return t?void o(e[n]):Promise.resolve(T(()=>{o(e[n])},k(0))).then(function(e){})});return s&&s.then?s.then(i):i()}const o=e=>j(F,e,te,K);return Promise.resolve(n?r():Promise.resolve(Z.beforeString(e)).then(r))}catch(e){return Promise.reject(e)}},x(t)),U=function(e){try{return Z=r(Z,e),Promise.resolve()}catch(e){return Promise.reject(e)}},Q=function(){try{return w()?(F.value="",Promise.resolve()):(H().forEach(e=>{E(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Y=function({num:e=null,instant:t=!1,to:n="START"}){try{const r=e=>m(e)?e:g(e,F,n);return Promise.resolve(T(function(){try{let n=r(e);const o=()=>{let e=H();var t;e.length&&(w()?F.value=F.value.slice(0,-1):(E(e[K]),t=te,v("*",F,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;E(t)}})))};let i=0;const s=C(function(){return i<n},function(){return i++},function(){return t?void o():Promise.resolve(T(o,k(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},x(t,1))).then(function(){const t=function(){if(null===e&&H().length-1>0)return Promise.resolve(Y({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=u(a("BR"));return D([[q,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=M(e);let n=O(t),r=e,{instant:o,to:i}=t;return D([n[0],[Y,{num:r,instant:o,to:i},W],n[1]],t)},this.empty=function(e={}){return D([[Q]],e)},this.exec=function(e,t){let n=O(t);return D([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=M(e);let n=O(t),{instant:r,to:o}=t;return D([n[0],[V,{value:null===e?"":e,to:o,instant:r},W],n[1]],t)},this.options=function(e){return e=M(e),D([[U,e]],e)},this.pause=function(e,t={}){return D([[R,M(e)]],t)},this.type=function(e,t={}){e=M(e);let n=O(t),r=l(e,Z.html),{instant:o}=t;return D([n[0],[q,{chars:r,instant:o},W],n[1]],t)},this.is=function(e){return X[e]},this.destroy=function(e=!0){J.forEach(e=>clearTimeout(e)),J=[],M(e)&&E(te),X.destroyed=!0},this.freeze=function(){X.frozen=!0},this.unfreeze=function(){X.frozen=!1,z()},this.reset=function(){!this.is("destroyed")&&this.destroy(),_.reset(),K=0;for(let e in X)X[e]=!1;return F[w()?"value":"innerHTML"]="",this},this.go=function(){return X.started?this:(function(){try{!w()&&F.appendChild(te),ee?(((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=Object.entries(L).reduce((e,[t,n])=>e+" "+t+": var(--ti-"+t+", "+(n||o[t])+");","");h("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; letter-spacing: -1em; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})($,Z,F),Promise.resolve()):Promise.resolve()}catch(e){return Promise.reject(e)}}(),Z.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(F,z.bind(this)),this):(z(),this))},this.getQueue=function(){return _},this.getOptions=function(){return Z},this.getElement=function(){return F};let F="string"==typeof(G=e)?v(G):G;var G;let J=[],K=0,W={freezeCursor:!0},X=r({},p),Z=r(y,t);Z=r(Z,{html:!w()&&Z.html,nextStringDelay:P(Z.nextStringDelay),loopDelay:P(Z.loopDelay)});let $=Math.random().toString().substring(2,9),_=function(e){const t=function(e){return o=o.concat(e.map(e=>n.map((t,n)=>e[n]?e[n]:t))),this};let o=[];return t(e),{add:t,set:function(e,t){o[e]=t},reset:function(){o=o.map(e=>(e[2].executed=!1,e))},getItems:function(){return o.filter(e=>!e[2].executed)},setMeta:function(e,t){o[e][2]=r(o[e][2],t)}}}([[R,Z.startDelay]]);F.dataset.typeitId=$,h("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=Z.cursor&&!w(),te=(()=>{if(w())return;let e=a("span");return e.className="ti-cursor",ee?(e.innerHTML=i(Z.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;Z.strings=(e=>{let t=F.innerHTML;return t?(F.innerHTML="",Z.startDelete?(c(t).forEach(e=>{j(F,e,te,K)}),A([[Y,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(d(ne=Z.strings)?ne:[ne]),Z.strings.length&&(()=>{let e=Z.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=l(t,Z.html);if(_.add([[q,{chars:r},W]]),n+1===e.length)return;const o=Z.breakLines?[[q,{chars:[u(a("BR"))]},W]]:[[Y,{num:r.length},W]];A(o)})})()}const O=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],A=["options","as","children","getBeforeInit","getAfterInit"],{useRef:B,useEffect:z,useState:R,useMemo:V}=e,q=n=>{const[r,o]=R(!0),i=B(null),{options:s,as:u,children:c,getBeforeInit:l,getAfterInit:a}=n,f=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(n,A),h=u,d=V(()=>O.indexOf(h.toLowerCase())>-1,[h]);return z(()=>{c&&(s.strings=i.current.innerHTML),o(!1)},[]),z(()=>{if(r)return;let e=new H(i.current,t({},s));return e=l(e),e.go(),e=a(e),()=>{e.destroy()}},[r]),e.createElement("div",{style:{opacity:r?0:1}},d?e.createElement(h,t({ref:i},f)):e.createElement(h,t({ref:i},f),r&&c))};q.defaultProps={as:"span",options:{},getBeforeInit:e=>e,getAfterInit:e=>e};export{q as default};
// TypeIt - React by Alex MacArthur - https://typeitjs.com
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e||self).TypeIt=t(e.react)}(this,function(e){function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var n=t(e);function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const o=[null,null,{}];var i=(e,t)=>Object.assign({},e,t),u=e=>Array.from(e),s=e=>(new DOMParser).parseFromString(e,"text/html").body;const c=(e,t=null,n=!1)=>{let r=u(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:c(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},l=(e,t=null)=>({node:t,content:e});function a(e){let t=s(e);return c(t).flatMap(e=>e.nodeValue?u(e.nodeValue).map(t=>l(t,e)):l(e))}function f(e,t=!0){return t?a(e):u(e).map(e=>l(e))}var h=e=>document.createElement(e),d=e=>document.createTextNode(e),m=(e,t="")=>{let n=h("style");n.id=t,n.appendChild(d(e)),document.head.appendChild(n)},v=e=>Array.isArray(e);const p=e=>Number.isInteger(e),y=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),g={started:!1,completed:!1,frozen:!1,destroyed:!1},b={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},P=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=y(".ti-cursor",t),i=e?y(e,t):t,u=c(i,o,!0),s=u[0],l=u[u.length-1],a=r&&!e?0:c(t,o,!0).findIndex(e=>e.isSameNode(r?s:l));return r&&a--,a+1};var S=e=>(v(e)||(e=[e/2,e/2]),e),j=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let w=e=>e/2;var N=e=>"value"in e;const T=e=>"function"==typeof e?e():e;var M=e=>"BODY"===e.tagName;const E=(e,t)=>{let n=u(y("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},x=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,u=null==i?void 0:i.parentNode,s=o?t.content:d(t.content);if(N(e))return void(e.value=""+e.value+t.content);if(!o&&u&&!M(u)){let r=E(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{s=u.cloneNode(),s.appendChild(d(t.content));let n=u.parentNode,r=n.cloneNode();if(!M(n)){let t=E(r,e);for(;!t&&!M(n);){let o=r;o.innerHTML=s.outerHTML,s=o,n=n.parentNode,r=n.cloneNode(),t=E(r,e)}e=t||e}}}let l=c(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(s,a.contains(n)?n:null)};var L=e=>e&&e.remove();const k=["font-family","font-weight","font-size","font-style","line-height","color"];function D(e,t,n){if(!e.s){if(n instanceof O){if(!n.s)return void(n.o=D.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(D.bind(null,e,t),D.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const O=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{D(r,1,e(this.v))}catch(e){D(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?D(r,1,t?t(o):o):n?D(r,1,n(o)):D(r,2,o)}catch(e){D(r,2,e)}},r},e}();function I(e){return e instanceof O&&1&e.s}function C(e,t,n){var r,o,i=-1;return function u(s){try{for(;++i<e.length&&(!n||!n());)if((s=t(i))&&s.then){if(!I(s))return void s.then(u,o||(o=D.bind(null,r=new O,2)));s=s.v}r?D(r,1,s):r=s}catch(e){D(r||(r=new O),2,e)}}(),r}function A(e,t,n){for(var r;;){var o=e();if(I(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!I(i)){r=1;break}i=i.s}if(t){var u=t();if(u&&u.then&&!I(u)){r=2;break}}}var s=new O,c=D.bind(null,s,2);return(0===r?o.then(a):1===r?i.then(l):u.then(f)).then(void 0,c),s;function l(r){i=r;do{if(t&&(u=t())&&u.then&&!I(u))return void u.then(f).then(void 0,c);if(!(o=e())||I(o)&&!o.v)return void D(s,1,i);if(o.then)return void o.then(a).then(void 0,c);I(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):D(s,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):D(s,1,i)}}function B(e,t={}){const n=this,r=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,G))}catch(e){return Promise.reject(e)}},d=()=>N(Q),M=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[j(t,w(t)),j(n,w(n))]:[t,n]}(X)[e],E=(e,t=0)=>e?M(t):0,D=(e,t)=>($.add(e),((e={})=>{let t=e.delay;t&&$.add([[z,t]])})(t),this),O=()=>(e=>N(e)?u(e.value):c(e,y(".ti-cursor",e),!0))(Q),I=(e={})=>[[F,e],[F,X]],B=e=>{let t=X.nextStringDelay;$.add([[z,t[0]],...e,[z,t[1]]])},H=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},R=function(){try{let e;W.started=!0;let t,o=$.getItems();const i=function(i,u){try{var s=function(){function i(e){return W.completed=!0,Promise.resolve(X.afterComplete(...t)).then(function(){if(!X.loop)throw"";let e=X.loopDelay;r(function(){try{return Promise.resolve(function(e){try{function t(t){return $.reset(),$.set(0,[z,e,{}]),Promise.resolve(_({num:null})).then(function(){})}return Promise.resolve(J?Promise.resolve(q({value:J})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){R()})}catch(e){return Promise.reject(e)}},e[1])})}const u=C(o,function(e){if(W.frozen||W.destroyed)throw"";let r=o[e],i=r[2];return t=[r,n],i.freezeCursor&&H(!0),Promise.resolve(X.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(n,r[1],i)).then(function(){return Promise.resolve(X.afterStep(...t)).then(function(){$.setMeta(e,{executed:!0}),H(!1)})})})},function(){return e});return u&&u.then?u.then(i):i()}()}catch(e){return}return s&&s.then?s.then(void 0,function(){}):s}();return Promise.resolve(i&&i.then?i.then(function(t){return e?t:n}):e?i:n)}catch(e){return Promise.reject(e)}},z=(e=0)=>r(()=>{},e),q=function({value:e,to:t="START",instant:n=!1}){try{let o=(({el:e,move:t,cursorPos:n,to:r})=>p(t)?-1*t:P(t,e,r)-n)({el:Q,move:e,cursorPos:J,to:t}),i=()=>{J+=o<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Q,O(),te,J)};return Promise.resolve(r(function(){try{let e=0;const t=A(function(){return e<Math.abs(o)},function(){return e++},function(){return n?void i():Promise.resolve(r(i,M(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},E(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>r(function(){try{function o(o){function u(){return n?void 0:Promise.resolve(X.afterString(e)).then(function(e){})}const s=C(e,function(n){return t?void i(e[n]):Promise.resolve(r(()=>{i(e[n])},M(0))).then(function(e){})});return s&&s.then?s.then(u):u()}const i=e=>x(Q,e,te,J);return Promise.resolve(n?o():Promise.resolve(X.beforeString(e)).then(o))}catch(e){return Promise.reject(e)}},E(t)),F=function(e){try{return X=i(X,e),Promise.resolve()}catch(e){return Promise.reject(e)}},U=function(){try{return d()?(Q.value="",Promise.resolve()):(O().forEach(e=>{L(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},_=function({num:e=null,instant:t=!1,to:n="START"}){try{const o=e=>p(e)?e:P(e,Q,n);return Promise.resolve(r(function(){try{let n=o(e);const i=()=>{let e=O();var t;e.length&&(d()?Q.value=Q.value.slice(0,-1):(L(e[J]),t=te,y("*",Q,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;L(t)}})))};let u=0;const s=A(function(){return u<n},function(){return u++},function(){return t?void i():Promise.resolve(r(i,M(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},E(t,1))).then(function(){const t=function(){if(null===e&&O().length-1>0)return Promise.resolve(_({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=l(h("BR"));return D([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=T(e);let n=I(t),r=e,{instant:o,to:i}=t;return D([n[0],[_,{num:r,instant:o,to:i},K],n[1]],t)},this.empty=function(e={}){return D([[U]],e)},this.exec=function(e,t){let n=I(t);return D([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=T(e);let n=I(t),{instant:r,to:o}=t;return D([n[0],[q,{value:null===e?"":e,to:o,instant:r},K],n[1]],t)},this.options=function(e){return e=T(e),D([[F,e]],e)},this.pause=function(e,t={}){return D([[z,T(e)]],t)},this.type=function(e,t={}){e=T(e);let n=I(t),r=f(e,X.html),{instant:o}=t;return D([n[0],[V,{chars:r,instant:o},K],n[1]],t)},this.is=function(e){return W[e]},this.destroy=function(e=!0){G.forEach(e=>clearTimeout(e)),G=[],T(e)&&L(te),W.destroyed=!0},this.freeze=function(){W.frozen=!0},this.unfreeze=function(){W.frozen=!1,R()},this.reset=function(){!this.is("destroyed")&&this.destroy(),$.reset(),J=0;for(let e in W)W[e]=!1;return Q[d()?"value":"innerHTML"]="",this},this.go=function(){return W.started?this:(function(){try{function e(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{const e=te.getBoundingClientRect().width/2;te.style.margin="0 -"+(e+2)+"px 0 -"+(e-2)+"px"})})}if(!d()&&Q.appendChild(te),!ee)return Promise.resolve();((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=k.reduce((e,t)=>e+" "+t+": var(--ti-"+t+", "+o[t]+");","");m("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})(Z,X,Q);const t="loaded"===document.fonts.status;Promise.resolve(t?e():Promise.resolve(document.fonts.ready).then(e))}catch(e){return Promise.reject(e)}}(),X.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Q,R.bind(this)),this):(R(),this))},this.getQueue=function(){return $},this.getOptions=function(){return X},this.getElement=function(){return Q};let Q="string"==typeof(Y=e)?y(Y):Y;var Y;let G=[],J=0,K={freezeCursor:!0},W=i({},g),X=i(b,t);X=i(X,{html:!d()&&X.html,nextStringDelay:S(X.nextStringDelay),loopDelay:S(X.loopDelay)});let Z=Math.random().toString().substring(2,9),$=function(e){const t=function(e){return n=n.concat(e.map(e=>o.map((t,n)=>e[n]?e[n]:t))),this};let n=[];return t(e),{add:t,set:function(e,t){n[e]=t},reset:function(){n=n.map(e=>(e[2].executed=!1,e))},getItems:function(){return n.filter(e=>!e[2].executed)},setMeta:function(e,t){n[e][2]=i(n[e][2],t)}}}([[z,X.startDelay]]);Q.dataset.typeitId=Z,m("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=X.cursor&&!d(),te=(()=>{if(d())return;let e=h("span");return e.className="ti-cursor",ee?(e.innerHTML=s(X.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;X.strings=(e=>{let t=Q.innerHTML;return t?(Q.innerHTML="",X.startDelete?(a(t).forEach(e=>{x(Q,e,te,J)}),B([[_,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(v(ne=X.strings)?ne:[ne]),X.strings.length&&(()=>{let e=X.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=f(t,X.html);if($.add([[V,{chars:r},K]]),n+1===e.length)return;const o=X.breakLines?[[V,{chars:[l(h("BR"))]},K]]:[[_,{num:r.length},K]];B(o)})})()}var H=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],R=["options","as","children","getBeforeInit","getAfterInit"],z=n.useRef,q=n.useEffect,V=n.useState,F=n.useMemo,U=function(e){var t=V(!0),o=t[0],i=t[1],u=z(null),s=e.options,c=e.as,l=e.children,a=e.getBeforeInit,f=e.getAfterInit,h=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,R),d=c,m=F(function(){return H.indexOf(d.toLowerCase())>-1},[d]);return q(function(){l&&(s.strings=u.current.innerHTML),i(!1)},[]),q(function(){if(!o){var e=new B(u.current,r({},s));return(e=a(e)).go(),e=f(e),function(){e.destroy()}}},[o]),n.createElement("div",{style:{opacity:o?0:1}},m?n.createElement(d,r({ref:u},h)):n.createElement(d,r({ref:u},h),o&&l))};return U.defaultProps={as:"span",options:{},getBeforeInit:function(e){return e},getAfterInit:function(e){return e}},U});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e||self).TypeIt=t(e.react)}(this,function(e){function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var n=t(e);function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const o=[null,null,{}];var i=(e,t)=>Object.assign({},e,t),u=e=>Array.from(e),s=e=>{let t=document.implementation.createHTMLDocument();return t.body.innerHTML=e,t.body};const c=(e,t=null,n=!1)=>{let r=u(e.childNodes).flatMap(e=>{return 3===(t=e).nodeType||"BR"===t.tagName?e:c(e);var t});return t&&(r=r.filter(e=>!t.contains(e))),n?r.reverse():r},l=(e,t=null)=>({node:t,content:e});function a(e){let t=s(e);return c(t).flatMap(e=>e.nodeValue?u(e.nodeValue).map(t=>l(t,e)):l(e))}function f(e,t=!0){return t?a(e):u(e).map(e=>l(e))}var h=e=>document.createElement(e),d=e=>document.createTextNode(e),m=(e,t="")=>{let n=h("style");n.id=t,n.appendChild(d(e)),document.head.appendChild(n)},v=e=>Array.isArray(e);const p=e=>Number.isInteger(e),y=(e,t=document,n=!1)=>t["querySelector"+(n?"All":"")](e),g={started:!1,completed:!1,frozen:!1,destroyed:!1},b={breakLines:!0,cursor:!0,cursorChar:"|",cursorSpeed:1e3,deleteSpeed:null,html:!0,lifeLike:!0,loop:!1,loopDelay:750,nextStringDelay:750,speed:100,startDelay:250,startDelete:!1,strings:[],waitUntilVisible:!1,beforeString:()=>{},afterString:()=>{},beforeStep:()=>{},afterStep:()=>{},afterComplete:()=>{}},P=(e,t,n="START")=>{let r=new RegExp("END","i").test(n),o=y(".ti-cursor",t),i=e?y(e,t):t,u=c(i,o,!0),s=u[0],l=u[u.length-1],a=r&&!e?0:c(t,o,!0).findIndex(e=>e.isSameNode(r?s:l));return r&&a--,a+1};var S=e=>(v(e)||(e=[e/2,e/2]),e),T=(e,t)=>Math.abs(Math.random()*(e+t-(e-t))+(e-t));let j=e=>e/2;var M=e=>"value"in e;const N=e=>"function"==typeof e?e():e;var w=e=>"BODY"===e.tagName;const E=(e,t)=>{let n=u(y("*",t,!0));return[t].concat(n.reverse()).find(t=>t.cloneNode().isEqualNode(e.cloneNode()))},L=(e,t,n,r)=>{let o=t.content instanceof HTMLElement,i=t.node,u=null==i?void 0:i.parentNode,s=o?t.content:d(t.content);if(M(e))return void(e.value=""+e.value+t.content);if(!o&&u&&!w(u)){let r=E(u,e);if(r&&((e,t)=>{let n=e.nextSibling;return!n||n.isEqualNode(t)})(r,n))e=r;else{s=u.cloneNode(),s.appendChild(d(t.content));let n=u.parentNode,r=n.cloneNode();if(!w(n)){let t=E(r,e);for(;!t&&!w(n);){let o=r;o.innerHTML=s.outerHTML,s=o,n=n.parentNode,r=n.cloneNode(),t=E(r,e)}e=t||e}}}let l=c(e,n,!0)[r-1],a=l?l.parentNode:e;a.insertBefore(s,a.contains(n)?n:null)};var k=e=>e&&e.remove();const x={"font-family":"","font-weight":"","font-size":"","font-style":"","line-height":"",color:"","margin-left":"-.125em","margin-right":".125em"};function D(e,t,n){if(!e.s){if(n instanceof O){if(!n.s)return void(n.o=D.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(D.bind(null,e,t),D.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}const O=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{D(r,1,e(this.v))}catch(e){D(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?D(r,1,t?t(o):o):n?D(r,1,n(o)):D(r,2,o)}catch(e){D(r,2,e)}},r},e}();function I(e){return e instanceof O&&1&e.s}function C(e,t,n){var r,o,i=-1;return function u(s){try{for(;++i<e.length&&(!n||!n());)if((s=t(i))&&s.then){if(!I(s))return void s.then(u,o||(o=D.bind(null,r=new O,2)));s=s.v}r?D(r,1,s):r=s}catch(e){D(r||(r=new O),2,e)}}(),r}function H(e,t,n){for(var r;;){var o=e();if(I(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!I(i)){r=1;break}i=i.s}if(t){var u=t();if(u&&u.then&&!I(u)){r=2;break}}}var s=new O,c=D.bind(null,s,2);return(0===r?o.then(a):1===r?i.then(l):u.then(f)).then(void 0,c),s;function l(r){i=r;do{if(t&&(u=t())&&u.then&&!I(u))return void u.then(f).then(void 0,c);if(!(o=e())||I(o)&&!o.v)return void D(s,1,i);if(o.then)return void o.then(a).then(void 0,c);I(i=n())&&(i=i.v)}while(!i||!i.then);i.then(l).then(void 0,c)}function a(e){e?(i=n())&&i.then?i.then(l).then(void 0,c):l(i):D(s,1,i)}function f(){(o=e())?o.then?o.then(a).then(void 0,c):a(o):D(s,1,i)}}function A(e,t={}){const n=this,r=function(e,t){try{return Promise.resolve(function(e,t,n){try{return Promise.resolve(new Promise(r=>{n.push(setTimeout(function(){try{return Promise.resolve(e()).then(function(){r()})}catch(e){return Promise.reject(e)}},t))}))}catch(e){return Promise.reject(e)}}(e,t,G))}catch(e){return Promise.reject(e)}},d=()=>M(Y),w=e=>function(e){let{speed:t,deleteSpeed:n,lifeLike:r}=e;return n=null!==n?n:t/3,r?[T(t,j(t)),T(n,j(n))]:[t,n]}(X)[e],E=(e,t=0)=>e?w(t):0,D=(e,t)=>($.add(e),((e={})=>{let t=e.delay;t&&$.add([[R,t]])})(t),this),O=()=>(e=>M(e)?u(e.value):c(e,y(".ti-cursor",e),!0))(Y),I=(e={})=>[[U,e],[U,X]],A=e=>{let t=X.nextStringDelay;$.add([[R,t[0]],...e,[R,t[1]]])},B=e=>{ee&&(te.classList.toggle("disabled",e),te.classList.toggle("with-delay",!e))},z=function(){try{let e;W.started=!0;let t,o=$.getItems();const i=function(i,u){try{var s=function(){function i(e){return W.completed=!0,Promise.resolve(X.afterComplete(...t)).then(function(){if(!X.loop)throw"";let e=X.loopDelay;r(function(){try{return Promise.resolve(function(e){try{function t(t){return $.reset(),$.set(0,[R,e,{}]),Promise.resolve(Q({num:null})).then(function(){})}return Promise.resolve(J?Promise.resolve(q({value:J})).then(t):t())}catch(e){return Promise.reject(e)}}(e[0])).then(function(){z()})}catch(e){return Promise.reject(e)}},e[1])})}const u=C(o,function(e){if(W.frozen||W.destroyed)throw"";let r=o[e],i=r[2];return t=[r,n],i.freezeCursor&&B(!0),Promise.resolve(X.beforeStep(...t)).then(function(){return Promise.resolve(r[0].call(n,r[1],i)).then(function(){return Promise.resolve(X.afterStep(...t)).then(function(){$.setMeta(e,{executed:!0}),B(!1)})})})},function(){return e});return u&&u.then?u.then(i):i()}()}catch(e){return}return s&&s.then?s.then(void 0,function(){}):s}();return Promise.resolve(i&&i.then?i.then(function(t){return e?t:n}):e?i:n)}catch(e){return Promise.reject(e)}},R=(e=0)=>r(()=>{},e),q=function({value:e,to:t="START",instant:n=!1}){try{let o=(({el:e,move:t,cursorPos:n,to:r})=>p(t)?-1*t:P(t,e,r)-n)({el:Y,move:e,cursorPos:J,to:t}),i=()=>{J+=o<0?-1:1,((e,t,n,r)=>{let o=t[Math.min(r,t.length)-1];(e=(null==o?void 0:o.parentNode)||e).insertBefore(n,o||null)})(Y,O(),te,J)};return Promise.resolve(r(function(){try{let e=0;const t=H(function(){return e<Math.abs(o)},function(){return e++},function(){return n?void i():Promise.resolve(r(i,w(0))).then(function(e){})});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},E(n))).then(function(){})}catch(e){return Promise.reject(e)}},V=({chars:e,instant:t,silent:n})=>r(function(){try{function o(o){function u(){return n?void 0:Promise.resolve(X.afterString(e)).then(function(e){})}const s=C(e,function(n){return t?void i(e[n]):Promise.resolve(r(()=>{i(e[n])},w(0))).then(function(e){})});return s&&s.then?s.then(u):u()}const i=e=>L(Y,e,te,J);return Promise.resolve(n?o():Promise.resolve(X.beforeString(e)).then(o))}catch(e){return Promise.reject(e)}},E(t)),U=function(e){try{return X=i(X,e),Promise.resolve()}catch(e){return Promise.reject(e)}},_=function(){try{return d()?(Y.value="",Promise.resolve()):(O().forEach(e=>{k(e)}),Promise.resolve())}catch(e){return Promise.reject(e)}},Q=function({num:e=null,instant:t=!1,to:n="START"}){try{const o=e=>p(e)?e:P(e,Y,n);return Promise.resolve(r(function(){try{let n=o(e);const i=()=>{let e=O();var t;e.length&&(d()?Y.value=Y.value.slice(0,-1):(k(e[J]),t=te,y("*",Y,!0).forEach(e=>{if(!e.innerHTML&&"BR"!==e.tagName&&!e.isSameNode(t)){let t=e;for(;1===t.parentElement.childNodes.length;)t=t.parentElement;k(t)}})))};let u=0;const s=H(function(){return u<n},function(){return u++},function(){return t?void i():Promise.resolve(r(i,w(1))).then(function(e){})});return Promise.resolve(s&&s.then?s.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},E(t,1))).then(function(){const t=function(){if(null===e&&O().length-1>0)return Promise.resolve(Q({num:null})).then(function(){})}();if(t&&t.then)return t.then(function(){})})}catch(e){return Promise.reject(e)}};this.break=function(e){const t=l(h("BR"));return D([[V,{chars:[t],silent:!0}]],e)},this.delete=function(e=null,t={}){e=N(e);let n=I(t),r=e,{instant:o,to:i}=t;return D([n[0],[Q,{num:r,instant:o,to:i},K],n[1]],t)},this.empty=function(e={}){return D([[_]],e)},this.exec=function(e,t){let n=I(t);return D([n[0],[e,null],n[1]],t)},this.move=function(e,t={}){e=N(e);let n=I(t),{instant:r,to:o}=t;return D([n[0],[q,{value:null===e?"":e,to:o,instant:r},K],n[1]],t)},this.options=function(e){return e=N(e),D([[U,e]],e)},this.pause=function(e,t={}){return D([[R,N(e)]],t)},this.type=function(e,t={}){e=N(e);let n=I(t),r=f(e,X.html),{instant:o}=t;return D([n[0],[V,{chars:r,instant:o},K],n[1]],t)},this.is=function(e){return W[e]},this.destroy=function(e=!0){G.forEach(e=>clearTimeout(e)),G=[],N(e)&&k(te),W.destroyed=!0},this.freeze=function(){W.frozen=!0},this.unfreeze=function(){W.frozen=!1,z()},this.reset=function(){!this.is("destroyed")&&this.destroy(),$.reset(),J=0;for(let e in W)W[e]=!1;return Y[d()?"value":"innerHTML"]="",this},this.go=function(){return W.started?this:(function(){try{!d()&&Y.appendChild(te),ee?(((e,t,n)=>{let r="[data-typeit-id='"+e+"'] .ti-cursor",o=getComputedStyle(n),i=Object.entries(x).reduce((e,[t,n])=>e+" "+t+": var(--ti-"+t+", "+(n||o[t])+");","");m("@keyframes blink-"+e+" { 0% {opacity: 0} 49% {opacity: 0} 50% {opacity: 1} } "+r+" { display: inline; letter-spacing: -1em; "+i+" animation: blink-"+e+" "+t.cursorSpeed/1e3+"s infinite; } "+r+".with-delay { animation-delay: 500ms; } "+r+".disabled { animation: none; }",e)})(Z,X,Y),Promise.resolve()):Promise.resolve()}catch(e){return Promise.reject(e)}}(),X.waitUntilVisible?(((e,t)=>{new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&(t(),r.unobserve(e))})},{threshold:1}).observe(e)})(Y,z.bind(this)),this):(z(),this))},this.getQueue=function(){return $},this.getOptions=function(){return X},this.getElement=function(){return Y};let Y="string"==typeof(F=e)?y(F):F;var F;let G=[],J=0,K={freezeCursor:!0},W=i({},g),X=i(b,t);X=i(X,{html:!d()&&X.html,nextStringDelay:S(X.nextStringDelay),loopDelay:S(X.loopDelay)});let Z=Math.random().toString().substring(2,9),$=function(e){const t=function(e){return n=n.concat(e.map(e=>o.map((t,n)=>e[n]?e[n]:t))),this};let n=[];return t(e),{add:t,set:function(e,t){n[e]=t},reset:function(){n=n.map(e=>(e[2].executed=!1,e))},getItems:function(){return n.filter(e=>!e[2].executed)},setMeta:function(e,t){n[e][2]=i(n[e][2],t)}}}([[R,X.startDelay]]);Y.dataset.typeitId=Z,m("[data-typeit-id]:before {content: '.'; display: inline-block; width: 0; visibility: hidden;}");let ee=X.cursor&&!d(),te=(()=>{if(d())return;let e=h("span");return e.className="ti-cursor",ee?(e.innerHTML=s(X.cursorChar).innerHTML,e):(e.style.visibility="hidden",e)})();var ne;X.strings=(e=>{let t=Y.innerHTML;return t?(Y.innerHTML="",X.startDelete?(a(t).forEach(e=>{L(Y,e,te,J)}),A([[Q,{num:null}]]),e):t.trim().split(/<br(?:\s*?)(?:\/)?>/).concat(e)):e})(v(ne=X.strings)?ne:[ne]),X.strings.length&&(()=>{let e=X.strings.filter(e=>!!e);e.forEach((t,n)=>{let r=f(t,X.html);if($.add([[V,{chars:r},K]]),n+1===e.length)return;const o=X.breakLines?[[V,{chars:[l(h("BR"))]},K]]:[[Q,{num:r.length},K]];A(o)})})()}var B=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],z=["options","as","children","getBeforeInit","getAfterInit"],R=n.useRef,q=n.useEffect,V=n.useState,U=n.useMemo,_=function(e){var t=V(!0),o=t[0],i=t[1],u=R(null),s=e.options,c=e.as,l=e.children,a=e.getBeforeInit,f=e.getAfterInit,h=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,z),d=c,m=U(function(){return B.indexOf(d.toLowerCase())>-1},[d]);return q(function(){l&&(s.strings=u.current.innerHTML),i(!1)},[]),q(function(){if(!o){var e=new A(u.current,r({},s));return(e=a(e)).go(),e=f(e),function(){e.destroy()}}},[o]),n.createElement("div",{style:{opacity:o?0:1}},m?n.createElement(d,r({ref:u},h)):n.createElement(d,r({ref:u},h),o&&l))};return _.defaultProps={as:"span",options:{},getBeforeInit:function(e){return e},getAfterInit:function(e){return e}},_});
{
"name": "typeit-react",
"version": "2.0.0-rc.0",
"version": "2.0.0-rc.1",
"description": "React component for the most versatile JavaScript animated typing utility on the planet.",

@@ -40,4 +40,3 @@ "homepage": "https://typeitjs.com",

"dependencies": {
"@types/react": "^17.0.18",
"npm-check-updates": "^11.8.3"
"@types/react": "^17.0.18"
},

@@ -50,10 +49,7 @@ "peerDependencies": {

"@babel/preset-typescript": "^7.15.0",
"concurrently": "^6.2.1",
"husky": "^7.0.1",
"jest": "^27.0.6",
"jest-cli": "^27.0.6",
"lint-staged": "^11.1.2",
"microbundle": "^0.13.3",
"prettier": "^2.3.2",
"typeit": "^8.0.0-rc.1",
"typeit": "^8.0.0-rc.2",
"typescript": "^4.3.5"

@@ -60,0 +56,0 @@ },

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc