"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react"),useWindowSize=require("./useWindowSize.js"),helpers=require("../common/helpers.js");const useTranslateValue=({containerBoundingClientRect:e,backgroundBoundingClientRect:t,speed:s=1})=>{let[r,a]=React.useState(0),[u,l]=React.useState(0),{height:i}=useWindowSize.default();return React.useEffect(()=>{t&&e&&a(t.height-e.height)},[e,t]),React.useEffect(()=>{if(!e||!t||!i)return;let a=helpers.getPercentageVisible(t,i),u=a/100*r-r/2;l(-(u*s*1))},[r,i,e,t,s]),{translateValue:u}};exports.default=useTranslateValue,exports.useTranslateValue=useTranslateValue;
