gsap-react-marquee 0.1.9 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 David Domenico Piscopo
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 David Domenico Piscopo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,48 +1,48 @@
1
- # GSAP React Marquee
2
-
3
- A high-performance, customizable React marquee component powered by GSAP animations.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install gsap-react-marquee
9
- # or
10
- yarn add gsap-react-marquee
11
- # or
12
- pnpm add gsap-react-marquee
13
- ```
14
-
15
- ## Usage
16
-
17
- ```tsx
18
- import Marquee from "gsap-react-marquee";
19
-
20
- function App() {
21
- return (
22
- <Marquee dir="right" speed={100} fill={true} spacing={16}>
23
- <div>Hello world</div>
24
- </Marquee>
25
- );
26
- }
27
- ```
28
-
29
- ## Props
30
-
31
- | Prop | Type | Default | Description |
32
- | -------------------- | ------------------------------------- | --------- | --------------------------------------------------------------------------------------- |
33
- | `children` | `ReactNode` | – | Content to render inside the marquee |
34
- | `className` | `string` | – | Additional CSS classes for styling |
35
- | `dir` | `"right" \| "left" \| "up" \| "down"` | `"right"` | Direction of the marquee movement |
36
- | `loop` | `number` | `-1` | Number of loops (`-1` = infinite) |
37
- | `paused` | `boolean` | `false` | Whether the marquee animation should be paused |
38
- | `alignRotationWithY` | `boolean` | `false` | Correctly orients (rotates) the content along Y axis (⚠️ avoid with `"left"`/`"right"`) |
39
- | `delay` | `number` | `0` | Delay before the animation starts |
40
- | `speed` | `number` | `100` | Speed of the marquee animation in px/s |
41
- | `fill` | `boolean` | `false` | Whether the marquee should continuously fill the space |
42
- | `pauseOnHover` | `boolean` | `false` | Pause the marquee when hovering |
43
- | `gradient` | `boolean` | `false` | Enable gradient overlay |
44
- | `gradientColor` | `string` | – | Color of the gradient if enabled |
45
- | `spacing` | `number` | `16` | Spacing between repeated elements in px |
46
- | `draggable` | `boolean` | `false` | Enable dragging to scroll manually |
47
- | `followScrollDir` | `boolean` | `false` | Sync marquee with page scroll direction |
48
- | `scrollSpeed` | `number` | `2.5` | Speed factor when syncing with page scroll |
1
+ # GSAP React Marquee
2
+
3
+ A high-performance React marquee component powered by GSAP animations.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install gsap-react-marquee
9
+ # or
10
+ yarn add gsap-react-marquee
11
+ # or
12
+ pnpm add gsap-react-marquee
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```tsx
18
+ import Marquee from "gsap-react-marquee";
19
+
20
+ function App() {
21
+ return (
22
+ <Marquee dir="right" speed={100} fill={true} spacing={16}>
23
+ <div>Hello world</div>
24
+ </Marquee>
25
+ );
26
+ }
27
+ ```
28
+
29
+ ## Props
30
+
31
+ | Prop | Type | Default | Description |
32
+ | -------------------- | ------------------------------------- | --------- | --------------------------------------------------------------------------------------- |
33
+ | `children` | `ReactNode` | – | Content to render inside the marquee |
34
+ | `className` | `string` | – | Additional CSS classes for styling |
35
+ | `dir` | `"right" \| "left" \| "up" \| "down"` | `"right"` | Direction of the marquee movement |
36
+ | `loop` | `number` | `-1` | Number of loops (`-1` = infinite) |
37
+ | `paused` | `boolean` | `false` | Whether the marquee animation should be paused |
38
+ | `alignRotationWithY` | `boolean` | `false` | Correctly orients (rotates) the content along Y axis (⚠️ avoid with `"left"`/`"right"`) |
39
+ | `delay` | `number` | `0` | Delay before the animation starts |
40
+ | `speed` | `number` | `100` | Speed of the marquee animation in px/s |
41
+ | `fill` | `boolean` | `false` | Whether the marquee should continuously fill the space |
42
+ | `pauseOnHover` | `boolean` | `false` | Pause the marquee when hovering |
43
+ | `gradient` | `boolean` | `false` | Enable gradient overlay |
44
+ | `gradientColor` | `string` | – | Color of the gradient if enabled |
45
+ | `spacing` | `number` | `16` | Spacing between repeated elements in px |
46
+ | `draggable` | `boolean` | `false` | Enable dragging to scroll manually |
47
+ | `followScrollDir` | `boolean` | `false` | Sync marquee with page scroll direction |
48
+ | `scrollSpeed` | `number` | `2.5` | Speed factor when syncing with page scroll |
package/dist/index.cjs.js CHANGED
@@ -1,45 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),n=require("@gsap/react"),r=require("gsap"),o=require("clsx"),i=require("tailwind-merge"),a={exports:{}},s={};var l,c={};
2
- /**
3
- * @license React
4
- * react-jsx-runtime.development.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */"production"===process.env.NODE_ENV?a.exports=function(){if(e)return s;e=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(e,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:o,ref:void 0!==n?n:null,props:r}}return s.Fragment=n,s.jsx=r,s.jsxs=r,s}():a.exports=(l||(l=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===_?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case h:return"Fragment";case v:return"Profiler";case g:return"StrictMode";case b:return"Suspense";case w:return"SuspenseList";case S:return"Activity"}if("object"==typeof t)switch(t.tag,t.$$typeof){case d:return"Portal";case y:return(t.displayName||"Context")+".Provider";case m:return(t._context.displayName||"Context")+".Consumer";case x:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case T:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case k:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}function n(e){return""+e}function r(e){try{n(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function o(t){if(t===h)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===k)return"<...>";try{var n=e(t);return n?"<"+n+">":"<...>"}catch(e){return"<...>"}}function i(){return Error("react-stack-top-frame")}function a(){var t=e(this.type);return N[t]||(N[t]=!0),void 0!==(t=this.props.ref)?t:null}function s(t,n,o,i,s,c,f,d){var h,g=n.children;if(void 0!==g)if(i){if(P(g)){for(i=0;i<g.length;i++)l(g[i]);Object.freeze&&Object.freeze(g)}}else l(g);if(M.call(n,"key")){g=e(t);var v=Object.keys(n).filter(function(e){return"key"!==e});i=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",X[g+i]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",X[g+i]=!0)}if(g=null,void 0!==o&&(r(o),g=""+o),function(e){if(M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(r(n.key),g=""+n.key),"key"in n)for(var m in o={},n)"key"!==m&&(o[m]=n[m]);else o=n;return g&&function(e){function t(){u||(u=!0)}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof t&&(t.displayName||t.name)),function(e,t,n,r,o,i,s,l){return n=i.ref,e={$$typeof:p,type:e,key:t,props:i,_owner:o},null!==(void 0!==n?n:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:a}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,g,c,0,null===(h=E.A)?null:h.getOwner(),o,f,d)}function l(e){"object"==typeof e&&null!==e&&e.$$typeof===p&&e._store&&(e._store.validated=1)}var u,f=t,p=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),y=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),_=Symbol.for("react.client.reference"),E=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,P=Array.isArray,C=console.createTask?console.createTask:function(){return null},N={},Y=(f={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(f,i)(),D=C(o(i)),X={};c.Fragment=h,c.jsx=function(e,t,n,r,i){var a=1e4>E.recentlyCreatedOwnerStacks++;return s(e,t,n,!1,0,i,a?Error("react-stack-top-frame"):Y,a?C(o(e)):D)},c.jsxs=function(e,t,n,r,i){var a=1e4>E.recentlyCreatedOwnerStacks++;return s(e,t,n,!0,0,i,a?Error("react-stack-top-frame"):Y,a?C(o(e)):D)}}()),c);var u,f,p,d,h,g,v,m,y,x=a.exports,b="transform",w=b+"Origin",T=function(e){var t=e.ownerDocument||e;!(b in e.style)&&"msTransform"in e.style&&(w=(b="msTransform")+"Origin");for(;t.parentNode&&(t=t.parentNode););if(f=window,v=new N,t){u=t,p=t.documentElement,d=t.body,(m=u.createElementNS("http://www.w3.org/2000/svg","g")).style.transform="none";var n=t.createElement("div"),r=t.createElement("div"),o=t&&(t.body||t.firstElementChild);o&&o.appendChild&&(o.appendChild(n),n.appendChild(r),n.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),y=r.offsetParent!==n,o.removeChild(n))}return t},k=[],S=[],_=function(e){return e.ownerSVGElement||("svg"===(e.tagName+"").toLowerCase()?e:null)},E=function e(t){return"fixed"===f.getComputedStyle(t).position||((t=t.parentNode)&&1===t.nodeType?e(t):void 0)},M=function e(t,n){if(t.parentNode&&(u||T(t))){var r=_(t),o=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i=r?n?"rect":"g":"div",a=2!==n?0:100,s=3===n?100:0,l="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",c=u.createElementNS?u.createElementNS(o.replace(/^https/,"http"),i):u.createElement(i);return n&&(r?(g||(g=e(t)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+a+","+s+")"),g.appendChild(c)):(h||((h=e(t)).style.cssText=l),c.style.cssText=l+"width:0.1px;height:0.1px;top:"+s+"px;left:"+a+"px",h.appendChild(c))),c}throw"Need document and parent."},P=function(e,t){var n,r,o,i,a,s,l=_(e),c=e===l,u=l?k:S,p=e.parentNode,d=p&&!l&&p.shadowRoot&&p.shadowRoot.appendChild?p.shadowRoot:p;if(e===f)return e;if(u.length||u.push(M(e,1),M(e,2),M(e,3)),n=l?g:h,l)c?(o=function(e){var t,n=e.getCTM();return n||(t=e.style[b],e.style[b]="none",e.appendChild(m),n=m.getCTM(),e.removeChild(m),t?e.style[b]=t:e.style.removeProperty(b.replace(/([A-Z])/g,"-$1").toLowerCase())),n||v.clone()}(e),i=-o.e/o.a,a=-o.f/o.d,r=v):e.getBBox?(o=e.getBBox(),i=(r=(r=e.transform?e.transform.baseVal:{}).numberOfItems?r.numberOfItems>1?function(e){for(var t=new N,n=0;n<e.numberOfItems;n++)t.multiply(e.getItem(n).matrix);return t}(r):r.getItem(0).matrix:v).a*o.x+r.c*o.y,a=r.b*o.x+r.d*o.y):(r=new N,i=a=0),(c?l:p).appendChild(n),n.setAttribute("transform","matrix("+r.a+","+r.b+","+r.c+","+r.d+","+(r.e+i)+","+(r.f+a)+")");else{if(i=a=0,y)for(r=e.offsetParent,o=e;o&&(o=o.parentNode)&&o!==r&&o.parentNode;)(f.getComputedStyle(o)[b]+"").length>4&&(i=o.offsetLeft,a=o.offsetTop,o=0);if("absolute"!==(s=f.getComputedStyle(e)).position&&"fixed"!==s.position)for(r=e.offsetParent;p&&p!==r;)i+=p.scrollLeft||0,a+=p.scrollTop||0,p=p.parentNode;(o=n.style).top=e.offsetTop-a+"px",o.left=e.offsetLeft-i+"px",o[b]=s[b],o[w]=s[w],o.position="fixed"===s.position?"fixed":"absolute",d.appendChild(n)}return n},C=function(e,t,n,r,o,i,a){return e.a=t,e.b=n,e.c=r,e.d=o,e.e=i,e.f=a,e},N=function(){function e(e,t,n,r,o,i){void 0===e&&(e=1),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===o&&(o=0),void 0===i&&(i=0),C(this,e,t,n,r,o,i)}var t=e.prototype;return t.inverse=function(){var e=this.a,t=this.b,n=this.c,r=this.d,o=this.e,i=this.f,a=e*r-t*n||1e-10;return C(this,r/a,-t/a,-n/a,e/a,(n*i-r*o)/a,-(e*i-t*o)/a)},t.multiply=function(e){var t=this.a,n=this.b,r=this.c,o=this.d,i=this.e,a=this.f,s=e.a,l=e.c,c=e.b,u=e.d,f=e.e,p=e.f;return C(this,s*t+c*r,s*n+c*o,l*t+u*r,l*n+u*o,i+f*t+p*r,a+f*n+p*o)},t.clone=function(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)},t.equals=function(e){var t=this.a,n=this.b,r=this.c,o=this.d,i=this.e,a=this.f;return t===e.a&&n===e.b&&r===e.c&&o===e.d&&i===e.e&&a===e.f},t.apply=function(e,t){void 0===t&&(t={});var n=e.x,r=e.y,o=this.a,i=this.b,a=this.c,s=this.d,l=this.e,c=this.f;return t.x=n*o+r*a+l||0,t.y=n*i+r*s+c||0,t},e}();
11
- /*!
12
- * matrix 3.13.0
13
- * https://gsap.com
14
- *
15
- * Copyright 2008-2025, GreenSock. All rights reserved.
16
- * Subject to the terms at https://gsap.com/standard-license
17
- * @author: Jack Doyle, jack@greensock.com
18
- */function Y(e,t,n,r){if(!e||!e.parentNode||(u||T(e)).documentElement===e)return new N;var o=function(e){for(var t,n;e&&e!==d;)(n=e._gsap)&&n.uncache&&n.get(e,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),t?t.push(n):t=[n]),e=e.parentNode;return t}(e),i=_(e)?k:S,a=P(e),s=i[0].getBoundingClientRect(),l=i[1].getBoundingClientRect(),c=i[2].getBoundingClientRect(),h=a.parentNode,g=E(e),v=new N((l.left-s.left)/100,(l.top-s.top)/100,(c.left-s.left)/100,(c.top-s.top)/100,s.left+(g?0:f.pageXOffset||u.scrollLeft||p.scrollLeft||d.scrollLeft||0),s.top+(g?0:f.pageYOffset||u.scrollTop||p.scrollTop||d.scrollTop||0));if(h.removeChild(a),o)for(s=o.length;s--;)(l=o[s]).scaleX=l.scaleY=0,l.renderTransform(1,l);return t?v.inverse():v}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var X,O,L,A,R,F,B,W,H,I,j,q,$,z,G,V,U,K,Z,J,Q,ee,te=0,ne=function(){return"undefined"!=typeof window},re=function(){return X||ne()&&(X=window.gsap)&&X.registerPlugin&&X},oe=function(e){return"function"==typeof e},ie=function(e){return"object"==typeof e},ae=function(e){return void 0===e},se=function(){return!1},le="transform",ce="transformOrigin",ue=function(e){return Math.round(1e4*e)/1e4},fe=Array.isArray,pe=function(e,t){var n=L.createElementNS?L.createElementNS("http://www.w3.org/1999/xhtml".replace(/^https/,"http"),e):L.createElement(e);return n.style?n:L.createElement(e)},de=180/Math.PI,he=1e20,ge=new N,ve=Date.now||function(){return(new Date).getTime()},me=[],ye={},xe=0,be=/^(?:a|input|textarea|button|select)$/i,we=0,Te={},ke={},Se=function(e,t){var n,r={};for(n in e)r[n]=t?e[n]*t:e[n];return r},_e=function e(t,n){for(var r,o=t.length;o--;)n?t[o].style.touchAction=n:t[o].style.removeProperty("touch-action"),(r=t[o].children)&&r.length&&e(r,n)},Ee=function(){return me.forEach(function(e){return e()})},Me=function(){return!me.length&&X.ticker.remove(Ee)},Pe=function(e){for(var t=me.length;t--;)me[t]===e&&me.splice(t,1);X.to(Me,{overwrite:!0,delay:15,duration:0,onComplete:Me,data:"_draggable"})},Ce=function(e,t,n,r){if(e.addEventListener){var o=$[t];r=r||(j?{passive:!1}:null),e.addEventListener(o||t,n,r),o&&t!==o&&e.addEventListener(t,n,r)}},Ne=function(e,t,n,r){if(e.removeEventListener){var o=$[t];e.removeEventListener(o||t,n,r),o&&t!==o&&e.removeEventListener(t,n,r)}},Ye=function(e){e.preventDefault&&e.preventDefault(),e.preventManipulation&&e.preventManipulation()},De=function e(t){z=t.touches&&te<t.touches.length,Ne(t.target,"touchend",e)},Xe=function(e){z=e.touches&&te<e.touches.length,Ce(e.target,"touchend",De)},Oe=function(e){return O.pageYOffset||e.scrollTop||e.documentElement.scrollTop||e.body.scrollTop||0},Le=function(e){return O.pageXOffset||e.scrollLeft||e.documentElement.scrollLeft||e.body.scrollLeft||0},Ae=function e(t,n){Ce(t,"scroll",n),Fe(t.parentNode)||e(t.parentNode,n)},Re=function e(t,n){Ne(t,"scroll",n),Fe(t.parentNode)||e(t.parentNode,n)},Fe=function(e){return!(e&&e!==A&&9!==e.nodeType&&e!==L.body&&e!==O&&e.nodeType&&e.parentNode)},Be=function(e,t){var n="x"===t?"Width":"Height",r="scroll"+n,o="client"+n;return Math.max(0,Fe(e)?Math.max(A[r],R[r])-(O["inner"+n]||A[o]||R[o]):e[r]-e[o])},We=function e(t,n){var r=Be(t,"x"),o=Be(t,"y");Fe(t)?t=ke:e(t.parentNode,n),t._gsMaxScrollX=r,t._gsMaxScrollY=o,n||(t._gsScrollX=t.scrollLeft||0,t._gsScrollY=t.scrollTop||0)},He=function(e,t,n){var r=e.style;r&&(ae(r[t])&&(t=H(t,e)||t),null==n?r.removeProperty&&r.removeProperty(t.replace(/([A-Z])/g,"-$1").toLowerCase()):r[t]=n)},Ie=function(e){return O.getComputedStyle(e instanceof Element?e:e.host||(e.parentNode||{}).host||e)},je={},qe=function(e){if(e===O)return je.left=je.top=0,je.width=je.right=A.clientWidth||e.innerWidth||R.clientWidth||0,je.height=je.bottom=(e.innerHeight||0)-20<A.clientHeight?A.clientHeight:e.innerHeight||R.clientHeight||0,je;var t=e.ownerDocument||L,n=ae(e.pageX)?e.nodeType||ae(e.left)||ae(e.top)?I(e)[0].getBoundingClientRect():e:{left:e.pageX-Le(t),top:e.pageY-Oe(t),right:e.pageX-Le(t)+1,bottom:e.pageY-Oe(t)+1};return ae(n.right)&&!ae(n.width)?(n.right=n.left+n.width,n.bottom=n.top+n.height):ae(n.width)&&(n={width:n.right-n.left,height:n.bottom-n.top,right:n.right,left:n.left,bottom:n.bottom,top:n.top}),n},$e=function(e,t,n){var r,o=e.vars,i=o[n],a=e._listeners[t];return oe(i)&&(r=i.apply(o.callbackScope||e,o[n+"Params"]||[e.pointerEvent])),a&&!1===e.dispatchEvent(t)&&(r=!1),r},ze=function(e,t){var n,r,o,i=I(e)[0];return i.nodeType||i===O?Ve(i,t):ae(e.left)?{left:r=e.min||e.minX||e.minRotation||0,top:n=e.min||e.minY||0,width:(e.max||e.maxX||e.maxRotation||0)-r,height:(e.max||e.maxY||0)-n}:(o={x:0,y:0},{left:e.left-o.x,top:e.top-o.y,width:e.width,height:e.height})},Ge={},Ve=function(e,t){t=I(t)[0];var n,r,o,i,a,s,l,c,u,f,p,d,h,g=e.getBBox&&e.ownerSVGElement,v=e.ownerDocument||L;if(e===O)o=Oe(v),r=(n=Le(v))+(v.documentElement.clientWidth||e.innerWidth||v.body.clientWidth||0),i=o+((e.innerHeight||0)-20<v.documentElement.clientHeight?v.documentElement.clientHeight:e.innerHeight||v.body.clientHeight||0);else{if(t===O||ae(t))return e.getBoundingClientRect();n=o=0,g?(p=(f=e.getBBox()).width,d=f.height):(e.viewBox&&(f=e.viewBox.baseVal)&&(n=f.x||0,o=f.y||0,p=f.width,d=f.height),p||(f="border-box"===(h=Ie(e)).boxSizing,p=(parseFloat(h.width)||e.clientWidth||0)+(f?0:parseFloat(h.borderLeftWidth)+parseFloat(h.borderRightWidth)),d=(parseFloat(h.height)||e.clientHeight||0)+(f?0:parseFloat(h.borderTopWidth)+parseFloat(h.borderBottomWidth)))),r=p,i=d}return e===t?{left:n,top:o,width:r-n,height:i-o}:(s=(a=Y(t,!0).multiply(Y(e))).apply({x:n,y:o}),l=a.apply({x:r,y:o}),c=a.apply({x:r,y:i}),u=a.apply({x:n,y:i}),{left:n=Math.min(s.x,l.x,c.x,u.x),top:o=Math.min(s.y,l.y,c.y,u.y),width:Math.max(s.x,l.x,c.x,u.x)-n,height:Math.max(s.y,l.y,c.y,u.y)-o})},Ue=function(e,t,n,r,o,i){var a,s,l,c={};if(t)if(1!==o&&t instanceof Array){if(c.end=a=[],l=t.length,ie(t[0]))for(s=0;s<l;s++)a[s]=Se(t[s],o);else for(s=0;s<l;s++)a[s]=t[s]*o;n+=1.1,r-=1.1}else oe(t)?c.end=function(n){var r,i,a=t.call(e,n);if(1!==o)if(ie(a)){for(i in r={},a)r[i]=a[i]*o;a=r}else a*=o;return a}:c.end=t;return(n||0===n)&&(c.max=n),(r||0===r)&&(c.min=r),i&&(c.velocity=0),c},Ke=function e(t){var n;return!(!t||!t.getAttribute||t===R)&&(!("true"!==(n=t.getAttribute("data-clickable"))&&("false"===n||!be.test(t.nodeName+"")&&"true"!==t.getAttribute("contentEditable")))||e(t.parentNode))},Ze=function(e,t){for(var n,r=e.length;r--;)(n=e[r]).ondragstart=n.onselectstart=t?null:se,X.set(n,{lazy:!0,userSelect:t?"text":"none"})},Je=function e(t){return"fixed"===Ie(t).position||((t=t.parentNode)&&1===t.nodeType?e(t):void 0)},Qe=function(e,t){e=X.utils.toArray(e)[0],t=t||{};var n,r,o,i,a,s,l=document.createElement("div"),c=l.style,u=e.firstChild,f=0,p=0,d=e.scrollTop,h=e.scrollLeft,g=e.scrollWidth,v=e.scrollHeight,m=0,y=0,x=0;Q&&!1!==t.force3D?(a="translate3d(",s="px,0px)"):le&&(a="translate(",s="px)"),this.scrollTop=function(e,t){if(!arguments.length)return-this.top();this.top(-e,t)},this.scrollLeft=function(e,t){if(!arguments.length)return-this.left();this.left(-e,t)},this.left=function(n,r){if(!arguments.length)return-(e.scrollLeft+p);var o=e.scrollLeft-h,i=p;if((o>2||o<-2)&&!r)return h=e.scrollLeft,X.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-h),void(t.onKill&&t.onKill());(n=-n)<0?(p=n-.5|0,n=0):n>y?(p=n-y|0,n=y):p=0,(p||i)&&(this._skip||(c[le]=a+-p+"px,"+-f+s),p+m>=0&&(c.paddingRight=p+m+"px")),e.scrollLeft=0|n,h=e.scrollLeft},this.top=function(n,r){if(!arguments.length)return-(e.scrollTop+f);var o=e.scrollTop-d,i=f;if((o>2||o<-2)&&!r)return d=e.scrollTop,X.killTweensOf(this,{top:1,scrollTop:1}),this.top(-d),void(t.onKill&&t.onKill());(n=-n)<0?(f=n-.5|0,n=0):n>x?(f=n-x|0,n=x):f=0,(f||i)&&(this._skip||(c[le]=a+-p+"px,"+-f+s)),e.scrollTop=0|n,d=e.scrollTop},this.maxScrollTop=function(){return x},this.maxScrollLeft=function(){return y},this.disable=function(){for(u=l.firstChild;u;)i=u.nextSibling,e.appendChild(u),u=i;e===l.parentNode&&e.removeChild(l)},this.enable=function(){if((u=e.firstChild)!==l){for(;u;)i=u.nextSibling,l.appendChild(u),u=i;e.appendChild(l),this.calibrate()}},this.calibrate=function(t){var i,a,s,u=e.clientWidth===n;d=e.scrollTop,h=e.scrollLeft,u&&e.clientHeight===r&&l.offsetHeight===o&&g===e.scrollWidth&&v===e.scrollHeight&&!t||((f||p)&&(a=this.left(),s=this.top(),this.left(-e.scrollLeft),this.top(-e.scrollTop)),i=Ie(e),u&&!t||(c.display="block",c.width="auto",c.paddingRight="0px",(m=Math.max(0,e.scrollWidth-e.clientWidth))&&(m+=parseFloat(i.paddingLeft)+(ee?parseFloat(i.paddingRight):0))),c.display="inline-block",c.position="relative",c.overflow="visible",c.verticalAlign="top",c.boxSizing="content-box",c.width="100%",c.paddingRight=m+"px",ee&&(c.paddingBottom=i.paddingBottom),n=e.clientWidth,r=e.clientHeight,g=e.scrollWidth,v=e.scrollHeight,y=e.scrollWidth-n,x=e.scrollHeight-r,o=l.offsetHeight,c.display="block",(a||s)&&(this.left(a),this.top(s)))},this.content=l,this.element=e,this._skip=!1,this.enable()},et=function(e){if(ne()&&document.body){var t=window&&window.navigator;O=window,L=document,A=L.documentElement,R=L.body,F=pe("div"),K=!!window.PointerEvent,(B=pe("div")).style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",U="grab"===B.style.cursor?"grab":"move",G=t&&-1!==t.userAgent.toLowerCase().indexOf("android"),q="ontouchstart"in A&&"orientation"in O||t&&(t.MaxTouchPoints>0||t.msMaxTouchPoints>0),r=pe("div"),o=pe("div"),i=o.style,a=R,i.display="inline-block",i.position="relative",r.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",r.appendChild(o),a.appendChild(r),n=o.offsetHeight+18>r.scrollHeight,a.removeChild(r),ee=n,$=function(e){for(var t=e.split(","),n=(("onpointerdown"in F?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in F?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":e).split(",")),r={},o=4;--o>-1;)r[t[o]]=n[o],r[n[o]]=t[o];try{A.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){j=1}}))}catch(e){}return r}("touchstart,touchmove,touchend,touchcancel"),Ce(L,"touchcancel",se),Ce(O,"touchmove",se),R&&R.addEventListener("touchstart",se),Ce(L,"contextmenu",function(){for(var e in ye)ye[e].isPressed&&ye[e].endDrag()}),X=W=re()}var n,r,o,i,a;X&&(V=X.plugins.inertia,Z=X.core.context||function(){},H=X.utils.checkPrefix,le=H(le),ce=H(ce),I=X.utils.toArray,J=X.core.getStyleSaver,Q=!!H("perspective"))},tt=function(e){var t,n;function r(t,n){var o;o=e.call(this)||this,W||et(),t=I(t)[0],o.styles=J&&J(t,"transform,left,top"),V||(V=X.plugins.inertia),o.vars=n=Se(n||{}),o.target=t,o.x=o.y=o.rotation=0,o.dragResistance=parseFloat(n.dragResistance)||0,o.edgeResistance=isNaN(n.edgeResistance)?1:parseFloat(n.edgeResistance)||0,o.lockAxis=n.lockAxis,o.autoScroll=n.autoScroll||0,o.lockedAxis=null,o.allowEventDefault=!!n.allowEventDefault,X.getProperty(t,"x");var i,a,s,l,c,u,f,p,d,h,g,v,m,y,x,b,w,T,k,S,_,E,M,P,C,R,F,H,j,Q,ee,ne,re,se=(n.type||"x,y").toLowerCase(),le=~se.indexOf("x")||~se.indexOf("y"),pe=-1!==se.indexOf("rotation"),be=pe?"rotation":le?"x":"left",Me=le?"y":"top",De=!(!~se.indexOf("x")&&!~se.indexOf("left")&&"scroll"!==se),Be=!(!~se.indexOf("y")&&!~se.indexOf("top")&&"scroll"!==se),je=n.minimumMovement||2,Ve=D(o),tt=I(n.trigger||n.handle||t),nt={},rt=0,ot=!1,it=n.autoScrollMarginTop||40,at=n.autoScrollMarginRight||40,st=n.autoScrollMarginBottom||40,lt=n.autoScrollMarginLeft||40,ct=n.clickableTest||Ke,ut=0,ft=t._gsap||X.core.getCache(t),pt=Je(t),dt=function(e,n){return parseFloat(ft.get(t,e,n))},ht=t.ownerDocument||L,gt=function(e){return Ye(e),e.stopImmediatePropagation&&e.stopImmediatePropagation(),!1},vt=function e(n){if(Ve.autoScroll&&Ve.isDragging&&(ot||w)){var r,o,i,s,l,c,u,f,d=t,h=15*Ve.autoScroll;for(ot=!1,ke.scrollTop=null!=O.pageYOffset?O.pageYOffset:null!=ht.documentElement.scrollTop?ht.documentElement.scrollTop:ht.body.scrollTop,ke.scrollLeft=null!=O.pageXOffset?O.pageXOffset:null!=ht.documentElement.scrollLeft?ht.documentElement.scrollLeft:ht.body.scrollLeft,s=Ve.pointerX-ke.scrollLeft,l=Ve.pointerY-ke.scrollTop;d&&!o;)r=(o=Fe(d.parentNode))?ke:d.parentNode,i=o?{bottom:Math.max(A.clientHeight,O.innerHeight||0),right:Math.max(A.clientWidth,O.innerWidth||0),left:0,top:0}:r.getBoundingClientRect(),c=u=0,Be&&((f=r._gsMaxScrollY-r.scrollTop)<0?u=f:l>i.bottom-st&&f?(ot=!0,u=Math.min(f,h*(1-Math.max(0,i.bottom-l)/st)|0)):l<i.top+it&&r.scrollTop&&(ot=!0,u=-Math.min(r.scrollTop,h*(1-Math.max(0,l-i.top)/it)|0)),u&&(r.scrollTop+=u)),De&&((f=r._gsMaxScrollX-r.scrollLeft)<0?c=f:s>i.right-at&&f?(ot=!0,c=Math.min(f,h*(1-Math.max(0,i.right-s)/at)|0)):s<i.left+lt&&r.scrollLeft&&(ot=!0,c=-Math.min(r.scrollLeft,h*(1-Math.max(0,s-i.left)/lt)|0)),c&&(r.scrollLeft+=c)),o&&(c||u)&&(O.scrollTo(r.scrollLeft,r.scrollTop),Ct(Ve.pointerX+c,Ve.pointerY+u)),d=r}if(w){var g=Ve.x,v=Ve.y;pe?(Ve.deltaX=g-parseFloat(ft.rotation),Ve.rotation=g,ft.rotation=g+"deg",ft.renderTransform(1,ft)):a?(Be&&(Ve.deltaY=v-a.top(),a.top(v)),De&&(Ve.deltaX=g-a.left(),a.left(g))):le?(Be&&(Ve.deltaY=v-parseFloat(ft.y),ft.y=v+"px"),De&&(Ve.deltaX=g-parseFloat(ft.x),ft.x=g+"px"),ft.renderTransform(1,ft)):(Be&&(Ve.deltaY=v-parseFloat(t.style.top||0),t.style.top=v+"px"),De&&(Ve.deltaX=g-parseFloat(t.style.left||0),t.style.left=g+"px")),!p||n||H||(H=!0,!1===$e(Ve,"drag","onDrag")&&(De&&(Ve.x-=Ve.deltaX),Be&&(Ve.y-=Ve.deltaY),e(!0)),H=!1)}w=!1},mt=function(e,n){var r,o,i=Ve.x,s=Ve.y;t._gsap||(ft=X.core.getCache(t)),ft.uncache&&X.getProperty(t,"x"),le?(Ve.x=parseFloat(ft.x),Ve.y=parseFloat(ft.y)):pe?Ve.x=Ve.rotation=parseFloat(ft.rotation):a?(Ve.y=a.top(),Ve.x=a.left()):(Ve.y=parseFloat(t.style.top||(o=Ie(t))&&o.top)||0,Ve.x=parseFloat(t.style.left||(o||{}).left)||0),(k||S||_)&&!n&&(Ve.isDragging||Ve.isThrowing)&&(_&&(Te.x=Ve.x,Te.y=Ve.y,(r=_(Te)).x!==Ve.x&&(Ve.x=r.x,w=!0),r.y!==Ve.y&&(Ve.y=r.y,w=!0)),k&&(r=k(Ve.x))!==Ve.x&&(Ve.x=r,pe&&(Ve.rotation=r),w=!0),S&&((r=S(Ve.y))!==Ve.y&&(Ve.y=r),w=!0)),w&&vt(!0),e||(Ve.deltaX=Ve.x-i,Ve.deltaY=Ve.y-s,$e(Ve,"throwupdate","onThrowUpdate"))},yt=function(e,t,n,r){return null==t&&(t=-he),null==n&&(n=he),oe(e)?function(o){var i=Ve.isPressed?1-Ve.edgeResistance:1;return e.call(Ve,(o>n?n+(o-n)*i:o<t?t+(o-t)*i:o)*r)*r}:fe(e)?function(r){for(var o,i,a=e.length,s=0,l=he;--a>-1;)(i=(o=e[a])-r)<0&&(i=-i),i<l&&o>=t&&o<=n&&(s=a,l=i);return e[s]}:isNaN(e)?function(e){return e}:function(){return e*r}},xt=function(){var e,r,o,i;f=!1,a?(a.calibrate(),Ve.minX=g=-a.maxScrollLeft(),Ve.minY=m=-a.maxScrollTop(),Ve.maxX=h=Ve.maxY=v=0,f=!0):n.bounds&&(e=ze(n.bounds,t.parentNode),pe?(Ve.minX=g=e.left,Ve.maxX=h=e.left+e.width,Ve.minY=m=Ve.maxY=v=0):ae(n.bounds.maxX)&&ae(n.bounds.maxY)?(r=ze(t,t.parentNode),Ve.minX=g=Math.round(dt(be,"px")+e.left-r.left),Ve.minY=m=Math.round(dt(Me,"px")+e.top-r.top),Ve.maxX=h=Math.round(g+(e.width-r.width)),Ve.maxY=v=Math.round(m+(e.height-r.height))):(e=n.bounds,Ve.minX=g=e.minX,Ve.minY=m=e.minY,Ve.maxX=h=e.maxX,Ve.maxY=v=e.maxY),g>h&&(Ve.minX=h,Ve.maxX=h=g,g=Ve.minX),m>v&&(Ve.minY=v,Ve.maxY=v=m,m=Ve.minY),pe&&(Ve.minRotation=g,Ve.maxRotation=h),f=!0),n.liveSnap&&(o=!0===n.liveSnap?n.snap||{}:n.liveSnap,i=fe(o)||oe(o),pe?(k=yt(i?o:o.rotation,g,h,1),S=null):o.points?_=function(e,t,n,r,o,i,a){return i=i&&i<he?i*i:he,oe(e)?function(s){var l,c,u,f=Ve.isPressed?1-Ve.edgeResistance:1,p=s.x,d=s.y;return s.x=p=p>n?n+(p-n)*f:p<t?t+(p-t)*f:p,s.y=d=d>o?o+(d-o)*f:d<r?r+(d-r)*f:d,(l=e.call(Ve,s))!==s&&(s.x=l.x,s.y=l.y),1!==a&&(s.x*=a,s.y*=a),i<he&&(c=s.x-p)*c+(u=s.y-d)*u>i&&(s.x=p,s.y=d),s}:fe(e)?function(t){for(var n,r,o,a,s=e.length,l=0,c=he;--s>-1;)(a=(n=(o=e[s]).x-t.x)*n+(r=o.y-t.y)*r)<c&&(l=s,c=a);return c<=i?e[l]:t}:function(e){return e}}(i?o:o.points,g,h,m,v,o.radius,a?-1:1):(De&&(k=yt(i?o:o.x||o.left||o.scrollLeft,g,h,a?-1:1)),Be&&(S=yt(i?o:o.y||o.top||o.scrollTop,m,v,a?-1:1))))},bt=function(){Ve.isThrowing=!1,$e(Ve,"throwcomplete","onThrowComplete")},wt=function(){Ve.isThrowing=!1},Tt=function(e,r){var o,i,s,l;e&&V?(!0===e&&(o=n.snap||n.liveSnap||{},i=fe(o)||oe(o),e={resistance:(n.throwResistance||n.resistance||1e3)/(pe?10:1)},pe?e.rotation=Ue(Ve,i?o:o.rotation,h,g,1,r):(De&&(e[be]=Ue(Ve,i?o:o.points||o.x||o.left,h,g,a?-1:1,r||"x"===Ve.lockedAxis)),Be&&(e[Me]=Ue(Ve,i?o:o.points||o.y||o.top,v,m,a?-1:1,r||"y"===Ve.lockedAxis)),(o.points||fe(o)&&ie(o[0]))&&(e.linkedProps=be+","+Me,e.radius=o.radius))),Ve.isThrowing=!0,l=isNaN(n.overshootTolerance)?1===n.edgeResistance?0:1-Ve.edgeResistance+.2:n.overshootTolerance,e.duration||(e.duration={max:Math.max(n.minDuration||0,"maxDuration"in n?n.maxDuration:2),min:isNaN(n.minDuration)?0===l||ie(e)&&e.resistance>1e3?0:.5:n.minDuration,overshoot:l}),Ve.tween=s=X.to(a||t,{inertia:e,data:"_draggable",inherit:!1,onComplete:bt,onInterrupt:wt,onUpdate:n.fastMode?$e:mt,onUpdateParams:n.fastMode?[Ve,"onthrowupdate","onThrowUpdate"]:o&&o.radius?[!1,!0]:[]}),n.fastMode||(a&&(a._skip=!0),s.render(1e9,!0,!0),mt(!0,!0),Ve.endX=Ve.x,Ve.endY=Ve.y,pe&&(Ve.endRotation=Ve.x),s.play(0),mt(!0,!0),a&&(a._skip=!1))):f&&Ve.applyBounds()},kt=function(e){var n,r=P;P=Y(t.parentNode,!0),e&&Ve.isPressed&&!P.equals(r||new N)&&(n=r.inverse().apply({x:s,y:l}),P.apply(n,n),s=n.x,l=n.y),P.equals(ge)&&(P=null)},St=function(){var e,n,r,o=1-Ve.edgeResistance,i=pt?Le(ht):0,p=pt?Oe(ht):0;le&&(ft.x=dt(be,"px")+"px",ft.y=dt(Me,"px")+"px",ft.renderTransform()),kt(!1),Ge.x=Ve.pointerX-i,Ge.y=Ve.pointerY-p,P&&P.apply(Ge,Ge),s=Ge.x,l=Ge.y,w&&(Ct(Ve.pointerX,Ve.pointerY),vt(!0)),ne=Y(t),a?(xt(),u=a.top(),c=a.left()):(_t()?(mt(!0,!0),xt()):Ve.applyBounds(),pe?(e=t.ownerSVGElement?[ft.xOrigin-t.getBBox().x,ft.yOrigin-t.getBBox().y]:(Ie(t)[ce]||"0 0").split(" "),b=Ve.rotationOrigin=Y(t).apply({x:parseFloat(e[0])||0,y:parseFloat(e[1])||0}),mt(!0,!0),n=Ve.pointerX-b.x-i,r=b.y-Ve.pointerY+p,c=Ve.x,u=Ve.y=Math.atan2(r,n)*de):(u=dt(Me,"px"),c=dt(be,"px"))),f&&o&&(c>h?c=h+(c-h)/o:c<g&&(c=g-(g-c)/o),pe||(u>v?u=v+(u-v)/o:u<m&&(u=m-(m-u)/o))),Ve.startX=c=ue(c),Ve.startY=u=ue(u)},_t=function(){return Ve.tween&&Ve.tween.isActive()},Et=function(){!B.parentNode||_t()||Ve.isDragging||B.parentNode.removeChild(B)},Mt=function(e,o){var c;if(!i||Ve.isPressed||!e||!("mousedown"!==e.type&&"pointerdown"!==e.type||o)&&ve()-ut<30&&$[Ve.pointerEvent.type])ee&&e&&i&&Ye(e);else{if(C=_t(),re=!1,Ve.pointerEvent=e,$[e.type]?(M=~e.type.indexOf("touch")?e.currentTarget||e.target:ht,Ce(M,"touchend",Nt),Ce(M,"touchmove",Pt),Ce(M,"touchcancel",Nt),Ce(ht,"touchstart",Xe)):(M=null,Ce(ht,"mousemove",Pt)),F=null,K&&M||(Ce(ht,"mouseup",Nt),e&&e.target&&Ce(e.target,"mouseup",Nt)),E=ct.call(Ve,e.target)&&!1===n.dragClickables&&!o)return Ce(e.target,"change",Nt),$e(Ve,"pressInit","onPressInit"),$e(Ve,"press","onPress"),Ze(tt,!0),void(ee=!1);var u;if(R=!(!M||De===Be||!1===Ve.vars.allowNativeTouchScrolling||Ve.vars.allowContextMenu&&e&&(e.ctrlKey||e.which>2))&&(De?"y":"x"),(ee=!R&&!Ve.allowEventDefault)&&(Ye(e),Ce(O,"touchforcechange",Ye)),e.changedTouches?(e=y=e.changedTouches[0],x=e.identifier):e.pointerId?x=e.pointerId:y=x=null,te++,u=vt,me.push(u),1===me.length&&X.ticker.add(Ee),l=Ve.pointerY=e.pageY,s=Ve.pointerX=e.pageX,$e(Ve,"pressInit","onPressInit"),(R||Ve.autoScroll)&&We(t.parentNode),!t.parentNode||!Ve.autoScroll||a||pe||!t.parentNode._gsMaxScrollX||B.parentNode||t.getBBox||(B.style.width=t.parentNode.scrollWidth+"px",t.parentNode.appendChild(B)),St(),Ve.tween&&Ve.tween.kill(),Ve.isThrowing=!1,X.killTweensOf(a||t,nt,!0),a&&X.killTweensOf(t,{scrollTo:1},!0),Ve.tween=Ve.lockedAxis=null,(n.zIndexBoost||!pe&&!a&&!1!==n.zIndexBoost)&&(t.style.zIndex=r.zIndex++),Ve.isPressed=!0,p=!(!n.onDrag&&!Ve._listeners.drag),d=!(!n.onMove&&!Ve._listeners.move),!1!==n.cursor||n.activeCursor)for(c=tt.length;--c>-1;)X.set(tt[c],{cursor:n.activeCursor||n.cursor||("grab"===U?"grabbing":U)});$e(Ve,"press","onPress")}},Pt=function(e){var n,r,o,a,c,u,f=e;if(i&&!z&&Ve.isPressed&&e){if(Ve.pointerEvent=e,n=e.changedTouches){if((e=n[0])!==y&&e.identifier!==x){for(a=n.length;--a>-1&&(e=n[a]).identifier!==x&&e.target!==t;);if(a<0)return}}else if(e.pointerId&&x&&e.pointerId!==x)return;M&&R&&!F&&(Ge.x=e.pageX-(pt?Le(ht):0),Ge.y=e.pageY-(pt?Oe(ht):0),P&&P.apply(Ge,Ge),r=Ge.x,o=Ge.y,((c=Math.abs(r-s))!==(u=Math.abs(o-l))&&(c>je||u>je)||G&&R===F)&&(F=c>u&&De?"x":"y",R&&F!==R&&Ce(O,"touchforcechange",Ye),!1!==Ve.vars.lockAxisOnTouchScroll&&De&&Be&&(Ve.lockedAxis="x"===F?"y":"x",oe(Ve.vars.onLockAxis)&&Ve.vars.onLockAxis.call(Ve,f)),G&&R===F))?Nt(f):(Ve.allowEventDefault||R&&(!F||R===F)||!1===f.cancelable?ee&&(ee=!1):(Ye(f),ee=!0),Ve.autoScroll&&(ot=!0),Ct(e.pageX,e.pageY,d))}else ee&&e&&i&&Ye(e)},Ct=function(e,t,n){var r,o,i,a,p,d,y=1-Ve.dragResistance,x=1-Ve.edgeResistance,T=Ve.pointerX,E=Ve.pointerY,M=u,C=Ve.x,N=Ve.y,Y=Ve.endX,D=Ve.endY,X=Ve.endRotation,O=w;Ve.pointerX=e,Ve.pointerY=t,pt&&(e-=Le(ht),t-=Oe(ht)),pe?(a=Math.atan2(b.y-t,e-b.x)*de,(p=Ve.y-a)>180?(u-=360,Ve.y=a):p<-180&&(u+=360,Ve.y=a),Ve.x!==c||Math.max(Math.abs(s-e),Math.abs(l-t))>je?(Ve.y=a,i=c+(u-a)*y):i=c):(P&&(d=e*P.a+t*P.c+P.e,t=e*P.b+t*P.d+P.f,e=d),(o=t-l)<je&&o>-je&&(o=0),(r=e-s)<je&&r>-je&&(r=0),(Ve.lockAxis||Ve.lockedAxis)&&(r||o)&&((d=Ve.lockedAxis)||(Ve.lockedAxis=d=De&&Math.abs(r)>Math.abs(o)?"y":Be?"x":null,d&&oe(Ve.vars.onLockAxis)&&Ve.vars.onLockAxis.call(Ve,Ve.pointerEvent)),"y"===d?o=0:"x"===d&&(r=0)),i=ue(c+r*y),a=ue(u+o*y)),(k||S||_)&&(Ve.x!==i||Ve.y!==a&&!pe)&&(_&&(Te.x=i,Te.y=a,d=_(Te),i=ue(d.x),a=ue(d.y)),k&&(i=ue(k(i))),S&&(a=ue(S(a)))),f&&(i>h?i=h+Math.round((i-h)*x):i<g&&(i=g+Math.round((i-g)*x)),pe||(a>v?a=Math.round(v+(a-v)*x):a<m&&(a=Math.round(m+(a-m)*x)))),(Ve.x!==i||Ve.y!==a&&!pe)&&(pe?(Ve.endRotation=Ve.x=Ve.endX=i,w=!0):(Be&&(Ve.y=Ve.endY=a,w=!0),De&&(Ve.x=Ve.endX=i,w=!0)),n&&!1===$e(Ve,"move","onMove")?(Ve.pointerX=T,Ve.pointerY=E,u=M,Ve.x=C,Ve.y=N,Ve.endX=Y,Ve.endY=D,Ve.endRotation=X,w=O):!Ve.isDragging&&Ve.isPressed&&(Ve.isDragging=re=!0,$e(Ve,"dragstart","onDragStart")))},Nt=function e(r,o){if(i&&Ve.isPressed&&(!r||null==x||o||!(r.pointerId&&r.pointerId!==x&&r.target!==t||r.changedTouches&&!function(e,t){for(var n=e.length;n--;)if(e[n].identifier===t)return!0}(r.changedTouches,x)))){Ve.isPressed=!1;var a,s,l,c,u,f=r,p=Ve.isDragging,d=Ve.vars.allowContextMenu&&r&&(r.ctrlKey||r.which>2),h=X.delayedCall(.001,Et);if(M?(Ne(M,"touchend",e),Ne(M,"touchmove",Pt),Ne(M,"touchcancel",e),Ne(ht,"touchstart",Xe)):Ne(ht,"mousemove",Pt),Ne(O,"touchforcechange",Ye),K&&M||(Ne(ht,"mouseup",e),r&&r.target&&Ne(r.target,"mouseup",e)),w=!1,p&&(rt=we=ve(),Ve.isDragging=!1),Pe(vt),E&&!d)return r&&(Ne(r.target,"change",e),Ve.pointerEvent=f),Ze(tt,!1),$e(Ve,"release","onRelease"),$e(Ve,"click","onClick"),void(E=!1);for(s=tt.length;--s>-1;)He(tt[s],"cursor",n.cursor||(!1!==n.cursor?U:null));if(te--,r){if((a=r.changedTouches)&&(r=a[0])!==y&&r.identifier!==x){for(s=a.length;--s>-1&&(r=a[s]).identifier!==x&&r.target!==t;);if(s<0&&!o)return}Ve.pointerEvent=f,Ve.pointerX=r.pageX,Ve.pointerY=r.pageY}return d&&f?(Ye(f),ee=!0,$e(Ve,"release","onRelease")):f&&!p?(ee=!1,C&&(n.snap||n.bounds)&&Tt(n.inertia||n.throwProps),$e(Ve,"release","onRelease"),G&&"touchmove"===f.type||-1!==f.type.indexOf("cancel")||($e(Ve,"click","onClick"),ve()-ut<300&&$e(Ve,"doubleclick","onDoubleClick"),c=f.target||t,ut=ve(),u=function(){ut===j||!Ve.enabled()||Ve.isPressed||f.defaultPrevented||(c.click?c.click():ht.createEvent&&((l=ht.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,O,1,Ve.pointerEvent.screenX,Ve.pointerEvent.screenY,Ve.pointerX,Ve.pointerY,!1,!1,!1,!1,0,null),c.dispatchEvent(l)))},G||f.defaultPrevented||X.delayedCall(.05,u))):(Tt(n.inertia||n.throwProps),Ve.allowEventDefault||!f||!1===n.dragClickables&&ct.call(Ve,f.target)||!p||R&&(!F||R!==F)||!1===f.cancelable?ee=!1:(ee=!0,Ye(f)),$e(Ve,"release","onRelease")),_t()&&h.duration(Ve.tween.duration()),p&&$e(Ve,"dragend","onDragEnd"),!0}ee&&r&&i&&Ye(r)},Yt=function(e){if(e&&Ve.isDragging&&!a){var n=e.target||t.parentNode,r=n.scrollLeft-n._gsScrollX,o=n.scrollTop-n._gsScrollY;(r||o)&&(P?(s-=r*P.a+o*P.c,l-=o*P.d+r*P.b):(s-=r,l-=o),n._gsScrollX+=r,n._gsScrollY+=o,Ct(Ve.pointerX,Ve.pointerY))}},Dt=function(e){var t=ve(),n=t-ut<100,r=t-rt<50,o=n&&j===ut,i=Ve.pointerEvent&&Ve.pointerEvent.defaultPrevented,a=n&&Q===ut,s=e.isTrusted||null==e.isTrusted&&n&&o;if((o||r&&!1!==Ve.vars.suppressClickOnDrag)&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),n&&(!Ve.pointerEvent||!Ve.pointerEvent.defaultPrevented)&&(!o||s&&!a))return s&&o&&(Q=ut),void(j=ut);(Ve.isPressed||r||n)&&(s&&e.detail&&n&&!i||Ye(e)),n||r||re||(e&&e.target&&(Ve.pointerEvent=e),$e(Ve,"click","onClick"))},Xt=function(e){return P?{x:e.x*P.a+e.y*P.c+P.e,y:e.x*P.b+e.y*P.d+P.f}:{x:e.x,y:e.y}};return(T=r.get(t))&&T.kill(),o.startDrag=function(e,n){var r,o,i,a;Mt(e||Ve.pointerEvent,!0),n&&!Ve.hitTest(e||Ve.pointerEvent)&&(r=qe(e||Ve.pointerEvent),o=qe(t),i=Xt({x:r.left+r.width/2,y:r.top+r.height/2}),a=Xt({x:o.left+o.width/2,y:o.top+o.height/2}),s-=i.x-a.x,l-=i.y-a.y),Ve.isDragging||(Ve.isDragging=re=!0,$e(Ve,"dragstart","onDragStart"))},o.drag=Pt,o.endDrag=function(e){return Nt(e||Ve.pointerEvent,!0)},o.timeSinceDrag=function(){return Ve.isDragging?0:(ve()-rt)/1e3},o.timeSinceClick=function(){return(ve()-ut)/1e3},o.hitTest=function(e,t){return r.hitTest(Ve.target,e,t)},o.getDirection=function(e,n){var r,o,i,a,s,l,f="velocity"===e&&V?e:ie(e)&&!pe?"element":"start";return"element"===f&&(s=qe(Ve.target),l=qe(e)),r="start"===f?Ve.x-c:"velocity"===f?V.getVelocity(t,be):s.left+s.width/2-(l.left+l.width/2),pe?r<0?"counter-clockwise":"clockwise":(n=n||2,o="start"===f?Ve.y-u:"velocity"===f?V.getVelocity(t,Me):s.top+s.height/2-(l.top+l.height/2),a=(i=Math.abs(r/o))<1/n?"":r<0?"left":"right",i<n&&(""!==a&&(a+="-"),a+=o<0?"up":"down"),a)},o.applyBounds=function(e,r){var o,i,a,s,l,c;if(e&&n.bounds!==e)return n.bounds=e,Ve.update(!0,r);if(mt(!0),xt(),f&&!_t()){if(o=Ve.x,i=Ve.y,o>h?o=h:o<g&&(o=g),i>v?i=v:i<m&&(i=m),(Ve.x!==o||Ve.y!==i)&&(a=!0,Ve.x=Ve.endX=o,pe?Ve.endRotation=o:Ve.y=Ve.endY=i,w=!0,vt(!0),Ve.autoScroll&&!Ve.isDragging))for(We(t.parentNode),s=t,ke.scrollTop=null!=O.pageYOffset?O.pageYOffset:null!=ht.documentElement.scrollTop?ht.documentElement.scrollTop:ht.body.scrollTop,ke.scrollLeft=null!=O.pageXOffset?O.pageXOffset:null!=ht.documentElement.scrollLeft?ht.documentElement.scrollLeft:ht.body.scrollLeft;s&&!c;)l=(c=Fe(s.parentNode))?ke:s.parentNode,Be&&l.scrollTop>l._gsMaxScrollY&&(l.scrollTop=l._gsMaxScrollY),De&&l.scrollLeft>l._gsMaxScrollX&&(l.scrollLeft=l._gsMaxScrollX),s=l;Ve.isThrowing&&(a||Ve.endX>h||Ve.endX<g||Ve.endY>v||Ve.endY<m)&&Tt(n.inertia||n.throwProps,a)}return Ve},o.update=function(e,n,r){if(n&&Ve.isPressed){var o=Y(t),i=ne.apply({x:Ve.x-c,y:Ve.y-u}),a=Y(t.parentNode,!0);a.apply({x:o.e-i.x,y:o.f-i.y},i),Ve.x-=i.x-a.e,Ve.y-=i.y-a.f,vt(!0),St()}var s=Ve.x,l=Ve.y;return kt(!n),e?Ve.applyBounds():(w&&r&&vt(!0),mt(!0)),n&&(Ct(Ve.pointerX,Ve.pointerY),w&&vt(!0)),Ve.isPressed&&!n&&(De&&Math.abs(s-Ve.x)>.01||Be&&Math.abs(l-Ve.y)>.01&&!pe)&&St(),Ve.autoScroll&&(We(t.parentNode,Ve.isDragging),ot=Ve.isDragging,vt(!0),Re(t,Yt),Ae(t,Yt)),Ve},o.enable=function(e){var r,o,s,l={lazy:!0};if(!1!==n.cursor&&(l.cursor=n.cursor||U),X.utils.checkPrefix("touchCallout")&&(l.touchCallout="none"),"soft"!==e){for(_e(tt,De===Be?"none":n.allowNativeTouchScrolling&&t.scrollHeight===t.clientHeight==(t.scrollWidth===t.clientHeight)||n.allowEventDefault?"manipulation":De?"pan-y":"pan-x"),o=tt.length;--o>-1;)s=tt[o],K||Ce(s,"mousedown",Mt),Ce(s,"touchstart",Mt),Ce(s,"click",Dt,!0),X.set(s,l),s.getBBox&&s.ownerSVGElement&&De!==Be&&X.set(s.ownerSVGElement,{touchAction:n.allowNativeTouchScrolling||n.allowEventDefault?"manipulation":De?"pan-y":"pan-x"}),n.allowContextMenu||Ce(s,"contextmenu",gt);Ze(tt,!1)}return Ae(t,Yt),i=!0,V&&"soft"!==e&&V.track(a||t,le?"x,y":pe?"rotation":"top,left"),t._gsDragID=r=t._gsDragID||"d"+xe++,ye[r]=Ve,a&&(a.enable(),a.element._gsDragID=r),(n.bounds||pe)&&St(),n.bounds&&Ve.applyBounds(),Ve},o.disable=function(e){for(var n,r=Ve.isDragging,o=tt.length;--o>-1;)He(tt[o],"cursor",null);if("soft"!==e){for(_e(tt,null),o=tt.length;--o>-1;)n=tt[o],He(n,"touchCallout",null),Ne(n,"mousedown",Mt),Ne(n,"touchstart",Mt),Ne(n,"click",Dt,!0),Ne(n,"contextmenu",gt);Ze(tt,!0),M&&(Ne(M,"touchcancel",Nt),Ne(M,"touchend",Nt),Ne(M,"touchmove",Pt)),Ne(ht,"mouseup",Nt),Ne(ht,"mousemove",Pt)}return Re(t,Yt),i=!1,V&&"soft"!==e&&(V.untrack(a||t,le?"x,y":pe?"rotation":"top,left"),Ve.tween&&Ve.tween.kill()),a&&a.disable(),Pe(vt),Ve.isDragging=Ve.isPressed=E=!1,r&&$e(Ve,"dragend","onDragEnd"),Ve},o.enabled=function(e,t){return arguments.length?e?Ve.enable(t):Ve.disable(t):i},o.kill=function(){return Ve.isThrowing=!1,Ve.tween&&Ve.tween.kill(),Ve.disable(),X.set(tt,{clearProps:"userSelect"}),delete ye[t._gsDragID],Ve},o.revert=function(){this.kill(),this.styles&&this.styles.revert()},~se.indexOf("scroll")&&(a=o.scrollProxy=new Qe(t,function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e}({onKill:function(){Ve.isPressed&&Nt(null)}},n)),t.style.overflowY=Be&&!q?"auto":"hidden",t.style.overflowX=De&&!q?"auto":"hidden",t=a.content),pe?nt.rotation=1:(De&&(nt[be]=1),Be&&(nt[Me]=1)),ft.force3D=!("force3D"in n)||n.force3D,Z(D(o)),o.enable(),o}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.register=function(e){X=e,et()},r.create=function(e,t){return W||et(),I(e).map(function(e){return new r(e,t)})},r.get=function(e){return ye[(I(e)[0]||{})._gsDragID]},r.timeSinceDrag=function(){return(ve()-we)/1e3},r.hitTest=function(e,t,n){if(e===t)return!1;var r,o,i,a=qe(e),s=qe(t),l=a.top,c=a.left,u=a.right,f=a.bottom,p=a.width,d=a.height,h=s.left>u||s.right<c||s.top>f||s.bottom<l;return h||!n?!h:(i=-1!==(n+"").indexOf("%"),n=parseFloat(n)||0,(r={left:Math.max(c,s.left),top:Math.max(l,s.top)}).width=Math.min(u,s.right)-r.left,r.height=Math.min(f,s.bottom)-r.top,!(r.width<0||r.height<0)&&(i?(n*=.01,(o=r.width*r.height)>=p*d*n||o>=s.width*s.height*n):r.width>n&&r.height>n))},r}(function(){function e(e){this._listeners={},this.target=e||this}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e]||(this._listeners[e]=[]);~n.indexOf(t)||n.push(t)},t.removeEventListener=function(e,t){var n=this._listeners[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},t.dispatchEvent=function(e){var t,n=this;return(this._listeners[e]||[]).forEach(function(r){return!1===r.call(n,{type:e,target:n.target})&&(t=!1)}),t},e}());function nt(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}
19
- /*!
20
- * Observer 3.13.0
21
- * https://gsap.com
22
- *
23
- * @license Copyright 2008-2025, GreenSock. All rights reserved.
24
- * Subject to the terms at https://gsap.com/standard-license
25
- * @author: Jack Doyle, jack@greensock.com
26
- */!function(e,t){for(var n in t)n in e||(e[n]=t[n])}(tt.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1}),tt.zIndex=1e3,tt.version="3.13.0",re()&&X.registerPlugin(tt);var rt,ot,it,at,st,lt,ct,ut,ft,pt,dt,ht,gt,vt=function(){return rt||"undefined"!=typeof window&&(rt=window.gsap)&&rt.registerPlugin&&rt},mt=1,yt=[],xt=[],bt=[],wt=Date.now,Tt=function(e,t){return t},kt=function(e){return!!~pt.indexOf(e)},St=function(e,t,n,r,o){return e.addEventListener(t,n,{passive:!1!==r,capture:!!o})},_t=function(e,t,n,r){return e.removeEventListener(t,n,!!r)},Et="scrollLeft",Mt="scrollTop",Pt=function(){return dt&&dt.isPressed||xt.cache++},Ct=function(e,t){var n=function n(r){if(r||0===r){mt&&(it.history.scrollRestoration="manual");var o=dt&&dt.isPressed;r=n.v=Math.round(r)||(dt&&dt.iOS?1:0),e(r),n.cacheID=xt.cache,o&&Tt("ss",r)}else(t||xt.cache!==n.cacheID||Tt("ref"))&&(n.cacheID=xt.cache,n.v=e());return n.v+n.offset};return n.offset=0,e&&n},Nt={s:Et,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Ct(function(e){return arguments.length?it.scrollTo(e,Yt.sc()):it.pageXOffset||at[Et]||st[Et]||lt[Et]||0})},Yt={s:Mt,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:Nt,sc:Ct(function(e){return arguments.length?it.scrollTo(Nt.sc(),e):it.pageYOffset||at[Mt]||st[Mt]||lt[Mt]||0})},Dt=function(e,t){var n=t.s,r=t.sc;kt(e)&&(e=at.scrollingElement||st);var o=xt.indexOf(e),i=r===Yt.sc?1:2;!~o&&(o=xt.push(e)-1),xt[o+i]||St(e,"scroll",Pt);var a=xt[o+i],s=a||(xt[o+i]=Ct(function(e,t){return~bt.indexOf(e)&&bt[bt.indexOf(e)+1][t]}(e,n),!0)||(kt(e)?r:Ct(function(t){return arguments.length?e[n]=t:e[n]})));return s.target=e,a||(s.smooth="smooth"===rt.getProperty(e,"scrollBehavior")),s},Xt=function(e,t,n){var r=e,o=e,i=wt(),a=i,s=t,l=Math.max(500,3*s),c=function(e,t){var n=wt();t||n-i>s?(o=r,r=e,a=i,i=n):r+=e};return{update:c,reset:function(){o=r=0,a=i=0},getVelocity:function(e){var t=a,n=o,s=wt();return(e||0===e)&&e!==r&&c(e),i===a||s-a>l?0:(r+n)/(s-t)*1e3}}},Ot=function(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},Lt=function(e){var t=Math.max.apply(Math,e),n=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(n)?t:n},At=function(){var e,t,n,r;(ft=rt.core.globals().ScrollTrigger)&&ft.core&&(e=ft.core,t=e.bridge||{},n=e._scrollers,r=e._proxies,n.push.apply(n,xt),r.push.apply(r,bt),xt=n,bt=r,Tt=function(e,n){return t[e](n)})},Rt=function(e){return rt=e||vt(),!ot&&rt&&"undefined"!=typeof document&&document.body&&(it=window,at=document,st=at.documentElement,lt=at.body,pt=[it,at,st,lt],rt.utils.clamp,gt=rt.core.context||function(){},ut="onpointerenter"in lt?"pointer":"mouse",ct=Ft.isTouch=it.matchMedia&&it.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in it||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,ht=Ft.eventTypes=("ontouchstart"in st?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in st?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return mt=0},500),At(),ot=1),ot};Nt.op=Yt,xt.cache=0;var Ft=function(){function e(e){this.init(e)}return e.prototype.init=function(e){ot||Rt(rt),ft||At();var t=e.tolerance,n=e.dragMinimum,r=e.type,o=e.target,i=e.lineHeight,a=e.debounce,s=e.preventDefault,l=e.onStop,c=e.onStopDelay,u=e.ignore,f=e.wheelSpeed,p=e.event,d=e.onDragStart,h=e.onDragEnd,g=e.onDrag,v=e.onPress,m=e.onRelease,y=e.onRight,x=e.onLeft,b=e.onUp,w=e.onDown,T=e.onChangeX,k=e.onChangeY,S=e.onChange,_=e.onToggleX,E=e.onToggleY,M=e.onHover,P=e.onHoverEnd,C=e.onMove,N=e.ignoreCheck,Y=e.isNormalizer,D=e.onGestureStart,X=e.onGestureEnd,O=e.onWheel,L=e.onEnable,A=e.onDisable,R=e.onClick,F=e.scrollSpeed,B=e.capture,W=e.allowClicks,H=e.lockAxis,I=e.onLockAxis;this.target=o=function(e,t){return(t&&t._ctx&&t._ctx.selector||rt.utils.toArray)(e)[0]||("string"==typeof e&&!1!==rt.config().nullTargetWarn?void 0:null)}(o)||st,this.vars=e,u&&(u=rt.utils.toArray(u)),t=t||1e-9,n=n||0,f=f||1,F=F||1,r=r||"wheel,touch,pointer",a=!1!==a,i||(i=parseFloat(it.getComputedStyle(lt).lineHeight)||22);var j,q,$,z,G,V,U,K=this,Z=0,J=0,Q=e.passive||!s&&!1!==e.passive,ee=Dt(o,Nt),te=Dt(o,Yt),ne=ee(),re=te(),oe=~r.indexOf("touch")&&!~r.indexOf("pointer")&&"pointerdown"===ht[0],ie=kt(o),ae=o.ownerDocument||at,se=[0,0,0],le=[0,0,0],ce=0,ue=function(){return ce=wt()},fe=function(e,t){return(K.event=e)&&u&&function(e,t){for(var n=t.length;n--;)if(t[n]===e||t[n].contains(e))return!0;return!1}(e.target,u)||t&&oe&&"touch"!==e.pointerType||N&&N(e,t)},pe=function(){var e=K.deltaX=Lt(se),n=K.deltaY=Lt(le),r=Math.abs(e)>=t,o=Math.abs(n)>=t;S&&(r||o)&&S(K,e,n,se,le),r&&(y&&K.deltaX>0&&y(K),x&&K.deltaX<0&&x(K),T&&T(K),_&&K.deltaX<0!=Z<0&&_(K),Z=K.deltaX,se[0]=se[1]=se[2]=0),o&&(w&&K.deltaY>0&&w(K),b&&K.deltaY<0&&b(K),k&&k(K),E&&K.deltaY<0!=J<0&&E(K),J=K.deltaY,le[0]=le[1]=le[2]=0),(z||$)&&(C&&C(K),$&&(d&&1===$&&d(K),g&&g(K),$=0),z=!1),V&&!(V=!1)&&I&&I(K),G&&(O(K),G=!1),j=0},de=function(e,t,n){se[n]+=e,le[n]+=t,K._vx.update(e),K._vy.update(t),a?j||(j=requestAnimationFrame(pe)):pe()},he=function(e,t){H&&!U&&(K.axis=U=Math.abs(e)>Math.abs(t)?"x":"y",V=!0),"y"!==U&&(se[2]+=e,K._vx.update(e,!0)),"x"!==U&&(le[2]+=t,K._vy.update(t,!0)),a?j||(j=requestAnimationFrame(pe)):pe()},ge=function(e){if(!fe(e,1)){var t=(e=Ot(e,s)).clientX,r=e.clientY,o=t-K.x,i=r-K.y,a=K.isDragging;K.x=t,K.y=r,(a||(o||i)&&(Math.abs(K.startX-t)>=n||Math.abs(K.startY-r)>=n))&&($=a?2:1,a||(K.isDragging=!0),he(o,i))}},ve=K.onPress=function(e){fe(e,1)||e&&e.button||(K.axis=U=null,q.pause(),K.isPressed=!0,e=Ot(e),Z=J=0,K.startX=K.x=e.clientX,K.startY=K.y=e.clientY,K._vx.reset(),K._vy.reset(),St(Y?o:ae,ht[1],ge,Q,!0),K.deltaX=K.deltaY=0,v&&v(K))},me=K.onRelease=function(e){if(!fe(e,1)){_t(Y?o:ae,ht[1],ge,!0);var t=!isNaN(K.y-K.startY),n=K.isDragging,r=n&&(Math.abs(K.x-K.startX)>3||Math.abs(K.y-K.startY)>3),i=Ot(e);!r&&t&&(K._vx.reset(),K._vy.reset(),s&&W&&rt.delayedCall(.08,function(){if(wt()-ce>300&&!e.defaultPrevented)if(e.target.click)e.target.click();else if(ae.createEvent){var t=ae.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,it,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(t)}})),K.isDragging=K.isGesturing=K.isPressed=!1,l&&n&&!Y&&q.restart(!0),$&&pe(),h&&n&&h(K),m&&m(K,r)}},ye=function(e){return e.touches&&e.touches.length>1&&(K.isGesturing=!0)&&D(e,K.isDragging)},xe=function(){return(K.isGesturing=!1)||X(K)},be=function(e){if(!fe(e)){var t=ee(),n=te();de((t-ne)*F,(n-re)*F,1),ne=t,re=n,l&&q.restart(!0)}},we=function(e){if(!fe(e)){e=Ot(e,s),O&&(G=!0);var t=(1===e.deltaMode?i:2===e.deltaMode?it.innerHeight:1)*f;de(e.deltaX*t,e.deltaY*t,0),l&&!Y&&q.restart(!0)}},Te=function(e){if(!fe(e)){var t=e.clientX,n=e.clientY,r=t-K.x,o=n-K.y;K.x=t,K.y=n,z=!0,l&&q.restart(!0),(r||o)&&he(r,o)}},ke=function(e){K.event=e,M(K)},Se=function(e){K.event=e,P(K)},_e=function(e){return fe(e)||Ot(e,s)&&R(K)};q=K._dc=rt.delayedCall(c||.25,function(){K._vx.reset(),K._vy.reset(),q.pause(),l&&l(K)}).pause(),K.deltaX=K.deltaY=0,K._vx=Xt(0,50),K._vy=Xt(0,50),K.scrollX=ee,K.scrollY=te,K.isDragging=K.isGesturing=K.isPressed=!1,gt(this),K.enable=function(e){return K.isEnabled||(St(ie?ae:o,"scroll",Pt),r.indexOf("scroll")>=0&&St(ie?ae:o,"scroll",be,Q,B),r.indexOf("wheel")>=0&&St(o,"wheel",we,Q,B),(r.indexOf("touch")>=0&&ct||r.indexOf("pointer")>=0)&&(St(o,ht[0],ve,Q,B),St(ae,ht[2],me),St(ae,ht[3],me),W&&St(o,"click",ue,!0,!0),R&&St(o,"click",_e),D&&St(ae,"gesturestart",ye),X&&St(ae,"gestureend",xe),M&&St(o,ut+"enter",ke),P&&St(o,ut+"leave",Se),C&&St(o,ut+"move",Te)),K.isEnabled=!0,K.isDragging=K.isGesturing=K.isPressed=z=$=!1,K._vx.reset(),K._vy.reset(),ne=ee(),re=te(),e&&e.type&&ve(e),L&&L(K)),K},K.disable=function(){K.isEnabled&&(yt.filter(function(e){return e!==K&&kt(e.target)}).length||_t(ie?ae:o,"scroll",Pt),K.isPressed&&(K._vx.reset(),K._vy.reset(),_t(Y?o:ae,ht[1],ge,!0)),_t(ie?ae:o,"scroll",be,B),_t(o,"wheel",we,B),_t(o,ht[0],ve,B),_t(ae,ht[2],me),_t(ae,ht[3],me),_t(o,"click",ue,!0),_t(o,"click",_e),_t(ae,"gesturestart",ye),_t(ae,"gestureend",xe),_t(o,ut+"enter",ke),_t(o,ut+"leave",Se),_t(o,ut+"move",Te),K.isEnabled=K.isPressed=K.isDragging=!1,A&&A(K))},K.kill=K.revert=function(){K.disable();var e=yt.indexOf(K);e>=0&&yt.splice(e,1),dt===K&&(dt=0)},yt.push(K),Y&&kt(o)&&(dt=K),K.enable(p)},nt(e,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),e}();Ft.version="3.13.0",Ft.create=function(e){return new Ft(e)},Ft.register=Rt,Ft.getAll=function(){return yt.slice()},Ft.getById=function(e){return yt.filter(function(t){return t.vars.id===e})[0]},vt()&&rt.registerPlugin(Ft);
27
- /*!
28
- * VelocityTracker: 3.13.0
29
- * https://gsap.com
30
- *
31
- * Copyright 2008-2025, GreenSock. All rights reserved.
32
- * Subject to the terms at https://gsap.com/standard-license
33
- * @author: Jack Doyle, jack@greensock.com
34
- */
35
- var Bt,Wt,Ht,It,jt,qt,$t,zt,Gt=function(){return Bt||"undefined"!=typeof window&&(Bt=window.gsap)},Vt={},Ut=function(e){return zt(e).id},Kt=function(e){return Vt[Ut("string"==typeof e?Ht(e)[0]:e)]},Zt=function(e){var t,n=jt;if(e-$t>=.05)for($t=e;n;)((t=n.g(n.t,n.p))!==n.v1||e-n.t1>.2)&&(n.v2=n.v1,n.v1=t,n.t2=n.t1,n.t1=e),n=n._next},Jt={deg:360,rad:2*Math.PI},Qt=function(){(Bt=Gt())&&(Ht=Bt.utils.toArray,It=Bt.utils.getUnit,zt=Bt.core.getCache,qt=Bt.ticker,Wt=1)},en=function(e,t,n,r){this.t=e,this.p=t,this.g=e._gsap.get,this.rCap=Jt[n||It(this.g(e,t))],this.v1=this.v2=0,this.t1=this.t2=qt.time,r&&(this._next=r,r._prev=this)},tn=function(){function e(e,t){Wt||Qt(),this.target=Ht(e)[0],Vt[Ut(this.target)]=this,this._props={},t&&this.add(t)}e.register=function(e){Bt=e,Qt()};var t=e.prototype;return t.get=function(e,t){var n,r,o,i=this._props[e]||void 0;return n=parseFloat(t?i.v1:i.g(i.t,i.p))-parseFloat(i.v2),(r=i.rCap)&&(n%=r)!==n%(r/2)&&(n=n<0?n+r:n-r),o=n/((t?i.t1:qt.time)-i.t2),Math.round(1e4*o)/1e4},t.getAll=function(){var e,t={},n=this._props;for(e in n)t[e]=this.get(e);return t},t.isTracking=function(e){return e in this._props},t.add=function(e,t){e in this._props||(jt||(qt.add(Zt),$t=qt.time),jt=this._props[e]=new en(this.target,e,t,jt))},t.remove=function(e){var t,n,r=this._props[e];r&&(t=r._prev,n=r._next,t&&(t._next=n),n?n._prev=t:jt===r&&(qt.remove(Zt),jt=0),delete this._props[e])},t.kill=function(e){for(var t in this._props)this.remove(t);e||delete Vt[Ut(this.target)]},e.track=function(t,n,r){Wt||Qt();for(var o,i,a=[],s=Ht(t),l=n.split(","),c=(r||"").split(","),u=s.length;u--;){for(o=Kt(s[u])||new e(s[u]),i=l.length;i--;)o.add(l[i],c[i]||c[0]);a.push(o)}return a},e.untrack=function(e,t){var n=(t||"").split(",");Ht(e).forEach(function(e){var t=Kt(e);t&&(n.length?n.forEach(function(e){return t.remove(e)}):t.kill(1))})},e.isTracking=function(e,t){var n=Kt(e);return n&&n.isTracking(t)},e.getVelocity=function(e,t){var n=Kt(e);return n&&n.isTracking(t)?n.get(t):void 0},e}();tn.getByTarget=Kt,Gt()&&Bt.registerPlugin(tn);
36
- /*!
37
- * InertiaPlugin 3.13.0
38
- * https://gsap.com
39
- *
40
- * @license Copyright 2008-2025, GreenSock. All rights reserved.
41
- * Subject to the terms at https://gsap.com/standard-license
42
- * @author: Jack Doyle, jack@greensock.com
43
- */
44
- var nn,rn,on,an,sn,ln,cn,un,fn,pn,dn,hn,gn,vn,mn=tn.getByTarget,yn=function(){return nn||"undefined"!=typeof window&&(nn=window.gsap)&&nn.registerPlugin&&nn},xn=function(e){return"number"==typeof e},bn=function(e){return"object"==typeof e},wn=function(e){return"function"==typeof e},Tn=Array.isArray,kn=function(e){return e},Sn=1e10,_n=function(e){return Math.round(1e4*e)/1e4},En=function(e,t,n){for(var r in t)r in e||r===n||(e[r]=t[r]);return e},Mn=function e(t){var n,r,o={};for(n in t)o[n]=bn(r=t[n])&&!Tn(r)?e(r):r;return o},Pn=function(e,t,n,r,o){var i,a,s,l,c=t.length,u=0,f=Sn;if(bn(e)){for(;c--;){for(s in i=t[c],a=0,e)a+=(l=i[s]-e[s])*l;a<f&&(u=c,f=a)}if((o||Sn)<Sn&&o<Math.sqrt(f))return e}else for(;c--;)(a=(i=t[c])-e)<0&&(a=-a),a<f&&i>=r&&i<=n&&(u=c,f=a);return t[u]},Cn=function(e,t,n,r,o,i,a){if("auto"===e.end)return e;var s,l,c=e.end;if(n=isNaN(n)?Sn:n,r=isNaN(r)?-Sn:r,bn(t)){if(s=t.calculated?t:(wn(c)?c(t,a):Pn(t,c,n,r,i))||t,!t.calculated){for(l in s)t[l]=s[l];t.calculated=!0}s=s[o]}else s=wn(c)?c(t,a):Tn(c)?Pn(t,c,n,r,i):parseFloat(c);return s>n?s=n:s<r&&(s=r),{max:s,min:s,unitFactor:e.unitFactor}},Nn=function(e,t,n){return isNaN(e[t])?n:+e[t]},Yn=function(e,t){return.05*t*e/pn},Dn=function(e,t,n){return Math.abs((t-e)*pn/n/.05)},Xn={resistance:1,checkpoint:1,preventOvershoot:1,linkedProps:1,radius:1,duration:1},On=function(e,t,n,r){if(t.linkedProps){var o,i,a,s,l,c,u=t.linkedProps.split(","),f={};for(o=0;o<u.length;o++)(a=t[i=u[o]])&&(s=xn(a.velocity)?a.velocity:(l=l||mn(e))&&l.isTracking(i)?l.get(i):0,c=Math.abs(s/Nn(a,"resistance",r)),f[i]=parseFloat(n(e,i))+Yn(s,c));return f}},Ln=function(){(nn=yn())&&(on=nn.parseEase,an=nn.utils.toArray,cn=nn.utils.getUnit,fn=nn.core.getCache,dn=nn.utils.clamp,gn=nn.core.getStyleSaver,vn=nn.core.reverting||function(){},sn=on("power3"),pn=sn(.05),un=nn.core.PropTween,nn.config({resistance:100,unitFactors:{time:1e3,totalTime:1e3,progress:1e3,totalProgress:1e3}}),ln=nn.config(),nn.registerPlugin(tn),rn=1)},An={version:"3.13.0",name:"inertia",register:function(e){nn=e,Ln()},init:function(e,t,n,r,o){rn||Ln();var i=mn(e);if("auto"===t){if(!i)return;t=i.getAll()}this.styles=gn&&"object"==typeof e.style&&gn(e),this.target=e,this.tween=n,hn=t;var a,s,l,c,u,f,p,d,h,g=e._gsap,v=g.get,m=t.duration,y=bn(m),x=t.preventOvershoot||y&&0===m.overshoot,b=Nn(t,"resistance",ln.resistance),w=xn(m)?m:function(e,t,n,r,o){if(void 0===n&&(n=10),void 0===r&&(r=.2),void 0===o&&(o=1),"string"==typeof e&&(e=an(e)[0]),!e)return 0;var i,a,s,l,c,u,f,p,d,h,g=0,v=Sn,m=t.inertia||t,y=fn(e).get,x=Nn(m,"resistance",ln.resistance);for(i in h=On(e,m,y,x),m)Xn[i]||(a=m[i],bn(a)||((p=p||mn(e))&&p.isTracking(i)?a=xn(a)?{velocity:a}:{velocity:p.get(i)}:(l=+a||0,s=Math.abs(l/x))),bn(a)&&(l=xn(a.velocity)?a.velocity:(p=p||mn(e))&&p.isTracking(i)?p.get(i):0,s=dn(r,n,Math.abs(l/Nn(a,"resistance",x))),u=(c=parseFloat(y(e,i))||0)+Yn(l,s),"end"in a&&(a=Cn(a,h&&i in h?h:u,a.max,a.min,i,m.radius,l),hn===t&&(hn=m=Mn(t)),m[i]=En(a,m[i],"end")),"max"in a&&u>+a.max+1e-10?(d=a.unitFactor||ln.unitFactors[i]||1,(f=c>a.max&&a.min!==a.max||l*d>-15&&l*d<45?r+.1*(n-r):Dn(c,a.max,l))+o<v&&(v=f+o)):"min"in a&&u<+a.min-1e-10&&(d=a.unitFactor||ln.unitFactors[i]||1,(f=c<a.min&&a.min!==a.max||l*d>-45&&l*d<15?r+.1*(n-r):Dn(c,a.min,l))+o<v&&(v=f+o)),f>g&&(g=f)),s>g&&(g=s));return g>v&&(g=v),g>n?n:g<r?r:g}(e,t,y&&m.max||10,y&&m.min||.2,y&&"overshoot"in m?+m.overshoot:x?0:1);for(a in t=hn,hn=0,h=On(e,t,v,b),t)Xn[a]||(s=t[a],wn(s)&&(s=s(r,e,o)),xn(s)?u=s:bn(s)&&!isNaN(s.velocity)?u=+s.velocity:i&&i.isTracking(a)&&(u=i.get(a)),f=Yn(u,w),d=0,l=v(e,a),c=cn(l),l=parseFloat(l),bn(s)&&(p=l+f,"end"in s&&(s=Cn(s,h&&a in h?h:p,s.max,s.min,a,t.radius,u)),"max"in s&&+s.max<p?x||s.preventOvershoot?f=s.max-l:d=s.max-l-f:"min"in s&&+s.min>p&&(x||s.preventOvershoot?f=s.min-l:d=s.min-l-f)),this._props.push(a),this.styles&&this.styles.save(a),this._pt=new un(this._pt,e,a,l,0,kn,0,g.set(e,a,this)),this._pt.u=c||0,this._pt.c1=f,this._pt.c2=d);return n.duration(w),1},render:function(e,t){var n=t._pt;if((e=sn(t.tween._time/t.tween._dur))||!vn())for(;n;)n.set(n.t,n.p,_n(n.s+n.c1*e+n.c2*e*e)+n.u,n.d,e),n=n._next;else t.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(e){return An[e]=tn[e]}),yn()&&nn.registerPlugin(An);const Rn=(...e)=>i.twMerge(o.clsx(e)),Fn=e=>{let t=e;for(;t;){const e=window.getComputedStyle(t).backgroundColor;if(e&&"rgba(0, 0, 0, 0)"!==e&&"transparent"!==e)return e;t=t.parentElement}return"transparent"},Bn=(e,t,n,o,i)=>{const{spacing:a=16,alignRotationWithY:s=!1}=i;if(r.set(e,{gap:`${a}px`,rotate:o?90:"0"}),o){const t=e.parentNode;r.set(e,{width:t.offsetHeight}),r.set(n,{overflow:"visible"})}if(s&&t.length>0){const o=t[0].offsetHeight;r.set(e,{alignItems:"center"}),r.set(n,{rotate:-90,x:(e.offsetWidth-a)/2-a,display:"flex",flexWrap:"wrap",width:o,wordBreak:"break-all",whiteSpace:"break-spaces"}),r.set(t,{height:e.offsetWidth-a})}},Wn=(e,t,n,r)=>{if(!r.fill)return 1;const o=n?window.innerHeight:t;return e<o?Math.ceil(o/e):1},Hn=(e,t,n,r)=>{const{fill:o=!1,alignRotationWithY:i=!1}=r;return o?"auto":i&&e.length>0?`${e[0].offsetHeight}px`:t<n?"100%":`${t}px`},In=(e,t,n,o,i,a,s)=>{const{spacing:l=16,speed:c=100,delay:u=0,paused:f=!1,alignRotationWithY:p=!1}=s,d=[],h=[],g=e.length-1;r.set(e,{xPercent:(e,t)=>{const n=d[e]=parseFloat(String(r.getProperty(t,"width","px")));return h[e]=parseFloat(String(r.getProperty(t,"x","px")))/n*100+Number(r.getProperty(t,"xPercent")),h[e]}}),r.set(e,{x:0});const v=e[g].offsetLeft+h[g]/100*d[g]-t+e[g].offsetWidth+l;if(e.forEach((e,r)=>{const o=h[r]/100*d[r],i=e.offsetLeft+o-t,a=p?i+e.offsetHeight-l:i+d[r];n.to(e,{xPercent:(o-a)/d[r]*100,duration:a/c},0).fromTo(e,{xPercent:(o-a+v)/d[r]*100},{xPercent:h[r],duration:(o-a+v-o)/c,immediateRender:!1},a/c)}),n.delay(u),o){if(f)return void n.pause();n.progress(1).pause(),r.delayedCall(u,()=>{n.reverse(),n.eventCallback("onReverseComplete",()=>{n.totalTime(n.rawTime()+100*n.duration())})})}let m;if("function"==typeof tt&&s.draggable){m=document.createElement("div");const e=r.utils.wrap(0,1);let t,s;const l=()=>{const r=a?c.startY-c.y:c.startX-c.x;n.progress(e(s+r*t))},c=tt.create(m,{trigger:i,type:a?"y":"x",onPress(){r.killTweensOf(n),n.pause(),s=n.progress(),t=1/v,r.set(m,{x:s/-t})},onDrag:l,onThrowUpdate:l,overshootTolerance:0,inertia:!0,onThrowComplete:()=>{if(o){if(f)return void n.pause();n.progress(n.progress()).pause(),r.delayedCall(u,()=>{n.reverse(),n.eventCallback("onReverseComplete",()=>{n.totalTime(n.rawTime()+100*n.duration())})})}else n.play()}})[0]}};r.registerPlugin(n.useGSAP,Ft,An,tt);const jn=t.forwardRef((e,o)=>{const{children:i,className:a,dir:s="left",loop:l=-1,paused:c=!1,fill:u=!1,followScrollDir:f=!1,scrollSpeed:p=2.5,gradient:d=!1,gradientColor:h=null,pauseOnHover:g=!1}=e,v=t.useRef(null),m=o||v,y=t.useRef(null),[b,w]=t.useState(1),[T,k]=t.useState(null);t.useLayoutEffect(()=>{if(!d||!(null==m?void 0:m.current))return;const e=Fn(m.current);k(e)},[d]);const S="up"===s||"down"===s,_="down"===s||"right"===s;n.useGSAP((t,n)=>{if(!(null==y?void 0:y.current)||!m.current||!n)return;const o=null==m?void 0:m.current,i=r.utils.toArray(o.querySelectorAll(".gsap-react-marquee")),a=r.utils.toArray(o.querySelectorAll(".gsap-react-marquee .gsap-react-marquee-content")),s=y.current;if(!s||!a)return;const d=r.timeline({paused:c,repeat:l,defaults:{ease:"none"},onReverseComplete(){d.totalTime(d.rawTime()+100*d.duration())}});Bn(o,i,a,S,e);const h=o.offsetWidth,v=a[0].offsetWidth,x=a[0].offsetLeft;let b=null;const T=Math.min(4,Math.max(1.1,p));w(Wn(v,h,S,e));const k=r.utils.toArray(s.children).map(e=>e.offsetWidth).reduce((e,t)=>e+t,0);r.set(i,{minWidth:Hn(a,k,h,e),flex:u?"0 0 auto":"1"}),In(u?a:i,x,d,_,i,S,e),f&&(b=Ft.create({onChangeY(e){let t=T*(_?-1:1);e.deltaY<0&&(t*=-1),r.timeline({defaults:{ease:"none"}}).to(d,{timeScale:t*T,duration:.2,overwrite:!0}).to(d,{timeScale:t/T,duration:1},"+=0.3")}}));const E=n(()=>{d.timeScale(0)}),M=n(()=>{d.timeScale(1)});return g&&(o.addEventListener("mouseenter",E),o.addEventListener("mouseleave",M)),()=>{o.removeEventListener("mouseenter",E),o.removeEventListener("mouseleave",M),d.kill(),null==b||b.kill()}},{dependencies:[b,s,l,c,u,f,p,d,h,g]});const E=t.useMemo(()=>!Number.isFinite(b)||b<=0?null:Array.from({length:b},(e,t)=>x.jsx("div",{className:Rn("gsap-react-marquee"),children:x.jsx("div",{className:Rn("gsap-react-marquee-content",a),children:i})},t)),[b,a,i]);return x.jsxs("div",{ref:m,style:{"--gradient-color":h||(d&&T?T:"transparent")},className:Rn("gsap-react-marquee-container flex w-full overflow-hidden whitespace-nowrap"),children:[x.jsx("div",{ref:y,className:Rn("gsap-react-marquee"),children:x.jsx("div",{className:Rn("gsap-react-marquee-content",a),children:i})}),E]})});jn.displayName="GSAPReactMarquee",exports.calculateDuplicates=Wn,exports.cn=Rn,exports.coreAnimation=In,exports.default=jn,exports.getEffectiveBackgroundColor=Fn,exports.getMinWidth=Hn,exports.setupContainerStyles=Bn;
45
- //# sourceMappingURL=index.cjs.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,r=require("react"),n=require("@gsap/react"),a=require("gsap"),o=require("gsap/all"),i=require("clsx"),s=require("tailwind-merge"),l={exports:{}},c={},u={};"production"===process.env.NODE_ENV?l.exports=function(){if(e)return c;e=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(e,r,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==r.key&&(a=""+r.key),"key"in r)for(var o in n={},r)"key"!==o&&(n[o]=r[o]);else n=r;return r=n.ref,{$$typeof:t,type:e,key:a,ref:void 0!==r?r:null,props:n}}return c.Fragment=r,c.jsx=n,c.jsxs=n,c}():l.exports=(t||(t=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===O?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case m:return"Fragment";case y:return"Profiler";case g:return"StrictMode";case x:return"Suspense";case S:return"SuspenseList";case _:return"Activity"}if("object"==typeof t)switch(t.tag,t.$$typeof){case d:return"Portal";case b:return(t.displayName||"Context")+".Provider";case v:return(t._context.displayName||"Context")+".Consumer";case h:var r=t.render;return(t=t.displayName)||(t=""!==(t=r.displayName||r.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case w:return null!==(r=t.displayName||null)?r:e(t.type)||"Memo";case k:r=t._payload,t=t._init;try{return e(t(r))}catch(e){}}return null}function t(e){return""+e}function n(e){try{t(e);var r=!1}catch(e){r=!0}if(r){var n=(r=console).error,a="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),t(e)}}function a(t){if(t===m)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===k)return"<...>";try{var r=e(t);return r?"<"+r+">":"<...>"}catch(e){return"<...>"}}function o(){return Error("react-stack-top-frame")}function i(){var t=e(this.type);return T[t]||(T[t]=!0),void 0!==(t=this.props.ref)?t:null}function s(t,r,a,o,s,u,f,d){var m,g=r.children;if(void 0!==g)if(o){if(P(g)){for(o=0;o<g.length;o++)l(g[o]);Object.freeze&&Object.freeze(g)}}else l(g);if(N.call(r,"key")){g=e(t);var y=Object.keys(r).filter(function(e){return"key"!==e});o=0<y.length?"{key: someKey, "+y.join(": ..., ")+": ...}":"{key: someKey}",R[g+o]||(y=0<y.length?"{"+y.join(": ..., ")+": ...}":"{}",R[g+o]=!0)}if(g=null,void 0!==a&&(n(a),g=""+a),function(e){if(N.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(r)&&(n(r.key),g=""+r.key),"key"in r)for(var v in a={},r)"key"!==v&&(a[v]=r[v]);else a=r;return g&&function(e){function t(){c||(c=!0)}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(a,"function"==typeof t&&(t.displayName||t.name)),function(e,t,r,n,a,o,s,l){return r=o.ref,e={$$typeof:p,type:e,key:t,props:o,_owner:a},null!==(void 0!==r?r:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,g,u,0,null===(m=j.A)?null:m.getOwner(),a,f,d)}function l(e){"object"==typeof e&&null!==e&&e.$$typeof===p&&e._store&&(e._store.validated=1)}var c,f=r,p=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),b=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),j=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,P=Array.isArray,q=console.createTask?console.createTask:function(){return null},T={},C=(f={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(f,o)(),E=q(a(o)),R={};u.Fragment=m,u.jsx=function(e,t,r,n,o){var i=1e4>j.recentlyCreatedOwnerStacks++;return s(e,t,r,!1,0,o,i?Error("react-stack-top-frame"):C,i?q(a(e)):E)},u.jsxs=function(e,t,r,n,o){var i=1e4>j.recentlyCreatedOwnerStacks++;return s(e,t,r,!0,0,o,i?Error("react-stack-top-frame"):C,i?q(a(e)):E)}}()),u);var f=l.exports;!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}('.gsap-react-marquee-container{display:flex;overflow:hidden;white-space:preserve nowrap;width:100%}.gsap-react-marquee-container:after{background:linear-gradient(270deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);left:0}.gsap-react-marquee-container:after,.gsap-react-marquee-container:before{content:"";height:100%;pointer-events:none;position:absolute;top:0;width:15%;z-index:10}.gsap-react-marquee-container:before{background:linear-gradient(90deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);right:0}.gsap-react-marquee{flex:1;height:max-content;width:auto}.gsap-react-marquee,.gsap-react-marquee-content{display:flex;line-height:100%;white-space:preserve nowrap}.gsap-react-marquee-content{overflow:hidden;width:max-content}');const p=(...e)=>s.twMerge(i.clsx(e)),d=e=>{let t=e;for(;t;){const e=window.getComputedStyle(t).backgroundColor;if(e&&"rgba(0, 0, 0, 0)"!==e&&"transparent"!==e)return e;t=t.parentElement}return"transparent"},m=(e,t,r,n,o)=>{const{spacing:i=16,alignRotationWithY:s=!1}=o;if(a.set(e,{gap:`${i}px`,rotate:n?90:"0"}),n){const t=e.parentNode;a.set(e,{width:t.offsetHeight}),a.set(r,{overflow:"visible"})}if(s&&t.length>0){const n=t[0].offsetHeight;a.set(e,{alignItems:"center"}),a.set(r,{rotate:-90,x:(e.offsetWidth-i)/2-i,display:"flex",flexWrap:"wrap",width:n,wordBreak:"break-all",whiteSpace:"break-spaces"}),a.set(t,{height:e.offsetWidth-i})}},g=(e,t,r,n)=>{if(!n.fill)return 1;const a=r?window.innerHeight:t;return e<a?Math.ceil(a/e):1},y=(e,t,r,n)=>{const{fill:a=!1,alignRotationWithY:o=!1}=n;return a?"auto":o&&e.length>0?`${e[0].offsetHeight}px`:t<r?"100%":`${t}px`},v=(e,t,r,n,i,s,l)=>{const{spacing:c=16,speed:u=100,delay:f=0,paused:p=!1,alignRotationWithY:d=!1}=l,m=[],g=[],y=e.length-1;a.set(e,{xPercent:(e,t)=>{const r=m[e]=parseFloat(String(a.getProperty(t,"width","px")));return g[e]=parseFloat(String(a.getProperty(t,"x","px")))/r*100+Number(a.getProperty(t,"xPercent")),g[e]}}),a.set(e,{x:0});const v=e[y].offsetLeft+g[y]/100*m[y]-t+e[y].offsetWidth+c;if(e.forEach((e,n)=>{const a=g[n]/100*m[n],o=e.offsetLeft+a-t,i=d?o+e.offsetHeight-c:o+m[n];r.to(e,{xPercent:(a-i)/m[n]*100,duration:i/u},0).fromTo(e,{xPercent:(a-i+v)/m[n]*100},{xPercent:g[n],duration:(a-i+v-a)/u,immediateRender:!1},i/u)}),r.delay(f),n){if(p)return void r.pause();r.progress(1).pause(),a.delayedCall(f,()=>{r.reverse(),r.eventCallback("onReverseComplete",()=>{r.totalTime(r.rawTime()+100*r.duration())})})}let b;if("function"==typeof o.Draggable&&l.draggable){b=document.createElement("div");const e=a.utils.wrap(0,1);let t,l;const c=()=>{const n=s?u.startY-u.y:u.startX-u.x;r.progress(e(l+n*t))};o.InertiaPlugin;const u=o.Draggable.create(b,{trigger:i,type:s?"y":"x",onPress(){a.killTweensOf(r),r.pause(),l=r.progress(),t=1/v,a.set(b,{x:l/-t})},onDrag:c,onThrowUpdate:c,overshootTolerance:0,inertia:!0,onThrowComplete:()=>{if(n){if(p)return void r.pause();r.progress(r.progress()).pause(),a.delayedCall(f,()=>{r.reverse(),r.eventCallback("onReverseComplete",()=>{r.totalTime(r.rawTime()+100*r.duration())})})}else r.play()}})[0]}};a.registerPlugin(n.useGSAP,o.Observer,o.InertiaPlugin,o.Draggable);const b=r.forwardRef((e,t)=>{const{children:i,className:s,dir:l="left",loop:c=-1,paused:u=!1,fill:b=!1,followScrollDir:h=!1,scrollSpeed:x=2.5,gradient:S=!1,gradientColor:w=null,pauseOnHover:k=!1}=e,_=r.useRef(null),O=t||_,j=r.useRef(null),[N,P]=r.useState(1),[q,T]=r.useState(null);r.useLayoutEffect(()=>{if(!S||!(null==O?void 0:O.current))return;const e=d(O.current);T(e)},[S]);const C="up"===l||"down"===l,E="down"===l||"right"===l;n.useGSAP((t,r)=>{if(!(null==j?void 0:j.current)||!O.current||!r)return;const n=null==O?void 0:O.current,i=a.utils.toArray(n.querySelectorAll(".gsap-react-marquee")),s=a.utils.toArray(n.querySelectorAll(".gsap-react-marquee .gsap-react-marquee-content")),l=j.current;if(!l||!s)return;const f=a.timeline({paused:u,repeat:c,defaults:{ease:"none"},onReverseComplete(){f.totalTime(f.rawTime()+100*f.duration())}});m(n,i,s,C,e);const p=n.offsetWidth,d=s[0].offsetWidth,S=s[0].offsetLeft;let w=null;const _=Math.min(4,Math.max(1.1,x));P(g(d,p,C,e));const N=a.utils.toArray(l.children).map(e=>e.offsetWidth).reduce((e,t)=>e+t,0);a.set(i,{minWidth:y(s,N,p,e),flex:b?"0 0 auto":"1"}),v(b?s:i,S,f,E,i,C,e),h&&(w=o.Observer.create({onChangeY(e){let t=_*(E?-1:1);e.deltaY<0&&(t*=-1),a.timeline({defaults:{ease:"none"}}).to(f,{timeScale:t*_,duration:.2,overwrite:!0}).to(f,{timeScale:t/_,duration:1},"+=0.3")}}));const q=r(()=>{f.timeScale(0)}),T=r(()=>{f.timeScale(1)});return k&&(n.addEventListener("mouseenter",q),n.addEventListener("mouseleave",T)),()=>{n.removeEventListener("mouseenter",q),n.removeEventListener("mouseleave",T),f.kill(),null==w||w.kill()}},{dependencies:[N,l,c,u,b,h,x,S,w,k]});const R=r.useMemo(()=>!Number.isFinite(N)||N<=0?null:Array.from({length:N},(e,t)=>f.jsx("div",{className:p("gsap-react-marquee"),children:f.jsx("div",{className:p("gsap-react-marquee-content",s),children:i})},t)),[N,s,i]);return f.jsxs("div",{ref:O,style:{"--gradient-color":w||(S&&q?q:"transparent")},className:p("gsap-react-marquee-container"),children:[f.jsx("div",{ref:j,className:p("gsap-react-marquee"),children:f.jsx("div",{className:p("gsap-react-marquee-content",s),children:i})}),R]})});b.displayName="GSAPReactMarquee",exports.calculateDuplicates=g,exports.cn=p,exports.coreAnimation=v,exports.default=b,exports.getEffectiveBackgroundColor=d,exports.getMinWidth=y,exports.setupContainerStyles=m;
package/dist/index.d.ts CHANGED
@@ -3,217 +3,31 @@ import { ReactNode } from 'react';
3
3
  import { ClassValue } from 'clsx';
4
4
 
5
5
  type GSAPReactMarqueeProps = {
6
- /** Content to render inside the marquee */
7
6
  children: ReactNode;
8
- /** Additional CSS classes for styling */
9
7
  className?: string;
10
- /**
11
- * @description Direction of the marquee movement
12
- * @type {"right" | "left" | "up" | "down"}
13
- * @default "right"
14
- */
15
8
  dir?: "right" | "left" | "up" | "down";
16
- /**
17
- * @description The number of times the marquee should loop, -1 is equivalent to infinite
18
- * @type {number}
19
- * @default -1
20
- */
21
9
  loop?: number;
22
- /**
23
- * @description Whether the marquee animation should be paused
24
- * @type {boolean}
25
- * @default false
26
- */
27
10
  paused?: boolean;
28
- /**
29
- * @description Correctly orients (rotates) the content with respect to the Y axis.
30
- * Useful for vertical movement ("up" | "down") to keep items upright via rotation fix.
31
- * @issue ⚠️ Not recommended to use together with "left" or "right" direction, as it may cause layout issues.
32
- * @type {boolean}
33
- * @default false
34
- */
35
11
  alignRotationWithY?: boolean;
36
- /**
37
- * @description Delay before the animation starts
38
- * @type {number}
39
- * @default 0
40
- */
41
12
  delay?: number;
42
- /**
43
- * @description Speed of the marquee animation in px/s
44
- * @type {number}
45
- * @default 100
46
- */
47
13
  speed?: number;
48
- /**
49
- * @description Whether the marquee should continuously fill the space
50
- * @type {boolean}
51
- * @default false
52
- */
53
14
  fill?: boolean;
54
- /**
55
- * @description Pause the marquee when hovering
56
- * @type {boolean}
57
- * @default false
58
- */
59
15
  pauseOnHover?: boolean;
60
- /**
61
- * @description Enable gradient overlay
62
- * @type {boolean}
63
- * @default false
64
- */
65
16
  gradient?: boolean;
66
- /**
67
- * @description Color of the gradient if enabled
68
- * @type {string}
69
- */
70
17
  gradientColor?: string;
71
- /**
72
- * @description Spacing between repeated elements in px
73
- * @type {number}
74
- * @default 16
75
- */
76
18
  spacing?: number;
77
- /**
78
- * @description Enable dragging to scroll manually
79
- * @type {boolean}
80
- * @default false
81
- */
82
19
  draggable?: boolean;
83
- /**
84
- * @description Whether to sync with page scroll direction
85
- * @type {boolean}
86
- * @default false
87
- */
88
20
  followScrollDir?: boolean;
89
- /**
90
- * @description Speed factor when syncing with page scroll, max value is 4
91
- * @type {number}
92
- * @default 2.5
93
- */
94
21
  scrollSpeed?: number;
95
22
  };
96
23
 
97
24
  declare const GSAPReactMarquee: react.ForwardRefExoticComponent<GSAPReactMarqueeProps & react.RefAttributes<HTMLDivElement>>;
98
25
 
99
- /**
100
- * Utility function to merge Tailwind classes with clsx
101
- *
102
- * Combines clsx for conditional classes with tailwind-merge to handle
103
- * conflicting Tailwind classes by keeping the last occurrence.
104
- * This prevents issues like "p-4 p-2" where both would be applied.
105
- *
106
- * @param inputs - Array of class values (strings, conditionals, objects)
107
- * @returns Merged and deduplicated class string
108
- */
109
26
  declare const cn: (...inputs: ClassValue[]) => string;
110
- /**
111
- * Traverses the DOM tree upward to find the first non-transparent background color
112
- *
113
- * This function walks up the element hierarchy starting from the given element,
114
- * checking each parent's computed backgroundColor style until it finds a visible
115
- * (non-transparent) background color. This is useful for automatically detecting
116
- * the effective background behind an element for gradient overlays.
117
- *
118
- * The traversal stops at the first element with a visible background color,
119
- * which could be the element itself or any of its ancestors up to the document root.
120
- *
121
- * @param el - The HTMLElement to start the background color search from
122
- * @returns The first non-transparent background color found in the hierarchy,
123
- * or "transparent" if no visible background is found
124
- *
125
- * @example
126
- * // Element with white parent background
127
- * const color = getEffectiveBackgroundColor(marqueeElement);
128
- * // Returns: "rgb(255, 255, 255)" or "#ffffff"
129
- *
130
- * @example
131
- * // Element with no background set anywhere in hierarchy
132
- * const color = getEffectiveBackgroundColor(marqueeElement);
133
- * // Returns: "transparent"
134
- */
135
27
  declare const getEffectiveBackgroundColor: (el: HTMLElement) => string;
136
- /**
137
- * Sets up container styles and rotation handling for the marquee
138
- *
139
- * This function handles the complex styling requirements for different marquee orientations:
140
- *
141
- * 1. **Basic Setup**: Applies gap spacing and rotation for vertical marquees
142
- * 2. **Vertical Mode**: Rotates container 90° and adjusts width to parent height
143
- * 3. **Rotation Alignment**: Special mode for vertical text that remains readable
144
- *
145
- * @param containerMarquee - The main container element that holds all marquee instances
146
- * @param marquees - Array of individual marquee wrapper elements
147
- * @param marqueesChildren - Array of content container elements within each marquee
148
- * @param isVertical - Boolean indicating if marquee moves up/down instead of left/right
149
- * @param props - Configuration object containing spacing and alignment options
150
- */
151
28
  declare const setupContainerStyles: (containerMarquee: HTMLElement, marquees: HTMLElement[], marqueesChildren: HTMLElement[], isVertical: boolean, props: GSAPReactMarqueeProps) => void;
152
- /**
153
- * Calculates the number of content duplicates needed for seamless looping
154
- *
155
- * For smooth infinite scrolling, we need enough content copies to fill the visible area
156
- * plus buffer space. This prevents gaps when content loops back to the beginning.
157
- *
158
- * Algorithm:
159
- * 1. If not in fill mode, only one copy is needed (content already spans container)
160
- * 2. Determine target width (viewport height for vertical, container width for horizontal)
161
- * 3. Calculate how many copies fit in the target space, rounding up for complete coverage
162
- *
163
- * @param marqueeChildrenWidth - Width of a single content instance
164
- * @param containerMarqueeWidth - Width of the marquee container
165
- * @param isVertical - Whether the marquee scrolls vertically
166
- * @param props - Configuration object containing fill mode setting
167
- * @returns Number of content duplicates needed (minimum 1)
168
- */
169
29
  declare const calculateDuplicates: (marqueeChildrenWidth: number, containerMarqueeWidth: number, isVertical: boolean, props: GSAPReactMarqueeProps) => number;
170
- /**
171
- * Determines the minimum width for marquee elements based on content and container
172
- *
173
- * This function ensures marquee elements have appropriate dimensions for their content
174
- * and container context, handling different modes and orientations.
175
- *
176
- * Width determination logic:
177
- * 1. **Fill mode**: Auto width lets content size naturally
178
- * 2. **Rotation alignment**: Use content height as width (rotated dimensions)
179
- * 3. **Undersized content**: Stretch to 100% to fill container
180
- * 4. **Oversized content**: Use actual content width for overflow scrolling
181
- *
182
- * @param marqueesChildren - Array of content elements for dimension measurement
183
- * @param totalWidth - Combined width of all content elements
184
- * @param containerMarqueeWidth - Available container width
185
- * @param props - Configuration object containing fill and alignment settings
186
- * @returns CSS width value (string with units or number for pixels)
187
- */
188
30
  declare const getMinWidth: (marqueesChildren: HTMLElement[], totalWidth: number, containerMarqueeWidth: number, props: GSAPReactMarqueeProps) => string | number;
189
- /**
190
- * Creates a complex marquee animation with seamless looping and draggable support
191
- *
192
- * This is the core animation engine that creates smooth, continuous scrolling.
193
- * It handles the complex math required for seamless looping by calculating
194
- * precise positions and durations for each content element.
195
- *
196
- * Animation Strategy:
197
- * 1. **Position Calculation**: Convert pixel positions to percentages for responsive scaling
198
- * 2. **Seamless Looping**: Calculate track length and loop points to prevent gaps
199
- * 3. **Staggered Animation**: Each element starts at different times for smooth flow
200
- * 4. **Direction Handling**: Support forward and reverse directions with proper timing
201
- * 5. **Integrated Draggable**: Optional support for drag interaction with manual control
202
- *
203
- * Technical Details:
204
- * - Uses xPercent for percentage-based positioning (responsive to element width changes)
205
- * - Creates two-part animation: main movement + seamless loop reset
206
- * - Calculates precise durations based on distance and speed for consistent motion
207
- * - Implements draggable with intelligent pause/resume animation handling
208
- *
209
- * @param elementsToAnimate - Array of DOM elements to animate (content or containers)
210
- * @param startX - Starting X position reference point
211
- * @param tl - GSAP timeline to add animations to
212
- * @param isReverse - Whether animation should play in reverse direction
213
- * @param draggableTrigger - Element(s) that will trigger the draggable functionality
214
- * @param isVertical - Whether the marquee scrolls vertically
215
- * @param props - Configuration object with spacing, speed, delay, and other settings
216
- */
217
31
  declare const coreAnimation: (elementsToAnimate: HTMLElement[], startX: number, tl: gsap.core.Timeline, isReverse: boolean, draggableTrigger: HTMLElement | HTMLElement[], isVertical: boolean, props: GSAPReactMarqueeProps) => void;
218
32
 
219
33
  export { calculateDuplicates, cn, coreAnimation, GSAPReactMarquee as default, getEffectiveBackgroundColor, getMinWidth, setupContainerStyles };