{ "version": 3, "sources": ["../../../javascript/entrypoints/warp/product-images-carousel.tsx", "../../../javascript/warp/components/pdp/ProductImages/Carousel.tsx", "../../../../node_modules/embla-carousel-reactive-utils/src/components/utils.ts", "../../../../node_modules/embla-carousel/src/components/utils.ts", "../../../../node_modules/embla-carousel/src/components/Alignment.ts", "../../../../node_modules/embla-carousel/src/components/EventStore.ts", "../../../../node_modules/embla-carousel/src/components/Animations.ts", "../../../../node_modules/embla-carousel/src/components/Axis.ts", "../../../../node_modules/embla-carousel/src/components/Limit.ts", "../../../../node_modules/embla-carousel/src/components/Counter.ts", "../../../../node_modules/embla-carousel/src/components/DragHandler.ts", "../../../../node_modules/embla-carousel/src/components/DragTracker.ts", "../../../../node_modules/embla-carousel/src/components/NodeRects.ts", "../../../../node_modules/embla-carousel/src/components/PercentOfView.ts", "../../../../node_modules/embla-carousel/src/components/ResizeHandler.ts", "../../../../node_modules/embla-carousel/src/components/ScrollBody.ts", "../../../../node_modules/embla-carousel/src/components/ScrollBounds.ts", "../../../../node_modules/embla-carousel/src/components/ScrollContain.ts", "../../../../node_modules/embla-carousel/src/components/ScrollLimit.ts", "../../../../node_modules/embla-carousel/src/components/ScrollLooper.ts", "../../../../node_modules/embla-carousel/src/components/ScrollProgress.ts", "../../../../node_modules/embla-carousel/src/components/ScrollSnaps.ts", "../../../../node_modules/embla-carousel/src/components/SlideRegistry.ts", "../../../../node_modules/embla-carousel/src/components/ScrollTarget.ts", "../../../../node_modules/embla-carousel/src/components/ScrollTo.ts", "../../../../node_modules/embla-carousel/src/components/SlideFocus.ts", "../../../../node_modules/embla-carousel/src/components/Vector1d.ts", "../../../../node_modules/embla-carousel/src/components/Translate.ts", "../../../../node_modules/embla-carousel/src/components/SlideLooper.ts", "../../../../node_modules/embla-carousel/src/components/SlidesHandler.ts", "../../../../node_modules/embla-carousel/src/components/SlidesInView.ts", "../../../../node_modules/embla-carousel/src/components/SlideSizes.ts", "../../../../node_modules/embla-carousel/src/components/SlidesToScroll.ts", "../../../../node_modules/embla-carousel/src/components/Engine.ts", "../../../../node_modules/embla-carousel/src/components/EventHandler.ts", "../../../../node_modules/embla-carousel/src/components/Options.ts", "../../../../node_modules/embla-carousel/src/components/OptionsHandler.ts", "../../../../node_modules/embla-carousel/src/components/PluginsHandler.ts", "../../../../node_modules/embla-carousel/src/components/EmblaCarousel.ts", "../../../../node_modules/embla-carousel-react/src/components/useEmblaCarousel.ts", "../../../javascript/warp/components/pdp/ProductImages/CarouselThumbs.tsx", "../../../javascript/warp/components/pdp/ProductImages/CarouselThumbsButton.tsx", "../../../javascript/warp/components/pdp/ProductImages/CarouselArrows.tsx", "../../../javascript/warp/hooks/carousel.ts", "../../../javascript/warp/components/ZoomModal/index.tsx", "../../../javascript/warp/components/pdp/ProductImages/ImagesGrid.tsx"], "sourcesContent": ["import ReactDOM from \"react-dom\"\nimport React from \"react\"\nimport { EmblaOptionsType } from \"embla-carousel\"\n\nimport parseJSONData from \"@warp/utilities/parseJSONData\"\nimport { Carousel } from \"@warp/components/pdp/ProductImages/Carousel\"\nimport ZoomModal from \"@warp/components/ZoomModal\"\nimport { ImagesGrid } from \"@warp/components/pdp/ProductImages/ImagesGrid\"\nimport { Badge, Image } from \"@warp/types/product\"\n\nconst node = document.getElementById(\"product-images-carousel-data\")\n\nif (node) {\n let slides: Image[] = parseJSONData(node.dataset, \"images\")\n const badges: Badge[] = parseJSONData(node.dataset, \"badges\")\n const translations = parseJSONData(node.dataset, \"translations\")\n const options: EmblaOptionsType = { loop: false, watchDrag: true }\n\n // If this element exists, we have to use it,\n // otherwise we use the carousel\n const gridContainer = document.getElementById(\"product-images-grid\")\n\n const carouselContainer = document.getElementById(\"product-images-carousel\")\n\n ReactDOM.render(\n <>\n {gridContainer ? (\n <ImagesGrid slides={slides} badges={badges} />\n ) : (\n <Carousel slides={slides} badges={badges} options={options} />\n )}\n <ZoomModal\n slides={slides}\n description={translations.zoomModalDescription}\n closeText={translations.zoom_modal_close}\n />\n </>,\n gridContainer || carouselContainer\n )\n} else {\n console.error(\"Failed to initialize carousel.\")\n}\n", "import React, { useCallback, useEffect, useState } from \"react\"\nimport { EmblaOptionsType } from \"embla-carousel\"\nimport useEmblaCarousel from \"embla-carousel-react\"\nimport { Image, Badge } from \"@warp/types/product\"\nimport CarouselThumbs from \"./CarouselThumbs\"\nimport ZoomableImage from \"../Zoom/ZoomableImage\"\nimport Badges from \"../Badges/Badges\"\nimport CarouselArrows from \"./CarouselArrows\"\nimport { useIsDesktop } from \"@warp/hooks/breakpoints\"\n\ntype PropType = {\n slides: Image[]\n badges?: Badge[]\n options?: EmblaOptionsType\n}\n\nexport const Carousel: React.FC<PropType> = (props) => {\n const isDesktop = useIsDesktop()\n const { slides, badges, options } = props\n const [selectedIndex, setSelectedIndex] = useState(0)\n const [emblaRef, emblaApi] = useEmblaCarousel(options)\n const [emblaThumbsRef, emblaThumbsApi] = useEmblaCarousel({\n containScroll: \"keepSnaps\",\n align: \"start\",\n dragFree: true,\n slidesToScroll: isDesktop ? 2 : 1\n })\n\n const onThumbClick = useCallback(\n (slideId: number) => {\n if (!emblaApi || !emblaThumbsApi) return\n\n const slideIndex = slides.findIndex((slide) => slide.id === slideId)\n if (slideIndex !== -1) {\n emblaApi.scrollTo(slideIndex, true)\n }\n },\n [emblaApi, emblaThumbsApi, slides]\n )\n\n const onSelect = useCallback(() => {\n if (!emblaApi || !emblaThumbsApi) return\n setSelectedIndex(emblaApi.selectedScrollSnap())\n emblaThumbsApi.scrollTo(emblaApi.selectedScrollSnap())\n }, [emblaApi, emblaThumbsApi, slides])\n\n useEffect(() => {\n if (!emblaApi) return\n onSelect()\n\n emblaApi.on(\"select\", onSelect).on(\"reInit\", onSelect)\n }, [emblaApi, onSelect])\n\n const toggleZoom = (index: number) => {\n const openEvent = new CustomEvent(\"zoomModalOpen\", {\n detail: { id: index }\n })\n document.dispatchEvent(openEvent)\n }\n\n return (\n <section className=\"carousel-container\">\n <div className=\"carousel\">\n <div className=\"carousel-slides\">\n <div className=\"carousel-slides__viewport\" ref={emblaRef}>\n <div className=\"carousel-slides__container\">\n {slides.map((image, index) => (\n <div className=\"carousel-slides__slide\" key={index}>\n <div className=\"carousel-slides__slide__image\">\n <Badges badges={badges} variantId={image.variantId} />\n <ZoomableImage\n image={image}\n toggleZoom={() => toggleZoom(image.id)}\n />\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n {isDesktop ? (\n <CarouselArrows emblaApi={emblaApi} />\n ) : (\n <CarouselThumbs\n images={slides}\n selectedIndex={selectedIndex}\n onThumbClick={onThumbClick}\n ref={emblaThumbsRef}\n />\n )}\n </div>\n </section>\n )\n}\n", "import { EmblaPluginType } from 'embla-carousel'\n\nexport function isObject(subject: unknown): subject is Record<string, unknown> {\n return Object.prototype.toString.call(subject) === '[object Object]'\n}\n\nexport function isRecord(\n subject: unknown\n): subject is Record<string | number, unknown> {\n return isObject(subject) || Array.isArray(subject)\n}\n\nexport function canUseDOM(): boolean {\n return !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n )\n}\n\nexport function areOptionsEqual(\n optionsA: Record<string, unknown>,\n optionsB: Record<string, unknown>\n): boolean {\n const optionsAKeys = Object.keys(optionsA)\n const optionsBKeys = Object.keys(optionsB)\n\n if (optionsAKeys.length !== optionsBKeys.length) return false\n\n const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}))\n const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}))\n\n if (breakpointsA !== breakpointsB) return false\n\n return optionsAKeys.every((key) => {\n const valueA = optionsA[key]\n const valueB = optionsB[key]\n if (typeof valueA === 'function') return `${valueA}` === `${valueB}`\n if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB\n return areOptionsEqual(valueA, valueB)\n })\n}\n\nexport function sortAndMapPluginToOptions(\n plugins: EmblaPluginType[]\n): EmblaPluginType['options'][] {\n return plugins\n .concat()\n .sort((a, b) => (a.name > b.name ? 1 : -1))\n .map((plugin) => plugin.options)\n}\n\nexport function arePluginsEqual(\n pluginsA: EmblaPluginType[],\n pluginsB: EmblaPluginType[]\n): boolean {\n if (pluginsA.length !== pluginsB.length) return false\n\n const optionsA = sortAndMapPluginToOptions(pluginsA)\n const optionsB = sortAndMapPluginToOptions(pluginsB)\n\n return optionsA.every((optionA, index) => {\n const optionB = optionsB[index]\n return areOptionsEqual(optionA, optionB)\n })\n}\n", "import { PointerEventType } from './DragTracker'\n\nexport type WindowType = Window & typeof globalThis\n\nexport function isNumber(subject: unknown): subject is number {\n return typeof subject === 'number'\n}\n\nexport function isString(subject: unknown): subject is string {\n return typeof subject === 'string'\n}\n\nexport function isBoolean(subject: unknown): subject is boolean {\n return typeof subject === 'boolean'\n}\n\nexport function isObject(subject: unknown): subject is Record<string, unknown> {\n return Object.prototype.toString.call(subject) === '[object Object]'\n}\n\nexport function mathAbs(n: number): number {\n return Math.abs(n)\n}\n\nexport function mathSign(n: number): number {\n return Math.sign(n)\n}\n\nexport function deltaAbs(valueB: number, valueA: number): number {\n return mathAbs(valueB - valueA)\n}\n\nexport function factorAbs(valueB: number, valueA: number): number {\n if (valueB === 0 || valueA === 0) return 0\n if (mathAbs(valueB) <= mathAbs(valueA)) return 0\n const diff = deltaAbs(mathAbs(valueB), mathAbs(valueA))\n return mathAbs(diff / valueB)\n}\n\nexport function arrayKeys<Type>(array: Type[]): number[] {\n return objectKeys(array).map(Number)\n}\n\nexport function arrayLast<Type>(array: Type[]): Type {\n return array[arrayLastIndex(array)]\n}\n\nexport function arrayLastIndex<Type>(array: Type[]): number {\n return Math.max(0, array.length - 1)\n}\n\nexport function arrayIsLastIndex<Type>(array: Type[], index: number): boolean {\n return index === arrayLastIndex(array)\n}\n\nexport function arrayFromNumber(n: number, startAt: number = 0): number[] {\n return Array.from(Array(n), (_, i) => startAt + i)\n}\n\nexport function objectKeys<Type extends object>(object: Type): string[] {\n return Object.keys(object)\n}\n\nexport function objectsMergeDeep(\n objectA: Record<string, unknown>,\n objectB: Record<string, unknown>\n): Record<string, unknown> {\n return [objectA, objectB].reduce((mergedObjects, currentObject) => {\n objectKeys(currentObject).forEach((key) => {\n const valueA = mergedObjects[key]\n const valueB = currentObject[key]\n const areObjects = isObject(valueA) && isObject(valueB)\n\n mergedObjects[key] = areObjects\n ? objectsMergeDeep(valueA, valueB)\n : valueB\n })\n return mergedObjects\n }, {})\n}\n\nexport function isMouseEvent(\n evt: PointerEventType,\n ownerWindow: WindowType\n): evt is MouseEvent {\n return (\n typeof ownerWindow.MouseEvent !== 'undefined' &&\n evt instanceof ownerWindow.MouseEvent\n )\n}\n", "import { isString } from './utils'\n\nexport type AlignmentOptionType =\n | 'start'\n | 'center'\n | 'end'\n | ((viewSize: number, snapSize: number, index: number) => number)\n\nexport type AlignmentType = {\n measure: (n: number, index: number) => number\n}\n\nexport function Alignment(\n align: AlignmentOptionType,\n viewSize: number\n): AlignmentType {\n const predefined = { start, center, end }\n\n function start(): number {\n return 0\n }\n\n function center(n: number): number {\n return end(n) / 2\n }\n\n function end(n: number): number {\n return viewSize - n\n }\n\n function measure(n: number, index: number): number {\n if (isString(align)) return predefined[align](n)\n return align(viewSize, n, index)\n }\n\n const self: AlignmentType = {\n measure\n }\n return self\n}\n", "type EventNameType = keyof DocumentEventMap | keyof WindowEventMap\ntype EventHandlerType = (evt: any) => void\ntype EventOptionsType = boolean | AddEventListenerOptions | undefined\ntype EventRemoverType = () => void\n\nexport type EventStoreType = {\n add: (\n node: EventTarget,\n type: EventNameType,\n handler: EventHandlerType,\n options?: EventOptionsType\n ) => EventStoreType\n clear: () => void\n}\n\nexport function EventStore(): EventStoreType {\n let listeners: EventRemoverType[] = []\n\n function add(\n node: EventTarget,\n type: EventNameType,\n handler: EventHandlerType,\n options: EventOptionsType = { passive: true }\n ): EventStoreType {\n let removeListener: EventRemoverType\n\n if ('addEventListener' in node) {\n node.addEventListener(type, handler, options)\n removeListener = () => node.removeEventListener(type, handler, options)\n } else {\n const legacyMediaQueryList = <MediaQueryList>node\n legacyMediaQueryList.addListener(handler)\n removeListener = () => legacyMediaQueryList.removeListener(handler)\n }\n\n listeners.push(removeListener)\n return self\n }\n\n function clear(): void {\n listeners = listeners.filter((remove) => remove())\n }\n\n const self: EventStoreType = {\n add,\n clear\n }\n return self\n}\n", "import { EngineType } from './Engine'\nimport { EventStore } from './EventStore'\nimport { WindowType } from './utils'\n\nexport type AnimationsUpdateType = (engine: EngineType) => void\n\nexport type AnimationsType = {\n init: () => void\n destroy: () => void\n start: () => void\n stop: () => void\n update: () => void\n}\n\nexport function Animations(\n ownerDocument: Document,\n ownerWindow: WindowType,\n update: AnimationsType['update']\n): AnimationsType {\n const documentVisibleHandler = EventStore()\n const timeStep = 1000 / 60\n let lastTimeStamp: number | null = null\n let animationFrame = 0\n let lag = 0\n\n function init(): void {\n documentVisibleHandler.add(ownerDocument, 'visibilitychange', () => {\n if (ownerDocument.hidden) reset()\n })\n }\n\n function destroy(): void {\n stop()\n documentVisibleHandler.clear()\n }\n\n function animate(timeStamp: DOMHighResTimeStamp): void {\n if (!animationFrame) return\n if (!lastTimeStamp) lastTimeStamp = timeStamp\n\n const timeElapsed = timeStamp - lastTimeStamp\n lastTimeStamp = timeStamp\n lag += timeElapsed\n\n while (lag >= timeStep) {\n update()\n lag -= timeStep\n }\n\n if (animationFrame) ownerWindow.requestAnimationFrame(animate)\n }\n\n function start(): void {\n if (animationFrame) return\n\n animationFrame = ownerWindow.requestAnimationFrame(animate)\n }\n\n function stop(): void {\n ownerWindow.cancelAnimationFrame(animationFrame)\n lastTimeStamp = null\n lag = 0\n animationFrame = 0\n }\n\n function reset(): void {\n lastTimeStamp = null\n lag = 0\n }\n\n const self: AnimationsType = {\n init,\n destroy,\n start,\n stop,\n update\n }\n return self\n}\n", "import { NodeRectType } from './NodeRects'\n\nexport type AxisOptionType = 'x' | 'y'\nexport type AxisDirectionOptionType = 'ltr' | 'rtl'\ntype AxisEdgeType = 'top' | 'right' | 'bottom' | 'left'\n\nexport type AxisType = {\n scroll: AxisOptionType\n cross: AxisOptionType\n startEdge: AxisEdgeType\n endEdge: AxisEdgeType\n measureSize: (nodeRect: NodeRectType) => number\n direction: (n: number) => number\n}\n\nexport function Axis(\n axis: AxisOptionType,\n contentDirection: AxisDirectionOptionType\n): AxisType {\n const isRightToLeft = contentDirection === 'rtl'\n const isVertical = axis === 'y'\n const scroll = isVertical ? 'y' : 'x'\n const cross = isVertical ? 'x' : 'y'\n const sign = !isVertical && isRightToLeft ? -1 : 1\n const startEdge = getStartEdge()\n const endEdge = getEndEdge()\n\n function measureSize(nodeRect: NodeRectType): number {\n const { height, width } = nodeRect\n return isVertical ? height : width\n }\n\n function getStartEdge(): AxisEdgeType {\n if (isVertical) return 'top'\n return isRightToLeft ? 'right' : 'left'\n }\n\n function getEndEdge(): AxisEdgeType {\n if (isVertical) return 'bottom'\n return isRightToLeft ? 'left' : 'right'\n }\n\n function direction(n: number): number {\n return n * sign\n }\n\n const self: AxisType = {\n scroll,\n cross,\n startEdge,\n endEdge,\n measureSize,\n direction\n }\n return self\n}\n", "import { mathAbs } from './utils'\n\nexport type LimitType = {\n min: number\n max: number\n length: number\n constrain: (n: number) => number\n reachedAny: (n: number) => boolean\n reachedMax: (n: number) => boolean\n reachedMin: (n: number) => boolean\n removeOffset: (n: number) => number\n}\n\nexport function Limit(min: number = 0, max: number = 0): LimitType {\n const length = mathAbs(min - max)\n\n function reachedMin(n: number): boolean {\n return n < min\n }\n\n function reachedMax(n: number): boolean {\n return n > max\n }\n\n function reachedAny(n: number): boolean {\n return reachedMin(n) || reachedMax(n)\n }\n\n function constrain(n: number): number {\n if (!reachedAny(n)) return n\n return reachedMin(n) ? min : max\n }\n\n function removeOffset(n: number): number {\n if (!length) return n\n return n - length * Math.ceil((n - max) / length)\n }\n\n const self: LimitType = {\n length,\n max,\n min,\n constrain,\n reachedAny,\n reachedMax,\n reachedMin,\n removeOffset\n }\n return self\n}\n", "import { Limit } from './Limit'\nimport { mathAbs } from './utils'\n\nexport type CounterType = {\n get: () => number\n set: (n: number) => CounterType\n add: (n: number) => CounterType\n clone: () => CounterType\n}\n\nexport function Counter(\n max: number,\n start: number,\n loop: boolean\n): CounterType {\n const { constrain } = Limit(0, max)\n const loopEnd = max + 1\n let counter = withinLimit(start)\n\n function withinLimit(n: number): number {\n return !loop ? constrain(n) : mathAbs((loopEnd + n) % loopEnd)\n }\n\n function get(): number {\n return counter\n }\n\n function set(n: number): CounterType {\n counter = withinLimit(n)\n return self\n }\n\n function add(n: number): CounterType {\n return clone().set(get() + n)\n }\n\n function clone(): CounterType {\n return Counter(max, get(), loop)\n }\n\n const self: CounterType = {\n get,\n set,\n add,\n clone\n }\n return self\n}\n", "import { EmblaCarouselType } from './EmblaCarousel'\nimport { AnimationsType } from './Animations'\nimport { CounterType } from './Counter'\nimport { DragTrackerType, PointerEventType } from './DragTracker'\nimport { EventHandlerType } from './EventHandler'\nimport { AxisType } from './Axis'\nimport { EventStore } from './EventStore'\nimport { ScrollBodyType } from './ScrollBody'\nimport { ScrollTargetType } from './ScrollTarget'\nimport { ScrollToType } from './ScrollTo'\nimport { Vector1DType } from './Vector1d'\nimport { PercentOfViewType } from './PercentOfView'\nimport { Limit } from './Limit'\nimport {\n deltaAbs,\n factorAbs,\n isBoolean,\n isMouseEvent,\n mathAbs,\n mathSign,\n WindowType\n} from './utils'\n\ntype DragHandlerCallbackType = (\n emblaApi: EmblaCarouselType,\n evt: PointerEventType\n) => boolean | void\n\nexport type DragHandlerOptionType = boolean | DragHandlerCallbackType\n\nexport type DragHandlerType = {\n init: (emblaApi: EmblaCarouselType) => void\n destroy: () => void\n pointerDown: () => boolean\n}\n\nexport function DragHandler(\n axis: AxisType,\n rootNode: HTMLElement,\n ownerDocument: Document,\n ownerWindow: WindowType,\n target: Vector1DType,\n dragTracker: DragTrackerType,\n location: Vector1DType,\n animation: AnimationsType,\n scrollTo: ScrollToType,\n scrollBody: ScrollBodyType,\n scrollTarget: ScrollTargetType,\n index: CounterType,\n eventHandler: EventHandlerType,\n percentOfView: PercentOfViewType,\n dragFree: boolean,\n dragThreshold: number,\n skipSnaps: boolean,\n baseFriction: number,\n watchDrag: DragHandlerOptionType\n): DragHandlerType {\n const { cross: crossAxis, direction } = axis\n const focusNodes = ['INPUT', 'SELECT', 'TEXTAREA']\n const nonPassiveEvent = { passive: false }\n const initEvents = EventStore()\n const dragEvents = EventStore()\n const goToNextThreshold = Limit(50, 225).constrain(percentOfView.measure(20))\n const snapForceBoost = { mouse: 300, touch: 400 }\n const freeForceBoost = { mouse: 500, touch: 600 }\n const baseSpeed = dragFree ? 43 : 25\n\n let isMoving = false\n let startScroll = 0\n let startCross = 0\n let pointerIsDown = false\n let preventScroll = false\n let preventClick = false\n let isMouse = false\n\n function init(emblaApi: EmblaCarouselType): void {\n if (!watchDrag) return\n\n function downIfAllowed(evt: PointerEventType): void {\n if (isBoolean(watchDrag) || watchDrag(emblaApi, evt)) down(evt)\n }\n\n const node = rootNode\n initEvents\n .add(node, 'dragstart', (evt) => evt.preventDefault(), nonPassiveEvent)\n .add(node, 'touchmove', () => undefined, nonPassiveEvent)\n .add(node, 'touchend', () => undefined)\n .add(node, 'touchstart', downIfAllowed)\n .add(node, 'mousedown', downIfAllowed)\n .add(node, 'touchcancel', up)\n .add(node, 'contextmenu', up)\n .add(node, 'click', click, true)\n }\n\n function destroy(): void {\n initEvents.clear()\n dragEvents.clear()\n }\n\n function addDragEvents(): void {\n const node = isMouse ? ownerDocument : rootNode\n dragEvents\n .add(node, 'touchmove', move, nonPassiveEvent)\n .add(node, 'touchend', up)\n .add(node, 'mousemove', move, nonPassiveEvent)\n .add(node, 'mouseup', up)\n }\n\n function isFocusNode(node: Element): boolean {\n const nodeName = node.nodeName || ''\n return focusNodes.includes(nodeName)\n }\n\n function forceBoost(): number {\n const boost = dragFree ? freeForceBoost : snapForceBoost\n const type = isMouse ? 'mouse' : 'touch'\n return boost[type]\n }\n\n function allowedForce(force: number, targetChanged: boolean): number {\n const next = index.add(mathSign(force) * -1)\n const baseForce = scrollTarget.byDistance(force, !dragFree).distance\n\n if (dragFree || mathAbs(force) < goToNextThreshold) return baseForce\n if (skipSnaps && targetChanged) return baseForce * 0.5\n\n return scrollTarget.byIndex(next.get(), 0).distance\n }\n\n function down(evt: PointerEventType): void {\n const isMouseEvt = isMouseEvent(evt, ownerWindow)\n isMouse = isMouseEvt\n preventClick = dragFree && isMouseEvt && !evt.buttons && isMoving\n isMoving = deltaAbs(target.get(), location.get()) >= 2\n\n if (isMouseEvt && evt.button !== 0) return\n if (isFocusNode(evt.target as Element)) return\n\n pointerIsDown = true\n dragTracker.pointerDown(evt)\n scrollBody.useFriction(0).useDuration(0)\n target.set(location)\n addDragEvents()\n startScroll = dragTracker.readPoint(evt)\n startCross = dragTracker.readPoint(evt, crossAxis)\n eventHandler.emit('pointerDown')\n }\n\n function move(evt: PointerEventType): void {\n const isTouchEvt = !isMouseEvent(evt, ownerWindow)\n if (isTouchEvt && evt.touches.length >= 2) return up(evt)\n\n const lastScroll = dragTracker.readPoint(evt)\n const lastCross = dragTracker.readPoint(evt, crossAxis)\n const diffScroll = deltaAbs(lastScroll, startScroll)\n const diffCross = deltaAbs(lastCross, startCross)\n\n if (!preventScroll && !isMouse) {\n if (!evt.cancelable) return up(evt)\n preventScroll = diffScroll > diffCross\n if (!preventScroll) return up(evt)\n }\n const diff = dragTracker.pointerMove(evt)\n if (diffScroll > dragThreshold) preventClick = true\n\n scrollBody.useFriction(0.3).useDuration(0.75)\n animation.start()\n target.add(direction(diff))\n evt.preventDefault()\n }\n\n function up(evt: PointerEventType): void {\n const currentLocation = scrollTarget.byDistance(0, false)\n const targetChanged = currentLocation.index !== index.get()\n const rawForce = dragTracker.pointerUp(evt) * forceBoost()\n const force = allowedForce(direction(rawForce), targetChanged)\n const forceFactor = factorAbs(rawForce, force)\n const speed = baseSpeed - 10 * forceFactor\n const friction = baseFriction + forceFactor / 50\n\n preventScroll = false\n pointerIsDown = false\n dragEvents.clear()\n scrollBody.useDuration(speed).useFriction(friction)\n scrollTo.distance(force, !dragFree)\n isMouse = false\n eventHandler.emit('pointerUp')\n }\n\n function click(evt: MouseEvent): void {\n if (preventClick) {\n evt.stopPropagation()\n evt.preventDefault()\n preventClick = false\n }\n }\n\n function pointerDown(): boolean {\n return pointerIsDown\n }\n\n const self: DragHandlerType = {\n init,\n destroy,\n pointerDown\n }\n return self\n}\n", "import { AxisOptionType, AxisType } from './Axis'\nimport { isMouseEvent, mathAbs, WindowType } from './utils'\n\ntype PointerCoordType = keyof Touch | keyof MouseEvent\nexport type PointerEventType = TouchEvent | MouseEvent\n\nexport type DragTrackerType = {\n pointerDown: (evt: PointerEventType) => number\n pointerMove: (evt: PointerEventType) => number\n pointerUp: (evt: PointerEventType) => number\n readPoint: (evt: PointerEventType, evtAxis?: AxisOptionType) => number\n}\n\nexport function DragTracker(\n axis: AxisType,\n ownerWindow: WindowType\n): DragTrackerType {\n const logInterval = 170\n\n let startEvent: PointerEventType\n let lastEvent: PointerEventType\n\n function readTime(evt: PointerEventType): number {\n return evt.timeStamp\n }\n\n function readPoint(evt: PointerEventType, evtAxis?: AxisOptionType): number {\n const property = evtAxis || axis.scroll\n const coord: PointerCoordType = `client${property === 'x' ? 'X' : 'Y'}`\n return (isMouseEvent(evt, ownerWindow) ? evt : evt.touches[0])[coord]\n }\n\n function pointerDown(evt: PointerEventType): number {\n startEvent = evt\n lastEvent = evt\n return readPoint(evt)\n }\n\n function pointerMove(evt: PointerEventType): number {\n const diff = readPoint(evt) - readPoint(lastEvent)\n const expired = readTime(evt) - readTime(startEvent) > logInterval\n\n lastEvent = evt\n if (expired) startEvent = evt\n return diff\n }\n\n function pointerUp(evt: PointerEventType): number {\n if (!startEvent || !lastEvent) return 0\n const diffDrag = readPoint(lastEvent) - readPoint(startEvent)\n const diffTime = readTime(evt) - readTime(startEvent)\n const expired = readTime(evt) - readTime(lastEvent) > logInterval\n const force = diffDrag / diffTime\n const isFlick = diffTime && !expired && mathAbs(force) > 0.1\n\n return isFlick ? force : 0\n }\n\n const self: DragTrackerType = {\n pointerDown,\n pointerMove,\n pointerUp,\n readPoint\n }\n return self\n}\n", "export type NodeRectType = {\n top: number\n right: number\n bottom: number\n left: number\n width: number\n height: number\n}\n\nexport type NodeRectsType = {\n measure: (node: HTMLElement) => NodeRectType\n}\n\nexport function NodeRects(): NodeRectsType {\n function measure(node: HTMLElement): NodeRectType {\n const { offsetTop, offsetLeft, offsetWidth, offsetHeight } = node\n const offset: NodeRectType = {\n top: offsetTop,\n right: offsetLeft + offsetWidth,\n bottom: offsetTop + offsetHeight,\n left: offsetLeft,\n width: offsetWidth,\n height: offsetHeight\n }\n\n return offset\n }\n\n const self: NodeRectsType = {\n measure\n }\n return self\n}\n", "export type PercentOfViewType = {\n measure: (n: number) => number\n}\n\nexport function PercentOfView(viewSize: number): PercentOfViewType {\n function measure(n: number): number {\n return viewSize * (n / 100)\n }\n\n const self: PercentOfViewType = {\n measure\n }\n return self\n}\n", "import { AxisType } from './Axis'\nimport { EmblaCarouselType } from './EmblaCarousel'\nimport { EventHandlerType } from './EventHandler'\nimport { NodeRectsType } from './NodeRects'\nimport { isBoolean, mathAbs, WindowType } from './utils'\n\ntype ResizeHandlerCallbackType = (\n emblaApi: EmblaCarouselType,\n entries: ResizeObserverEntry[]\n) => boolean | void\n\nexport type ResizeHandlerOptionType = boolean | ResizeHandlerCallbackType\n\nexport type ResizeHandlerType = {\n init: (emblaApi: EmblaCarouselType) => void\n destroy: () => void\n}\n\nexport function ResizeHandler(\n container: HTMLElement,\n eventHandler: EventHandlerType,\n ownerWindow: WindowType,\n slides: HTMLElement[],\n axis: AxisType,\n watchResize: ResizeHandlerOptionType,\n nodeRects: NodeRectsType\n): ResizeHandlerType {\n let resizeObserver: ResizeObserver\n let containerSize: number\n let slideSizes: number[] = []\n let destroyed = false\n\n function readSize(node: HTMLElement): number {\n return axis.measureSize(nodeRects.measure(node))\n }\n\n function init(emblaApi: EmblaCarouselType): void {\n if (!watchResize) return\n\n containerSize = readSize(container)\n slideSizes = slides.map(readSize)\n\n function defaultCallback(entries: ResizeObserverEntry[]): void {\n for (const entry of entries) {\n const isContainer = entry.target === container\n const slideIndex = slides.indexOf(<HTMLElement>entry.target)\n const lastSize = isContainer ? containerSize : slideSizes[slideIndex]\n const newSize = readSize(isContainer ? container : slides[slideIndex])\n const diffSize = mathAbs(newSize - lastSize)\n\n if (diffSize >= 0.5) {\n ownerWindow.requestAnimationFrame(() => {\n emblaApi.reInit()\n eventHandler.emit('resize')\n })\n break\n }\n }\n }\n\n resizeObserver = new ResizeObserver((entries) => {\n if (destroyed) return\n if (isBoolean(watchResize) || watchResize(emblaApi, entries)) {\n defaultCallback(entries)\n }\n })\n\n const observeNodes = [container].concat(slides)\n observeNodes.forEach((node) => resizeObserver.observe(node))\n }\n\n function destroy(): void {\n if (resizeObserver) resizeObserver.disconnect()\n destroyed = true\n }\n\n const self: ResizeHandlerType = {\n init,\n destroy\n }\n return self\n}\n", "import { mathSign, mathAbs } from './utils'\nimport { Vector1DType } from './Vector1d'\n\nexport type ScrollBodyType = {\n direction: () => number\n duration: () => number\n velocity: () => number\n seek: () => ScrollBodyType\n settled: () => boolean\n useBaseFriction: () => ScrollBodyType\n useBaseDuration: () => ScrollBodyType\n useFriction: (n: number) => ScrollBodyType\n useDuration: (n: number) => ScrollBodyType\n}\n\nexport function ScrollBody(\n location: Vector1DType,\n target: Vector1DType,\n baseDuration: number,\n baseFriction: number\n): ScrollBodyType {\n let bodyVelocity = 0\n let scrollDirection = 0\n let scrollDuration = baseDuration\n let scrollFriction = baseFriction\n let rawLocation = location.get()\n let rawLocationPrevious = 0\n\n function seek(): ScrollBodyType {\n const diff = target.get() - location.get()\n const isInstant = !scrollDuration\n let directionDiff = 0\n\n if (isInstant) {\n bodyVelocity = 0\n location.set(target)\n\n directionDiff = diff\n } else {\n bodyVelocity += diff / scrollDuration\n bodyVelocity *= scrollFriction\n rawLocation += bodyVelocity\n location.add(bodyVelocity)\n\n directionDiff = rawLocation - rawLocationPrevious\n }\n\n scrollDirection = mathSign(directionDiff)\n rawLocationPrevious = rawLocation\n return self\n }\n\n function settled(): boolean {\n const diff = target.get() - location.get()\n return mathAbs(diff) < 0.001\n }\n\n function duration(): number {\n return scrollDuration\n }\n\n function direction(): number {\n return scrollDirection\n }\n\n function velocity(): number {\n return bodyVelocity\n }\n\n function useBaseDuration(): ScrollBodyType {\n return useDuration(baseDuration)\n }\n\n function useBaseFriction(): ScrollBodyType {\n return useFriction(baseFriction)\n }\n\n function useDuration(n: number): ScrollBodyType {\n scrollDuration = n\n return self\n }\n\n function useFriction(n: number): ScrollBodyType {\n scrollFriction = n\n return self\n }\n\n const self: ScrollBodyType = {\n direction,\n duration,\n velocity,\n seek,\n settled,\n useBaseFriction,\n useBaseDuration,\n useFriction,\n useDuration\n }\n return self\n}\n", "import { Limit, LimitType } from './Limit'\nimport { ScrollBodyType } from './ScrollBody'\nimport { Vector1DType } from './Vector1d'\nimport { mathAbs } from './utils'\nimport { PercentOfViewType } from './PercentOfView'\n\nexport type ScrollBoundsType = {\n shouldConstrain: () => boolean\n constrain: (pointerDown: boolean) => void\n toggleActive: (active: boolean) => void\n}\n\nexport function ScrollBounds(\n limit: LimitType,\n location: Vector1DType,\n target: Vector1DType,\n scrollBody: ScrollBodyType,\n percentOfView: PercentOfViewType\n): ScrollBoundsType {\n const pullBackThreshold = percentOfView.measure(10)\n const edgeOffsetTolerance = percentOfView.measure(50)\n const frictionLimit = Limit(0.1, 0.99)\n let disabled = false\n\n function shouldConstrain(): boolean {\n if (disabled) return false\n if (!limit.reachedAny(target.get())) return false\n if (!limit.reachedAny(location.get())) return false\n return true\n }\n\n function constrain(pointerDown: boolean): void {\n if (!shouldConstrain()) return\n const edge = limit.reachedMin(location.get()) ? 'min' : 'max'\n const diffToEdge = mathAbs(limit[edge] - location.get())\n const diffToTarget = target.get() - location.get()\n const friction = frictionLimit.constrain(diffToEdge / edgeOffsetTolerance)\n\n target.subtract(diffToTarget * friction)\n\n if (!pointerDown && mathAbs(diffToTarget) < pullBackThreshold) {\n target.set(limit.constrain(target.get()))\n scrollBody.useDuration(25).useBaseFriction()\n }\n }\n\n function toggleActive(active: boolean): void {\n disabled = !active\n }\n\n const self: ScrollBoundsType = {\n shouldConstrain,\n constrain,\n toggleActive\n }\n return self\n}\n", "import { Limit, LimitType } from './Limit'\nimport { arrayIsLastIndex, arrayLast, deltaAbs } from './utils'\n\nexport type ScrollContainOptionType = false | 'trimSnaps' | 'keepSnaps'\n\nexport type ScrollContainType = {\n snapsContained: number[]\n scrollContainLimit: LimitType\n}\n\nexport function ScrollContain(\n viewSize: number,\n contentSize: number,\n snapsAligned: number[],\n containScroll: ScrollContainOptionType,\n pixelTolerance: number\n): ScrollContainType {\n const scrollBounds = Limit(-contentSize + viewSize, 0)\n const snapsBounded = measureBounded()\n const scrollContainLimit = findScrollContainLimit()\n const snapsContained = measureContained()\n\n function usePixelTolerance(bound: number, snap: number): boolean {\n return deltaAbs(bound, snap) < 1\n }\n\n function findScrollContainLimit(): LimitType {\n const startSnap = snapsBounded[0]\n const endSnap = arrayLast(snapsBounded)\n const min = snapsBounded.lastIndexOf(startSnap)\n const max = snapsBounded.indexOf(endSnap) + 1\n return Limit(min, max)\n }\n\n function measureBounded(): number[] {\n return snapsAligned\n .map((snapAligned, index) => {\n const { min, max } = scrollBounds\n const snap = scrollBounds.constrain(snapAligned)\n const isFirst = !index\n const isLast = arrayIsLastIndex(snapsAligned, index)\n if (isFirst) return max\n if (isLast) return min\n if (usePixelTolerance(min, snap)) return min\n if (usePixelTolerance(max, snap)) return max\n return snap\n })\n .map((scrollBound) => parseFloat(scrollBound.toFixed(3)))\n }\n\n function measureContained(): number[] {\n if (contentSize <= viewSize + pixelTolerance) return [scrollBounds.max]\n if (containScroll === 'keepSnaps') return snapsBounded\n const { min, max } = scrollContainLimit\n return snapsBounded.slice(min, max)\n }\n\n const self: ScrollContainType = {\n snapsContained,\n scrollContainLimit\n }\n return self\n}\n", "import { Limit, LimitType } from './Limit'\nimport { arrayLast } from './utils'\n\nexport type ScrollLimitType = {\n limit: LimitType\n}\n\nexport function ScrollLimit(\n contentSize: number,\n scrollSnaps: number[],\n loop: boolean\n): ScrollLimitType {\n const max = scrollSnaps[0]\n const min = loop ? max - contentSize : arrayLast(scrollSnaps)\n const limit = Limit(min, max)\n\n const self: ScrollLimitType = {\n limit\n }\n return self\n}\n", "import { Limit, LimitType } from './Limit'\nimport { Vector1DType } from './Vector1d'\n\nexport type ScrollLooperType = {\n loop: (direction: number) => void\n}\n\nexport function ScrollLooper(\n contentSize: number,\n limit: LimitType,\n location: Vector1DType,\n vectors: Vector1DType[]\n): ScrollLooperType {\n const jointSafety = 0.1\n const min = limit.min + jointSafety\n const max = limit.max + jointSafety\n const { reachedMin, reachedMax } = Limit(min, max)\n\n function shouldLoop(direction: number): boolean {\n if (direction === 1) return reachedMax(location.get())\n if (direction === -1) return reachedMin(location.get())\n return false\n }\n\n function loop(direction: number): void {\n if (!shouldLoop(direction)) return\n\n const loopDistance = contentSize * (direction * -1)\n vectors.forEach((v) => v.add(loopDistance))\n }\n\n const self: ScrollLooperType = {\n loop\n }\n return self\n}\n", "import { LimitType } from './Limit'\n\nexport type ScrollProgressType = {\n get: (n: number) => number\n}\n\nexport function ScrollProgress(limit: LimitType): ScrollProgressType {\n const { max, length } = limit\n\n function get(n: number): number {\n const currentLocation = n - max\n return length ? currentLocation / -length : 0\n }\n\n const self: ScrollProgressType = {\n get\n }\n return self\n}\n", "import { AlignmentType } from './Alignment'\nimport { AxisType } from './Axis'\nimport { NodeRectType } from './NodeRects'\nimport { SlidesToScrollType } from './SlidesToScroll'\nimport { arrayLast, mathAbs } from './utils'\n\nexport type ScrollSnapsType = {\n snaps: number[]\n snapsAligned: number[]\n}\n\nexport function ScrollSnaps(\n axis: AxisType,\n alignment: AlignmentType,\n containerRect: NodeRectType,\n slideRects: NodeRectType[],\n slidesToScroll: SlidesToScrollType\n): ScrollSnapsType {\n const { startEdge, endEdge } = axis\n const { groupSlides } = slidesToScroll\n const alignments = measureSizes().map(alignment.measure)\n const snaps = measureUnaligned()\n const snapsAligned = measureAligned()\n\n function measureSizes(): number[] {\n return groupSlides(slideRects)\n .map((rects) => arrayLast(rects)[endEdge] - rects[0][startEdge])\n .map(mathAbs)\n }\n\n function measureUnaligned(): number[] {\n return slideRects\n .map((rect) => containerRect[startEdge] - rect[startEdge])\n .map((snap) => -mathAbs(snap))\n }\n\n function measureAligned(): number[] {\n return groupSlides(snaps)\n .map((g) => g[0])\n .map((snap, index) => snap + alignments[index])\n }\n\n const self: ScrollSnapsType = {\n snaps,\n snapsAligned\n }\n return self\n}\n", "import { LimitType } from './Limit'\nimport { ScrollContainOptionType } from './ScrollContain'\nimport { SlidesToScrollType } from './SlidesToScroll'\nimport {\n arrayFromNumber,\n arrayIsLastIndex,\n arrayLast,\n arrayLastIndex\n} from './utils'\n\nexport type SlideRegistryType = {\n slideRegistry: number[][]\n}\n\nexport function SlideRegistry(\n containSnaps: boolean,\n containScroll: ScrollContainOptionType,\n scrollSnaps: number[],\n scrollContainLimit: LimitType,\n slidesToScroll: SlidesToScrollType,\n slideIndexes: number[]\n): SlideRegistryType {\n const { groupSlides } = slidesToScroll\n const { min, max } = scrollContainLimit\n const slideRegistry = createSlideRegistry()\n\n function createSlideRegistry(): number[][] {\n const groupedSlideIndexes = groupSlides(slideIndexes)\n const doNotContain = !containSnaps || containScroll === 'keepSnaps'\n\n if (scrollSnaps.length === 1) return [slideIndexes]\n if (doNotContain) return groupedSlideIndexes\n\n return groupedSlideIndexes.slice(min, max).map((group, index, groups) => {\n const isFirst = !index\n const isLast = arrayIsLastIndex(groups, index)\n\n if (isFirst) {\n const range = arrayLast(groups[0]) + 1\n return arrayFromNumber(range)\n }\n if (isLast) {\n const range = arrayLastIndex(slideIndexes) - arrayLast(groups)[0] + 1\n return arrayFromNumber(range, arrayLast(groups)[0])\n }\n return group\n })\n }\n\n const self: SlideRegistryType = {\n slideRegistry\n }\n return self\n}\n", "import { LimitType } from './Limit'\nimport { Vector1DType } from './Vector1d'\nimport { arrayLast, mathAbs, mathSign } from './utils'\n\nexport type TargetType = {\n distance: number\n index: number\n}\n\nexport type ScrollTargetType = {\n byIndex: (target: number, direction: number) => TargetType\n byDistance: (force: number, snap: boolean) => TargetType\n shortcut: (target: number, direction: number) => number\n}\n\nexport function ScrollTarget(\n loop: boolean,\n scrollSnaps: number[],\n contentSize: number,\n limit: LimitType,\n targetVector: Vector1DType\n): ScrollTargetType {\n const { reachedAny, removeOffset, constrain } = limit\n\n function minDistance(distances: number[]): number {\n return distances.concat().sort((a, b) => mathAbs(a) - mathAbs(b))[0]\n }\n\n function findTargetSnap(target: number): TargetType {\n const distance = loop ? removeOffset(target) : constrain(target)\n const ascDiffsToSnaps = scrollSnaps\n .map((snap, index) => ({ diff: shortcut(snap - distance, 0), index }))\n .sort((d1, d2) => mathAbs(d1.diff) - mathAbs(d2.diff))\n\n const { index } = ascDiffsToSnaps[0]\n return { index, distance }\n }\n\n function shortcut(target: number, direction: number): number {\n const targets = [target, target + contentSize, target - contentSize]\n\n if (!loop) return target\n if (!direction) return minDistance(targets)\n\n const matchingTargets = targets.filter((t) => mathSign(t) === direction)\n if (matchingTargets.length) return minDistance(matchingTargets)\n return arrayLast(targets) - contentSize\n }\n\n function byIndex(index: number, direction: number): TargetType {\n const diffToSnap = scrollSnaps[index] - targetVector.get()\n const distance = shortcut(diffToSnap, direction)\n return { index, distance }\n }\n\n function byDistance(distance: number, snap: boolean): TargetType {\n const target = targetVector.get() + distance\n const { index, distance: targetSnapDistance } = findTargetSnap(target)\n const reachedBound = !loop && reachedAny(target)\n\n if (!snap || reachedBound) return { index, distance }\n\n const diffToSnap = scrollSnaps[index] - targetSnapDistance\n const snapDistance = distance + shortcut(diffToSnap, 0)\n\n return { index, distance: snapDistance }\n }\n\n const self: ScrollTargetType = {\n byDistance,\n byIndex,\n shortcut\n }\n return self\n}\n", "import { AnimationsType } from './Animations'\nimport { CounterType } from './Counter'\nimport { EventHandlerType } from './EventHandler'\nimport { ScrollTargetType, TargetType } from './ScrollTarget'\nimport { Vector1DType } from './Vector1d'\n\nexport type ScrollToType = {\n distance: (n: number, snap: boolean) => void\n index: (n: number, direction: number) => void\n}\n\nexport function ScrollTo(\n animation: AnimationsType,\n indexCurrent: CounterType,\n indexPrevious: CounterType,\n scrollTarget: ScrollTargetType,\n targetVector: Vector1DType,\n eventHandler: EventHandlerType\n): ScrollToType {\n function scrollTo(target: TargetType): void {\n const distanceDiff = target.distance\n const indexDiff = target.index !== indexCurrent.get()\n\n targetVector.add(distanceDiff)\n\n if (distanceDiff) animation.start()\n\n if (indexDiff) {\n indexPrevious.set(indexCurrent.get())\n indexCurrent.set(target.index)\n eventHandler.emit('select')\n }\n }\n\n function distance(n: number, snap: boolean): void {\n const target = scrollTarget.byDistance(n, snap)\n scrollTo(target)\n }\n\n function index(n: number, direction: number): void {\n const targetIndex = indexCurrent.clone().set(n)\n const target = scrollTarget.byIndex(targetIndex.get(), direction)\n scrollTo(target)\n }\n\n const self: ScrollToType = {\n distance,\n index\n }\n return self\n}\n", "import { EventHandlerType } from './EventHandler'\nimport { EventStoreType } from './EventStore'\nimport { ScrollBodyType } from './ScrollBody'\nimport { ScrollToType } from './ScrollTo'\nimport { SlideRegistryType } from './SlideRegistry'\nimport { isNumber } from './utils'\n\nexport type SlideFocusType = {\n init: () => void\n}\n\nexport function SlideFocus(\n root: HTMLElement,\n slides: HTMLElement[],\n slideRegistry: SlideRegistryType['slideRegistry'],\n scrollTo: ScrollToType,\n scrollBody: ScrollBodyType,\n eventStore: EventStoreType,\n eventHandler: EventHandlerType\n): SlideFocusType {\n let lastTabPressTime = 0\n\n function init(): void {\n eventStore.add(document, 'keydown', registerTabPress, false)\n slides.forEach(addSlideFocusEvent)\n }\n\n function registerTabPress(event: KeyboardEvent): void {\n if (event.code === 'Tab') lastTabPressTime = new Date().getTime()\n }\n\n function addSlideFocusEvent(slide: HTMLElement): void {\n const focus = (): void => {\n const nowTime = new Date().getTime()\n const diffTime = nowTime - lastTabPressTime\n\n if (diffTime > 10) return\n\n root.scrollLeft = 0\n const index = slides.indexOf(slide)\n const group = slideRegistry.findIndex((group) => group.includes(index))\n\n if (!isNumber(group)) return\n\n scrollBody.useDuration(0)\n scrollTo.index(group, 0)\n eventHandler.emit('slideFocus')\n }\n\n eventStore.add(slide, 'focus', focus, {\n passive: true,\n capture: true\n })\n }\n\n const self: SlideFocusType = {\n init\n }\n return self\n}\n", "import { isNumber } from './utils'\n\nexport type Vector1DType = {\n get: () => number\n set: (n: Vector1DType | number) => void\n add: (n: Vector1DType | number) => void\n subtract: (n: Vector1DType | number) => void\n}\n\nexport function Vector1D(initialValue: number): Vector1DType {\n let value = initialValue\n\n function get(): number {\n return value\n }\n\n function set(n: Vector1DType | number): void {\n value = normalizeInput(n)\n }\n\n function add(n: Vector1DType | number): void {\n value += normalizeInput(n)\n }\n\n function subtract(n: Vector1DType | number): void {\n value -= normalizeInput(n)\n }\n\n function normalizeInput(n: Vector1DType | number): number {\n return isNumber(n) ? n : n.get()\n }\n\n const self: Vector1DType = {\n get,\n set,\n add,\n subtract\n }\n return self\n}\n", "import { AxisType } from './Axis'\n\nexport type TranslateType = {\n clear: () => void\n to: (target: number) => void\n toggleActive: (active: boolean) => void\n}\n\nexport function Translate(\n axis: AxisType,\n container: HTMLElement\n): TranslateType {\n const translate = axis.scroll === 'x' ? x : y\n const containerStyle = container.style\n let disabled = false\n\n function x(n: number): string {\n return `translate3d(${n}px,0px,0px)`\n }\n\n function y(n: number): string {\n return `translate3d(0px,${n}px,0px)`\n }\n\n function to(target: number): void {\n if (disabled) return\n containerStyle.transform = translate(axis.direction(target))\n }\n\n function toggleActive(active: boolean): void {\n disabled = !active\n }\n\n function clear(): void {\n if (disabled) return\n containerStyle.transform = ''\n if (!container.getAttribute('style')) container.removeAttribute('style')\n }\n\n const self: TranslateType = {\n clear,\n to,\n toggleActive\n }\n return self\n}\n", "import { AxisType } from './Axis'\nimport { arrayKeys } from './utils'\nimport { Vector1D, Vector1DType } from './Vector1d'\nimport { Translate, TranslateType } from './Translate'\n\ntype SlideBoundType = {\n start: number\n end: number\n}\n\ntype LoopPointType = {\n loopPoint: number\n index: number\n translate: TranslateType\n slideLocation: Vector1DType\n target: () => number\n}\n\nexport type SlideLooperType = {\n canLoop: () => boolean\n clear: () => void\n loop: () => void\n loopPoints: LoopPointType[]\n}\n\nexport function SlideLooper(\n axis: AxisType,\n viewSize: number,\n contentSize: number,\n slideSizes: number[],\n slideSizesWithGaps: number[],\n snaps: number[],\n scrollSnaps: number[],\n location: Vector1DType,\n slides: HTMLElement[]\n): SlideLooperType {\n const roundingSafety = 0.5\n const ascItems = arrayKeys(slideSizesWithGaps)\n const descItems = arrayKeys(slideSizesWithGaps).reverse()\n const loopPoints = startPoints().concat(endPoints())\n\n function removeSlideSizes(indexes: number[], from: number): number {\n return indexes.reduce((a: number, i) => {\n return a - slideSizesWithGaps[i]\n }, from)\n }\n\n function slidesInGap(indexes: number[], gap: number): number[] {\n return indexes.reduce((a: number[], i) => {\n const remainingGap = removeSlideSizes(a, gap)\n return remainingGap > 0 ? a.concat([i]) : a\n }, [])\n }\n\n function findSlideBounds(offset: number): SlideBoundType[] {\n return snaps.map((snap, index) => ({\n start: snap - slideSizes[index] + roundingSafety + offset,\n end: snap + viewSize - roundingSafety + offset\n }))\n }\n\n function findLoopPoints(\n indexes: number[],\n offset: number,\n isEndEdge: boolean\n ): LoopPointType[] {\n const slideBounds = findSlideBounds(offset)\n\n return indexes.map((index) => {\n const initial = isEndEdge ? 0 : -contentSize\n const altered = isEndEdge ? contentSize : 0\n const boundEdge = isEndEdge ? 'end' : 'start'\n const loopPoint = slideBounds[index][boundEdge]\n\n return {\n index,\n loopPoint,\n slideLocation: Vector1D(-1),\n translate: Translate(axis, slides[index]),\n target: () => (location.get() > loopPoint ? initial : altered)\n }\n })\n }\n\n function startPoints(): LoopPointType[] {\n const gap = scrollSnaps[0]\n const indexes = slidesInGap(descItems, gap)\n return findLoopPoints(indexes, contentSize, false)\n }\n\n function endPoints(): LoopPointType[] {\n const gap = viewSize - scrollSnaps[0] - 1\n const indexes = slidesInGap(ascItems, gap)\n return findLoopPoints(indexes, -contentSize, true)\n }\n\n function canLoop(): boolean {\n return loopPoints.every(({ index }) => {\n const otherIndexes = ascItems.filter((i) => i !== index)\n return removeSlideSizes(otherIndexes, viewSize) <= 0.1\n })\n }\n\n function loop(): void {\n loopPoints.forEach((loopPoint) => {\n const { target, translate, slideLocation } = loopPoint\n const shiftLocation = target()\n if (shiftLocation === slideLocation.get()) return\n translate.to(shiftLocation)\n slideLocation.set(shiftLocation)\n })\n }\n\n function clear(): void {\n loopPoints.forEach((loopPoint) => loopPoint.translate.clear())\n }\n\n const self: SlideLooperType = {\n canLoop,\n clear,\n loop,\n loopPoints\n }\n return self\n}\n", "import { EmblaCarouselType } from './EmblaCarousel'\nimport { EventHandlerType } from './EventHandler'\nimport { isBoolean } from './utils'\n\ntype SlidesHandlerCallbackType = (\n emblaApi: EmblaCarouselType,\n mutations: MutationRecord[]\n) => boolean | void\n\nexport type SlidesHandlerOptionType = boolean | SlidesHandlerCallbackType\n\nexport type SlidesHandlerType = {\n init: (emblaApi: EmblaCarouselType) => void\n destroy: () => void\n}\n\nexport function SlidesHandler(\n container: HTMLElement,\n eventHandler: EventHandlerType,\n watchSlides: SlidesHandlerOptionType\n): SlidesHandlerType {\n let mutationObserver: MutationObserver\n let destroyed = false\n\n function init(emblaApi: EmblaCarouselType): void {\n if (!watchSlides) return\n\n function defaultCallback(mutations: MutationRecord[]): void {\n for (const mutation of mutations) {\n if (mutation.type === 'childList') {\n emblaApi.reInit()\n eventHandler.emit('slidesChanged')\n break\n }\n }\n }\n\n mutationObserver = new MutationObserver((mutations) => {\n if (destroyed) return\n if (isBoolean(watchSlides) || watchSlides(emblaApi, mutations)) {\n defaultCallback(mutations)\n }\n })\n\n mutationObserver.observe(container, { childList: true })\n }\n\n function destroy(): void {\n if (mutationObserver) mutationObserver.disconnect()\n destroyed = true\n }\n\n const self: SlidesHandlerType = {\n init,\n destroy\n }\n return self\n}\n", "import { EventHandlerType } from './EventHandler'\nimport { objectKeys } from './utils'\n\ntype IntersectionEntryMapType = {\n [key: number]: IntersectionObserverEntry\n}\n\nexport type SlidesInViewOptionsType = IntersectionObserverInit['threshold']\n\nexport type SlidesInViewType = {\n init: () => void\n destroy: () => void\n get: (inView?: boolean) => number[]\n}\n\nexport function SlidesInView(\n container: HTMLElement,\n slides: HTMLElement[],\n eventHandler: EventHandlerType,\n threshold: SlidesInViewOptionsType\n): SlidesInViewType {\n const intersectionEntryMap: IntersectionEntryMapType = {}\n let inViewCache: number[] | null = null\n let notInViewCache: number[] | null = null\n let intersectionObserver: IntersectionObserver\n let destroyed = false\n\n function init(): void {\n intersectionObserver = new IntersectionObserver(\n (entries) => {\n if (destroyed) return\n\n entries.forEach((entry) => {\n const index = slides.indexOf(<HTMLElement>entry.target)\n intersectionEntryMap[index] = entry\n })\n\n inViewCache = null\n notInViewCache = null\n eventHandler.emit('slidesInView')\n },\n {\n root: container.parentElement,\n threshold\n }\n )\n\n slides.forEach((slide) => intersectionObserver.observe(slide))\n }\n\n function destroy(): void {\n if (intersectionObserver) intersectionObserver.disconnect()\n destroyed = true\n }\n\n function createInViewList(inView: boolean): number[] {\n return objectKeys(intersectionEntryMap).reduce(\n (list: number[], slideIndex) => {\n const index = parseInt(slideIndex)\n const { isIntersecting } = intersectionEntryMap[index]\n const inViewMatch = inView && isIntersecting\n const notInViewMatch = !inView && !isIntersecting\n\n if (inViewMatch || notInViewMatch) list.push(index)\n return list\n },\n []\n )\n }\n\n function get(inView: boolean = true): number[] {\n if (inView && inViewCache) return inViewCache\n if (!inView && notInViewCache) return notInViewCache\n\n const slideIndexes = createInViewList(inView)\n\n if (inView) inViewCache = slideIndexes\n if (!inView) notInViewCache = slideIndexes\n\n return slideIndexes\n }\n\n const self: SlidesInViewType = {\n init,\n destroy,\n get\n }\n\n return self\n}\n", "import { AxisType } from './Axis'\nimport { NodeRectType } from './NodeRects'\nimport { arrayIsLastIndex, arrayLast, mathAbs, WindowType } from './utils'\n\nexport type SlideSizesType = {\n slideSizes: number[]\n slideSizesWithGaps: number[]\n startGap: number\n endGap: number\n}\n\nexport function SlideSizes(\n axis: AxisType,\n containerRect: NodeRectType,\n slideRects: NodeRectType[],\n slides: HTMLElement[],\n readEdgeGap: boolean,\n ownerWindow: WindowType\n): SlideSizesType {\n const { measureSize, startEdge, endEdge } = axis\n const withEdgeGap = slideRects[0] && readEdgeGap\n const startGap = measureStartGap()\n const endGap = measureEndGap()\n const slideSizes = slideRects.map(measureSize)\n const slideSizesWithGaps = measureWithGaps()\n\n function measureStartGap(): number {\n if (!withEdgeGap) return 0\n const slideRect = slideRects[0]\n return mathAbs(containerRect[startEdge] - slideRect[startEdge])\n }\n\n function measureEndGap(): number {\n if (!withEdgeGap) return 0\n const style = ownerWindow.getComputedStyle(arrayLast(slides))\n return parseFloat(style.getPropertyValue(`margin-${endEdge}`))\n }\n\n function measureWithGaps(): number[] {\n return slideRects\n .map((rect, index, rects) => {\n const isFirst = !index\n const isLast = arrayIsLastIndex(rects, index)\n if (isFirst) return slideSizes[index] + startGap\n if (isLast) return slideSizes[index] + endGap\n return rects[index + 1][startEdge] - rect[startEdge]\n })\n .map(mathAbs)\n }\n\n const self: SlideSizesType = {\n slideSizes,\n slideSizesWithGaps,\n startGap,\n endGap\n }\n return self\n}\n", "import { AxisType } from './Axis'\nimport { NodeRectType } from './NodeRects'\nimport {\n arrayKeys,\n arrayLast,\n arrayLastIndex,\n isNumber,\n mathAbs\n} from './utils'\n\nexport type SlidesToScrollOptionType = 'auto' | number\n\nexport type SlidesToScrollType = {\n groupSlides: <Type>(array: Type[]) => Type[][]\n}\n\nexport function SlidesToScroll(\n axis: AxisType,\n viewSize: number,\n slidesToScroll: SlidesToScrollOptionType,\n loop: boolean,\n containerRect: NodeRectType,\n slideRects: NodeRectType[],\n startGap: number,\n endGap: number,\n pixelTolerance: number\n): SlidesToScrollType {\n const { startEdge, endEdge, direction } = axis\n const groupByNumber = isNumber(slidesToScroll)\n\n function byNumber<Type>(array: Type[], groupSize: number): Type[][] {\n return arrayKeys(array)\n .filter((i) => i % groupSize === 0)\n .map((i) => array.slice(i, i + groupSize))\n }\n\n function bySize<Type>(array: Type[]): Type[][] {\n if (!array.length) return []\n\n return arrayKeys(array)\n .reduce((groups: number[], rectB, index) => {\n const rectA = arrayLast(groups) || 0\n const isFirst = rectA === 0\n const isLast = rectB === arrayLastIndex(array)\n\n const edgeA = containerRect[startEdge] - slideRects[rectA][startEdge]\n const edgeB = containerRect[startEdge] - slideRects[rectB][endEdge]\n const gapA = !loop && isFirst ? direction(startGap) : 0\n const gapB = !loop && isLast ? direction(endGap) : 0\n const chunkSize = mathAbs(edgeB - gapB - (edgeA + gapA))\n\n if (index && chunkSize > viewSize + pixelTolerance) groups.push(rectB)\n if (isLast) groups.push(array.length)\n return groups\n }, [])\n .map((currentSize, index, groups) => {\n const previousSize = Math.max(groups[index - 1] || 0)\n return array.slice(previousSize, currentSize)\n })\n }\n\n function groupSlides<Type>(array: Type[]): Type[][] {\n return groupByNumber ? byNumber(array, slidesToScroll) : bySize(array)\n }\n\n const self: SlidesToScrollType = {\n groupSlides\n }\n return self\n}\n", "import { Alignment } from './Alignment'\nimport { Animations, AnimationsType, AnimationsUpdateType } from './Animations'\nimport { Axis, AxisType } from './Axis'\nimport { Counter, CounterType } from './Counter'\nimport { DragHandler, DragHandlerType } from './DragHandler'\nimport { DragTracker } from './DragTracker'\nimport { EventHandlerType } from './EventHandler'\nimport { EventStore, EventStoreType } from './EventStore'\nimport { LimitType } from './Limit'\nimport { NodeRectType, NodeRects } from './NodeRects'\nimport { OptionsType } from './Options'\nimport { PercentOfView, PercentOfViewType } from './PercentOfView'\nimport { ResizeHandler, ResizeHandlerType } from './ResizeHandler'\nimport { ScrollBody, ScrollBodyType } from './ScrollBody'\nimport { ScrollBounds, ScrollBoundsType } from './ScrollBounds'\nimport { ScrollContain } from './ScrollContain'\nimport { ScrollLimit } from './ScrollLimit'\nimport { ScrollLooper, ScrollLooperType } from './ScrollLooper'\nimport { ScrollProgress, ScrollProgressType } from './ScrollProgress'\nimport { ScrollSnaps } from './ScrollSnaps'\nimport { SlideRegistry, SlideRegistryType } from './SlideRegistry'\nimport { ScrollTarget, ScrollTargetType } from './ScrollTarget'\nimport { ScrollTo, ScrollToType } from './ScrollTo'\nimport { SlideFocus, SlideFocusType } from './SlideFocus'\nimport { SlideLooper, SlideLooperType } from './SlideLooper'\nimport { SlidesHandler, SlidesHandlerType } from './SlidesHandler'\nimport { SlidesInView, SlidesInViewType } from './SlidesInView'\nimport { SlideSizes } from './SlideSizes'\nimport { SlidesToScroll, SlidesToScrollType } from './SlidesToScroll'\nimport { Translate, TranslateType } from './Translate'\nimport { arrayKeys, arrayLast, arrayLastIndex, WindowType } from './utils'\nimport { Vector1D, Vector1DType } from './Vector1d'\n\nexport type EngineType = {\n ownerDocument: Document\n ownerWindow: WindowType\n eventHandler: EventHandlerType\n axis: AxisType\n animation: AnimationsType\n scrollBounds: ScrollBoundsType\n scrollLooper: ScrollLooperType\n scrollProgress: ScrollProgressType\n index: CounterType\n indexPrevious: CounterType\n limit: LimitType\n location: Vector1DType\n options: OptionsType\n percentOfView: PercentOfViewType\n scrollBody: ScrollBodyType\n dragHandler: DragHandlerType\n eventStore: EventStoreType\n slideLooper: SlideLooperType\n slidesInView: SlidesInViewType\n slidesToScroll: SlidesToScrollType\n target: Vector1DType\n translate: TranslateType\n resizeHandler: ResizeHandlerType\n slidesHandler: SlidesHandlerType\n scrollTo: ScrollToType\n scrollTarget: ScrollTargetType\n scrollSnapList: number[]\n scrollSnaps: number[]\n slideIndexes: number[]\n slideFocus: SlideFocusType\n slideRegistry: SlideRegistryType['slideRegistry']\n containerRect: NodeRectType\n slideRects: NodeRectType[]\n}\n\nexport function Engine(\n root: HTMLElement,\n container: HTMLElement,\n slides: HTMLElement[],\n ownerDocument: Document,\n ownerWindow: WindowType,\n options: OptionsType,\n eventHandler: EventHandlerType\n): EngineType {\n // Options\n const {\n align,\n axis: scrollAxis,\n direction,\n startIndex,\n loop,\n duration,\n dragFree,\n dragThreshold,\n inViewThreshold,\n slidesToScroll: groupSlides,\n skipSnaps,\n containScroll,\n watchResize,\n watchSlides,\n watchDrag\n } = options\n\n // Measurements\n const pixelTolerance = 2\n const nodeRects = NodeRects()\n const containerRect = nodeRects.measure(container)\n const slideRects = slides.map(nodeRects.measure)\n const axis = Axis(scrollAxis, direction)\n const viewSize = axis.measureSize(containerRect)\n const percentOfView = PercentOfView(viewSize)\n const alignment = Alignment(align, viewSize)\n const containSnaps = !loop && !!containScroll\n const readEdgeGap = loop || !!containScroll\n const { slideSizes, slideSizesWithGaps, startGap, endGap } = SlideSizes(\n axis,\n containerRect,\n slideRects,\n slides,\n readEdgeGap,\n ownerWindow\n )\n const slidesToScroll = SlidesToScroll(\n axis,\n viewSize,\n groupSlides,\n loop,\n containerRect,\n slideRects,\n startGap,\n endGap,\n pixelTolerance\n )\n const { snaps, snapsAligned } = ScrollSnaps(\n axis,\n alignment,\n containerRect,\n slideRects,\n slidesToScroll\n )\n const contentSize = -arrayLast(snaps) + arrayLast(slideSizesWithGaps)\n const { snapsContained, scrollContainLimit } = ScrollContain(\n viewSize,\n contentSize,\n snapsAligned,\n containScroll,\n pixelTolerance\n )\n const scrollSnaps = containSnaps ? snapsContained : snapsAligned\n const { limit } = ScrollLimit(contentSize, scrollSnaps, loop)\n\n // Indexes\n const index = Counter(arrayLastIndex(scrollSnaps), startIndex, loop)\n const indexPrevious = index.clone()\n const slideIndexes = arrayKeys(slides)\n\n // Animation\n const update: AnimationsUpdateType = ({\n dragHandler,\n eventHandler,\n scrollBody,\n scrollBounds,\n scrollLooper,\n slideLooper,\n translate,\n location,\n animation,\n options: { loop }\n }) => {\n if (!loop) scrollBounds.constrain(dragHandler.pointerDown())\n scrollBody.seek()\n\n const shouldSettle = scrollBody.settled()\n const withinBounds = !scrollBounds.shouldConstrain()\n const hasSettled = loop ? shouldSettle : shouldSettle && withinBounds\n\n if (hasSettled && !dragHandler.pointerDown()) {\n animation.stop()\n eventHandler.emit('settle')\n }\n if (!hasSettled) eventHandler.emit('scroll')\n\n if (loop) {\n scrollLooper.loop(scrollBody.direction())\n slideLooper.loop()\n }\n\n translate.to(location.get())\n }\n\n const animation = Animations(ownerDocument, ownerWindow, () => update(engine))\n\n // Shared\n const friction = 0.68\n const startLocation = scrollSnaps[index.get()]\n const location = Vector1D(startLocation)\n const target = Vector1D(startLocation)\n const scrollBody = ScrollBody(location, target, duration, friction)\n const scrollTarget = ScrollTarget(\n loop,\n scrollSnaps,\n contentSize,\n limit,\n target\n )\n const scrollTo = ScrollTo(\n animation,\n index,\n indexPrevious,\n scrollTarget,\n target,\n eventHandler\n )\n const scrollProgress = ScrollProgress(limit)\n const eventStore = EventStore()\n const slidesInView = SlidesInView(\n container,\n slides,\n eventHandler,\n inViewThreshold\n )\n const { slideRegistry } = SlideRegistry(\n containSnaps,\n containScroll,\n scrollSnaps,\n scrollContainLimit,\n slidesToScroll,\n slideIndexes\n )\n const slideFocus = SlideFocus(\n root,\n slides,\n slideRegistry,\n scrollTo,\n scrollBody,\n eventStore,\n eventHandler\n )\n\n // Engine\n const engine: EngineType = {\n ownerDocument,\n ownerWindow,\n eventHandler,\n containerRect,\n slideRects,\n animation,\n axis,\n dragHandler: DragHandler(\n axis,\n root,\n ownerDocument,\n ownerWindow,\n target,\n DragTracker(axis, ownerWindow),\n location,\n animation,\n scrollTo,\n scrollBody,\n scrollTarget,\n index,\n eventHandler,\n percentOfView,\n dragFree,\n dragThreshold,\n skipSnaps,\n friction,\n watchDrag\n ),\n eventStore,\n percentOfView,\n index,\n indexPrevious,\n limit,\n location,\n options,\n resizeHandler: ResizeHandler(\n container,\n eventHandler,\n ownerWindow,\n slides,\n axis,\n watchResize,\n nodeRects\n ),\n scrollBody,\n scrollBounds: ScrollBounds(\n limit,\n location,\n target,\n scrollBody,\n percentOfView\n ),\n scrollLooper: ScrollLooper(contentSize, limit, location, [\n location,\n target\n ]),\n scrollProgress,\n scrollSnapList: scrollSnaps.map(scrollProgress.get),\n scrollSnaps,\n scrollTarget,\n scrollTo,\n slideLooper: SlideLooper(\n axis,\n viewSize,\n contentSize,\n slideSizes,\n slideSizesWithGaps,\n snaps,\n scrollSnaps,\n location,\n slides\n ),\n slideFocus,\n slidesHandler: SlidesHandler(container, eventHandler, watchSlides),\n slidesInView,\n slideIndexes,\n slideRegistry,\n slidesToScroll,\n target,\n translate: Translate(axis, container)\n }\n\n return engine\n}\n", "import { EmblaCarouselType } from './EmblaCarousel'\n\ntype CallbackType = (emblaApi: EmblaCarouselType, evt: EmblaEventType) => void\ntype ListenersType = Partial<{ [key in EmblaEventType]: CallbackType[] }>\n\nexport type EmblaEventType = EmblaEventListType[keyof EmblaEventListType]\n\nexport interface EmblaEventListType {\n init: 'init'\n pointerDown: 'pointerDown'\n pointerUp: 'pointerUp'\n slidesChanged: 'slidesChanged'\n slidesInView: 'slidesInView'\n scroll: 'scroll'\n select: 'select'\n settle: 'settle'\n destroy: 'destroy'\n reInit: 'reInit'\n resize: 'resize'\n slideFocus: 'slideFocus'\n}\n\nexport type EventHandlerType = {\n init: (emblaApi: EmblaCarouselType) => void\n emit: (evt: EmblaEventType) => EventHandlerType\n on: (evt: EmblaEventType, cb: CallbackType) => EventHandlerType\n off: (evt: EmblaEventType, cb: CallbackType) => EventHandlerType\n clear: () => void\n}\n\nexport function EventHandler(): EventHandlerType {\n let listeners: ListenersType = {}\n let api: EmblaCarouselType\n\n function init(emblaApi: EmblaCarouselType): void {\n api = emblaApi\n }\n\n function getListeners(evt: EmblaEventType): CallbackType[] {\n return listeners[evt] || []\n }\n\n function emit(evt: EmblaEventType): EventHandlerType {\n getListeners(evt).forEach((e) => e(api, evt))\n return self\n }\n\n function on(evt: EmblaEventType, cb: CallbackType): EventHandlerType {\n listeners[evt] = getListeners(evt).concat([cb])\n return self\n }\n\n function off(evt: EmblaEventType, cb: CallbackType): EventHandlerType {\n listeners[evt] = getListeners(evt).filter((e) => e !== cb)\n return self\n }\n\n function clear(): void {\n listeners = {}\n }\n\n const self: EventHandlerType = {\n init,\n emit,\n off,\n on,\n clear\n }\n return self\n}\n", "import { AlignmentOptionType } from './Alignment'\nimport { AxisDirectionOptionType, AxisOptionType } from './Axis'\nimport { SlidesToScrollOptionType } from './SlidesToScroll'\nimport { ScrollContainOptionType } from './ScrollContain'\nimport { DragHandlerOptionType } from './DragHandler'\nimport { ResizeHandlerOptionType } from './ResizeHandler'\nimport { SlidesHandlerOptionType } from './SlidesHandler'\nimport { SlidesInViewOptionsType } from './SlidesInView'\n\nexport type LooseOptionsType = {\n [key: string]: unknown\n}\n\nexport type CreateOptionsType<Type extends LooseOptionsType> = Type & {\n active: boolean\n breakpoints: {\n [key: string]: Omit<Partial<CreateOptionsType<Type>>, 'breakpoints'>\n }\n}\n\nexport type OptionsType = CreateOptionsType<{\n align: AlignmentOptionType\n axis: AxisOptionType\n container: string | HTMLElement | null\n slides: string | HTMLElement[] | NodeListOf<HTMLElement> | null\n containScroll: ScrollContainOptionType\n direction: AxisDirectionOptionType\n slidesToScroll: SlidesToScrollOptionType\n dragFree: boolean\n dragThreshold: number\n inViewThreshold: SlidesInViewOptionsType\n loop: boolean\n skipSnaps: boolean\n duration: number\n startIndex: number\n watchDrag: DragHandlerOptionType\n watchResize: ResizeHandlerOptionType\n watchSlides: SlidesHandlerOptionType\n}>\n\nexport const defaultOptions: OptionsType = {\n align: 'center',\n axis: 'x',\n container: null,\n slides: null,\n containScroll: 'trimSnaps',\n direction: 'ltr',\n slidesToScroll: 1,\n inViewThreshold: 0,\n breakpoints: {},\n dragFree: false,\n dragThreshold: 10,\n loop: false,\n skipSnaps: false,\n duration: 25,\n startIndex: 0,\n active: true,\n watchDrag: true,\n watchResize: true,\n watchSlides: true\n}\n\nexport type EmblaOptionsType = Partial<OptionsType>\n", "import { LooseOptionsType, CreateOptionsType } from './Options'\nimport { objectKeys, objectsMergeDeep, WindowType } from './utils'\n\ntype OptionsType = Partial<CreateOptionsType<LooseOptionsType>>\n\nexport type OptionsHandlerType = {\n mergeOptions: <TypeA extends OptionsType, TypeB extends OptionsType>(\n optionsA: TypeA,\n optionsB?: TypeB\n ) => TypeA\n optionsAtMedia: <Type extends OptionsType>(options: Type) => Type\n optionsMediaQueries: (optionsList: OptionsType[]) => MediaQueryList[]\n}\n\nexport function OptionsHandler(ownerWindow: WindowType): OptionsHandlerType {\n function mergeOptions<TypeA extends OptionsType, TypeB extends OptionsType>(\n optionsA: TypeA,\n optionsB?: TypeB\n ): TypeA {\n return <TypeA>objectsMergeDeep(optionsA, optionsB || {})\n }\n\n function optionsAtMedia<Type extends OptionsType>(options: Type): Type {\n const optionsAtMedia = options.breakpoints || {}\n const matchedMediaOptions = objectKeys(optionsAtMedia)\n .filter((media) => ownerWindow.matchMedia(media).matches)\n .map((media) => optionsAtMedia[media])\n .reduce((a, mediaOption) => mergeOptions(a, mediaOption), {})\n\n return mergeOptions(options, matchedMediaOptions)\n }\n\n function optionsMediaQueries(optionsList: OptionsType[]): MediaQueryList[] {\n return optionsList\n .map((options) => objectKeys(options.breakpoints || {}))\n .reduce((acc, mediaQueries) => acc.concat(mediaQueries), [])\n .map(ownerWindow.matchMedia)\n }\n\n const self: OptionsHandlerType = {\n mergeOptions,\n optionsAtMedia,\n optionsMediaQueries\n }\n return self\n}\n", "import { EmblaCarouselType } from './EmblaCarousel'\nimport { OptionsHandlerType } from './OptionsHandler'\nimport { EmblaPluginsType, EmblaPluginType } from './Plugins'\n\nexport type PluginsHandlerType = {\n init: (\n emblaApi: EmblaCarouselType,\n plugins: EmblaPluginType[]\n ) => EmblaPluginsType\n destroy: () => void\n}\n\nexport function PluginsHandler(\n optionsHandler: OptionsHandlerType\n): PluginsHandlerType {\n let activePlugins: EmblaPluginType[] = []\n\n function init(\n emblaApi: EmblaCarouselType,\n plugins: EmblaPluginType[]\n ): EmblaPluginsType {\n activePlugins = plugins.filter(\n ({ options }) => optionsHandler.optionsAtMedia(options).active !== false\n )\n activePlugins.forEach((plugin) => plugin.init(emblaApi, optionsHandler))\n\n return plugins.reduce(\n (map, plugin) => Object.assign(map, { [plugin.name]: plugin }),\n {}\n )\n }\n\n function destroy(): void {\n activePlugins = activePlugins.filter((plugin) => plugin.destroy())\n }\n\n const self: PluginsHandlerType = {\n init,\n destroy\n }\n return self\n}\n", "import { Engine, EngineType } from './Engine'\nimport { EventStore } from './EventStore'\nimport { EventHandler, EventHandlerType } from './EventHandler'\nimport { defaultOptions, EmblaOptionsType, OptionsType } from './Options'\nimport { OptionsHandler } from './OptionsHandler'\nimport { PluginsHandler } from './PluginsHandler'\nimport { EmblaPluginsType, EmblaPluginType } from './Plugins'\nimport { isString, WindowType } from './utils'\n\nexport type EmblaCarouselType = {\n canScrollNext: () => boolean\n canScrollPrev: () => boolean\n containerNode: () => HTMLElement\n internalEngine: () => EngineType\n destroy: () => void\n off: EventHandlerType['off']\n on: EventHandlerType['on']\n emit: EventHandlerType['emit']\n plugins: () => EmblaPluginsType\n previousScrollSnap: () => number\n reInit: (options?: EmblaOptionsType, plugins?: EmblaPluginType[]) => void\n rootNode: () => HTMLElement\n scrollNext: (jump?: boolean) => void\n scrollPrev: (jump?: boolean) => void\n scrollProgress: () => number\n scrollSnapList: () => number[]\n scrollTo: (index: number, jump?: boolean) => void\n selectedScrollSnap: () => number\n slideNodes: () => HTMLElement[]\n slidesInView: () => number[]\n slidesNotInView: () => number[]\n}\n\nfunction EmblaCarousel(\n root: HTMLElement,\n userOptions?: EmblaOptionsType,\n userPlugins?: EmblaPluginType[]\n): EmblaCarouselType {\n const ownerDocument = root.ownerDocument\n const ownerWindow = <WindowType>ownerDocument.defaultView\n const optionsHandler = OptionsHandler(ownerWindow)\n const pluginsHandler = PluginsHandler(optionsHandler)\n const mediaHandlers = EventStore()\n const eventHandler = EventHandler()\n const { mergeOptions, optionsAtMedia, optionsMediaQueries } = optionsHandler\n const { on, off, emit } = eventHandler\n const reInit = reActivate\n\n let destroyed = false\n let engine: EngineType\n let optionsBase = mergeOptions(defaultOptions, EmblaCarousel.globalOptions)\n let options = mergeOptions(optionsBase)\n let pluginList: EmblaPluginType[] = []\n let pluginApis: EmblaPluginsType\n\n let container: HTMLElement\n let slides: HTMLElement[]\n\n function storeElements(): void {\n const { container: userContainer, slides: userSlides } = options\n\n const customContainer = isString(userContainer)\n ? root.querySelector(userContainer)\n : userContainer\n container = <HTMLElement>(customContainer || root.children[0])\n\n const customSlides = isString(userSlides)\n ? container.querySelectorAll(userSlides)\n : userSlides\n slides = <HTMLElement[]>[].slice.call(customSlides || container.children)\n }\n\n function createEngine(options: OptionsType): EngineType {\n const engine = Engine(\n root,\n container,\n slides,\n ownerDocument,\n ownerWindow,\n options,\n eventHandler\n )\n\n if (options.loop && !engine.slideLooper.canLoop()) {\n const optionsWithoutLoop = Object.assign({}, options, { loop: false })\n return createEngine(optionsWithoutLoop)\n }\n return engine\n }\n\n function activate(\n withOptions?: EmblaOptionsType,\n withPlugins?: EmblaPluginType[]\n ): void {\n if (destroyed) return\n\n optionsBase = mergeOptions(optionsBase, withOptions)\n options = optionsAtMedia(optionsBase)\n pluginList = withPlugins || pluginList\n\n storeElements()\n\n engine = createEngine(options)\n\n optionsMediaQueries([\n optionsBase,\n ...pluginList.map(({ options }) => options)\n ]).forEach((query) => mediaHandlers.add(query, 'change', reActivate))\n\n if (!options.active) return\n\n engine.translate.to(engine.location.get())\n engine.animation.init()\n engine.slidesInView.init()\n engine.slideFocus.init()\n engine.eventHandler.init(self)\n engine.resizeHandler.init(self)\n engine.slidesHandler.init(self)\n\n if (engine.options.loop) engine.slideLooper.loop()\n if (container.offsetParent && slides.length) engine.dragHandler.init(self)\n\n pluginApis = pluginsHandler.init(self, pluginList)\n }\n\n function reActivate(\n withOptions?: EmblaOptionsType,\n withPlugins?: EmblaPluginType[]\n ): void {\n const startIndex = selectedScrollSnap()\n deActivate()\n activate(mergeOptions({ startIndex }, withOptions), withPlugins)\n eventHandler.emit('reInit')\n }\n\n function deActivate(): void {\n engine.dragHandler.destroy()\n engine.eventStore.clear()\n engine.translate.clear()\n engine.slideLooper.clear()\n engine.resizeHandler.destroy()\n engine.slidesHandler.destroy()\n engine.slidesInView.destroy()\n engine.animation.destroy()\n pluginsHandler.destroy()\n mediaHandlers.clear()\n }\n\n function destroy(): void {\n if (destroyed) return\n destroyed = true\n mediaHandlers.clear()\n deActivate()\n eventHandler.emit('destroy')\n eventHandler.clear()\n }\n\n function scrollTo(index: number, jump?: boolean, direction?: number): void {\n if (!options.active || destroyed) return\n engine.scrollBody\n .useBaseFriction()\n .useDuration(jump === true ? 0 : options.duration)\n engine.scrollTo.index(index, direction || 0)\n }\n\n function scrollNext(jump?: boolean): void {\n const next = engine.index.add(1).get()\n scrollTo(next, jump, -1)\n }\n\n function scrollPrev(jump?: boolean): void {\n const prev = engine.index.add(-1).get()\n scrollTo(prev, jump, 1)\n }\n\n function canScrollNext(): boolean {\n const next = engine.index.add(1).get()\n return next !== selectedScrollSnap()\n }\n\n function canScrollPrev(): boolean {\n const prev = engine.index.add(-1).get()\n return prev !== selectedScrollSnap()\n }\n\n function scrollSnapList(): number[] {\n return engine.scrollSnapList\n }\n\n function scrollProgress(): number {\n return engine.scrollProgress.get(engine.location.get())\n }\n\n function selectedScrollSnap(): number {\n return engine.index.get()\n }\n\n function previousScrollSnap(): number {\n return engine.indexPrevious.get()\n }\n\n function slidesInView(): number[] {\n return engine.slidesInView.get()\n }\n\n function slidesNotInView(): number[] {\n return engine.slidesInView.get(false)\n }\n\n function plugins(): EmblaPluginsType {\n return pluginApis\n }\n\n function internalEngine(): EngineType {\n return engine\n }\n\n function rootNode(): HTMLElement {\n return root\n }\n\n function containerNode(): HTMLElement {\n return container\n }\n\n function slideNodes(): HTMLElement[] {\n return slides\n }\n\n const self: EmblaCarouselType = {\n canScrollNext,\n canScrollPrev,\n containerNode,\n internalEngine,\n destroy,\n off,\n on,\n emit,\n plugins,\n previousScrollSnap,\n reInit,\n rootNode,\n scrollNext,\n scrollPrev,\n scrollProgress,\n scrollSnapList,\n scrollTo,\n selectedScrollSnap,\n slideNodes,\n slidesInView,\n slidesNotInView\n }\n\n activate(userOptions, userPlugins)\n setTimeout(() => eventHandler.emit('init'), 0)\n return self\n}\n\ndeclare namespace EmblaCarousel {\n let globalOptions: EmblaOptionsType | undefined\n}\n\nEmblaCarousel.globalOptions = undefined\n\nexport default EmblaCarousel\n", "import { useRef, useEffect, useState, useCallback } from 'react'\nimport {\n areOptionsEqual,\n arePluginsEqual,\n canUseDOM\n} from 'embla-carousel-reactive-utils'\nimport EmblaCarousel, {\n EmblaCarouselType,\n EmblaOptionsType,\n EmblaPluginType\n} from 'embla-carousel'\n\ntype EmblaViewportRefType = <ViewportElement extends HTMLElement>(\n instance: ViewportElement | null\n) => void\n\nexport type UseEmblaCarouselType = [\n EmblaViewportRefType,\n EmblaCarouselType | undefined\n]\n\nfunction useEmblaCarousel(\n options: EmblaOptionsType = {},\n plugins: EmblaPluginType[] = []\n): UseEmblaCarouselType {\n const storedOptions = useRef(options)\n const storedPlugins = useRef(plugins)\n const [emblaApi, setEmblaApi] = useState<EmblaCarouselType>()\n const [viewport, setViewport] = useState<HTMLElement>()\n\n const reInit = useCallback(() => {\n if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current)\n }, [emblaApi])\n\n useEffect(() => {\n if (canUseDOM() && viewport) {\n EmblaCarousel.globalOptions = useEmblaCarousel.globalOptions\n const newEmblaApi = EmblaCarousel(\n viewport,\n storedOptions.current,\n storedPlugins.current\n )\n setEmblaApi(newEmblaApi)\n return () => newEmblaApi.destroy()\n } else {\n setEmblaApi(undefined)\n }\n }, [viewport, setEmblaApi])\n\n useEffect(() => {\n if (areOptionsEqual(storedOptions.current, options)) return\n storedOptions.current = options\n reInit()\n }, [options, reInit])\n\n useEffect(() => {\n if (arePluginsEqual(storedPlugins.current, plugins)) return\n storedPlugins.current = plugins\n reInit()\n }, [plugins, reInit])\n\n return [<EmblaViewportRefType>setViewport, emblaApi]\n}\n\ndeclare namespace useEmblaCarousel {\n let globalOptions: EmblaOptionsType | undefined\n}\n\nuseEmblaCarousel.globalOptions = undefined\n\nexport default useEmblaCarousel\n", "import React, { forwardRef } from \"react\"\nimport { Thumb } from \"./CarouselThumbsButton\"\nimport { CarouselThumbs as CarouselThumbsProps } from \"@warp/types/product\"\n\nconst CarouselThumbs = forwardRef<HTMLDivElement, CarouselThumbsProps>(\n ({ images, selectedIndex, onThumbClick }, ref) => {\n return (\n <div className=\"carousel-thumbs\">\n <div className=\"carousel-thumbs__viewport\" ref={ref}>\n <div className=\"carousel-thumbs__container\">\n {images.map((image, index) => (\n <Thumb\n key={image.id}\n onClick={() => onThumbClick(image.id)}\n selected={index === selectedIndex}\n image={image}\n />\n ))}\n </div>\n </div>\n </div>\n )\n }\n)\n\nexport default CarouselThumbs\n", "import React from \"react\"\nimport { Image } from \"@warp/types/product\"\nimport { buildSrcsetString, getLastSrcsetUrl } from \"@warp/utilities/images\"\n\ntype PropType = {\n selected: boolean\n image: Image\n onClick: React.MouseEventHandler<HTMLButtonElement>\n}\n\nexport const Thumb: React.FC<PropType> = (props) => {\n const { selected, image, onClick } = props\n\n return (\n <div\n className={\"carousel-thumbs__slide\".concat(\n selected ? \" carousel-thumbs__slide--selected\" : \"\"\n )}\n >\n <button\n onClick={onClick}\n type=\"button\"\n className=\"carousel-thumbs__slide__image\"\n >\n <img\n src={getLastSrcsetUrl(image.thumbnail.srcset)}\n srcSet={buildSrcsetString(image.thumbnail.srcset)}\n alt={image.alt}\n sizes=\"25vw\"\n />\n </button>\n </div>\n )\n}\n", "import React, { ComponentProps } from \"react\"\nimport { EmblaCarouselType } from \"embla-carousel\"\nimport { usePrevNextButtons } from \"@warp/hooks/carousel\"\n\nexport interface CarouselArrowsProps {\n emblaApi?: EmblaCarouselType\n}\n\ntype ArrowPropType = ComponentProps<\"button\">\n\nfunction ArrowLeft(props: ArrowPropType) {\n return (\n <div className=\"carousel__arrow-prev\">\n <button\n className=\"carousel__arrow-prev__icon\"\n aria-hidden=\"true\"\n {...props}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <path d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z\"></path>\n </svg>\n </button>\n <span className=\"visually-hidden\">Previous</span>\n </div>\n )\n}\n\nfunction ArrowRight(props: ArrowPropType) {\n return (\n <div className=\"carousel__arrow-next\">\n <button\n className=\"carousel__arrow-next__icon\"\n aria-hidden=\"true\"\n {...props}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <path d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z\"></path>\n </svg>\n </button>\n <span className=\"visually-hidden\">Next</span>\n </div>\n )\n}\n\nexport default function CarouselArrows({ emblaApi }: CarouselArrowsProps) {\n const {\n prevBtnDisabled,\n nextBtnDisabled,\n onPrevButtonClick,\n onNextButtonClick\n } = usePrevNextButtons(emblaApi)\n\n return (\n <>\n <ArrowLeft onClick={onPrevButtonClick} disabled={prevBtnDisabled} />\n <ArrowRight onClick={onNextButtonClick} disabled={nextBtnDisabled} />\n </>\n )\n}\n", "import { useCallback, useEffect, useState } from \"react\"\nimport { EmblaCarouselType } from \"embla-carousel\"\n\ntype UsePrevNextButtonsType = {\n prevBtnDisabled: boolean\n nextBtnDisabled: boolean\n onPrevButtonClick: () => void\n onNextButtonClick: () => void\n}\n\nexport const usePrevNextButtons = (\n emblaApi: EmblaCarouselType | undefined\n): UsePrevNextButtonsType => {\n const [prevBtnDisabled, setPrevBtnDisabled] = useState(true)\n const [nextBtnDisabled, setNextBtnDisabled] = useState(true)\n\n const onPrevButtonClick = useCallback(() => {\n if (!emblaApi) return\n emblaApi.scrollPrev()\n }, [emblaApi])\n\n const onNextButtonClick = useCallback(() => {\n if (!emblaApi) return\n emblaApi.scrollNext()\n }, [emblaApi])\n\n const onSelect = useCallback((emblaApi: EmblaCarouselType) => {\n setPrevBtnDisabled(!emblaApi.canScrollPrev())\n setNextBtnDisabled(!emblaApi.canScrollNext())\n }, [])\n\n useEffect(() => {\n if (!emblaApi) return\n\n onSelect(emblaApi)\n emblaApi.on(\"reInit\", onSelect).on(\"select\", onSelect)\n }, [emblaApi, onSelect])\n\n return {\n prevBtnDisabled,\n nextBtnDisabled,\n onPrevButtonClick,\n onNextButtonClick\n }\n}\n", "import React, { useCallback } from \"react\"\nimport Dialog, { DialogProps } from \"../Dialog\"\nimport { Image } from \"@warp/types/product\"\nimport { getLastSrcsetUrl } from \"@warp/utilities/images\"\nimport ZoomAndPan from \"@warp/components/pdp/Zoom/ZoomAndPan\"\nimport CarouselThumbs from \"@warp/components/pdp/ProductImages/CarouselThumbs\"\nimport useEmblaCarousel from \"embla-carousel-react\"\n\ninterface ZoomDialogProps\n extends Omit<\n DialogProps,\n \"modalName\" | \"children\" | \"onOpenCallback\" | \"onCloseCallback\"\n > {\n onOpenCallbackWithId?: (id?: string) => void\n onCloseCallbackWithId?: (id?: string) => void\n slides: Image[]\n description?: string\n closeText?: string\n}\n\ninterface OpenEventDetail {\n id?: string\n variantIds?: number[]\n images?: Image[]\n}\n\nexport default function ZoomModal({\n onOpenCallbackWithId,\n onCloseCallbackWithId,\n slides,\n description,\n closeText\n}: ZoomDialogProps) {\n const [currentImageId, setCurrentImageId] = React.useState<number | null>(\n null\n )\n const [currentSlideIndex, setCurrentSlideIndex] = React.useState(0)\n const [customImages, setCustomImages] = React.useState<Image[]>([])\n\n const [variantIds, setVariantIds] = React.useState<number[]>([])\n\n const [emblaThumbsRef, emblaThumbsApi] = useEmblaCarousel({\n align: \"start\",\n dragFree: true\n })\n\n const filteredSlides = React.useMemo(() => {\n if (variantIds.length > 0) {\n return slides.filter((slide) => variantIds.includes(slide.variantId))\n }\n\n return slides\n }, [slides, variantIds])\n\n React.useEffect(() => {\n const newIndex = filteredSlides.findIndex(\n (slide) => slide.id === currentImageId\n )\n\n if (newIndex !== -1) {\n setCurrentSlideIndex(newIndex)\n } else {\n setCurrentSlideIndex(0)\n }\n }, [currentImageId, filteredSlides])\n\n const onThumbClick = useCallback(\n (id: number) => {\n setCurrentImageId(id)\n },\n [emblaThumbsApi, filteredSlides]\n )\n\n const modalName = \"zoom\"\n\n const handleOpen = ({ id, variantIds, images }: OpenEventDetail) => {\n setCurrentImageId(Number(id))\n\n if (variantIds) {\n setVariantIds(variantIds)\n }\n\n if (images) {\n setCustomImages(images)\n }\n\n onOpenCallbackWithId?.(id)\n }\n\n const handleClose = (id?: string) => {\n setVariantIds([])\n setCustomImages([])\n onCloseCallbackWithId?.(id)\n }\n\n const handleDialogClose = () => {\n handleClose()\n }\n\n React.useEffect(() => {\n const handleOpenEvent = (event: CustomEvent) => {\n handleOpen(event.detail)\n }\n const handleCloseEvent = (event: CustomEvent) => {\n handleClose(event.detail.id)\n }\n\n document.addEventListener(\n `${modalName}ModalOpen`,\n handleOpenEvent as EventListener\n )\n document.addEventListener(\n `${modalName}ModalClose`,\n handleCloseEvent as EventListener\n )\n\n return () => {\n document.removeEventListener(\n `${modalName}ModalOpen`,\n handleOpenEvent as EventListener\n )\n document.removeEventListener(\n `${modalName}ModalClose`,\n handleCloseEvent as EventListener\n )\n }\n }, [])\n\n const images: Image[] =\n customImages.length > 0 ? customImages : filteredSlides\n\n const slide = images[currentSlideIndex]\n\n return (\n <Dialog\n modalName={modalName}\n description={description}\n closeText={closeText}\n onCloseCallback={handleDialogClose}\n contentClassName=\"zoom-modal__content\"\n headerWrapperClassName=\"zoom-modal__header-wrapper\"\n footerClassName=\"zoom-modal__footer\"\n footer={\n <CarouselThumbs\n images={images}\n selectedIndex={currentSlideIndex}\n onThumbClick={onThumbClick}\n ref={emblaThumbsRef}\n />\n }\n >\n <div className=\"zoom-modal__content__image__desktop\">\n <ZoomAndPan\n largeImage={getLastSrcsetUrl(slide.srcset)}\n alt={slide.alt}\n objectFit=\"contain\"\n minScale={4}\n />\n </div>\n <div className=\"zoom-modal__content__image__mobile\">\n <ZoomAndPan\n largeImage={getLastSrcsetUrl(slide.srcset)}\n alt={slide.alt}\n objectFit=\"contain\"\n minScale={2}\n maxScale={4}\n />\n </div>\n </Dialog>\n )\n}\n", "import React from \"react\"\nimport { Image, Badge } from \"@warp/types/product\"\nimport ZoomableImage from \"../Zoom/ZoomableImage\"\nimport Badges from \"../Badges/Badges\"\n\ntype PropType = {\n slides: Image[]\n badges?: Badge[]\n}\n\nexport const ImagesGrid: React.FC<PropType> = ({ slides, badges }) => {\n const toggleZoom = (index: number) => {\n const openEvent = new CustomEvent(\"zoomModalOpen\", {\n detail: { id: index }\n })\n document.dispatchEvent(openEvent)\n }\n\n if (slides.length === 1) {\n const image = slides[0]\n return (\n <div className=\"product-images__desktop__single-image\">\n <Badges badges={badges} variantId={image.variantId} />\n <ZoomableImage\n image={image}\n sizes=\"100vw\"\n toggleZoom={() => toggleZoom(image.id)}\n />\n </div>\n )\n }\n\n return (\n <div className=\"product-images__desktop__images\">\n {slides.map((image, index) => (\n <div className=\"product-images__desktop__images__image\" key={index}>\n <Badges badges={badges} variantId={image.variantId} />\n <ZoomableImage\n image={image}\n sizes=\"40vw\"\n toggleZoom={() => toggleZoom(image.id)}\n />\n </div>\n ))}\n </div>\n )\n}\n"], "mappings": "2YAAA,IAAAA,GAAqB,UACrBC,GAAkB,SCDlB,IAAAC,EAAwD,wBCElD,SAAUC,GAASC,EAAgB,CACvC,OAAOC,OAAOC,UAAUC,SAASC,KAAKJ,CAAO,IAAM,iBACrD,CAEM,SAAUK,GACdL,EAAgB,CAEhB,OAAOD,GAASC,CAAO,GAAKM,MAAMC,QAAQP,CAAO,CACnD,UAEgBQ,IAAS,CACvB,MA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,iBAC1B,CACF,EACAE,GAAiBC,CACnB,CACF,MACE,QAAQ,MAAM,gCAAgC", "names": ["import_react_dom", "import_react", "import_react", "isObject", "subject", "Object", "prototype", "toString", "call", "isRecord", "Array", "isArray", "canUseDOM", "window", "document", "createElement", "areOptionsEqual", "optionsA", "optionsB", "optionsAKeys", "keys", "optionsBKeys", "length", "breakpointsA", "JSON", "stringify", "breakpoints", "breakpointsB", "every", "key", "valueA", "valueB", "sortAndMapPluginToOptions", "plugins", "concat", "sort", "a", "b", "name", "map", "plugin", "options", "arePluginsEqual", "pluginsA", "pluginsB", "optionA", "index", "optionB", "isNumber", "subject", "isString", "isBoolean", "isObject", "Object", "prototype", "toString", "call", "mathAbs", "n", "Math", "abs", "mathSign", "sign", "deltaAbs", "valueB", "valueA", "factorAbs", "diff", "arrayKeys", "array", "objectKeys", "map", "Number", "arrayLast", "arrayLastIndex", "max", "length", "arrayIsLastIndex", "index", "arrayFromNumber", "startAt", "Array", "from", "_", "i", "object", "keys", "objectsMergeDeep", "objectA", "objectB", "reduce", "mergedObjects", "currentObject", "forEach", "key", "areObjects", "isMouseEvent", "evt", "ownerWindow", "MouseEvent", "Alignment", "align", "viewSize", "predefined", "start", "center", "end", "measure", "EventStore", "listeners", "add", "node", "type", "handler", "options", "passive", "removeListener", "addEventListener", "removeEventListener", "legacyMediaQueryList", "addListener", "push", "self", "clear", "filter", "remove", "Animations", "ownerDocument", "update", "documentVisibleHandler", "timeStep", "lastTimeStamp", "animationFrame", "lag", "init", "hidden", "reset", "destroy", "stop", "animate", "timeStamp", "timeElapsed", "requestAnimationFrame", "cancelAnimationFrame", "Axis", "axis", "contentDirection", "isRightToLeft", "isVertical", "scroll", "cross", "startEdge", "getStartEdge", "endEdge", "getEndEdge", "measureSize", "nodeRect", "height", "width", "direction", "Limit", "min", "reachedMin", "reachedMax", "reachedAny", "constrain", "removeOffset", "ceil", "Counter", "loop", "loopEnd", "counter", "withinLimit", "get", "set", "clone", "DragHandler", "rootNode", "target", "dragTracker", "location", "animation", "scrollTo", "scrollBody", "scrollTarget", "eventHandler", "percentOfView", "dragFree", "dragThreshold", "skipSnaps", "baseFriction", "watchDrag", "crossAxis", "focusNodes", "nonPassiveEvent", "initEvents", "dragEvents", "goToNextThreshold", "snapForceBoost", "mouse", "touch", "freeForceBoost", "baseSpeed", "isMoving", "startScroll", "startCross", "pointerIsDown", "preventScroll", "preventClick", "isMouse", "emblaApi", "downIfAllowed", "down", "preventDefault", "up", "click", "addDragEvents", "move", "isFocusNode", "nodeName", "includes", "forceBoost", "allowedForce", "force", "targetChanged", "next", "baseForce", "byDistance", "distance", "byIndex", "isMouseEvt", "buttons", "button", "pointerDown", "useFriction", "useDuration", "readPoint", "emit", "touches", "lastScroll", "lastCross", "diffScroll", "diffCross", "cancelable", "pointerMove", "rawForce", "pointerUp", "forceFactor", "speed", "friction", "stopPropagation", "DragTracker", "startEvent", "lastEvent", "readTime", "evtAxis", "coord", "expired", "logInterval", "diffDrag", "diffTime", "NodeRects", "offsetTop", "offsetLeft", "offsetWidth", "offsetHeight", "top", "right", "bottom", "left", "PercentOfView", "ResizeHandler", "container", "slides", "watchResize", "nodeRects", "resizeObserver", "containerSize", "slideSizes", "destroyed", "readSize", "defaultCallback", "entries", "entry", "isContainer", "slideIndex", "indexOf", "lastSize", "newSize", "reInit", "ResizeObserver", "concat", "observe", "disconnect", "ScrollBody", "baseDuration", "bodyVelocity", "scrollDirection", "scrollDuration", "scrollFriction", "rawLocation", "rawLocationPrevious", "seek", "isInstant", "directionDiff", "settled", "duration", "velocity", "useBaseDuration", "useBaseFriction", "ScrollBounds", "limit", "pullBackThreshold", "edgeOffsetTolerance", "frictionLimit", "disabled", "shouldConstrain", "edge", "diffToEdge", "diffToTarget", "subtract", "toggleActive", "active", "ScrollContain", "contentSize", "snapsAligned", "containScroll", "pixelTolerance", "scrollBounds", "snapsBounded", "measureBounded", "scrollContainLimit", "findScrollContainLimit", "snapsContained", "measureContained", "usePixelTolerance", "bound", "snap", "startSnap", "endSnap", "lastIndexOf", "snapAligned", "isFirst", "isLast", "scrollBound", "parseFloat", "toFixed", "slice", "ScrollLimit", "scrollSnaps", "ScrollLooper", "vectors", "jointSafety", "shouldLoop", "loopDistance", "v", "ScrollProgress", "currentLocation", "ScrollSnaps", "alignment", "containerRect", "slideRects", "slidesToScroll", "groupSlides", "alignments", "measureSizes", "snaps", "measureUnaligned", "measureAligned", "rects", "rect", "g", "SlideRegistry", "containSnaps", "slideIndexes", "slideRegistry", "createSlideRegistry", "groupedSlideIndexes", "doNotContain", "group", "groups", "range", "ScrollTarget", "targetVector", "minDistance", "distances", "sort", "a", "b", "findTargetSnap", "ascDiffsToSnaps", "shortcut", "d1", "d2", "targets", "matchingTargets", "t", "diffToSnap", "targetSnapDistance", "reachedBound", "snapDistance", "ScrollTo", "indexCurrent", "indexPrevious", "distanceDiff", "indexDiff", "targetIndex", "SlideFocus", "root", "eventStore", "lastTabPressTime", "document", "registerTabPress", "addSlideFocusEvent", "event", "code", "Date", "getTime", "slide", "focus", "scrollLeft", "findIndex", "capture", "Vector1D", "initialValue", "value", "normalizeInput", "Translate", "translate", "x", "y", "containerStyle", "style", "to", "transform", "getAttribute", "removeAttribute", "SlideLooper", "slideSizesWithGaps", "ascItems", "descItems", "reverse", "loopPoints", "startPoints", "endPoints", "removeSlideSizes", "indexes", "slidesInGap", "gap", "findSlideBounds", "offset", "roundingSafety", "findLoopPoints", "isEndEdge", "slideBounds", "initial", "altered", "boundEdge", "loopPoint", "slideLocation", "canLoop", "every", "otherIndexes", "shiftLocation", "SlidesHandler", "watchSlides", "mutationObserver", "mutations", "mutation", "MutationObserver", "childList", "SlidesInView", "threshold", "intersectionEntryMap", "inViewCache", "notInViewCache", "intersectionObserver", "IntersectionObserver", "parentElement", "createInViewList", "inView", "list", "parseInt", "isIntersecting", "SlideSizes", "readEdgeGap", "withEdgeGap", "startGap", "measureStartGap", "endGap", "measureEndGap", "measureWithGaps", "slideRect", "getComputedStyle", "getPropertyValue", "SlidesToScroll", "groupByNumber", "byNumber", "groupSize", "bySize", "rectB", "rectA", "edgeA", "edgeB", "gapA", "gapB", "chunkSize", "currentSize", "previousSize", "Engine", "scrollAxis", "startIndex", "inViewThreshold", "dragHandler", "scrollLooper", "slideLooper", "shouldSettle", "withinBounds", "hasSettled", "engine", "startLocation", "scrollProgress", "slidesInView", "slideFocus", "resizeHandler", "scrollSnapList", "slidesHandler", "EventHandler", "api", "getListeners", "e", "on", "cb", "off", "defaultOptions", "breakpoints", "OptionsHandler", "mergeOptions", "optionsA", "optionsB", "optionsAtMedia", "matchedMediaOptions", "media", "matchMedia", "matches", "mediaOption", "optionsMediaQueries", "optionsList", "acc", "mediaQueries", "PluginsHandler", "optionsHandler", "activePlugins", "plugins", "plugin", "assign", "name", "EmblaCarousel", "userOptions", "userPlugins", "defaultView", "pluginsHandler", "mediaHandlers", "reActivate", "optionsBase", "globalOptions", "pluginList", "pluginApis", "storeElements", "userContainer", "userSlides", "querySelector", "children", "customSlides", "querySelectorAll", "createEngine", "optionsWithoutLoop", "activate", "withOptions", "withPlugins", "query", "offsetParent", "selectedScrollSnap", "deActivate", "jump", "scrollNext", "scrollPrev", "prev", "canScrollNext", "canScrollPrev", "previousScrollSnap", "slidesNotInView", "internalEngine", "containerNode", "slideNodes", "setTimeout", "undefined", "useEmblaCarousel", "options", "plugins", "storedOptions", "useRef", "storedPlugins", "emblaApi", "setEmblaApi", "useState", "viewport", "setViewport", "reInit", "useCallback", "current", "useEffect", "canUseDOM", "EmblaCarousel", "globalOptions", "newEmblaApi", "destroy", "undefined", "areOptionsEqual", "arePluginsEqual", "import_react", "import_react", "Thumb", "props", "selected", "image", "onClick", "React", "getLastSrcsetUrl", "buildSrcsetString", "CarouselThumbs", "images", "selectedIndex", "onThumbClick", "ref", "React", "image", "index", "Thumb", "CarouselThumbs_default", "import_react", "import_react", "usePrevNextButtons", "emblaApi", "prevBtnDisabled", "setPrevBtnDisabled", "nextBtnDisabled", "setNextBtnDisabled", "onPrevButtonClick", "onNextButtonClick", "onSelect", "ArrowLeft", "props", "React", "__spreadValues", "ArrowRight", "CarouselArrows", "emblaApi", "prevBtnDisabled", "nextBtnDisabled", "onPrevButtonClick", "onNextButtonClick", "usePrevNextButtons", "Carousel", "props", "isDesktop", "useIsDesktop", "slides", "badges", "options", "selectedIndex", "setSelectedIndex", "emblaRef", "emblaApi", "useEmblaCarousel", "emblaThumbsRef", "emblaThumbsApi", "onThumbClick", "slideId", "slideIndex", "slide", "onSelect", "toggleZoom", "index", "openEvent", "React", "image", "Badges_default", "ZoomableImage_default", "CarouselArrows", "CarouselThumbs_default", "import_react", "ZoomModal", "onOpenCallbackWithId", "onCloseCallbackWithId", "slides", "description", "closeText", "currentImageId", "setCurrentImageId", "React", "currentSlideIndex", "setCurrentSlideIndex", "customImages", "setCustomImages", "variantIds", "setVariantIds", "emblaThumbsRef", "emblaThumbsApi", "useEmblaCarousel", "filteredSlides", "slide", "newIndex", "onThumbClick", "id", "modalName", "handleOpen", "images", "handleClose", "handleDialogClose", "handleOpenEvent", "event", "handleCloseEvent", "Dialog_default", "CarouselThumbs_default", "ZoomAndPan_default", "getLastSrcsetUrl", "import_react", "ImagesGrid", "slides", "badges", "toggleZoom", "index", "openEvent", "image", "React", "Badges_default", "ZoomableImage_default", "node", "slides", "parseJSONData_default", "badges", "translations", "options", "gridContainer", "carouselContainer", "ReactDOM", "React", "ImagesGrid", "Carousel", "ZoomModal"] }