{"version":3,"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","getElementOffset","el","top","left","element","offsetTop","offsetLeft","offsetParent","ScrollDomElement","constructor","getHorizontalScroll","scrollLeft","getVerticalScroll","scrollTop","getMaxHorizontalScroll","scrollWidth","clientWidth","getMaxVerticalScroll","scrollHeight","clientHeight","getHorizontalElementScrollOffset","elementToScrollTo","elementToScroll","getVerticalElementScrollOffset","scrollTo","x","y","ScrollWindow","window","scrollX","document","documentElement","scrollY","Math","max","body","offsetWidth","innerWidth","offsetHeight","innerHeight","getBoundingClientRect","activeAnimations","elements","cancelMethods","add","cancelAnimation","push","remove","shouldStop","index","indexOf","splice","WINDOW_EXISTS","defaultOptions","cancelOnUserAction","easing","t","horizontalOffset","maxDuration","minDuration","speed","verticalOffset","animateScrollTo","numberOrCoordsOrElement","userOptions","scrollToElement","options","Object","assign","isWindow","isElement","nodeName","scrollBehaviorElement","scrollBehavior","getComputedStyle","getPropertyValue","console","warn","tagName","Element","contains","isSameNode","Array","isArray","length","maxHorizontalScroll","initialHorizontalScroll","horizontalDistanceToScroll","maxVerticalScroll","initialVerticalScroll","verticalDistanceToScroll","horizontalDuration","abs","round","verticalDuration","duration","requestID","removeListeners","cancelAnimationFrame","preventDefaultHandler","preventDefault","handler","eventOptions","passive","events","forEach","eventName","removeEventListener","addEventListener","startingTime","Date","now","timeDiff","horizontalScrollPosition","verticalScrollPosition","requestAnimationFrame","async","scrollContainer","targetPosition","direction","offset","EasingFunctions","easeInOutQuad","animateScrollToWrapper","positioningOffset","animateScrollToOptions","scrollContainerWidth","childOffsetLeft","firstChild","scrollContainerHeight","childOffsetTop","linear","easeInQuad","easeOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint"],"sources":["node_modules/animated-scroll-to/dist/esm/index.js","src/utils/scroll-helper.ts"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n// --------- HELPERS\nfunction getElementOffset(el) {\n let top = 0;\n let left = 0;\n let element = el;\n // Loop through the DOM tree\n // and add it's parent's offset to get page offset\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n return {\n top,\n left,\n };\n}\n// --------- SCROLL INTERFACES\n// ScrollDomElement and ScrollWindow have identical interfaces\nclass ScrollDomElement {\n constructor(element) {\n this.element = element;\n }\n getHorizontalScroll() {\n return this.element.scrollLeft;\n }\n getVerticalScroll() {\n return this.element.scrollTop;\n }\n getMaxHorizontalScroll() {\n return this.element.scrollWidth - this.element.clientWidth;\n }\n getMaxVerticalScroll() {\n return this.element.scrollHeight - this.element.clientHeight;\n }\n getHorizontalElementScrollOffset(elementToScrollTo, elementToScroll) {\n return (getElementOffset(elementToScrollTo).left -\n getElementOffset(elementToScroll).left);\n }\n getVerticalElementScrollOffset(elementToScrollTo, elementToScroll) {\n return (getElementOffset(elementToScrollTo).top -\n getElementOffset(elementToScroll).top);\n }\n scrollTo(x, y) {\n this.element.scrollLeft = x;\n this.element.scrollTop = y;\n }\n}\nclass ScrollWindow {\n constructor() {\n this.element = window;\n }\n getHorizontalScroll() {\n return window.scrollX || document.documentElement.scrollLeft;\n }\n getVerticalScroll() {\n return window.scrollY || document.documentElement.scrollTop;\n }\n getMaxHorizontalScroll() {\n return (Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.body.clientWidth, document.documentElement.clientWidth) - window.innerWidth);\n }\n getMaxVerticalScroll() {\n return (Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) - window.innerHeight);\n }\n getHorizontalElementScrollOffset(elementToScrollTo) {\n const scrollLeft = window.scrollX || document.documentElement.scrollLeft;\n return scrollLeft + elementToScrollTo.getBoundingClientRect().left;\n }\n getVerticalElementScrollOffset(elementToScrollTo) {\n const scrollTop = window.scrollY || document.documentElement.scrollTop;\n return scrollTop + elementToScrollTo.getBoundingClientRect().top;\n }\n scrollTo(x, y) {\n window.scrollTo(x, y);\n }\n}\nconst activeAnimations = {\n elements: [],\n cancelMethods: [],\n add: (element, cancelAnimation) => {\n activeAnimations.elements.push(element);\n activeAnimations.cancelMethods.push(cancelAnimation);\n },\n remove: (element, shouldStop) => {\n const index = activeAnimations.elements.indexOf(element);\n if (index > -1) {\n // Stop animation\n if (shouldStop) {\n activeAnimations.cancelMethods[index]();\n }\n // Remove it\n activeAnimations.elements.splice(index, 1);\n activeAnimations.cancelMethods.splice(index, 1);\n }\n },\n};\n// --------- CHECK IF CODE IS RUNNING IN A BROWSER\nconst WINDOW_EXISTS = typeof window !== 'undefined';\n// --------- ANIMATE SCROLL TO\nconst defaultOptions = {\n cancelOnUserAction: true,\n easing: (t) => --t * t * t + 1,\n elementToScroll: WINDOW_EXISTS ? window : null,\n horizontalOffset: 0,\n maxDuration: 3000,\n minDuration: 250,\n speed: 500,\n verticalOffset: 0,\n};\nfunction animateScrollTo(numberOrCoordsOrElement, userOptions = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n // Check for server rendering\n if (!WINDOW_EXISTS) {\n // @ts-ignore\n // If it still gets called on server, return Promise for API consistency\n return new Promise((resolve) => {\n resolve(false); // Returning false on server\n });\n }\n else if (!window.Promise) {\n throw \"Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill.\";\n }\n let x;\n let y;\n let scrollToElement;\n let options = Object.assign(Object.assign({}, defaultOptions), userOptions);\n const isWindow = options.elementToScroll === window;\n const isElement = !!options.elementToScroll.nodeName;\n if (!isWindow && !isElement) {\n throw 'Element to scroll needs to be either window or DOM element.';\n }\n // Check for \"scroll-behavior: smooth\" as it can break the animation\n // https://github.com/Stanko/animated-scroll-to/issues/55\n const scrollBehaviorElement = isWindow\n ? document.documentElement\n : options.elementToScroll;\n const scrollBehavior = getComputedStyle(scrollBehaviorElement).getPropertyValue('scroll-behavior');\n if (scrollBehavior === 'smooth') {\n console.warn(`${scrollBehaviorElement.tagName} has \"scroll-behavior: smooth\" which can mess up with animated-scroll-to's animations`);\n }\n // Select the correct scrolling interface\n const elementToScroll = isWindow\n ? new ScrollWindow()\n : new ScrollDomElement(options.elementToScroll);\n if (numberOrCoordsOrElement instanceof Element) {\n scrollToElement = numberOrCoordsOrElement;\n // If \"elementToScroll\" is not a parent of \"scrollToElement\"\n if (isElement &&\n (!options.elementToScroll.contains(scrollToElement) ||\n options.elementToScroll.isSameNode(scrollToElement))) {\n throw 'options.elementToScroll has to be a parent of scrollToElement';\n }\n x = elementToScroll.getHorizontalElementScrollOffset(scrollToElement, options.elementToScroll);\n y = elementToScroll.getVerticalElementScrollOffset(scrollToElement, options.elementToScroll);\n }\n else if (typeof numberOrCoordsOrElement === 'number') {\n x = elementToScroll.getHorizontalScroll();\n y = numberOrCoordsOrElement;\n }\n else if (Array.isArray(numberOrCoordsOrElement) &&\n numberOrCoordsOrElement.length === 2) {\n x =\n numberOrCoordsOrElement[0] === null\n ? elementToScroll.getHorizontalScroll()\n : numberOrCoordsOrElement[0];\n y =\n numberOrCoordsOrElement[1] === null\n ? elementToScroll.getVerticalScroll()\n : numberOrCoordsOrElement[1];\n }\n else {\n // ERROR\n throw ('Wrong function signature. Check documentation.\\n' +\n 'Available method signatures are:\\n' +\n ' animateScrollTo(y:number, options)\\n' +\n ' animateScrollTo([x:number | null, y:number | null], options)\\n' +\n ' animateScrollTo(scrollToElement:Element, options)');\n }\n // Add offsets\n x += options.horizontalOffset;\n y += options.verticalOffset;\n // Horizontal scroll distance\n const maxHorizontalScroll = elementToScroll.getMaxHorizontalScroll();\n const initialHorizontalScroll = elementToScroll.getHorizontalScroll();\n // If user specified scroll position is greater than maximum available scroll\n if (x > maxHorizontalScroll) {\n x = maxHorizontalScroll;\n }\n // Calculate distance to scroll\n const horizontalDistanceToScroll = x - initialHorizontalScroll;\n // Vertical scroll distance distance\n const maxVerticalScroll = elementToScroll.getMaxVerticalScroll();\n const initialVerticalScroll = elementToScroll.getVerticalScroll();\n // If user specified scroll position is greater than maximum available scroll\n if (y > maxVerticalScroll) {\n y = maxVerticalScroll;\n }\n // Calculate distance to scroll\n const verticalDistanceToScroll = y - initialVerticalScroll;\n // Calculate duration of the scroll\n const horizontalDuration = Math.abs(Math.round((horizontalDistanceToScroll / 1000) * options.speed));\n const verticalDuration = Math.abs(Math.round((verticalDistanceToScroll / 1000) * options.speed));\n let duration = horizontalDuration > verticalDuration\n ? horizontalDuration\n : verticalDuration;\n // Set minimum and maximum duration\n if (duration < options.minDuration) {\n duration = options.minDuration;\n }\n else if (duration > options.maxDuration) {\n duration = options.maxDuration;\n }\n // @ts-ignore\n return new Promise((resolve, reject) => {\n // Scroll is already in place, nothing to do\n if (horizontalDistanceToScroll === 0 && verticalDistanceToScroll === 0) {\n // Resolve promise with a boolean hasScrolledToPosition set to true\n resolve(true);\n }\n // Cancel existing animation if it is already running on the same element\n activeAnimations.remove(elementToScroll.element, true);\n // To cancel animation we have to store request animation frame ID\n let requestID;\n // Cancel animation handler\n const cancelAnimation = () => {\n removeListeners();\n cancelAnimationFrame(requestID);\n // Resolve promise with a boolean hasScrolledToPosition set to false\n resolve(false);\n };\n // Registering animation so it can be canceled if function\n // gets called again on the same element\n activeAnimations.add(elementToScroll.element, cancelAnimation);\n // Prevent user actions handler\n const preventDefaultHandler = (e) => e.preventDefault();\n const handler = options.cancelOnUserAction\n ? cancelAnimation\n : preventDefaultHandler;\n // If animation is not cancelable by the user, we can't use passive events\n const eventOptions = options.cancelOnUserAction\n ? { passive: true }\n : { passive: false };\n const events = ['wheel', 'touchstart', 'keydown', 'mousedown'];\n // Function to remove listeners after animation is finished\n const removeListeners = () => {\n events.forEach((eventName) => {\n elementToScroll.element.removeEventListener(eventName, handler, eventOptions);\n });\n };\n // Add listeners\n events.forEach((eventName) => {\n elementToScroll.element.addEventListener(eventName, handler, eventOptions);\n });\n // Animation\n const startingTime = Date.now();\n const step = () => {\n var timeDiff = Date.now() - startingTime;\n var t = timeDiff / duration;\n const horizontalScrollPosition = Math.round(initialHorizontalScroll +\n horizontalDistanceToScroll * options.easing(t));\n const verticalScrollPosition = Math.round(initialVerticalScroll + verticalDistanceToScroll * options.easing(t));\n if (timeDiff < duration &&\n (horizontalScrollPosition !== x || verticalScrollPosition !== y)) {\n // If scroll didn't reach desired position or time is not elapsed\n // Scroll to a new position\n elementToScroll.scrollTo(horizontalScrollPosition, verticalScrollPosition);\n // And request a new step\n requestID = requestAnimationFrame(step);\n }\n else {\n // If the time elapsed or we reached the desired offset\n // Set scroll to the desired offset (when rounding made it to be off a pixel or two)\n // Clear animation frame to be sure\n elementToScroll.scrollTo(x, y);\n cancelAnimationFrame(requestID);\n // Remove listeners\n removeListeners();\n // Remove animation from the active animations coordinator\n activeAnimations.remove(elementToScroll.element, false);\n // Resolve promise with a boolean hasScrolledToPosition set to true\n resolve(true);\n }\n };\n // Start animating scroll\n requestID = requestAnimationFrame(step);\n });\n });\n}\nexport default animateScrollTo;\n","import animateScrollTo from \"animated-scroll-to\";\n\ninterface IOptions {\n // If the children to be scrolled are slotted component we can't rely on the value given by element.offsetLeft\n // because it returns different values in different browsers. The offsetParent is calcualted differently for\n // slotted components (Firefox searches only in shadow DOM while Chrome searches all the DOM).\n firstChild?: HTMLElement | null;\n scrollContainer?: any; // DOM element that should be scrolled\n targetPosition?: string; // start, center, end\n direction?: string; // horizontally, vertically\n offset?: number; // positive or negative number\n maxDuration?: number; // Maximum duration of the scroll animation\n minDuration?: number; // Minimum duration of the scroll animation\n speed?: number; // Duration of the scroll per 1000px\n cancelOnUserAction?: boolean; // Indicated if scroll animation should be canceled on user action (scroll/keypress/touch)\n easing?: (t: number) => number; // easing function\n}\n\n/**\n * Function to scroll an element within its parent by using either scrollTo if available or\n * do the scroll animation manually instead.\n * @param element: target element\n * @param userOptions: can be used for overwriting default options\n */\nexport async function scrollToElement(element: HTMLElement, userOptions: IOptions): Promise {\n const defaultOptions: IOptions = {\n scrollContainer: window,\n targetPosition: \"start\",\n direction: \"vertically\",\n offset: 0,\n maxDuration: 1500,\n minDuration: 250,\n speed: 650,\n cancelOnUserAction: false,\n easing: EasingFunctions.easeInOutQuad\n };\n\n let options: IOptions = {\n ...defaultOptions,\n ...userOptions\n };\n\n return animateScrollToWrapper(element, options);\n}\n\n/**\n * Scroll function based on animateScrollTo plugin (https://github.com/Stanko/animated-scroll-to).\n */\nasync function animateScrollToWrapper(element: HTMLElement, options: IOptions): Promise {\n let positioningOffset;\n\n let animateScrollToOptions = {\n cancelOnUserAction: options.cancelOnUserAction,\n easing: options.easing,\n elementToScroll: options.scrollContainer,\n maxDuration: options.maxDuration,\n minDuration: options.minDuration,\n speed: options.speed,\n horizontalOffset: 0,\n verticalOffset: 0\n };\n\n switch (options.direction) {\n case \"horizontally\":\n let scrollContainerWidth: number;\n let childOffsetLeft = options.firstChild\n ? element.getBoundingClientRect().left - options.firstChild.getBoundingClientRect().left\n : element.offsetLeft;\n\n scrollContainerWidth =\n options.scrollContainer === window ? window.innerWidth : options.scrollContainer.offsetWidth;\n\n switch (options.targetPosition) {\n case \"center\":\n positioningOffset = element.offsetWidth / 2 - scrollContainerWidth / 2;\n animateScrollToOptions.horizontalOffset = options.offset + positioningOffset;\n return animateScrollTo([childOffsetLeft, null], animateScrollToOptions);\n case \"end\":\n positioningOffset = -(scrollContainerWidth - element.offsetWidth);\n animateScrollToOptions.horizontalOffset = options.offset + positioningOffset;\n return animateScrollTo([childOffsetLeft, null], animateScrollToOptions);\n default:\n // start\n animateScrollToOptions.horizontalOffset = options.offset;\n return animateScrollTo([childOffsetLeft, null], animateScrollToOptions);\n }\n default:\n // vertically\n let scrollContainerHeight: number;\n let childOffsetTop = options.firstChild\n ? element.getBoundingClientRect().top - options.firstChild.getBoundingClientRect().top\n : element.offsetTop;\n\n scrollContainerHeight =\n options.scrollContainer === window ? window.innerHeight : options.scrollContainer.offsetHeight;\n\n switch (options.targetPosition) {\n case \"center\":\n positioningOffset = element.offsetHeight / 2 - scrollContainerHeight / 2;\n animateScrollToOptions.verticalOffset = options.offset + positioningOffset;\n return animateScrollTo([null, childOffsetTop], animateScrollToOptions);\n case \"end\":\n positioningOffset = -(scrollContainerHeight - element.offsetHeight);\n animateScrollToOptions.verticalOffset = options.offset + positioningOffset;\n return animateScrollTo([null, childOffsetTop], animateScrollToOptions);\n default:\n // start of the DOM/Element provided\n animateScrollToOptions.verticalOffset = options.offset;\n return animateScrollTo(element, animateScrollToOptions);\n }\n }\n}\n\n/*\n * Easing Functions\n * https://gist.github.com/gre/1650294\n */\nconst EasingFunctions = {\n // no easing, no acceleration\n linear: (t) => {\n return t;\n },\n // accelerating from zero velocity\n easeInQuad: (t) => {\n return t * t;\n },\n // decelerating to zero velocity\n easeOutQuad: (t) => {\n return t * (2 - t);\n },\n // acceleration until halfway, then deceleration\n easeInOutQuad: (t) => {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n },\n // accelerating from zero velocity\n easeInCubic: (t) => {\n return t * t * t;\n },\n // decelerating to zero velocity\n easeOutCubic: (t) => {\n return --t * t * t + 1;\n },\n // acceleration until halfway, then deceleration\n easeInOutCubic: (t) => {\n return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;\n },\n // accelerating from zero velocity\n easeInQuart: (t) => {\n return t * t * t * t;\n },\n // decelerating to zero velocity\n easeOutQuart: (t) => {\n return 1 - --t * t * t * t;\n },\n // acceleration until halfway, then deceleration\n easeInOutQuart: (t) => {\n return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;\n },\n // accelerating from zero velocity\n easeInQuint: (t) => {\n return t * t * t * t * t;\n },\n // decelerating to zero velocity\n easeOutQuint: (t) => {\n return 1 + --t * t * t * t * t;\n },\n // acceleration until halfway, then deceleration\n easeInOutQuint: (t) => {\n return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;\n }\n};\n"],"mappings":"AAAA,IAAIA,EAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,EAAO,GAAI,CAC1G,OAAO,IAAKH,IAAMA,EAAIK,WAAU,SAAUD,EAASE,GAC/C,SAASC,EAAUJ,GAAS,IAAMK,EAAKP,EAAUQ,KAAKN,GAAQ,CAAG,MAAOO,GAAKJ,EAAOI,EAAG,CAAE,CACzF,SAASC,EAASR,GAAS,IAAMK,EAAKP,EAAU,SAASE,GAAQ,CAAG,MAAOO,GAAKJ,EAAOI,EAAG,CAAE,CAC5F,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOT,OAASD,EAAMU,EAAOT,OAAOW,KAAKP,EAAWI,EAAU,CAC5GH,GAAMP,EAAYA,EAAUc,MAAMjB,EAASC,GAAc,KAAKU,OACtE,GACA,EAEA,SAASO,EAAiBC,GACtB,IAAIC,EAAM,EACV,IAAIC,EAAO,EACX,IAAIC,EAAUH,EAGd,EAAG,CACCC,GAAOE,EAAQC,WAAa,EAC5BF,GAAQC,EAAQE,YAAc,EAC9BF,EAAUA,EAAQG,YAC1B,OAAaH,GACT,MAAO,CACHF,MACAC,OAER,CAGA,MAAMK,EACF,WAAAC,CAAYL,GACRvB,KAAKuB,QAAUA,CACvB,CACI,mBAAAM,GACI,OAAO7B,KAAKuB,QAAQO,UAC5B,CACI,iBAAA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