typeit-react
Advanced tools
Comparing version 2.0.0-rc.0 to 2.0.0-rc.1
// 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
3
7
240741
4600
- Removednpm-check-updates@^11.8.3
- Removed@gar/promisify@1.1.3(transitive)
- Removed@nodelib/fs.scandir@2.1.5(transitive)
- Removed@nodelib/fs.stat@2.0.5(transitive)
- Removed@nodelib/fs.walk@1.2.8(transitive)
- Removed@npmcli/fs@1.1.1(transitive)
- Removed@npmcli/git@2.1.0(transitive)
- Removed@npmcli/installed-package-contents@1.0.7(transitive)
- Removed@npmcli/move-file@1.1.2(transitive)
- Removed@npmcli/node-gyp@1.0.3(transitive)
- Removed@npmcli/promise-spawn@1.3.2(transitive)
- Removed@npmcli/run-script@1.8.6(transitive)
- Removed@sindresorhus/is@0.14.0(transitive)
- Removed@szmarczak/http-timer@1.1.2(transitive)
- Removed@tootallnate/once@1.1.2(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedagent-base@6.0.2(transitive)
- Removedagentkeepalive@4.5.0(transitive)
- Removedaggregate-error@3.1.0(transitive)
- Removedajv@6.12.6(transitive)
- Removedansi-align@3.0.1(transitive)
- Removedansi-regex@2.1.15.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedaproba@1.2.0(transitive)
- Removedare-we-there-yet@1.1.7(transitive)
- Removedargparse@2.0.1(transitive)
- Removedarray-union@2.1.0(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.12.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedboxen@5.1.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.2(transitive)
- Removedbuiltins@1.0.3(transitive)
- Removedcacache@15.3.0(transitive)
- Removedcacheable-request@6.1.0(transitive)
- Removedcamelcase@6.3.0(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedchownr@2.0.0(transitive)
- Removedci-info@2.0.0(transitive)
- Removedcint@8.2.1(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedcli-boxes@2.2.1(transitive)
- Removedcli-table@0.3.11(transitive)
- Removedclone-response@1.0.3(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcolors@1.0.3(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcommander@6.2.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconfigstore@5.0.1(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedcore-util-is@1.0.21.0.3(transitive)
- Removedcrypto-random-string@2.0.0(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddebug@4.3.4(transitive)
- Removeddecompress-response@3.3.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddefer-to-connect@1.1.3(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddir-glob@3.0.1(transitive)
- Removeddot-prop@5.3.0(transitive)
- Removedduplexer3@0.1.5(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedenv-paths@2.2.1(transitive)
- Removederr-code@2.0.3(transitive)
- Removedescape-goat@2.1.1(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-glob@3.3.2(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfast-memoize@2.5.2(transitive)
- Removedfastq@1.17.1(transitive)
- Removedfiggy-pudding@3.5.2(transitive)
- Removedfill-range@7.0.1(transitive)
- Removedfind-up@3.0.05.0.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedfp-and-or@0.1.4(transitive)
- Removedfs-minipass@2.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedgauge@2.7.4(transitive)
- Removedget-stdin@8.0.0(transitive)
- Removedget-stream@4.1.05.2.0(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedglobal-dirs@3.0.1(transitive)
- Removedglobby@11.1.0(transitive)
- Removedgot@9.6.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedhas-yarn@2.1.0(transitive)
- Removedhosted-git-info@4.1.0(transitive)
- Removedhttp-cache-semantics@4.1.1(transitive)
- Removedhttp-proxy-agent@4.0.1(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedhttps-proxy-agent@5.0.1(transitive)
- Removedhumanize-ms@1.2.1(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedignore@5.3.1(transitive)
- Removedignore-walk@3.0.4(transitive)
- Removedimport-lazy@2.1.0(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedindent-string@4.0.0(transitive)
- Removedinfer-owner@1.0.4(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedini@1.3.82.0.0(transitive)
- Removedip-address@9.0.5(transitive)
- Removedis-ci@2.0.0(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-fullwidth-code-point@1.0.03.0.0(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-installed-globally@0.4.0(transitive)
- Removedis-lambda@1.0.1(transitive)
- Removedis-npm@5.0.0(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-obj@2.0.0(transitive)
- Removedis-path-inside@3.0.3(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedis-yarn-global@0.3.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjju@1.4.0(transitive)
- Removedjs-yaml@4.1.0(transitive)
- Removedjsbn@0.1.11.1.0(transitive)
- Removedjson-buffer@3.0.0(transitive)
- Removedjson-parse-even-better-errors@2.3.1(transitive)
- Removedjson-parse-helpfulerror@1.0.3(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjson5@2.2.3(transitive)
- Removedjsonlines@0.1.1(transitive)
- Removedjsonparse@1.3.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedkeyv@3.1.0(transitive)
- Removedkleur@3.0.3(transitive)
- Removedlatest-version@5.1.0(transitive)
- Removedlibnpmconfig@1.2.1(transitive)
- Removedlocate-path@3.0.06.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlowercase-keys@1.0.12.0.0(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removedmake-dir@3.1.0(transitive)
- Removedmake-fetch-happen@9.1.0(transitive)
- Removedmerge2@1.4.1(transitive)
- Removedmicromatch@4.0.5(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedmimic-response@1.0.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedminipass@3.3.65.0.0(transitive)
- Removedminipass-collect@1.0.2(transitive)
- Removedminipass-fetch@1.4.1(transitive)
- Removedminipass-flush@1.0.5(transitive)
- Removedminipass-json-stream@1.0.1(transitive)
- Removedminipass-pipeline@1.2.4(transitive)
- Removedminipass-sized@1.0.3(transitive)
- Removedminizlib@2.1.2(transitive)
- Removedmkdirp@1.0.4(transitive)
- Removedms@2.1.2(transitive)
- Removednegotiator@0.6.3(transitive)
- Removednode-gyp@7.1.2(transitive)
- Removednopt@5.0.0(transitive)
- Removednormalize-url@4.5.1(transitive)
- Removednpm-bundled@1.1.2(transitive)
- Removednpm-check-updates@11.8.5(transitive)
- Removednpm-install-checks@4.0.0(transitive)
- Removednpm-normalize-package-bin@1.0.1(transitive)
- Removednpm-package-arg@8.1.5(transitive)
- Removednpm-packlist@2.2.2(transitive)
- Removednpm-pick-manifest@6.1.1(transitive)
- Removednpm-registry-fetch@11.0.0(transitive)
- Removednpmlog@4.1.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedp-cancelable@1.1.0(transitive)
- Removedp-limit@2.3.03.1.0(transitive)
- Removedp-locate@3.0.05.0.0(transitive)
- Removedp-map@4.0.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpackage-json@6.5.0(transitive)
- Removedpacote@11.3.5(transitive)
- Removedparse-github-url@1.0.2(transitive)
- Removedpath-exists@3.0.04.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-type@4.0.0(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedprepend-http@2.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedprogress@2.0.3(transitive)
- Removedpromise-inflight@1.0.1(transitive)
- Removedpromise-retry@2.0.1(transitive)
- Removedprompts@2.4.2(transitive)
- Removedpsl@1.9.0(transitive)
- Removedpump@3.0.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedpupa@2.1.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedqueue-microtask@1.2.3(transitive)
- Removedrc@1.2.8(transitive)
- Removedrc-config-loader@4.1.3(transitive)
- Removedread-package-json-fast@2.0.3(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedregistry-auth-token@4.2.2(transitive)
- Removedregistry-url@5.1.0(transitive)
- Removedremote-git-tags@3.0.0(transitive)
- Removedrequest@2.88.2(transitive)
- Removedrequire-from-string@2.0.2(transitive)
- Removedresponselike@1.0.2(transitive)
- Removedretry@0.12.0(transitive)
- Removedreusify@1.0.4(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedrun-parallel@1.2.0(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsemver@6.3.17.6.2(transitive)
- Removedsemver-diff@3.1.1(transitive)
- Removedsemver-utils@1.1.4(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsisteransi@1.0.5(transitive)
- Removedslash@3.0.0(transitive)
- Removedsmart-buffer@4.2.0(transitive)
- Removedsocks@2.8.3(transitive)
- Removedsocks-proxy-agent@6.2.1(transitive)
- Removedspawn-please@1.0.0(transitive)
- Removedsprintf-js@1.1.3(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedssri@8.0.1(transitive)
- Removedstring-width@1.0.24.2.3(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.16.0.1(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtar@6.2.1(transitive)
- Removedto-readable-stream@1.0.0(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removedtype-fest@0.20.2(transitive)
- Removedtypedarray-to-buffer@3.1.5(transitive)
- Removedunique-filename@1.1.1(transitive)
- Removedunique-slug@2.0.2(transitive)
- Removedunique-string@2.0.0(transitive)
- Removedupdate-notifier@5.1.0(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedurl-parse-lax@3.0.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removeduuid@3.4.0(transitive)
- Removedvalidate-npm-package-name@3.0.0(transitive)
- Removedverror@1.10.0(transitive)
- Removedwhich@2.0.2(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedwidest-line@3.1.0(transitive)
- Removedwrap-ansi@7.0.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedwrite-file-atomic@3.0.3(transitive)
- Removedxdg-basedir@4.0.0(transitive)
- Removedyallist@4.0.0(transitive)
- Removedyocto-queue@0.1.0(transitive)