!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).window=e.window||{})}(this,function(e){"use strict";let t,i,n,l="undefined"!=typeof Intl?new Intl.Segmenter:0,s=e=>"string"==typeof e?s(document.querySelectorAll(e)):"length"in e?Array.from(e):[e],r=e=>s(e).filter(e=>e instanceof HTMLElement),o=[],a=function(){},d=/\s+/g,h=new RegExp("\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?(\\u{200D}\\p{Emoji}(\\p{EMod}|\\u{FE0F}\\u{20E3}?|[\\u{E0020}-\\u{E007E}]+\\u{E007F})?)*|.","gu"),p={left:0,top:0,width:0,height:0},c=(e,t)=>{if(t){let i,n,l,s,r=new Set(e.join("").match(t)||o),a=e.length;if(r.size)for(;--a>-1;)for(l of(n=e[a],r))if(l.startsWith(n)&&l.length>n.length){for(i=0,s=n;l.startsWith(s+=e[a+ ++i])&&s.length"inline"===window.getComputedStyle(e).display&&(e.style.display="inline-block"),f=(e,t,i)=>t.insertBefore("string"==typeof e?document.createTextNode(e):e,i),g=(e,t,i)=>{let n=t[e+"sClass"]||"",{tag:l="div",aria:s="auto",propIndex:r=!1}=t,o="line"===e?"block":"inline-block",a=n.indexOf("++")>-1,d=t=>{let d=document.createElement(l),h=i.length+1;return n&&(d.className=n+(a?" "+n+h:"")),r&&d.style.setProperty("--"+e,h+""),"none"!==s&&d.setAttribute("aria-hidden","true"),"span"!==l&&(d.style.position="relative",d.style.display=o),d.textContent=t,i.push(d),d};return a&&(n=n.replace("++","")),d.collection=i,d},m=(e,t,i,n,s,r,a,h,p,g)=>{var b;let w,x,y,v,C,E,S,T,A,N,R,W,_,O,k,B,j,L,F=Array.from(e.childNodes),M=0,{wordDelimiter:z,reduceWhiteSpace:H=!0,prepareText:I}=t,D=e.getBoundingClientRect(),P=D,q=!H&&"pre"===window.getComputedStyle(e).whiteSpace.substring(0,3),$=0,G=i.collection;for("object"==typeof z?(y=z.delimiter||z,x=z.replaceWith||""):x=""===z?"":z||" ",w=" "!==x;M-1?(E=G[G.length-1]).appendChild(document.createTextNode(n?"":B)):(E=i(n?"":B),f(E,e,v),$&&1===A&&!S&&E.insertBefore($,E.firstChild)),n)for(R=l?c([...l.segment(B)].map(e=>e.segment),p):B.match(h)||o,L=0;LP.top&&N.left<=P.left){for(W=e.cloneNode(),_=e.childNodes[0];_&&_!==E;)O=_,_=_.nextSibling,W.appendChild(O);e.parentNode.insertBefore(W,e),s&&u(W)}P=N}(A=C.length?" ":w&&" "===B.slice(-1)?" "+x:x,e,v)}else f(x,e,v);e.removeChild(v),$=0}else 1===v.nodeType&&(a&&a.indexOf(v)>-1?(G.indexOf(v.previousSibling)>-1&&G[G.length-1].appendChild(v),$=v):(m(v,t,i,n,s,r,a,h,p,!0),$=0),s&&u(v))};const b=class e{constructor(e,t){this.isSplit=!1,(()=>n||w.register(window.gsap))(),this.elements=r(e),this.chars=[],this.words=[],this.lines=[],this.masks=[],this.vars=t,this._split=(()=>this.isSplit&&this.split(this.vars));let i,l=[],s=()=>{let e,t=l.length;for(;t--;){let i=(e=l[t]).element.offsetWidth;if(i!==e.width)return e.width=i,void this._split()}};this._data={orig:l,obs:"undefined"!=typeof ResizeObserver&&new ResizeObserver(()=>{clearTimeout(i),i=setTimeout(s,200)})},a(this),this.split(t)}split(e){this.isSplit&&this.revert(),this.vars=e=e||this.vars||{};let t,{type:n="chars,words,lines",aria:l="auto",deepSlice:o=!0,smartWrap:a,onSplit:d,autoSplit:c=!1,specialChars:u,mask:f}=this.vars,b=n.indexOf("lines")>-1,w=n.indexOf("chars")>-1,x=n.indexOf("words")>-1,y=w&&!x&&!b,v=u&&("push"in u?new RegExp("(?:"+u.join("|")+")","gu"):u),C=v?new RegExp(v.source+"|"+h.source,"gu"):h,E=!!e.ignore&&r(e.ignore),{orig:S,animTime:T,obs:A}=this._data;return(w||x||b)&&(this.elements.forEach((t,i)=>{S[i]={element:t,html:t.innerHTML,ariaL:t.getAttribute("aria-label"),ariaH:t.getAttribute("aria-hidden")},"auto"===l?t.setAttribute("aria-label",(t.textContent||"").trim()):"hidden"===l&&t.setAttribute("aria-hidden","true");let n,r,d,h,c=[],u=[],f=[],T=w?g("char",e,c):null,A=g("word",e,u);if(m(t,e,A,T,y,o&&(b||y),E,C,v,!1),b){let i,l=s(t.childNodes),r=((e,t,i,n)=>{let l=g("line",i,n),s=window.getComputedStyle(e).textAlign||"left";return(i,n)=>{let r=l("");for(r.style.textAlign=s,e.insertBefore(r,t[i]);i1===e.nodeType?e.getBoundingClientRect():p),h=p;for(n=0;nh.top&&d[n].left<=h.left&&(r(a,n),a=n),h=d[n]));a{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})}if(!x){for(n=0;n{let t=e.cloneNode();return e.replaceWith(t),t.appendChild(e),e.className&&(t.className=e.className.replace(/(\b\w+\b)/g,"$1-mask")),t.style.overflow="clip",t}))),this.isSplit=!0,i&&(c?i.addEventListener("loadingdone",this._split):"loading"===i.status&&console.warn("SplitText called before fonts loaded")),(t=d&&d(this))&&t.totalTime&&(this._data.anim=T?t.totalTime(T):t),b&&c&&this.elements.forEach((e,t)=>{S[t].width=e.offsetWidth,A&&A.observe(e)}),this}revert(){var e,t;let{orig:n,anim:l,obs:s}=this._data;return s&&s.disconnect(),n.forEach(({element:e,html:t,ariaL:i,ariaH:n})=>{e.innerHTML=t,i?e.setAttribute("aria-label",i):e.removeAttribute("aria-label"),n?e.setAttribute("aria-hidden",n):e.removeAttribute("aria-hidden")}),this.chars.length=this.words.length=this.lines.length=n.length=this.masks.length=0,this.isSplit=!1,null==i||i.removeEventListener("loadingdone",this._split),l&&(this._data.animTime=l.totalTime(),l.revert()),null==(t=(e=this.vars).onRevert)||t.call(e,this),this}static create(t,i){return new e(t,i)}static register(e){(t=t||e||window.gsap)&&(s=t.utils.toArray,a=t.core.context||a),!n&&window.innerWidth>0&&(i=document.fonts,n=!0)}};b.version="3.13.0";let w=b;e.SplitText=w,e.default=w,Object.defineProperty(e,"__esModule",{value:!0})});