{"version":3,"sources":["webpack://@verndale/toolkit/./node_modules/body-scroll-lock/lib/bodyScrollLock.esm.js","webpack://@verndale/toolkit/./node_modules/seamless-scroll-polyfill/lib/common.js","webpack://@verndale/toolkit/./node_modules/seamless-scroll-polyfill/lib/scroll-end-event.js","webpack://@verndale/toolkit/./node_modules/seamless-scroll-polyfill/lib/scroll-step.js","webpack://@verndale/toolkit/./node_modules/seamless-scroll-polyfill/lib/scroll.js","webpack://@verndale/toolkit/./node_modules/seamless-scroll-polyfill/lib/scrollIntoView.js"],"names":[],"mappings":"gNAAA,WAA4B,EAAK,CAAE,GAAI,MAAM,QAAQ,GAAM,CAAE,OAAS,GAAI,EAAG,EAAO,MAAM,EAAI,QAAS,EAAI,EAAI,OAAQ,IAAO,EAAK,GAAK,EAAI,GAAM,MAAO,OAAe,OAAO,OAAM,KAAK,GAO1L,GAAI,GAAmB,GACvB,GAAI,MAAO,SAAW,YAAa,CACjC,GAAI,GAAqB,IACnB,UAAU,CACZ,EAAmB,KAIvB,OAAO,iBAAiB,cAAe,KAAM,GAC7C,OAAO,oBAAoB,cAAe,KAAM,GAGlD,GAAI,GAAc,MAAO,SAAW,aAAe,OAAO,WAAa,OAAO,UAAU,UAAa,kBAAiB,KAAK,OAAO,UAAU,WAAa,OAAO,UAAU,WAAa,YAAc,OAAO,UAAU,eAAiB,GAGnO,EAAQ,GACR,EAAwB,GACxB,EAAiB,GACjB,EAA8B,OAC9B,EAAuB,OACvB,EAA2B,OAG3B,EAAiB,SAAwB,EAAI,CAC/C,MAAO,GAAM,KAAK,SAAU,EAAM,CAChC,MAAI,KAAK,QAAQ,gBAAkB,EAAK,QAAQ,eAAe,OAQ/D,EAAiB,SAAwB,EAAU,CACrD,GAAI,GAAI,GAAY,OAAO,MAW3B,MALI,GAAe,EAAE,SAKjB,EAAE,QAAQ,OAAS,EAAU,GAE7B,GAAE,gBAAgB,EAAE,iBAEjB,KAGL,EAAoB,SAA2B,EAAS,CAE1D,GAAI,IAA6B,OAAW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,EAAc,EAAS,EAAK,GAAU,EAAc,EAAS,EAAU,GACtG,EAAQ,GAAY,GACpB,EAAM,GAAO,CAAC,EAAM,YAAc,EAAM,YAAc,EAAM,WAAY,CAAC,EAAM,YAC/E,EAAM,GAAO,CAAC,EAAM,WAAY,EAAM,YAAc,EAAM,YAAc,EAAM,YAC9E,EAAQ,EAAM,GAAO,CAAC,EAAM,UAAW,EAAM,aAAe,EAAM,aAAe,EAAM,WAC7F,EAAQ,KAAK,CACT,EACA,CAAE,KAAM,EAAM,WAAa,EAAO,IAAK,EAAM,UAAY,EAAO,SAAU,EAAQ,YAEtF,EAAM,KAAK,IAAI,EAAM,EAAO,GAC5B,EAAQ,KAAK,IAAI,EAAQ,EAAO,GAChC,EAAS,KAAK,IAAI,EAAS,EAAO,GAClC,EAAO,KAAK,IAAI,EAAO,EAAO,GAElC,MAAO,IAEE,GAAiB,CAAC,EAAS,EAAuB,IAAW,CACtE,KAAM,GAAU,GAAyB,GACzC,GAAI,CAAC,EAAc,EAAQ,UACvB,KAAM,IAAI,WAAU,EAA8B,iBAAkB,UAAW,EAAQ,WAG3F,GADsC,EAAS,GACvC,QAAQ,CAAC,CAAC,EAAO,KAAqB,CAC1C,EAAc,EAAO,EAAiB,MAGjC,GAAwB","file":"scripts/1269.e7972e20fb9d6d0d64b8.js","sourcesContent":["function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n// Older browsers don't support event options, feature detect it.\n\n// Adopted and modified solution from Bohdan Didukh (2017)\n// https://stackoverflow.com/questions/41594997/ios-10-safari-prevent-scrolling-behind-a-fixed-overlay-and-maintain-scroll-posi\n\nvar hasPassiveEvents = false;\nif (typeof window !== 'undefined') {\n var passiveTestOptions = {\n get passive() {\n hasPassiveEvents = true;\n return undefined;\n }\n };\n window.addEventListener('testPassive', null, passiveTestOptions);\n window.removeEventListener('testPassive', null, passiveTestOptions);\n}\n\nvar isIosDevice = typeof window !== 'undefined' && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === 'MacIntel' && window.navigator.maxTouchPoints > 1);\n\n\nvar locks = [];\nvar documentListenerAdded = false;\nvar initialClientY = -1;\nvar previousBodyOverflowSetting = void 0;\nvar previousBodyPosition = void 0;\nvar previousBodyPaddingRight = void 0;\n\n// returns true if `el` should be allowed to receive touchmove events.\nvar allowTouchMove = function allowTouchMove(el) {\n return locks.some(function (lock) {\n if (lock.options.allowTouchMove && lock.options.allowTouchMove(el)) {\n return true;\n }\n\n return false;\n });\n};\n\nvar preventDefault = function preventDefault(rawEvent) {\n var e = rawEvent || window.event;\n\n // For the case whereby consumers adds a touchmove event listener to document.\n // Recall that we do document.addEventListener('touchmove', preventDefault, { passive: false })\n // in disableBodyScroll - so if we provide this opportunity to allowTouchMove, then\n // the touchmove event on document will break.\n if (allowTouchMove(e.target)) {\n return true;\n }\n\n // Do not prevent if the event has more than one touch (usually meaning this is a multi touch gesture like pinch to zoom).\n if (e.touches.length > 1) return true;\n\n if (e.preventDefault) e.preventDefault();\n\n return false;\n};\n\nvar setOverflowHidden = function setOverflowHidden(options) {\n // If previousBodyPaddingRight is already set, don't set it again.\n if (previousBodyPaddingRight === undefined) {\n var _reserveScrollBarGap = !!options && options.reserveScrollBarGap === true;\n var scrollBarGap = window.innerWidth - document.documentElement.clientWidth;\n\n if (_reserveScrollBarGap && scrollBarGap > 0) {\n var computedBodyPaddingRight = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right'), 10);\n previousBodyPaddingRight = document.body.style.paddingRight;\n document.body.style.paddingRight = computedBodyPaddingRight + scrollBarGap + 'px';\n }\n }\n\n // If previousBodyOverflowSetting is already set, don't set it again.\n if (previousBodyOverflowSetting === undefined) {\n previousBodyOverflowSetting = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n};\n\nvar restoreOverflowSetting = function restoreOverflowSetting() {\n if (previousBodyPaddingRight !== undefined) {\n document.body.style.paddingRight = previousBodyPaddingRight;\n\n // Restore previousBodyPaddingRight to undefined so setOverflowHidden knows it\n // can be set again.\n previousBodyPaddingRight = undefined;\n }\n\n if (previousBodyOverflowSetting !== undefined) {\n document.body.style.overflow = previousBodyOverflowSetting;\n\n // Restore previousBodyOverflowSetting to undefined\n // so setOverflowHidden knows it can be set again.\n previousBodyOverflowSetting = undefined;\n }\n};\n\nvar setPositionFixed = function setPositionFixed() {\n return window.requestAnimationFrame(function () {\n // If previousBodyPosition is already set, don't set it again.\n if (previousBodyPosition === undefined) {\n previousBodyPosition = {\n position: document.body.style.position,\n top: document.body.style.top,\n left: document.body.style.left\n };\n\n // Update the dom inside an animation frame \n var _window = window,\n scrollY = _window.scrollY,\n scrollX = _window.scrollX,\n innerHeight = _window.innerHeight;\n\n document.body.style.position = 'fixed';\n document.body.style.top = -scrollY;\n document.body.style.left = -scrollX;\n\n setTimeout(function () {\n return window.requestAnimationFrame(function () {\n // Attempt to check if the bottom bar appeared due to the position change\n var bottomBarHeight = innerHeight - window.innerHeight;\n if (bottomBarHeight && scrollY >= innerHeight) {\n // Move the content further up so that the bottom bar doesn't hide it\n document.body.style.top = -(scrollY + bottomBarHeight);\n }\n });\n }, 300);\n }\n });\n};\n\nvar restorePositionSetting = function restorePositionSetting() {\n if (previousBodyPosition !== undefined) {\n // Convert the position from \"px\" to Int\n var y = -parseInt(document.body.style.top, 10);\n var x = -parseInt(document.body.style.left, 10);\n\n // Restore styles\n document.body.style.position = previousBodyPosition.position;\n document.body.style.top = previousBodyPosition.top;\n document.body.style.left = previousBodyPosition.left;\n\n // Restore scroll\n window.scrollTo(x, y);\n\n previousBodyPosition = undefined;\n }\n};\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#Problems_and_solutions\nvar isTargetElementTotallyScrolled = function isTargetElementTotallyScrolled(targetElement) {\n return targetElement ? targetElement.scrollHeight - targetElement.scrollTop <= targetElement.clientHeight : false;\n};\n\nvar handleScroll = function handleScroll(event, targetElement) {\n var clientY = event.targetTouches[0].clientY - initialClientY;\n\n if (allowTouchMove(event.target)) {\n return false;\n }\n\n if (targetElement && targetElement.scrollTop === 0 && clientY > 0) {\n // element is at the top of its scroll.\n return preventDefault(event);\n }\n\n if (isTargetElementTotallyScrolled(targetElement) && clientY < 0) {\n // element is at the bottom of its scroll.\n return preventDefault(event);\n }\n\n event.stopPropagation();\n return true;\n};\n\nexport var disableBodyScroll = function disableBodyScroll(targetElement, options) {\n // targetElement must be provided\n if (!targetElement) {\n // eslint-disable-next-line no-console\n console.error('disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.');\n return;\n }\n\n // disableBodyScroll must not have been called on this targetElement before\n if (locks.some(function (lock) {\n return lock.targetElement === targetElement;\n })) {\n return;\n }\n\n var lock = {\n targetElement: targetElement,\n options: options || {}\n };\n\n locks = [].concat(_toConsumableArray(locks), [lock]);\n\n if (isIosDevice) {\n setPositionFixed();\n } else {\n setOverflowHidden(options);\n }\n\n if (isIosDevice) {\n targetElement.ontouchstart = function (event) {\n if (event.targetTouches.length === 1) {\n // detect single touch.\n initialClientY = event.targetTouches[0].clientY;\n }\n };\n targetElement.ontouchmove = function (event) {\n if (event.targetTouches.length === 1) {\n // detect single touch.\n handleScroll(event, targetElement);\n }\n };\n\n if (!documentListenerAdded) {\n document.addEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);\n documentListenerAdded = true;\n }\n }\n};\n\nexport var clearAllBodyScrollLocks = function clearAllBodyScrollLocks() {\n if (isIosDevice) {\n // Clear all locks ontouchstart/ontouchmove handlers, and the references.\n locks.forEach(function (lock) {\n lock.targetElement.ontouchstart = null;\n lock.targetElement.ontouchmove = null;\n });\n\n if (documentListenerAdded) {\n document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);\n documentListenerAdded = false;\n }\n\n // Reset initial clientY.\n initialClientY = -1;\n }\n\n if (isIosDevice) {\n restorePositionSetting();\n } else {\n restoreOverflowSetting();\n }\n\n locks = [];\n};\n\nexport var enableBodyScroll = function enableBodyScroll(targetElement) {\n if (!targetElement) {\n // eslint-disable-next-line no-console\n console.error('enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.');\n return;\n }\n\n locks = locks.filter(function (lock) {\n return lock.targetElement !== targetElement;\n });\n\n if (isIosDevice) {\n targetElement.ontouchstart = null;\n targetElement.ontouchmove = null;\n\n if (documentListenerAdded && locks.length === 0) {\n document.removeEventListener('touchmove', preventDefault, hasPassiveEvents ? { passive: false } : undefined);\n documentListenerAdded = false;\n }\n }\n\n if (isIosDevice) {\n restorePositionSetting();\n } else {\n restoreOverflowSetting();\n }\n};\n\n","export const checkBehavior = (behavior) => {\n return behavior === undefined || behavior === \"auto\" || behavior === \"instant\" || behavior === \"smooth\";\n};\nexport function elementScrollXY(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n}\nexport const failedExecute = (method, object, reason = \"cannot convert to dictionary.\") => `Failed to execute '${method}' on '${object}': ${reason}`;\nexport const failedExecuteInvalidEnumValue = (method, object, value) => failedExecute(method, object, `The provided value '${value}' is not a valid enum value of type ScrollBehavior.`);\n/* eslint-disable */\nexport const backupMethod = (proto, method, fallback) => {\n var _a;\n const backup = `__SEAMLESS.BACKUP$${method}`;\n if (!proto[backup] && proto[method] && !((_a = proto[method]) === null || _a === void 0 ? void 0 : _a.__isPolyfill)) {\n proto[backup] = proto[method];\n }\n return proto[backup] || fallback;\n};\n/* eslint-enable */\nexport const isObject = (value) => {\n const type = typeof value;\n return value !== null && (type === \"object\" || type === \"function\");\n};\nexport const isScrollBehaviorSupported = (config) => \"scrollBehavior\" in window.document.documentElement.style && (config === null || config === void 0 ? void 0 : config.forcePolyfill) !== true;\nexport const markPolyfill = (method) => {\n Object.defineProperty(method, \"__isPolyfill\", { value: true });\n};\nexport const modifyPrototypes = (prop, func) => {\n markPolyfill(func);\n [HTMLElement.prototype, SVGElement.prototype, Element.prototype].forEach((prototype) => {\n backupMethod(prototype, prop);\n prototype[prop] = func;\n });\n};\n/**\n * - On Chrome and Firefox, document.scrollingElement will return the element.\n * - Safari, document.scrollingElement will return the element.\n * - On Edge, document.scrollingElement will return the element.\n * - IE11 does not support document.scrollingElement, but you can assume its .\n */\nexport const scrollingElement = (element) => element.ownerDocument.scrollingElement || element.ownerDocument.documentElement;\n//# sourceMappingURL=common.js.map","export function scrollEndEvent(bubbles) {\n if (typeof Event === \"function\") {\n return new Event(\"scrollend\", {\n bubbles,\n cancelable: false,\n });\n }\n const event = document.createEvent(\"Event\");\n event.initEvent(\"scrollend\", bubbles, false);\n return event;\n}\n//# sourceMappingURL=scroll-end-event.js.map","const ease = (k) => {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n};\n/* eslint-disable */\nexport function now() {\n var _a;\n let fn;\n if ((_a = window.performance) === null || _a === void 0 ? void 0 : _a.now) {\n fn = () => window.performance.now();\n }\n else {\n fn = () => window.Date.now();\n }\n // @ts-ignore\n now = fn;\n return fn();\n}\n/* eslint-enable */\nconst DURATION = 500;\nexport const step = (context) => {\n const currentTime = now();\n const elapsed = (currentTime - context.timeStamp) / (context.duration || DURATION);\n if (elapsed > 1) {\n context.method(context.targetX, context.targetY);\n context.callback();\n return;\n }\n const value = (context.timingFunc || ease)(elapsed);\n const currentX = context.startX + (context.targetX - context.startX) * value;\n const currentY = context.startY + (context.targetY - context.startY) * value;\n context.method(currentX, currentY);\n context.rafId = window.requestAnimationFrame(() => {\n step(context);\n });\n};\n//# sourceMappingURL=scroll-step.js.map","import { backupMethod, checkBehavior, elementScrollXY, failedExecute, failedExecuteInvalidEnumValue, isObject, scrollingElement, } from \"./common.js\";\nimport { scrollEndEvent } from \"./scroll-end-event.js\";\nimport { now, step } from \"./scroll-step.js\";\n// https://drafts.csswg.org/cssom-view/#normalize-non-finite-values\nconst nonFinite = (value) => {\n if (!isFinite(value)) {\n return 0;\n }\n return Number(value);\n};\nconst isConnected = (node) => {\n var _a;\n return ((_a = node.isConnected) !== null && _a !== void 0 ? _a : (!node.ownerDocument ||\n // eslint-disable-next-line no-bitwise\n !(node.ownerDocument.compareDocumentPosition(node) & /** DOCUMENT_POSITION_DISCONNECTED */ 1)));\n};\nconst scrollWithOptions = (element, options, config) => {\n var _a, _b;\n if (!isConnected(element)) {\n return;\n }\n const startX = element.scrollLeft;\n const startY = element.scrollTop;\n const targetX = nonFinite((_a = options.left) !== null && _a !== void 0 ? _a : startX);\n const targetY = nonFinite((_b = options.top) !== null && _b !== void 0 ? _b : startY);\n if (targetX === startX && targetY === startY) {\n return;\n }\n const fallback = backupMethod(HTMLElement.prototype, \"scroll\", elementScrollXY);\n const method = backupMethod(Object.getPrototypeOf(element), \"scroll\", fallback).bind(element);\n if (options.behavior !== \"smooth\") {\n method(targetX, targetY);\n return;\n }\n const removeEventListener = () => {\n window.removeEventListener(\"wheel\", cancelScroll);\n window.removeEventListener(\"touchmove\", cancelScroll);\n };\n const callback = () => {\n removeEventListener();\n const isDocument = element.nodeType === /** Node.DOCUMENT_NODE */ 9;\n element.dispatchEvent(scrollEndEvent(isDocument));\n };\n const context = Object.assign(Object.assign({}, config), { timeStamp: now(), startX,\n startY,\n targetX,\n targetY, rafId: 0, method,\n callback });\n const cancelScroll = () => {\n window.cancelAnimationFrame(context.rafId);\n removeEventListener();\n };\n window.addEventListener(\"wheel\", cancelScroll, {\n passive: true,\n once: true,\n });\n window.addEventListener(\"touchmove\", cancelScroll, {\n passive: true,\n once: true,\n });\n step(context);\n};\nconst isWindow = (obj) => obj.window === obj;\nconst createScroll = (scrollName) => (target, scrollOptions, config) => {\n const [element, scrollType] = isWindow(target)\n ? [scrollingElement(target.document.documentElement), \"Window\"]\n : [target, \"Element\"];\n const options = scrollOptions !== null && scrollOptions !== void 0 ? scrollOptions : {};\n if (!isObject(options)) {\n throw new TypeError(failedExecute(scrollName, scrollType));\n }\n if (!checkBehavior(options.behavior)) {\n throw new TypeError(failedExecuteInvalidEnumValue(scrollName, scrollType, options.behavior));\n }\n if (scrollName === \"scrollBy\") {\n options.left = nonFinite(options.left) + element.scrollLeft;\n options.top = nonFinite(options.top) + element.scrollTop;\n }\n scrollWithOptions(element, options, config);\n};\nexport const scroll = /* #__PURE__ */ createScroll(\"scroll\");\nexport const scrollTo = /* #__PURE__ */ createScroll(\"scrollTo\");\nexport const scrollBy = /* #__PURE__ */ createScroll(\"scrollBy\");\nexport const elementScroll = scroll;\nexport const elementScrollTo = scrollTo;\nexport const elementScrollBy = scrollBy;\nexport const windowScroll = scroll;\nexport const windowScrollTo = scrollTo;\nexport const windowScrollBy = scrollBy;\n//# sourceMappingURL=scroll.js.map","/* eslint-disable no-bitwise */\nimport { checkBehavior, failedExecuteInvalidEnumValue, scrollingElement } from \"./common.js\";\nimport { elementScroll } from \"./scroll.js\";\n// https://drafts.csswg.org/css-writing-modes-4/#block-flow\nconst normalizeWritingMode = (writingMode) => {\n switch (writingMode) {\n case \"horizontal-tb\":\n case \"lr\":\n case \"lr-tb\":\n case \"rl\":\n case \"rl-tb\":\n return 0 /* WritingMode.HorizontalTb */;\n case \"vertical-rl\":\n case \"tb\":\n case \"tb-rl\":\n return 1 /* WritingMode.VerticalRl */;\n case \"vertical-lr\":\n case \"tb-lr\":\n return 2 /* WritingMode.VerticalLr */;\n case \"sideways-rl\":\n return 3 /* WritingMode.SidewaysRl */;\n case \"sideways-lr\":\n return 4 /* WritingMode.SidewaysLr */;\n }\n return 0 /* WritingMode.HorizontalTb */;\n};\nconst calcPhysicalAxis = (writingMode, isLTR, hPos, vPos) => {\n /** 0b{vertical}{horizontal} 0: normal, 1: reverse */\n let layout = 0b00;\n /**\n * WritingMode.VerticalLr: ↓→\n * | 1 | 4 | |\n * | 2 | 5 | |\n * | 3 | | |\n *\n * RTL: ↑→\n * | 3 | | |\n * | 2 | 5 | |\n * | 1 | 4 | |\n */\n if (!isLTR) {\n layout ^= 2 /* OP.ReverseVertical */;\n }\n switch (writingMode) {\n /**\n * ↓→\n * | 1 | 2 | 3 |\n * | 4 | 5 | |\n * | | | |\n *\n * RTL: ↓←\n * | 3 | 2 | 1 |\n * | | 5 | 4 |\n * | | | |\n */\n case 0 /* WritingMode.HorizontalTb */:\n // swap horizontal and vertical\n layout = (layout >> 1) | ((layout & 1) << 1);\n [hPos, vPos] = [vPos, hPos];\n break;\n /**\n * ↓←\n * | | 4 | 1 |\n * | | 5 | 2 |\n * | | | 3 |\n *\n * RTL: ↑←\n * | | | 3 |\n * | | 5 | 2 |\n * | | 4 | 1 |\n */\n case 1 /* WritingMode.VerticalRl */:\n case 3 /* WritingMode.SidewaysRl */:\n // reverse horizontal\n layout ^= 1 /* OP.ReverseHorizontal */;\n break;\n /**\n * ↑→\n * | 3 | | |\n * | 2 | 5 | |\n * | 1 | 4 | |\n *\n * RTL: ↓→\n * | 1 | 4 | |\n * | 2 | 5 | |\n * | 3 | | |\n */\n case 4 /* WritingMode.SidewaysLr */:\n // reverse vertical\n layout ^= 2 /* OP.ReverseVertical */;\n break;\n }\n return [layout, hPos, vPos];\n};\nconst isXReversed = (computedStyle) => {\n const layout = calcPhysicalAxis(normalizeWritingMode(computedStyle.writingMode), computedStyle.direction !== \"rtl\", undefined, undefined)[0];\n return (layout & 1) === 1;\n};\n// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/element.cc;l=1097-1189;drc=6a7533d4a1e9f2372223a9d912a9e53a6fa35ae0\nconst toPhysicalAlignment = (options, writingMode, isLTR) => {\n const [layout, hPos, vPos] = calcPhysicalAxis(writingMode, isLTR, options.block || \"start\", options.inline || \"nearest\");\n return [hPos, vPos].map((value, index) => {\n switch (value) {\n case \"center\":\n return 1 /* ScrollAlignment.CenterAlways */;\n case \"nearest\":\n return 0 /* ScrollAlignment.ToEdgeIfNeeded */;\n default: {\n const reverse = (layout >> index) & 1;\n return (value === \"start\") === !reverse ? 2 /* ScrollAlignment.LeftOrTop */ : 3 /* ScrollAlignment.RightOrBottom */;\n }\n }\n });\n};\n// code from stipsan/compute-scroll-into-view\n// https://github.com/stipsan/compute-scroll-into-view/blob/5396c6b78af5d0bbce11a7c4e93cc3146546fcd3/src/index.ts\n/**\n * Find out which edge to align against when logical scroll position is \"nearest\"\n * Interesting fact: \"nearest\" works similarily to \"if-needed\", if the element is fully visible it will not scroll it\n *\n * Legends:\n * ┌────────┐ ┏ ━ ━ ━ ┓\n * │ target │ frame\n * └────────┘ ┗ ━ ━ ━ ┛\n */\nconst mapNearest = (align, scrollingEdgeStart, scrollingEdgeEnd, scrollingSize, elementEdgeStart, elementEdgeEnd, elementSize) => {\n if (align !== 0 /* ScrollAlignment.ToEdgeIfNeeded */) {\n return align;\n }\n /**\n * If element edge A and element edge B are both outside scrolling box edge A and scrolling box edge B\n *\n * ┌──┐\n * ┏━│━━│━┓\n * │ │\n * ┃ │ │ ┃ do nothing\n * │ │\n * ┗━│━━│━┛\n * └──┘\n *\n * If element edge C and element edge D are both outside scrolling box edge C and scrolling box edge D\n *\n * ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐\n * │┃ ┃│ do nothing\n * └───────────┘\n * ┗ ━ ━ ━ ━ ┛\n */\n if ((elementEdgeStart < scrollingEdgeStart && elementEdgeEnd > scrollingEdgeEnd) ||\n (elementEdgeStart > scrollingEdgeStart && elementEdgeEnd < scrollingEdgeEnd)) {\n return null;\n }\n /**\n * If element edge A is outside scrolling box edge A and element height is less than scrolling box height\n *\n * ┌──┐\n * ┏━│━━│━┓ ┏━┌━━┐━┓\n * └──┘ │ │\n * from ┃ ┃ to ┃ └──┘ ┃\n *\n * ┗━ ━━ ━┛ ┗━ ━━ ━┛\n *\n * If element edge B is outside scrolling box edge B and element height is greater than scrolling box height\n *\n * ┏━ ━━ ━┓ ┏━┌━━┐━┓\n * │ │\n * from ┃ ┌──┐ ┃ to ┃ │ │ ┃\n * │ │ │ │\n * ┗━│━━│━┛ ┗━│━━│━┛\n * │ │ └──┘\n * │ │\n * └──┘\n *\n * If element edge C is outside scrolling box edge C and element width is less than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───┐ ┌───┐\n * │ ┃ │ ┃ ┃ │ ┃\n * └───┘ └───┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n * If element edge D is outside scrolling box edge D and element width is greater than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐ ┌───────────┐\n * ┃ │ ┃ │ ┃ ┃ │\n * └───────────┘ └───────────┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n */\n if ((elementEdgeStart <= scrollingEdgeStart && elementSize <= scrollingSize) ||\n (elementEdgeEnd >= scrollingEdgeEnd && elementSize >= scrollingSize)) {\n return 2 /* ScrollAlignment.LeftOrTop */;\n }\n /**\n * If element edge B is outside scrolling box edge B and element height is less than scrolling box height\n *\n * ┏━ ━━ ━┓ ┏━ ━━ ━┓\n *\n * from ┃ ┃ to ┃ ┌──┐ ┃\n * ┌──┐ │ │\n * ┗━│━━│━┛ ┗━└━━┘━┛\n * └──┘\n *\n * If element edge A is outside scrolling box edge A and element height is greater than scrolling box height\n *\n * ┌──┐\n * │ │\n * │ │ ┌──┐\n * ┏━│━━│━┓ ┏━│━━│━┓\n * │ │ │ │\n * from ┃ └──┘ ┃ to ┃ │ │ ┃\n * │ │\n * ┗━ ━━ ━┛ ┗━└━━┘━┛\n *\n * If element edge C is outside scrolling box edge C and element width is greater than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───────────┐ ┌───────────┐\n * │ ┃ │ ┃ │ ┃ ┃\n * └───────────┘ └───────────┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n * If element edge D is outside scrolling box edge D and element width is less than scrolling box width\n *\n * from to\n * ┏ ━ ━ ━ ━ ┓ ┏ ━ ━ ━ ━ ┓\n * ┌───┐ ┌───┐\n * ┃ │ ┃ │ ┃ │ ┃\n * └───┘ └───┘\n * ┗ ━ ━ ━ ━ ┛ ┗ ━ ━ ━ ━ ┛\n *\n */\n if ((elementEdgeEnd > scrollingEdgeEnd && elementSize < scrollingSize) ||\n (elementEdgeStart < scrollingEdgeStart && elementSize > scrollingSize)) {\n return 3 /* ScrollAlignment.RightOrBottom */;\n }\n return null;\n};\nconst canOverflow = (overflow) => {\n return overflow !== \"visible\" && overflow !== \"clip\";\n};\nconst getFrameElement = (element) => {\n var _a;\n try {\n return ((_a = element.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement) || null;\n }\n catch (_b) {\n return null;\n }\n};\nconst isScrollable = (element, computedStyle) => {\n if (element.clientHeight < element.scrollHeight || element.clientWidth < element.scrollWidth) {\n return (canOverflow(computedStyle.overflowY) ||\n canOverflow(computedStyle.overflowX) ||\n element === scrollingElement(element));\n }\n return false;\n};\nconst parentElement = (element) => {\n const pNode = element.parentNode;\n const pElement = element.parentElement;\n if (pElement === null && pNode !== null) {\n if (pNode.nodeType === /** Node.DOCUMENT_FRAGMENT_NODE */ 11) {\n return pNode.host;\n }\n if (pNode.nodeType === /** Node.DOCUMENT_NODE */ 9) {\n return getFrameElement(element);\n }\n }\n return pElement;\n};\nconst clamp = (value, min, max) => {\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n};\nconst getSupportedScrollMarginProperty = (ownerDocument) => {\n // Webkit uses \"scroll-snap-margin\" https://bugs.webkit.org/show_bug.cgi?id=189265.\n return [\"scroll-margin\", \"scroll-snap-margin\"].filter((property) => property in ownerDocument.documentElement.style)[0];\n};\nconst getElementScrollSnapArea = (element, elementRect, computedStyle) => {\n const { top, right, bottom, left } = elementRect;\n const scrollProperty = getSupportedScrollMarginProperty(element.ownerDocument);\n if (!scrollProperty) {\n return [top, right, bottom, left];\n }\n const scrollMarginValue = (edge) => {\n const value = computedStyle.getPropertyValue(`${scrollProperty}-${edge}`);\n return parseInt(value, 10) || 0;\n };\n return [\n top - scrollMarginValue(\"top\"),\n right + scrollMarginValue(\"right\"),\n bottom + scrollMarginValue(\"bottom\"),\n left - scrollMarginValue(\"left\"),\n ];\n};\nconst calcAlignEdge = (align, start, end) => {\n switch (align) {\n case 1 /* ScrollAlignment.CenterAlways */:\n return (start + end) / 2;\n case 3 /* ScrollAlignment.RightOrBottom */:\n return end;\n case 2 /* ScrollAlignment.LeftOrTop */:\n case 0 /* ScrollAlignment.ToEdgeIfNeeded */:\n return start;\n }\n};\nconst getFrameViewport = (frame, frameRect) => {\n var _a, _b, _c;\n const visualViewport = (_a = frame.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.visualViewport;\n const [x, y, width, height] = frame === scrollingElement(frame)\n ? [0, 0, (_b = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.width) !== null && _b !== void 0 ? _b : frame.clientWidth, (_c = visualViewport === null || visualViewport === void 0 ? void 0 : visualViewport.height) !== null && _c !== void 0 ? _c : frame.clientHeight]\n : [frameRect.left, frameRect.top, frame.clientWidth, frame.clientHeight];\n const left = x + frame.clientLeft;\n const top = y + frame.clientTop;\n const right = left + width;\n const bottom = top + height;\n return [top, right, bottom, left];\n};\nconst computeScrollIntoView = (element, options) => {\n // Collect all the scrolling boxes, as defined in the spec: https://drafts.csswg.org/cssom-view/#scrolling-box\n const actions = [];\n let ownerDocument = element.ownerDocument;\n let ownerWindow = ownerDocument.defaultView;\n if (!ownerWindow) {\n return actions;\n }\n const computedStyle = window.getComputedStyle(element);\n const isLTR = computedStyle.direction !== \"rtl\";\n const writingMode = normalizeWritingMode(computedStyle.writingMode ||\n computedStyle.getPropertyValue(\"-webkit-writing-mode\") ||\n computedStyle.getPropertyValue(\"-ms-writing-mode\"));\n const [alignH, alignV] = toPhysicalAlignment(options, writingMode, isLTR);\n let [top, right, bottom, left] = getElementScrollSnapArea(element, element.getBoundingClientRect(), computedStyle);\n for (let frame = parentElement(element); frame !== null; frame = parentElement(frame)) {\n if (ownerDocument !== frame.ownerDocument) {\n ownerDocument = frame.ownerDocument;\n ownerWindow = ownerDocument.defaultView;\n if (!ownerWindow) {\n break;\n }\n const { left: dX, top: dY } = frame.getBoundingClientRect();\n top += dY;\n right += dX;\n bottom += dY;\n left += dX;\n }\n const frameStyle = ownerWindow.getComputedStyle(frame);\n if (frameStyle.position === \"fixed\") {\n break;\n }\n if (!isScrollable(frame, frameStyle)) {\n continue;\n }\n const frameRect = frame.getBoundingClientRect();\n const [frameTop, frameRight, frameBottom, frameLeft] = getFrameViewport(frame, frameRect);\n const eAlignH = mapNearest(alignH, frameLeft, frameRight, frame.clientWidth, left, right, right - left);\n const eAlignV = mapNearest(alignV, frameTop, frameBottom, frame.clientHeight, top, bottom, bottom - top);\n const diffX = eAlignH === null ? 0 : calcAlignEdge(eAlignH, left, right) - calcAlignEdge(eAlignH, frameLeft, frameRight);\n const diffY = eAlignV === null ? 0 : calcAlignEdge(eAlignV, top, bottom) - calcAlignEdge(eAlignV, frameTop, frameBottom);\n const moveX = isXReversed(frameStyle)\n ? clamp(diffX, -frame.scrollWidth + frame.clientWidth - frame.scrollLeft, -frame.scrollLeft)\n : clamp(diffX, -frame.scrollLeft, frame.scrollWidth - frame.clientWidth - frame.scrollLeft);\n const moveY = clamp(diffY, -frame.scrollTop, frame.scrollHeight - frame.clientHeight - frame.scrollTop);\n actions.push([\n frame,\n { left: frame.scrollLeft + moveX, top: frame.scrollTop + moveY, behavior: options.behavior },\n ]);\n top = Math.max(top - moveY, frameTop);\n right = Math.min(right - moveX, frameRight);\n bottom = Math.min(bottom - moveY, frameBottom);\n left = Math.max(left - moveX, frameLeft);\n }\n return actions;\n};\nexport const scrollIntoView = (element, scrollIntoViewOptions, config) => {\n const options = scrollIntoViewOptions || {};\n if (!checkBehavior(options.behavior)) {\n throw new TypeError(failedExecuteInvalidEnumValue(\"scrollIntoView\", \"Element\", options.behavior));\n }\n const actions = computeScrollIntoView(element, options);\n actions.forEach(([frame, scrollToOptions]) => {\n elementScroll(frame, scrollToOptions, config);\n });\n};\nexport const elementScrollIntoView = scrollIntoView;\n//# sourceMappingURL=scrollIntoView.js.map"],"sourceRoot":""}