const GSgreenCalculateScroll=(t,e=window,a=0,r=100,l=100,s=0,i="vertical")=>{let n=t.getBoundingClientRect(),o=null,c="vertical"===i?n.top:n.left,$="vertical"===i?n.height:n.width,u=0;u=e.innerHeight?"vertical"===i?e.innerHeight:e.innerWidth:"vertical"===i?e.clientHeight:e.clientWidth;let g=c+$*a/100,f=c+$*l/100,d=u*r/100,_=u*s/100;if(g<=d&&f>=_){let h=d-_+(f-g),m=d-g,y=t.getAttribute("data-scroll-initial")||0,p=(t,e,a=100)=>{t=Math.max(e,Math.min(a,t));let r=(t-e)/(a-e)*100;return r};o=p(o=m/h*100,y,100)}else o=f<_?100:0;return o},GSgreengetTransformValue=(t,e)=>{let a=new DOMMatrix(t),r={scale:()=>Math.sqrt(a.a*a.a+a.b*a.b),rotate(){let e=t.match(/rotate\(([^)]+)\)/);if(e){let r=parseFloat(e[1]);return(r%=360)<0&&(r+=360),r}return Math.atan2(a.b,a.a)*(180/Math.PI)},scaleX:()=>a.a,scaleY:()=>a.d,rotateX(){let e=t.match(/rotateX\(([^)]+)\)/);return e?parseFloat(e[1]):0},rotateY(){let e=t.match(/rotateY\(([^)]+)\)/);return e?parseFloat(e[1]):0},translateX:()=>a.e,translateY:()=>a.f,translateZ:()=>a.m34};return r.hasOwnProperty(e)?r[e]():null};window.addEventListener("load",t=>{let e=document.querySelectorAll(".gs-motion-onscrub, [data-aos-scrub]");for(let a of e){let r=GSgreenCalculateScroll(a,window);r&&a.setAttribute("data-scroll-initial",r);let l=window.getComputedStyle(a),s={},i=["translateX","translateY","translateZ","rotateX","rotateY","rotate","scaleX","scaleY","scale","skewX","skewY","opacity"];console.log(l),console.log(GSgreengetTransformValue(l.getPropertyValue("transform"),"rotate")),i.forEach(t=>{if("opacity"===t)s[t]=parseFloat(l.getPropertyValue(t));else{let e=l.getPropertyValue("transform");s[t]=GSgreengetTransformValue(e,t)||0}}),a.setAttribute("data-initial-values",JSON.stringify(s))}}),window.addEventListener("scroll",t=>{let e=document.querySelectorAll(".gs-motion-onscrub, [data-aos-scrub]");for(let a of e){let r=GSgreenCalculateScroll(a,window);if(r){a.setAttribute("data-scroll-progress",r);let l=JSON.parse(a.getAttribute("data-initial-values")),s=r/100,i="",n=1;if(l)for(let[o,c]of Object.entries(l))if("opacity"===o||"scale"===o||"scaleX"===o||"scaleY"===o)n=c+(1-c)*s;else{let $=c+(0-c)*s;o.startsWith("rotate")?i+=`${o}(${$}deg) `:o.startsWith("skew")?i+=`${o}(${$}deg) `:i+=`${o}(${$}${o.startsWith("scale")?"":"px"}) `}a.style.transform=i.trim(),a.style.opacity=n}}});