(function(He,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],p):(He=typeof globalThis<"u"?globalThis:He||self,p(He["react-next-parallax"]={},He.React))})(this,function(He,p){"use strict";var ct={exports:{}},qe={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var pt;function Rt(){if(pt)return qe;pt=1;var a=p,c=Symbol.for("react.element"),E=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,S=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_={key:!0,ref:!0,__self:!0,__source:!0};function O(R,u,I){var g,j={},C=null,U=null;I!==void 0&&(C=""+I),u.key!==void 0&&(C=""+u.key),u.ref!==void 0&&(U=u.ref);for(g in u)m.call(u,g)&&!_.hasOwnProperty(g)&&(j[g]=u[g]);if(R&&R.defaultProps)for(g in u=R.defaultProps,u)j[g]===void 0&&(j[g]=u[g]);return{$$typeof:c,type:R,key:C,ref:U,props:j,_owner:S.current}}return qe.Fragment=E,qe.jsx=O,qe.jsxs=O,qe}var et={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var vt;function wt(){return vt||(vt=1,process.env.NODE_ENV!=="production"&&function(){var a=p,c=Symbol.for("react.element"),E=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),R=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),Ye=Symbol.iterator,Se="@@iterator";function xe(e){if(e===null||typeof e!="object")return null;var t=Ye&&e[Ye]||e[Se];return typeof t=="function"?t:null}var G=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=1&&w>=0&&o[h]!==T[w];)w--;for(;h>=1&&w>=0;h--,w--)if(o[h]!==T[w]){if(h!==1||w!==1)do if(h--,w--,w<0||o[h]!==T[w]){var D=` `+o[h].replace(" at new "," at ");return e.displayName&&D.includes("")&&(D=D.replace("",e.displayName)),typeof e=="function"&&P.set(e,D),D}while(h>=1&&w>=0);break}}}finally{L=!1,$.current=v,M(),Error.prepareStackTrace=l}var ge=e?e.displayName||e.name:"",it=ge?fe(ge):"";return typeof e=="function"&&P.set(e,it),it}function me(e,t,r){return Ce(e,!1)}function f(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function d(e,t,r){if(e==null)return"";if(typeof e=="function")return Ce(e,f(e));if(typeof e=="string")return fe(e);switch(e){case I:return fe("Suspense");case g:return fe("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return me(e.render);case j:return d(e.type,t,r);case C:{var n=e,l=n._payload,v=n._init;try{return d(v(l),t,r)}catch{}}}return""}var y=Object.prototype.hasOwnProperty,q={},ee=G.ReactDebugCurrentFrame;function W(e){if(e){var t=e._owner,r=d(e.type,e._source,t?t.type:null);ee.setExtraStackFrame(r)}else ee.setExtraStackFrame(null)}function Ae(e,t,r,n,l){{var v=Function.call.bind(y);for(var s in e)if(v(e,s)){var o=void 0;try{if(typeof e[s]!="function"){var T=Error((n||"React class")+": "+r+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}o=e[s](t,s,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){o=h}o&&!(o instanceof Error)&&(W(l),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,s,typeof o),W(null)),o instanceof Error&&!(o.message in q)&&(q[o.message]=!0,W(l),k("Failed %s type: %s",r,o.message),W(null))}}}var te=Array.isArray;function Oe(e){return te(e)}function rt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function nt(e){try{return X(e),!1}catch{return!0}}function X(e){return""+e}function Pe(e){if(nt(e))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rt(e)),X(e)}var H=G.ReactCurrentOwner,we={key:!0,ref:!0,__self:!0,__source:!0},se,re,ne;ne={};function at(e){if(y.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function ot(e){if(y.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Qe(e,t){if(typeof e.ref=="string"&&H.current&&t&&H.current.stateNode!==t){var r=F(H.current.type);ne[r]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',F(H.current.type),e.ref),ne[r]=!0)}}function $e(e,t){{var r=function(){se||(se=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function le(e,t){{var r=function(){re||(re=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var de=function(e,t,r,n,l,v,s){var o={$$typeof:c,type:e,key:t,ref:r,props:s,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function Ne(e,t,r,n,l){{var v,s={},o=null,T=null;r!==void 0&&(Pe(r),o=""+r),ot(t)&&(Pe(t.key),o=""+t.key),at(t)&&(T=t.ref,Qe(t,l));for(v in t)y.call(t,v)&&!we.hasOwnProperty(v)&&(s[v]=t[v]);if(e&&e.defaultProps){var h=e.defaultProps;for(v in h)s[v]===void 0&&(s[v]=h[v])}if(o||T){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&$e(s,w),T&&le(s,w)}return de(e,o,T,l,n,H.current,s)}}var pe=G.ReactCurrentOwner,be=G.ReactDebugCurrentFrame;function ae(e){if(e){var t=e._owner,r=d(e.type,e._source,t?t.type:null);be.setExtraStackFrame(r)}else be.setExtraStackFrame(null)}var ve;ve=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}function ye(){{if(pe.current){var e=F(pe.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function Ze(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return` Check your code at `+t+":"+r+"."}return""}}var je={};function Ve(e){{var t=ye();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=` Check the top-level render call using <`+r+">.")}return t}}function Ie(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Ve(t);if(je[r])return;je[r]=!0;var n="";e&&e._owner&&e._owner!==pe.current&&(n=" It was passed a child from "+F(e._owner.type)+"."),ae(e),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),ae(null)}}function Fe(e,t){{if(typeof e!="object")return;if(Oe(e))for(var r=0;r",o=" Did you accidentally export a JSX literal instead of a component?"):h=typeof e,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,o)}var w=Ne(e,t,r,l,v);if(w==null)return w;if(s){var D=t.children;if(D!==void 0)if(n)if(Oe(D)){for(var ge=0;ge1?t-1:0),n=1;n=1&&w>=0&&o[h]!==T[w];)w--;for(;h>=1&&w>=0;h--,w--)if(o[h]!==T[w]){if(h!==1||w!==1)do if(h--,w--,w<0||o[h]!==T[w]){var D=` `+o[h].replace(" at new "," at ");return e.displayName&&D.includes("")&&(D=D.replace("",e.displayName)),typeof e=="function"&&P.set(e,D),D}while(h>=1&&w>=0);break}}}finally{L=!1,$.current=v,M(),Error.prepareStackTrace=l}var ge=e?e.displayName||e.name:"",it=ge?fe(ge):"";return typeof e=="function"&&P.set(e,it),it}function me(e,t,r){return Ce(e,!1)}function f(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function d(e,t,r){if(e==null)return"";if(typeof e=="function")return Ce(e,f(e));if(typeof e=="string")return fe(e);switch(e){case I:return fe("Suspense");case g:return fe("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return me(e.render);case j:return d(e.type,t,r);case C:{var n=e,l=n._payload,v=n._init;try{return d(v(l),t,r)}catch{}}}return""}var y=Object.prototype.hasOwnProperty,q={},ee=G.ReactDebugCurrentFrame;function W(e){if(e){var t=e._owner,r=d(e.type,e._source,t?t.type:null);ee.setExtraStackFrame(r)}else ee.setExtraStackFrame(null)}function Ae(e,t,r,n,l){{var v=Function.call.bind(y);for(var s in e)if(v(e,s)){var o=void 0;try{if(typeof e[s]!="function"){var T=Error((n||"React class")+": "+r+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}o=e[s](t,s,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){o=h}o&&!(o instanceof Error)&&(W(l),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,s,typeof o),W(null)),o instanceof Error&&!(o.message in q)&&(q[o.message]=!0,W(l),k("Failed %s type: %s",r,o.message),W(null))}}}var te=Array.isArray;function Oe(e){return te(e)}function rt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function nt(e){try{return X(e),!1}catch{return!0}}function X(e){return""+e}function Pe(e){if(nt(e))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rt(e)),X(e)}var H=G.ReactCurrentOwner,we={key:!0,ref:!0,__self:!0,__source:!0},se,re,ne;ne={};function at(e){if(y.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function ot(e){if(y.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Qe(e,t){if(typeof e.ref=="string"&&H.current&&t&&H.current.stateNode!==t){var r=F(H.current.type);ne[r]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',F(H.current.type),e.ref),ne[r]=!0)}}function $e(e,t){{var r=function(){se||(se=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function le(e,t){{var r=function(){re||(re=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var de=function(e,t,r,n,l,v,s){var o={$$typeof:c,type:e,key:t,ref:r,props:s,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function Ne(e,t,r,n,l){{var v,s={},o=null,T=null;r!==void 0&&(Pe(r),o=""+r),ot(t)&&(Pe(t.key),o=""+t.key),at(t)&&(T=t.ref,Qe(t,l));for(v in t)y.call(t,v)&&!we.hasOwnProperty(v)&&(s[v]=t[v]);if(e&&e.defaultProps){var h=e.defaultProps;for(v in h)s[v]===void 0&&(s[v]=h[v])}if(o||T){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&$e(s,w),T&&le(s,w)}return de(e,o,T,l,n,H.current,s)}}var pe=G.ReactCurrentOwner,be=G.ReactDebugCurrentFrame;function ae(e){if(e){var t=e._owner,r=d(e.type,e._source,t?t.type:null);be.setExtraStackFrame(r)}else be.setExtraStackFrame(null)}var ve;ve=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}function ye(){{if(pe.current){var e=F(pe.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function Ze(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return` Check your code at `+t+":"+r+"."}return""}}var je={};function Ve(e){{var t=ye();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=` Check the top-level render call using <`+r+">.")}return t}}function Ie(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Ve(t);if(je[r])return;je[r]=!0;var n="";e&&e._owner&&e._owner!==pe.current&&(n=" It was passed a child from "+F(e._owner.type)+"."),ae(e),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),ae(null)}}function Fe(e,t){{if(typeof e!="object")return;if(Oe(e))for(var r=0;r",o=" Did you accidentally export a JSX literal instead of a component?"):h=typeof e,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,o)}var w=Ne(e,t,r,l,v);if(w==null)return w;if(s){var D=t.children;if(D!==void 0)if(n)if(Oe(D)){for(var ge=0;geaE?E:a,Tt=(a,c,E)=>{let m=0;return c==="top"?m=(a.offsetY*2-1)*-1:c==="bottom"?m=(a.offsetY-.5)*2:c==="left"?m=(a.offsetX*2-1)*-1:c==="right"?m=(a.offsetX-.5)*2:c==="all"&&(m=Math.max(Math.abs(a.offsetX-.5)*2,Math.abs(a.offsetY-.5)*2)),(m*E).toFixed(2)},Ct=(a,c,E)=>{let m=a.offsetX,S=a.offsetY;E||(m=1-m,S=1-S);let _="translateX(0%) translateY(0%)";return c==="top"?_=`translateX( ${m*50}% )`:c==="bottom"?_=`translateX( ${m*50}% ) translateY(50%)`:c==="left"?_=`translateY( ${S*50}% )`:c==="right"?_=`translateX(50%) translateY( ${S*50}% ) `:c==="all"&&(_=`translateX(${(m-.5)*50}%) translateY(${(S-.5)*50}%) `),_},bt=a=>{if(!a)return"translateX(0%) translateY(0%)";switch(a){case"top-left":a={left:"25%",top:"25%"};break;case"top-right":a={left:"75%",top:"25%"};break;case"bottom-left":a={left:"25%",top:"75%"};break;case"bottom-right":a={left:"75%",top:"75%"};break;case"center":a={left:"50%",top:"50%"};break}const c=a.left.includes("%")?String(parseInt(a.left)/2)+"%":a.left,E=a.top.includes("%")?String(parseInt(a.top)/2)+"%":a.top;return`translateX(${c}) translateY(${E})`},Ot=(a,c,E)=>{let m=a.offsetX,S=a.offsetY;c==="top-right"&&(m=1-m),c==="bottom-left"&&(S=1-S),c==="bottom-right"&&(m=1-m,S=1-S);let _=0;return E?_=((m+S)*(3/2)-1)*100:_=((m+S)*(-3/2)+.5)*100,`translateX(${_}%)`},gt=(a,c)=>{if(!c)return`translateX(${a?"50%":"-100%"})`;switch(c){case"left":c={left:"25%"};break;case"center":c={left:"50%"};break;case"right":c={left:"75%"};break}return`translateX(${c.left.includes("%")?String(parseInt(c.left)/2)+"%":c.left})`},ht=a=>{if(a instanceof HTMLElement)return a;if(a instanceof Document)return document.documentElement;if(a.current&&a.current instanceof Object&&"element"in a.current&&a.current.element instanceof HTMLElement)return a.current.element;if(a.current&&a.current instanceof HTMLElement)return a.current},Pt=p.forwardRef(({width:a,height:c,borderRadius:E,perspective:m="1000px",scale:S=1,shadowEnable:_=!1,shadow:O="0 0 1rem rgba(0,0,0,0.5)",shadowType:R="box",lineGlareEnable:u=!0,lineGlareBlurEnable:I=!0,lineGlareBlurAmount:g="4px",lineGlareMaxOpacity:j=.1,lineGlareWidthPercent:C=10,lineGlareMixBlendMode:U="normal",lineGlareColor:Ye="white",lineGlareReverse:Se=!1,lineGlareDirection:xe="to-bottom-right",lineGlareHoverPosition:G="top-left",lineGlareFixedPosition:k=void 0,spotGlareEnable:Me=!0,spotGlareSizePercent:he=200,spotGlareMaxOpacity:Te=.5,spotGlareMixBlendMode:Ke="normal",spotGlarePosition:Ee="top",spotGlareColor:Je="white",spotGlareReverse:_e=!1,spotGlareFixedPosition:J=void 0,tiltMaxAngleX:Q=20,tiltMaxAngleY:z=20,tiltReverse:F=!1,tiltReset:A=!0,initialAngleX:N=0,initialAngleY:K=0,disableScrollOnTouch:Y=!0,style:We,tiltStyle:Re,tiltClass:ue,tiltProps:De,gyroMaxAngleX:Z=0,gyroMaxAngleY:B=0,gyroReverse:Xe=!1,disabled:M=!1,disabledFilter:$="grayscale(1) brightness(125%)",CSSTransition:oe="all 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99)",TiltWrapper:fe,fullPageListening:L=!1,controlElement:P,controlElementOnly:ie=!1,preserve3dEnable:Ce=!0,testIdEnable:me=!1,onTilt:f,onReset:d,onMouseEnter:y,onMouseMove:q,onMouseLeave:ee,onTouchStart:W,onTouchMove:Ae,onTouchEnd:te,children:Oe,...rt},nt)=>{const X=p.useRef(),Pe=p.useRef(!1),H=!L&&(!P||P&&!ie),we=p.useRef(null),se=p.useRef(null),re=p.useRef(null),ne=p.useRef(null),at=p.useCallback(({children:i})=>Le.jsx(Le.Fragment,{children:i}),[]),ot=fe||at;u&&(C=ke(C,0,50)/2),Me&&(he=he<0?0:he/2),Q=ke(Q,0,90),z=ke(z,0,90),Z=ke(Z,0,90),B=ke(B,0,90),N&&(N=ke(N,-Q,Q)),K&&(K=ke(K,-z,z));const Qe=p.useMemo(()=>u?(100-C)/2:0,[u,C]),$e=p.useMemo(()=>u?Qe+C:0,[u,C,Qe]),le=p.useCallback((i=!0)=>{requestAnimationFrame(()=>{se.current&&(se.current.style.willChange=i?"transform":""),re.current&&(re.current.style.willChange=i?"transform, opacity":""),ne.current&&(ne.current.style.willChange=i?"transform":"")})},[]),de=p.useCallback((i=!0)=>{requestAnimationFrame(()=>{if(R==="box")se.current&&_&&(se.current.style.boxShadow=i?O:"");else if(we.current&&_){const b=we.current.style.filter.replace(/(drop-shadow?\(.*?\))(?=\s[a-z].*?\(.*?\)|\s*$)/g,"");we.current.style.filter=i?b+` drop-shadow(${O})`:b}})},[O,_,R]),Ne=p.useCallback(()=>{if(!we.current||!re.current||!X.current||J)return;const i=Tt(X.current,Ee,Te),b=Ct(X.current,Ee,_e);requestAnimationFrame(()=>{re.current&&(re.current.style.opacity=i,re.current.style.transform=b)})},[Ee,Te,_e,J]),pe=p.useCallback(()=>{if(!we.current||!ne.current||!X.current||k)return;const i=Ot(X.current,G,Se);requestAnimationFrame(()=>{ne.current&&(ne.current.style.transform=i)})},[G,Se,k]),be=p.useCallback((i=!0)=>{if(!we.current||!X.current)return{angleX:0,angleY:0};let b=-(X.current.offsetY-.5)*2*Q,x=(X.current.offsetX-.5)*2*z;return F&&i&&(b=-b,x=-x),{angleX:b,angleY:x}},[Q,z,F]),ae=p.useCallback(i=>{const b=(i.angleY/z+1)/2,x=(-i.angleX/Q+1)/2;X.current={offsetX:b,offsetY:x}},[Q,z]),ve=p.useCallback((i,b=!0,x=!1)=>{const Be=b?S:1;requestAnimationFrame(()=>{se.current&&(se.current.style.transform=`rotateX(${i.angleX}deg) rotateY(${i.angleY}deg) scale3d(${Be},${Be},${Be})`)}),f&&f({angleX:i.angleX,angleY:i.angleY},x)},[f,S]),ce=p.useCallback((i,b=!1,x=!1)=>{ae(i),ve(i,b,x),de(b),pe(),Ne()},[ae,ve,de,pe,Ne]),ye=p.useCallback(()=>{d&&d(),N||K?ce({angleX:N||0,angleY:K||0}):(X.current=void 0,requestAnimationFrame(()=>{ne.current&&!k&&(ne.current.style.transform=gt(Se)),re.current&&!J&&(re.current.style.transform=bt(),re.current.style.opacity="0"),se.current&&(se.current.style.transform="rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)")}))},[N,K,Se,J,k,d,ce]),Ze=p.useCallback((i,b)=>{if(!b)return;if(L){X.current={offsetX:i.x/window.innerWidth,offsetY:i.y/window.innerHeight};return}const x=b.getBoundingClientRect();if(!x.width||!x.height)return;const Be=ke(i.x,x.left,x.right),e=ke(i.y,x.top,x.bottom),t=(Be-x.left)/x.width,r=(e-x.top)/x.height;X.current={offsetX:t,offsetY:r}},[L]);p.useImperativeHandle(nt,()=>({tilt:ce,reset:ye,angle:()=>be(!1),updateWillChange:le,element:we.current}),[ce,ye,le,be]);const je=p.useCallback(()=>{M||(Pe.current=!0,le(),de())},[M,de,le]),Ve=p.useCallback(()=>{M||(Y&&!L&&(typeof Y=="boolean"?document.body.style.overflow="hidden":Y.style.overflow="hidden"),Pe.current=!0,le(),de())},[Y,M,L,de,le]),Ie=p.useCallback(i=>{M||(Ze({x:i.clientX,y:i.clientY},i.currentTarget),ve(be()),pe(),Ne())},[M,be,Ze,ve,pe,Ne]),Fe=p.useCallback(i=>{if(M)return;const b=i.changedTouches[0];b&&(Ze({x:b.clientX,y:b.clientY},i.currentTarget),ve(be()),pe(),Ne())},[M,be,Ze,ve,pe,Ne]),Ue=p.useCallback(()=>{M||(Pe.current=!1,le(!1),de(!1),A&&ye())},[M,ye,A,de,le]),Ge=p.useCallback(()=>{M||(Y&&!L&&(typeof Y=="boolean"?document.body.style.overflow="":Y.style.overflow=""),Pe.current=!1,le(!1),de(!1),A&&ye())},[Y,M,L,ye,A,de,le]);p.useEffect(()=>{if(!P&&!L)return;let i;L||!P?i=[document]:i=Array.isArray(P)?P:[P];for(let b of i){const x=ht(b);x&&(b=x,b.addEventListener("mouseenter",je),b.addEventListener("mousemove",Ie),b.addEventListener("mouseleave",Ue),b.addEventListener("touchstart",Ve,{passive:!0}),b.addEventListener("touchmove",Fe,{passive:!0}),b.addEventListener("touchend",Ge,{passive:!0}))}return()=>{for(let b of i){const x=ht(b);x&&(b=x,b.removeEventListener("mouseenter",je),b.removeEventListener("mousemove",Ie),b.removeEventListener("mouseleave",Ue),b.removeEventListener("touchstart",Ve),b.removeEventListener("touchmove",Fe),b.removeEventListener("touchend",Ge))}}},[P,je,Ie,Ue,Ve,Fe,Ge,L]);const ze=p.useCallback(i=>{if(Pe.current||i.beta===null&&i.gamma===null)return;let b=Z&&i.beta?ke(-i.beta,-Z,Z):N||0,x=B&&i.gamma?ke(i.gamma,-B,B):K||0;Xe&&(b=-b,x=-x),ce({angleX:b,angleY:x},!1,!0)},[Z,B,N,K,Xe,ce]);return p.useEffect(()=>{if(!(!Z&&!B))return window.addEventListener("deviceorientation",ze),()=>window.removeEventListener("deviceorientation",ze)},[Z,B,ze,le]),Le.jsx("div",{ref:i=>{i&&(we.current=i,X.current&&(M?ye():ce(be())),(N||K)&&!X.current&&ye())},"data-testid":me?"container":void 0,style:Object.assign({display:"inline-block",verticalAlign:"middle",width:a,height:c,borderRadius:E,perspective:m,transformStyle:Ce?"preserve-3d":void 0,backfaceVisibility:"hidden",filter:M?$:void 0,transition:R==="drop"?oe:void 0},We),onMouseEnter:H?y?i=>{je(),y(i)}:je:y,onTouchStart:H?W?i=>{Ve(),W(i)}:Ve:W,onMouseMove:H?q?i=>{Ie(i),q(i)}:Ie:q,onTouchMove:H?Ae?i=>{Fe(i),Ae(i)}:Fe:Ae,onMouseLeave:H?ee?i=>{Ue(),ee(i)}:Ue:ee,onTouchEnd:H?te?i=>{Ge(),te(i)}:Ge:te,...rt,children:Le.jsx(ot,{children:Le.jsxs("div",{ref:se,"data-testid":me?"tilt":void 0,style:Object.assign({boxSizing:"border-box",position:"relative",width:"100%",height:"100%",borderRadius:E,transformStyle:Ce?"preserve-3d":void 0,backfaceVisibility:"hidden",transition:oe,transform:"rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"},Re),className:ue,...De,children:[Oe,Me&&Le.jsx("div",{"data-testid":me?"spot-glare-container":void 0,style:{pointerEvents:"none",position:"absolute",inset:"0",borderRadius:E,overflow:"hidden",backfaceVisibility:"hidden",mixBlendMode:Ke},children:Le.jsx("div",{ref:re,"data-testid":me?"spot-glare":void 0,style:{position:"absolute",left:Ee==="all"&&!J?"-50%":"-100%",top:Ee==="all"&&!J?"-50%":"-100%",width:"200%",height:"200%",transition:oe,backgroundImage:`radial-gradient(${Je}, transparent ${he}%)`,transform:bt(J),opacity:J?Te:"0"}})}),u&&Le.jsx("div",{"data-testid":me?"line-glare-container":void 0,style:{pointerEvents:"none",position:"absolute",inset:"0",borderRadius:E,overflow:"hidden",backfaceVisibility:"hidden",mixBlendMode:U},children:Le.jsx("div",{"data-testid":me?"line-glare":void 0,ref:ne,style:{position:"absolute",left:k?"-100%":0,top:"-50%",width:"200%",height:"200%",filter:I?`blur(${g})`:"",transition:oe,opacity:String(j),transform:gt(Se,k),backgroundImage:`linear-gradient(${xe==="to-bottom-right"?"to bottom right":"to bottom left"}, transparent, transparent ${Qe}%, ${Ye} calc(${Qe}% + 1px), ${Ye} ${$e}%, transparent calc(${$e}% + 1px), transparent 0%)`}})})]})})})}),Et=p.memo(Pt);Et.displayName="Tilt";const _t=a=>{if(a instanceof HTMLElement)return a;if(a instanceof Document)return document;if(a.current&&a.current instanceof Object&&"element"in a.current&&a.current.element instanceof HTMLElement)return a.current.element;if(a.current&&a.current instanceof HTMLElement)return a.current},jt=(a,c)=>{const E=a.split(c);for(const _ of E)if(isNaN(Number(_)))return;const m=E.length>1?Number(E[0]):0,S=E.length>1?Number(E[1]):Number(E[0]);return[m,S]},ft=(a,c,E)=>{a[c]=E},It=(a,c,E,m,S,_,O)=>{const R={element:a,transformInitial:a.style.transform};for(const u of c){const I=a.getAttribute(`${E}-${u}`);if(I)switch(u){case"offset":{const g=_==="all"||_==="offset";R.offset=Number(I)*O.offset,g&&(R.offset*=-1),R.transformInitial=R.transformInitial.replace(/translate[XY3d]*\([^)]*\)/g,"");break}case"opacity":case"scale":case"rotation":case"skew":{const g=jt(I,m);if(!g)continue;const j=_==="all"||_==="all-except-offset"||_==="opacity"&&u==="opacity"||_==="scale"&&u==="scale"||_==="rotation"&&u==="rotation"||_==="skew"&&u==="skew";let C=j?g[1]:g[0],U=j?g[0]:g[1];O[u]!==1&&(C*=O[u],U*=O[u]),ft(R,u+"Initial",S==="center-to-edge"?C:C+(U-C)/2),ft(R,u+"Start",C),ft(R,u+"End",U),u==="scale"?R.transformInitial=R.transformInitial.replace(/scale[XY3d]*\([^)]*\)/g,""):u==="rotation"?R.transformInitial=R.transformInitial.replace(/rotate[Z3d]*\([^)]*\)/g,""):u==="skew"&&(R.transformInitial=R.transformInitial.replace(/skew[XY3d]*\([^)]*\)/g,""));break}}}return R},lt=(a,c,E,m,S,_)=>{if(_==="center-to-edge"){const O=c?Math.abs(a.angleX)/c:0,R=E?Math.abs(a.angleY)/E:0;return Math.max(O,R)*(S-m)+m}else{const O=c?a.angleX/c:0,R=E?a.angleY/E:0;return _==="edge-to-edge-x"?(R+1)/2*(S-m)+m:_==="edge-to-edge-y"?(-O+1)/2*(S-m)+m:((-O+R)/2+1)/2*(S-m)+m}},Ft=p.forwardRef(({overflowHiddenEnable:a=!0,animationMode:c="center-to-edge",animationReverse:E="none",offsetMultiplier:m=1,opacityMultiplier:S=1,scaleMultiplier:_=1,rotationMultiplier:O=1,skewMultiplier:R=1,disabled:u=!1,fullPageListening:I,controlElement:g,controlElementOnly:j,perspective:C="1200px",scale:U=1.05,shadowEnable:Ye=!0,shadow:Se="0 0 1.5rem rgba(0, 0, 0, 0.5)",CSSTransition:xe="all 0.3s ease-out",spotGlareSizePercent:G=100,spotGlarePosition:k="all",children:Me,tiltMaxAngleX:he=20,tiltMaxAngleY:Te=20,gyroMaxAngleX:Ke=0,gyroMaxAngleY:Ee=0,tiltStyle:Je={},onMouseEnter:_e,onMouseLeave:J,onTouchStart:Q,onTouchEnd:z,onTilt:F,onReset:A,...N},K)=>{const[Y,We]=p.useState([]),Re=!I&&(!g||g&&!j),ue=p.useRef(null),De="data-parallax",Z=";",B=p.useMemo(()=>["offset","opacity","rotation","scale","skew"],[]),Xe=B.map(f=>`[${De}-${f}]`).join(", "),M=p.useMemo(()=>({offset:m,opacity:S,scale:_,rotation:O,skew:R}),[m,S,O,_,R]),$=p.useCallback((f=!0)=>{requestAnimationFrame(()=>{for(const d of Y)if(!f)d.element.style.willChange="";else{const y=[];(d.offset||d.opacityInitial!==void 0||d.scaleInitial!==void 0||d.rotationInitial!==void 0||d.skewInitial!==void 0)&&y.push("transform"),d.opacityInitial!==void 0&&y.push("opacity"),d.element.style.willChange=y.join(", ")}})},[Y]),oe=p.useCallback((f,d=!1)=>{for(const y of Y){const q=d?Ke:he,ee=d?Ee:Te;let W="",Ae=y.opacityInitial;if(y.offset){const te=ee?f.angleY/ee*y.offset:0,Oe=q?-f.angleX/q*y.offset:0;W+=`translate(${te}%, ${Oe}%)`}if(y.rotationStart!==void 0&&y.rotationEnd!==void 0){const te=lt(f,q,ee,y.rotationStart,y.rotationEnd,c);W+=` rotate(${te}deg)`}if(y.scaleStart!==void 0&&y.scaleEnd!==void 0){const te=lt(f,q,ee,y.scaleStart,y.scaleEnd,c);W+=` scale(${te})`}if(y.skewStart!==void 0&&y.skewEnd!==void 0){const te=lt(f,q,ee,y.skewStart,y.skewEnd,c);W+=` skew(${te}deg, ${te}deg)`}y.opacityStart!==void 0&&y.opacityEnd!==void 0&&(Ae=lt(f,q,ee,y.opacityStart,y.opacityEnd,c)),y.transformInitial&&(W+=" "+y.transformInitial),requestAnimationFrame(()=>{W&&(y.element.style.transform=W),y.opacityStart!==void 0&&y.opacityEnd!==void 0&&(y.element.style.opacity=String(Ae))})}},[Y,c,he,Te,Ke,Ee]),fe=p.useCallback(()=>{requestAnimationFrame(()=>{for(const f of Y)f.element.style.transition=xe})},[xe,Y]),L=p.useCallback(()=>{for(const f of Y){let d="";f.offset&&(d+="translate(0%, 0%)"),f.rotationInitial!==void 0&&(d+=` rotate(${f.rotationInitial}deg)`),f.scaleInitial!==void 0&&(d+=` scale(${f.scaleInitial})`),f.skewInitial!==void 0&&(d+=` skew(${f.skewInitial}deg, ${f.skewInitial}deg)`),f.transformInitial&&(d+=" "+f.transformInitial),requestAnimationFrame(()=>{d&&(f.element.style.transform=d),f.opacityInitial!==void 0&&(f.element.style.opacity=String(f.opacityInitial))})}},[Y]);p.useImperativeHandle(K,()=>ue.current?{...ue.current,updateWillChange:(f=!0)=>{var d;(d=ue.current)==null||d.updateWillChange(f),$(f)}}:{element:null,angle:()=>({angleX:0,angleY:0}),reset:()=>{},tilt:()=>{},updateWillChange:()=>{}},[$,U]);const P=p.useCallback(()=>{u||$()},[u,$]),ie=p.useCallback(()=>{u||$(!1)},[u,$]),Ce=p.useCallback((f,d)=>{oe(f,d)},[oe]),me=p.useCallback(()=>{L()},[L]);return p.useEffect(()=>{if(!g&&!I)return;let f;I||!g?f=[document]:f=Array.isArray(g)?g:[g];for(let d of f){const y=_t(d);y&&(d=y,d.addEventListener("mouseenter",P),d.addEventListener("mouseleave",ie),d.addEventListener("touchstart",P,{passive:!0}),d.addEventListener("touchend",ie))}return()=>{for(let d of f){const y=_t(d);y&&(d=y,d.removeEventListener("mouseenter",P),d.removeEventListener("mouseleave",ie),d.removeEventListener("touchstart",P),d.removeEventListener("touchend",ie))}}},[g,I,P,ie]),p.useEffect(()=>{var d;if(!((d=ue.current)!=null&&d.element))return;const f=[];ue.current.element.querySelectorAll(Xe).forEach(y=>{f.push(It(y,B,De,Z,c,E,M)),y.style.transition=xe}),We(f)},[xe,c,E,Xe,B,M,Me]),p.useEffect(()=>{Y.length!==0&&(L(),fe())},[fe,Y,L]),kt.jsx(Et,{ref:ue,onMouseEnter:Re?_e?f=>{P(),_e(f)}:P:_e,onTouchStart:Re?Q?f=>{P(),Q(f)}:P:Q,onMouseLeave:Re?J?f=>{ie(),J(f)}:ie:J,onTouchEnd:Re?z?f=>{ie(),z(f)}:ie:z,onTilt:F?(f,d)=>{Ce(f,d),F(f,d)}:Ce,onReset:A?()=>{me(),A()}:me,disabled:u,fullPageListening:I,controlElement:g,controlElementOnly:j,perspective:C,scale:U,shadowEnable:Ye,shadow:Se,CSSTransition:xe,spotGlareSizePercent:G,spotGlarePosition:k,tiltMaxAngleX:he,tiltMaxAngleY:Te,tiltStyle:a?Object.assign({overflow:"hidden"},Je):Je,...N,children:Me})}),dt=p.memo(Ft);dt.displayName="Parallax",He.Parallax=dt,He.default=dt,Object.defineProperties(He,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});