{"version":3,"sources":["jsdelivr-header.js","/npm/framer-motion@12.43.0/src/animation/utils/is-dom-keyframes.ts","/npm/framer-motion@12.43.0/src/animation/animate/resolve-subjects.ts","/npm/framer-motion@12.43.0/src/animation/sequence/utils/calc-repeat-duration.ts","/npm/framer-motion@12.43.0/src/animation/sequence/utils/calc-time.ts","/npm/framer-motion@12.43.0/src/animation/sequence/utils/edit.ts","/npm/framer-motion@12.43.0/src/animation/sequence/utils/normalize-times.ts","/npm/framer-motion@12.43.0/src/animation/sequence/utils/sort.ts","/npm/framer-motion@12.43.0/src/animation/sequence/create.ts","/npm/framer-motion@12.43.0/src/animation/utils/create-visual-element.ts","/npm/framer-motion@12.43.0/src/animation/animate/subject.ts","/npm/framer-motion@12.43.0/src/animation/animate/sequence.ts","/npm/framer-motion@12.43.0/src/animation/animate/index.ts","/npm/framer-motion@12.43.0/src/animation/animators/waapi/animate-elements.ts","/npm/framer-motion@12.43.0/src/animation/animators/waapi/animate-style.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/utils/can-use-native-timeline.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/info.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/offsets/inset.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/offsets/edge.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/offsets/offset.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/offsets/presets.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/offsets/index.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/on-scroll-handler.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/track.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/utils/offset-to-range.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/utils/get-timeline.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/attach-animation.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/utils/is-element-tracking.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/attach-function.ts","/npm/framer-motion@12.43.0/src/render/dom/scroll/index.ts","/npm/framer-motion@12.43.0/src/render/dom/viewport/index.ts","/npm/framer-motion@12.43.0/src/utils/distance.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,0mCCJM,SAAU,EACZ,EAAkB,CAElB,OAAO,OAAO,GAAc,UAAY,CAAC,MAAM,QAAQ,CAAS,CACpE,CCGM,SAAU,GACZ,EASA,EACA,EACA,EAA6B,CAE7B,OAAI,GAAW,KACJ,CAAA,EAGP,OAAO,GAAY,UAAY,EAAe,CAAS,EAChD,EAAgB,EAAS,EAAO,CAAa,EAC7C,aAAmB,SACnB,MAAM,KAAK,CAAO,EAClB,MAAM,QAAQ,CAAO,EACrB,EAAQ,OAAQ,GAAM,GAAK,IAAI,EAE/B,CAAC,CAAO,CAEvB,CCpCgB,SAAA,GACZ,EACA,EACA,EAAmB,CAEnB,OAAO,GAAY,EAAS,GAAK,EAAc,CACnD,CCAM,SAAU,GACZ,EACA,EACA,EACA,EAA2B,CAE3B,OAAI,OAAO,GAAS,SACT,EACA,EAAK,WAAW,GAAG,GAAK,EAAK,WAAW,GAAG,EAC3C,KAAK,IAAI,EAAG,EAAU,WAAW,CAAI,CAAC,EACtC,IAAS,IACT,EACA,EAAK,WAAW,GAAG,EACnB,KAAK,IAAI,EAAG,EAAO,WAAW,EAAK,MAAM,CAAC,CAAC,CAAC,EAE5C,EAAO,IAAI,CAAI,GAAK,CAEnC,CCnBgB,SAAA,GACZ,EACA,EACA,EAAe,CAEf,QAAS,EAAI,EAAG,EAAI,EAAS,OAAQ,IAAK,CACtC,MAAM,EAAW,EAAS,CAAC,EAEvB,EAAS,GAAK,GAAa,EAAS,GAAK,IACzC,GAAW,EAAU,CAAQ,EAG7B,IAER,CACJ,CAEM,SAAU,GACZ,EACA,EACA,EACA,EACA,EACA,EAAe,CAOf,GAAe,EAAU,EAAW,CAAO,EAE3C,QAAS,EAAI,EAAG,EAAI,EAAU,OAAQ,IAClC,E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,EAAM,OAAQ,CAAQ,EAE9C,EAAS,UAAU,EAAM,MAAM,CAEvC,MAAW,OAAO,GAAU,aACxB,EAAM,CAAK,EACX,EAAoB,OAAO,EAAM,MAAM,EAE/C,CAAC,CACL,EAEM,EAAW,IAAI,qBAAqB,EAAsB,CAC5D,KAAA,EACA,WAAA,EACA,UAAW,OAAO,GAAW,SAAW,EAAS,GAAW,CAAM,CACrE,CAAA,EAED,OAAA,EAAS,QAAS,GAAY,EAAS,QAAQ,CAAO,CAAC,EAEhD,IAAM,EAAS,WAAU,CACpC,CCjEO,MAAM,EAAW,CAAC,EAAW,IAAc,KAAK,IAAI,EAAI,CAAC,EAE1D,SAAU,GAAW,EAAU,EAAQ,CAEzC,MAAM,EAAS,EAAS,EAAE,EAAG,EAAE,CAAC,EAC1B,EAAS,EAAS,EAAE,EAAG,EAAE,CAAC,EAChC,OAAO,KAAK,KAAK,GAAU,EAAI,GAAU,CAAC,CAC9C","file":"/npm/framer-motion@12.43.0/dist/es/dom.mjs/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/framer-motion@12.43.0/dist/es/dom.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { DOMKeyframesDefinition } from \"motion-dom\"\n\nexport function isDOMKeyframes(\n    keyframes: unknown\n): keyframes is DOMKeyframesDefinition {\n    return typeof keyframes === \"object\" && !Array.isArray(keyframes)\n}\n","import {\n    AnimationScope,\n    DOMKeyframesDefinition,\n    SelectorCache,\n    resolveElements,\n} from \"motion-dom\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\n\nexport function resolveSubjects<O extends {}>(\n    subject:\n        | string\n        | Element\n        | Element[]\n        | NodeListOf<Element>\n        | O\n        | O[]\n        | null\n        | undefined,\n    keyframes: DOMKeyframesDefinition | ObjectTarget<O>,\n    scope?: AnimationScope,\n    selectorCache?: SelectorCache\n) {\n    if (subject == null) {\n        return []\n    }\n\n    if (typeof subject === \"string\" && isDOMKeyframes(keyframes)) {\n        return resolveElements(subject, scope, selectorCache)\n    } else if (subject instanceof NodeList) {\n        return Array.from(subject)\n    } else if (Array.isArray(subject)) {\n        return subject.filter((s) => s != null)\n    } else {\n        return [subject]\n    }\n}\n","export function calculateRepeatDuration(\n    duration: number,\n    repeat: number,\n    repeatDelay: number\n): number {\n    return duration * (repeat + 1) + repeatDelay * repeat\n}\n","import { SequenceTime } from \"../types\"\n\n/**\n * Given a absolute or relative time definition and current/prev time state of the sequence,\n * calculate an absolute time for the next keyframes.\n */\nexport function calcNextTime(\n    current: number,\n    next: SequenceTime,\n    prev: number,\n    labels: Map<string, number>\n): number {\n    if (typeof next === \"number\") {\n        return next\n    } else if (next.startsWith(\"-\") || next.startsWith(\"+\")) {\n        return Math.max(0, current + parseFloat(next))\n    } else if (next === \"<\") {\n        return prev\n    } else if (next.startsWith(\"<\")) {\n        return Math.max(0, prev + parseFloat(next.slice(1)))\n    } else {\n        return labels.get(next) ?? current\n    }\n}\n","import { mixNumber, UnresolvedValueKeyframe } from \"motion-dom\"\nimport { Easing, getEasingForSegment, removeItem } from \"motion-utils\"\nimport type { ValueSequence } from \"../types\"\n\nexport function eraseKeyframes(\n    sequence: ValueSequence,\n    startTime: number,\n    endTime: number\n): void {\n    for (let i = 0; i < sequence.length; i++) {\n        const keyframe = sequence[i]\n\n        if (keyframe.at > startTime && keyframe.at < endTime) {\n            removeItem(sequence, keyframe)\n\n            // If we remove this item we have to push the pointer back one\n            i--\n        }\n    }\n}\n\nexport function addKeyframes(\n    sequence: ValueSequence,\n    keyframes: UnresolvedValueKeyframe[],\n    easing: Easing | Easing[],\n    offset: number[],\n    startTime: number,\n    endTime: number\n): void {\n    /**\n     * Erase every existing value between currentTime and targetTime,\n     * this will essentially splice this timeline into any currently\n     * defined ones.\n     */\n    eraseKeyframes(sequence, startTime, endTime)\n\n    for (let i = 0; i < keyframes.length; i++) {\n        sequence.push({\n            value: keyframes[i],\n            at: mixNumber(startTime, endTime, offset[i]),\n            easing: getEasingForSegment(easing, i),\n        })\n    }\n}\n","/**\n * Take an array of times that represent repeated keyframes. For instance\n * if we have original times of [0, 0.5, 1] then our repeated times will\n * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back\n * down to a 0-1 scale.\n *\n * `repeatDelayUnits` is the repeatDelay expressed in units of a single\n * iteration's duration, so the total span equals `(repeat + 1) + repeat * repeatDelayUnits`.\n */\nexport function normalizeTimes(\n    times: number[],\n    repeat: number,\n    repeatDelayUnits = 0\n): void {\n    const totalUnits = repeat + 1 + repeat * repeatDelayUnits\n    for (let i = 0; i < times.length; i++) {\n        times[i] = times[i] / totalUnits\n    }\n}\n","import { AbsoluteKeyframe } from \"../types\"\n\nexport function compareByTime(\n    a: AbsoluteKeyframe,\n    b: AbsoluteKeyframe\n): number {\n    if (a.at === b.at) {\n        if (a.value === null) return 1\n        if (b.value === null) return -1\n        return 0\n    } else {\n        return a.at - b.at\n    }\n}\n","import {\n    AnimationScope,\n    createGeneratorEasing,\n    defaultOffset,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    fillOffset,\n    GeneratorFactory,\n    isGenerator,\n    isMotionValue,\n    Transition,\n    UnresolvedValueKeyframe,\n    type AnyResolvedKeyframe,\n    type MotionValue,\n} from \"motion-dom\"\nimport {\n    Easing,\n    getEasingForSegment,\n    progress,\n    reverseEasing,\n    secondsToMilliseconds,\n    warning,\n} from \"motion-utils\"\nimport { resolveSubjects } from \"../animate/resolve-subjects\"\nimport {\n    AnimationSequence,\n    At,\n    ResolvedAnimationDefinitions,\n    SequenceMap,\n    SequenceOptions,\n    ValueSequence,\n} from \"./types\"\nimport { calculateRepeatDuration } from \"./utils/calc-repeat-duration\"\nimport { calcNextTime } from \"./utils/calc-time\"\nimport { addKeyframes } from \"./utils/edit\"\nimport { normalizeTimes } from \"./utils/normalize-times\"\nimport { compareByTime } from \"./utils/sort\"\n\nconst defaultSegmentEasing = \"easeInOut\"\n\nconst MAX_REPEAT = 20\n\nexport function createAnimationsFromSequence(\n    sequence: AnimationSequence,\n    { defaultTransition = {}, ...sequenceTransition }: SequenceOptions = {},\n    scope?: AnimationScope,\n    generators?: { [key: string]: GeneratorFactory }\n): ResolvedAnimationDefinitions {\n    const defaultDuration = defaultTransition.duration || 0.3\n    const animationDefinitions: ResolvedAnimationDefinitions = new Map()\n    const sequences = new Map<Element | MotionValue, SequenceMap>()\n    const elementCache = {}\n    const timeLabels = new Map<string, number>()\n\n    let prevTime = 0\n    let currentTime = 0\n    let totalDuration = 0\n\n    /**\n     * Build the timeline by mapping over the sequence array and converting\n     * the definitions into keyframes and offsets with absolute time values.\n     * These will later get converted into relative offsets in a second pass.\n     */\n    for (let i = 0; i < sequence.length; i++) {\n        const segment = sequence[i]\n\n        /**\n         * If this is a timeline label, mark it and skip the rest of this iteration.\n         */\n        if (typeof segment === \"string\") {\n            timeLabels.set(segment, currentTime)\n            continue\n        } else if (!Array.isArray(segment)) {\n            timeLabels.set(\n                segment.name,\n                calcNextTime(currentTime, segment.at, prevTime, timeLabels)\n            )\n            continue\n        }\n\n        let [subject, keyframes, transition = {}] = segment\n\n        /**\n         * If a relative or absolute time value has been specified we need to resolve\n         * it in relation to the currentTime.\n         */\n        if (transition.at !== undefined) {\n            currentTime = calcNextTime(\n                currentTime,\n                transition.at,\n                prevTime,\n                timeLabels\n            )\n        }\n\n        /**\n         * Keep track of the maximum duration in this definition. This will be\n         * applied to currentTime once the definition has been parsed.\n         */\n        let maxDuration = 0\n\n        const resolveValueSequence = (\n            valueKeyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[],\n            valueTransition: Transition | DynamicAnimationOptions,\n            valueSequence: ValueSequence,\n            elementIndex = 0,\n            numSubjects = 0\n        ) => {\n            const valueKeyframesAsList = keyframesAsList(valueKeyframes)\n            const {\n                delay = 0,\n                times = defaultOffset(valueKeyframesAsList),\n                type = defaultTransition.type || \"keyframes\",\n                repeat,\n                repeatType,\n                repeatDelay = 0,\n                ...remainingTransition\n            } = valueTransition\n            let { ease = defaultTransition.ease || \"easeOut\", duration } =\n                valueTransition\n\n            /**\n             * Resolve stagger() if defined.\n             */\n            const calculatedDelay =\n                typeof delay === \"function\"\n                    ? delay(elementIndex, numSubjects)\n                    : delay\n\n            /**\n             * If this animation should and can use a spring, generate a spring easing function.\n             */\n            const numKeyframes = valueKeyframesAsList.length\n            const createGenerator = isGenerator(type)\n                ? type\n                : generators?.[type || \"keyframes\"]\n\n            if (numKeyframes <= 2 && createGenerator) {\n                /**\n                 * As we're creating an easing function from a spring,\n                 * ideally we want to generate it using the real distance\n                 * between the two keyframes. However this isn't always\n                 * possible - in these situations we use 0-100.\n                 */\n                let absoluteDelta = 100\n                if (\n                    numKeyframes === 2 &&\n                    isNumberKeyframesArray(valueKeyframesAsList)\n                ) {\n                    const delta =\n                        valueKeyframesAsList[1] - valueKeyframesAsList[0]\n                    absoluteDelta = Math.abs(delta)\n                }\n\n                const springTransition = {\n                    ...defaultTransition,\n                    ...remainingTransition,\n                }\n                if (duration !== undefined) {\n                    springTransition.duration = secondsToMilliseconds(duration)\n                }\n\n                const springEasing = createGeneratorEasing(\n                    springTransition,\n                    absoluteDelta,\n                    createGenerator\n                )\n\n                ease = springEasing.ease\n                duration = springEasing.duration\n            }\n\n            duration ??= defaultDuration\n\n            const startTime = currentTime + calculatedDelay\n\n            /**\n             * If there's only one time offset of 0, fill in a second with length 1\n             */\n            if (times.length === 1 && times[0] === 0) {\n                times[1] = 1\n            }\n\n            /**\n             * Fill out if offset if fewer offsets than keyframes\n             */\n            const remainder = times.length - valueKeyframesAsList.length\n            remainder > 0 && fillOffset(times, remainder)\n\n            /**\n             * If only one value has been set, ie [1], push a null to the start of\n             * the keyframe array. This will let us mark a keyframe at this point\n             * that will later be hydrated with the previous value.\n             */\n            valueKeyframesAsList.length === 1 &&\n                valueKeyframesAsList.unshift(null)\n\n            /**\n             * Segments can't express `repeat: Infinity` or very large\n             * counts — they'd leave dead time after the segment or\n             * explode the keyframe array. Ignore with a warning.\n             */\n            if (repeat) {\n                warning(\n                    repeat < MAX_REPEAT,\n                    `Sequence segments can't repeat ${repeat} times — ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`\n                )\n            }\n\n            if (repeat && repeat < MAX_REPEAT) {\n                /**\n                 * Express repeatDelay in units of a single iteration's duration\n                 * so it can be added to the per-iteration time offsets below\n                 * before they're normalized to 0-1.\n                 */\n                const repeatDelayUnits =\n                    duration > 0 ? repeatDelay / duration : 0\n\n                duration = calculateRepeatDuration(\n                    duration,\n                    repeat,\n                    repeatDelay\n                )\n\n                const originalKeyframes = [...valueKeyframesAsList]\n                const originalTimes = [...times]\n                ease = Array.isArray(ease) ? [...ease] : [ease]\n                const originalEase = [...ease]\n\n                /**\n                 * For reverse/mirror, alternate iterations play the segment\n                 * backwards. mirror matches JSAnimation's mirroredGenerator:\n                 * reversed keyframes, easings unchanged. reverse matches\n                 * JSAnimation's iterationProgress = 1 - p: reversed\n                 * keyframes, easing array reversed AND each function easing\n                 * mapped through reverseEasing (string easings unchanged —\n                 * they're resolved later by the keyframes engine).\n                 */\n                const isFlipping =\n                    repeatType === \"reverse\" || repeatType === \"mirror\"\n                let flippedKeyframes = originalKeyframes\n                let flippedEases = originalEase\n                if (isFlipping) {\n                    flippedKeyframes = [...originalKeyframes].reverse()\n                    if (repeatType === \"reverse\") {\n                        flippedEases = [...originalEase]\n                            .reverse()\n                            .map((e) =>\n                                typeof e === \"function\"\n                                    ? reverseEasing(e)\n                                    : e\n                            )\n                    }\n                }\n\n                for (\n                    let repeatIndex = 0;\n                    repeatIndex < repeat;\n                    repeatIndex++\n                ) {\n                    const isFlipped = isFlipping && repeatIndex % 2 === 0\n                    const iterKeyframes = isFlipped\n                        ? flippedKeyframes\n                        : originalKeyframes\n                    const iterEase = isFlipped ? flippedEases : originalEase\n                    const iterStartOffset =\n                        (repeatIndex + 1) * (1 + repeatDelayUnits)\n\n                    /**\n                     * If repeatDelay is set, hold the previous iteration's\n                     * final value through the delay by inserting a keyframe\n                     * at the moment the next iteration begins.\n                     */\n                    if (repeatDelayUnits > 0) {\n                        valueKeyframesAsList.push(\n                            valueKeyframesAsList[\n                                valueKeyframesAsList.length - 1\n                            ]\n                        )\n                        times.push(iterStartOffset)\n                        ease.push(\"linear\")\n                    }\n\n                    valueKeyframesAsList.push(...iterKeyframes)\n\n                    for (\n                        let keyframeIndex = 0;\n                        keyframeIndex < iterKeyframes.length;\n                        keyframeIndex++\n                    ) {\n                        times.push(\n                            originalTimes[keyframeIndex] + iterStartOffset\n                        )\n                        ease.push(\n                            keyframeIndex === 0\n                                ? \"linear\"\n                                : getEasingForSegment(\n                                      iterEase,\n                                      keyframeIndex - 1\n                                  )\n                        )\n                    }\n                }\n\n                normalizeTimes(times, repeat, repeatDelayUnits)\n            }\n\n            const targetTime = startTime + duration\n\n            /**\n             * Add keyframes, mapping offsets to absolute time.\n             */\n            addKeyframes(\n                valueSequence,\n                valueKeyframesAsList,\n                ease as Easing | Easing[],\n                times,\n                startTime,\n                targetTime\n            )\n\n            maxDuration = Math.max(calculatedDelay + duration, maxDuration)\n            totalDuration = Math.max(targetTime, totalDuration)\n        }\n\n        if (isMotionValue(subject)) {\n            const subjectSequence = getSubjectSequence(subject, sequences)\n            resolveValueSequence(\n                keyframes as AnyResolvedKeyframe,\n                transition,\n                getValueSequence(\"default\", subjectSequence)\n            )\n        } else {\n            const subjects = resolveSubjects(\n                subject,\n                keyframes as DOMKeyframesDefinition,\n                scope,\n                elementCache\n            )\n\n            const numSubjects = subjects.length\n\n            /**\n             * For every element in this segment, process the defined values.\n             */\n            for (\n                let subjectIndex = 0;\n                subjectIndex < numSubjects;\n                subjectIndex++\n            ) {\n                /**\n                 * Cast necessary, but we know these are of this type\n                 */\n                keyframes = keyframes as DOMKeyframesDefinition\n                transition = transition as DynamicAnimationOptions\n\n                const thisSubject = subjects[subjectIndex]\n                const subjectSequence = getSubjectSequence(\n                    thisSubject,\n                    sequences\n                )\n\n                for (const key in keyframes) {\n                    resolveValueSequence(\n                        keyframes[\n                            key as keyof typeof keyframes\n                        ] as UnresolvedValueKeyframe,\n                        getValueTransition(transition, key),\n                        getValueSequence(key, subjectSequence),\n                        subjectIndex,\n                        numSubjects\n                    )\n                }\n            }\n        }\n\n        prevTime = currentTime\n        currentTime += maxDuration\n    }\n\n    /**\n     * For every element and value combination create a new animation.\n     */\n    sequences.forEach((valueSequences, element) => {\n        for (const key in valueSequences) {\n            const valueSequence = valueSequences[key]\n\n            /**\n             * Arrange all the keyframes in ascending time order.\n             */\n            valueSequence.sort(compareByTime)\n\n            const keyframes: UnresolvedValueKeyframe[] = []\n            const valueOffset: number[] = []\n            const valueEasing: Easing[] = []\n\n            /**\n             * For each keyframe, translate absolute times into\n             * relative offsets based on the total duration of the timeline.\n             */\n            for (let i = 0; i < valueSequence.length; i++) {\n                const { at, value, easing } = valueSequence[i]\n                keyframes.push(value)\n                valueOffset.push(progress(0, totalDuration, at))\n                valueEasing.push(easing || \"easeOut\")\n            }\n\n            /**\n             * If the first keyframe doesn't land on offset: 0\n             * provide one by duplicating the initial keyframe. This ensures\n             * it snaps to the first keyframe when the animation starts.\n             */\n            if (valueOffset[0] !== 0) {\n                valueOffset.unshift(0)\n                keyframes.unshift(keyframes[0])\n                valueEasing.unshift(defaultSegmentEasing)\n            }\n\n            /**\n             * If the last keyframe doesn't land on offset: 1\n             * provide one with a null wildcard value. This will ensure it\n             * stays static until the end of the animation.\n             */\n            if (valueOffset[valueOffset.length - 1] !== 1) {\n                valueOffset.push(1)\n                keyframes.push(null)\n            }\n\n            if (!animationDefinitions.has(element)) {\n                animationDefinitions.set(element, {\n                    keyframes: {},\n                    transition: {},\n                })\n            }\n\n            const definition = animationDefinitions.get(element)!\n\n            definition.keyframes[key] = keyframes\n\n            /**\n             * Exclude `type` from defaultTransition since springs have been\n             * converted to duration-based easing functions in resolveValueSequence.\n             * Including `type: \"spring\"` would cause JSAnimation to error when\n             * the merged keyframes array has more than 2 keyframes.\n             */\n            const { type: _type, ...remainingDefaultTransition } =\n                defaultTransition\n            definition.transition[key] = {\n                ...remainingDefaultTransition,\n                duration: totalDuration,\n                ease: valueEasing,\n                times: valueOffset,\n                ...sequenceTransition,\n            }\n        }\n    })\n\n    return animationDefinitions\n}\n\nfunction getSubjectSequence<O extends {}>(\n    subject: Element | MotionValue | O,\n    sequences: Map<Element | MotionValue | O, SequenceMap>\n): SequenceMap {\n    !sequences.has(subject) && sequences.set(subject, {})\n    return sequences.get(subject)!\n}\n\nfunction getValueSequence(name: string, sequences: SequenceMap): ValueSequence {\n    if (!sequences[name]) sequences[name] = []\n    return sequences[name]\n}\n\nfunction keyframesAsList(\n    keyframes: UnresolvedValueKeyframe | UnresolvedValueKeyframe[]\n): UnresolvedValueKeyframe[] {\n    return Array.isArray(keyframes) ? keyframes : [keyframes]\n}\n\nexport function getValueTransition(\n    transition: DynamicAnimationOptions & At,\n    key: string\n): DynamicAnimationOptions {\n    return transition && transition[key as keyof typeof transition]\n        ? {\n              ...transition,\n              ...(transition[key as keyof typeof transition] as Transition),\n          }\n        : { ...transition }\n}\n\nconst isNumber = (keyframe: unknown) => typeof keyframe === \"number\"\nconst isNumberKeyframesArray = (\n    keyframes: UnresolvedValueKeyframe[]\n): keyframes is number[] => keyframes.every(isNumber)\n","import {\n    HTMLVisualElement,\n    isSVGElement,\n    isSVGSVGElement,\n    ObjectVisualElement,\n    SVGVisualElement,\n    visualElementStore,\n} from \"motion-dom\"\n\nexport function createDOMVisualElement(element: HTMLElement | SVGElement) {\n    const options = {\n        presenceContext: null,\n        props: {},\n        visualState: {\n            renderState: {\n                transform: {},\n                transformOrigin: {},\n                style: {},\n                vars: {},\n                attrs: {},\n            },\n            latestValues: {},\n        },\n    }\n    const node =\n        isSVGElement(element) && !isSVGSVGElement(element)\n            ? new SVGVisualElement(options)\n            : new HTMLVisualElement(options)\n\n    node.mount(element as any)\n\n    visualElementStore.set(element, node)\n}\n\nexport function createObjectVisualElement(subject: Object) {\n    const options = {\n        presenceContext: null,\n        props: {},\n        visualState: {\n            renderState: {\n                output: {},\n            },\n            latestValues: {},\n        },\n    }\n    const node = new ObjectVisualElement(options)\n\n    node.mount(subject)\n\n    visualElementStore.set(subject, node)\n}\n","import {\n    animateTarget,\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    AnyResolvedKeyframe,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    ElementOrSelector,\n    isMotionValue,\n    MotionValue,\n    TargetAndTransition,\n    UnresolvedValueKeyframe,\n    ValueAnimationTransition,\n    visualElementStore,\n} from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport { ObjectTarget } from \"../sequence/types\"\nimport {\n    createDOMVisualElement,\n    createObjectVisualElement,\n} from \"../utils/create-visual-element\"\nimport { isDOMKeyframes } from \"../utils/is-dom-keyframes\"\nimport { resolveSubjects } from \"./resolve-subjects\"\nimport { animateSingleValue } from \"motion-dom\"\n\nexport type AnimationSubject = Element | MotionValue<any> | any\n\nfunction isSingleValue(\n    subject: unknown,\n    keyframes: unknown\n): subject is MotionValue | AnyResolvedKeyframe {\n    return (\n        isMotionValue(subject) ||\n        typeof subject === \"number\" ||\n        (typeof subject === \"string\" && !isDOMKeyframes(keyframes))\n    )\n}\n\n/**\n * Animate a string\n */\nexport function animateSubject(\n    value: string | MotionValue<string>,\n    keyframes: string | UnresolvedValueKeyframe<string>[],\n    options?: ValueAnimationTransition<string>\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a number\n */\nexport function animateSubject(\n    value: number | MotionValue<number>,\n    keyframes: number | UnresolvedValueKeyframe<number>[],\n    options?: ValueAnimationTransition<number>\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a Element\n */\nexport function animateSubject(\n    element: ElementOrSelector,\n    keyframes: DOMKeyframesDefinition,\n    options?: DynamicAnimationOptions,\n    scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[]\n/**\n * Animate a object\n */\nexport function animateSubject<O extends Object>(\n    object: O | O[],\n    keyframes: ObjectTarget<O>,\n    options?: DynamicAnimationOptions\n): AnimationPlaybackControlsWithThen[]\n/**\n * Implementation\n */\nexport function animateSubject<O extends Object>(\n    subject:\n        | MotionValue<number>\n        | MotionValue<string>\n        | number\n        | string\n        | ElementOrSelector\n        | O\n        | O[],\n    keyframes:\n        | number\n        | string\n        | UnresolvedValueKeyframe<number>[]\n        | UnresolvedValueKeyframe<string>[]\n        | DOMKeyframesDefinition\n        | ObjectTarget<O>,\n    options?:\n        | ValueAnimationTransition<number>\n        | ValueAnimationTransition<string>\n        | DynamicAnimationOptions,\n    scope?: AnimationScope\n): AnimationPlaybackControlsWithThen[] {\n    const animations: AnimationPlaybackControlsWithThen[] = []\n\n    if (isSingleValue(subject, keyframes)) {\n        animations.push(\n            animateSingleValue(\n                subject,\n                isDOMKeyframes(keyframes)\n                    ? (keyframes as any).default || keyframes\n                    : keyframes,\n                options ? (options as any).default || options : options\n            )\n        )\n    } else {\n        // Gracefully handle null/undefined subjects (e.g., from querySelector returning null)\n        if (subject == null) {\n            return animations\n        }\n\n        const subjects = resolveSubjects(\n            subject,\n            keyframes as DOMKeyframesDefinition,\n            scope\n        )\n\n        const numSubjects = subjects.length\n\n        invariant(\n            Boolean(numSubjects),\n            \"No valid elements provided.\",\n            \"no-valid-elements\"\n        )\n\n        for (let i = 0; i < numSubjects; i++) {\n            const thisSubject = subjects[i]\n\n            const createVisualElement =\n                thisSubject instanceof Element\n                    ? createDOMVisualElement\n                    : createObjectVisualElement\n\n            if (!visualElementStore.has(thisSubject)) {\n                createVisualElement(thisSubject as any)\n            }\n\n            const visualElement = visualElementStore.get(thisSubject)!\n            const transition = { ...options }\n\n            /**\n             * Resolve stagger function if provided.\n             */\n            if (\n                \"delay\" in transition &&\n                typeof transition.delay === \"function\"\n            ) {\n                transition.delay = transition.delay(i, numSubjects)\n            }\n\n            animations.push(\n                ...animateTarget(\n                    visualElement,\n                    { ...(keyframes as {}), transition } as TargetAndTransition,\n                    {}\n                )\n            )\n        }\n    }\n\n    return animations\n}\n","import {\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    motionValue,\n    spring,\n} from \"motion-dom\"\nimport { createAnimationsFromSequence } from \"../sequence/create\"\nimport { AnimationSequence, SequenceOptions } from \"../sequence/types\"\nimport { animateSubject } from \"./subject\"\n\nexport function animateSequence(\n    sequence: AnimationSequence,\n    options?: SequenceOptions,\n    scope?: AnimationScope\n) {\n    const animations: AnimationPlaybackControlsWithThen[] = []\n\n    /**\n     * Pre-process: replace function segments with MotionValue segments,\n     * subscribe callbacks immediately\n     */\n    const processedSequence = sequence.map((segment) => {\n        if (Array.isArray(segment) && typeof segment[0] === \"function\") {\n            const callback = segment[0] as (value: any) => void\n            const mv = motionValue(0)\n            mv.on(\"change\", callback)\n\n            if (segment.length === 1) {\n                return [mv, [0, 1]] as any\n            } else if (segment.length === 2) {\n                return [mv, [0, 1], segment[1]] as any\n            } else {\n                return [mv, segment[1], segment[2]] as any\n            }\n        }\n        return segment\n    }) as AnimationSequence\n\n    const animationDefinitions = createAnimationsFromSequence(\n        processedSequence,\n        options,\n        scope,\n        { spring }\n    )\n\n    animationDefinitions.forEach(({ keyframes, transition }, subject) => {\n        animations.push(...animateSubject(subject, keyframes, transition))\n    })\n\n    return animations\n}\n","import type {\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    ElementOrSelector,\n    MotionValue,\n    UnresolvedValueKeyframe,\n    ValueAnimationTransition,\n} from \"motion-dom\"\nimport { GroupAnimationWithThen } from \"motion-dom\"\nimport { removeItem } from \"motion-utils\"\nimport {\n    AnimationSequence,\n    ObjectTarget,\n    SequenceOptions,\n} from \"../sequence/types\"\nimport { animateSequence } from \"./sequence\"\nimport { animateSubject } from \"./subject\"\n\nfunction isSequence(value: unknown): value is AnimationSequence {\n    return Array.isArray(value) && value.some(Array.isArray)\n}\n\ninterface ScopedAnimateOptions {\n    scope?: AnimationScope\n    reduceMotion?: boolean\n    skipAnimations?: boolean\n}\n\n/**\n * Creates an animation function that is optionally scoped\n * to a specific element.\n */\nexport function createScopedAnimate(options: ScopedAnimateOptions = {}) {\n    const { scope, reduceMotion, skipAnimations } = options\n    /**\n     * Animate a sequence\n     */\n    function scopedAnimate(\n        sequence: AnimationSequence,\n        options?: SequenceOptions\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate a string\n     */\n    function scopedAnimate(\n        value: string | MotionValue<string>,\n        keyframes: string | UnresolvedValueKeyframe<string>[],\n        options?: ValueAnimationTransition<string>\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate a number\n     */\n    function scopedAnimate(\n        value: number | MotionValue<number>,\n        keyframes: number | UnresolvedValueKeyframe<number>[],\n        options?: ValueAnimationTransition<number>\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate a generic motion value\n     */\n    function scopedAnimate<V extends string | number>(\n        value: V | MotionValue<V>,\n        keyframes: V | UnresolvedValueKeyframe<V>[],\n        options?: ValueAnimationTransition<V>\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate an Element\n     */\n    function scopedAnimate(\n        element: ElementOrSelector,\n        keyframes: DOMKeyframesDefinition,\n        options?: DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Animate an object\n     */\n    function scopedAnimate<O extends {}>(\n        object: O | O[],\n        keyframes: ObjectTarget<O>,\n        options?: DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen\n    /**\n     * Implementation\n     */\n    function scopedAnimate<O extends {}>(\n        subjectOrSequence:\n            | AnimationSequence\n            | MotionValue<number>\n            | MotionValue<string>\n            | number\n            | string\n            | ElementOrSelector\n            | O\n            | O[],\n        optionsOrKeyframes?:\n            | SequenceOptions\n            | number\n            | string\n            | UnresolvedValueKeyframe<number>[]\n            | UnresolvedValueKeyframe<string>[]\n            | DOMKeyframesDefinition\n            | ObjectTarget<O>,\n        options?:\n            | ValueAnimationTransition<number>\n            | ValueAnimationTransition<string>\n            | DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen {\n        let animations: AnimationPlaybackControlsWithThen[] = []\n        let animationOnComplete: VoidFunction | undefined\n\n        const inherited: { reduceMotion?: boolean; skipAnimations?: boolean } =\n            {}\n        if (reduceMotion !== undefined) inherited.reduceMotion = reduceMotion\n        if (skipAnimations !== undefined)\n            inherited.skipAnimations = skipAnimations\n\n        if (isSequence(subjectOrSequence)) {\n            const { onComplete, ...sequenceOptions } =\n                (optionsOrKeyframes as SequenceOptions) || {}\n            if (typeof onComplete === \"function\") {\n                animationOnComplete = onComplete as VoidFunction\n            }\n            animations = animateSequence(\n                subjectOrSequence,\n                { ...inherited, ...sequenceOptions } as SequenceOptions,\n                scope\n            )\n        } else {\n            // Extract top-level onComplete so it doesn't get applied per-value\n            const { onComplete, ...rest } = options || {}\n            if (typeof onComplete === \"function\") {\n                animationOnComplete = onComplete as VoidFunction\n            }\n            animations = animateSubject(\n                subjectOrSequence as ElementOrSelector,\n                optionsOrKeyframes as DOMKeyframesDefinition,\n                { ...inherited, ...rest } as DynamicAnimationOptions,\n                scope\n            )\n        }\n\n        const animation = new GroupAnimationWithThen(animations)\n\n        if (animationOnComplete) {\n            animation.finished.then(animationOnComplete)\n        }\n\n        if (scope) {\n            scope.animations.push(animation)\n            animation.finished.then(() => {\n                removeItem(scope.animations, animation)\n            })\n        }\n\n        return animation\n    }\n\n    return scopedAnimate\n}\n\nexport const animate = createScopedAnimate()\n","import {\n    animationMapKey,\n    AnimationPlaybackControls,\n    AnimationScope,\n    applyPxDefaults,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    ElementOrSelector,\n    fillWildcards,\n    getAnimationMap,\n    getComputedStyle,\n    getValueTransition,\n    NativeAnimation,\n    NativeAnimationOptions,\n    resolveElements,\n    UnresolvedValueKeyframe,\n    ValueKeyframe,\n} from \"motion-dom\"\nimport { invariant, secondsToMilliseconds } from \"motion-utils\"\n\ninterface AnimationDefinition {\n    map: Map<string, NativeAnimation<any>>\n    key: string\n    unresolvedKeyframes: UnresolvedValueKeyframe[]\n    options: Omit<NativeAnimationOptions, \"keyframes\"> & {\n        keyframes?: ValueKeyframe[]\n    }\n}\n\nexport function animateElements(\n    elementOrSelector: ElementOrSelector,\n    keyframes: DOMKeyframesDefinition,\n    options?: DynamicAnimationOptions,\n    scope?: AnimationScope\n) {\n    // Gracefully handle null/undefined elements (e.g., from querySelector returning null)\n    if (elementOrSelector == null) {\n        return []\n    }\n\n    const elements = resolveElements(elementOrSelector, scope) as Array<\n        HTMLElement | SVGElement\n    >\n    const numElements = elements.length\n\n    invariant(\n        Boolean(numElements),\n        \"No valid elements provided.\",\n        \"no-valid-elements\"\n    )\n\n    /**\n     * WAAPI doesn't support interrupting animations.\n     *\n     * Therefore, starting animations requires a three-step process:\n     * 1. Stop existing animations (write styles to DOM)\n     * 2. Resolve keyframes (read styles from DOM)\n     * 3. Create new animations (write styles to DOM)\n     *\n     * The hybrid `animate()` function uses AsyncAnimation to resolve\n     * keyframes before creating new animations, which removes style\n     * thrashing. Here, we have much stricter filesize constraints.\n     * Therefore we do this in a synchronous way that ensures that\n     * at least within `animate()` calls there is no style thrashing.\n     *\n     * In the motion-native-animate-mini-interrupt benchmark this\n     * was 80% faster than a single loop.\n     */\n    const animationDefinitions: AnimationDefinition[] = []\n\n    /**\n     * Step 1: Build options and stop existing animations (write)\n     */\n    for (let i = 0; i < numElements; i++) {\n        const element = elements[i]\n        const elementTransition: DynamicAnimationOptions = { ...options }\n\n        /**\n         * Resolve stagger function if provided.\n         */\n        if (typeof elementTransition.delay === \"function\") {\n            elementTransition.delay = elementTransition.delay(i, numElements)\n        }\n\n        for (const valueName in keyframes) {\n            let valueKeyframes = keyframes[valueName as keyof typeof keyframes]!\n\n            if (!Array.isArray(valueKeyframes)) {\n                valueKeyframes = [valueKeyframes]\n            }\n\n            const valueOptions = {\n                ...getValueTransition(elementTransition as any, valueName),\n            }\n\n            valueOptions.duration &&= secondsToMilliseconds(\n                valueOptions.duration\n            )\n\n            valueOptions.delay &&= secondsToMilliseconds(valueOptions.delay)\n\n            /**\n             * If there's an existing animation playing on this element then stop it\n             * before creating a new one.\n             */\n            const map = getAnimationMap(element)\n            const key = animationMapKey(\n                valueName,\n                valueOptions.pseudoElement || \"\"\n            )\n            const currentAnimation = map.get(key)\n            currentAnimation && currentAnimation.stop()\n\n            animationDefinitions.push({\n                map,\n                key,\n                unresolvedKeyframes: valueKeyframes,\n                options: {\n                    ...valueOptions,\n                    element,\n                    name: valueName,\n                    allowFlatten:\n                        !elementTransition.type && !elementTransition.ease,\n                },\n            })\n        }\n    }\n\n    /**\n     * Step 2: Resolve keyframes (read)\n     */\n    for (let i = 0; i < animationDefinitions.length; i++) {\n        const { unresolvedKeyframes, options: animationOptions } =\n            animationDefinitions[i]\n\n        const { element, name, pseudoElement } = animationOptions\n        if (!pseudoElement && unresolvedKeyframes[0] === null) {\n            unresolvedKeyframes[0] = getComputedStyle(element, name)\n        }\n\n        fillWildcards(unresolvedKeyframes)\n        applyPxDefaults(unresolvedKeyframes, name)\n\n        /**\n         * If we only have one keyframe, explicitly read the initial keyframe\n         * from the computed style. This is to ensure consistency with WAAPI behaviour\n         * for restarting animations, for instance .play() after finish, when it\n         * has one vs two keyframes.\n         */\n        if (!pseudoElement && unresolvedKeyframes.length < 2) {\n            unresolvedKeyframes.unshift(getComputedStyle(element, name))\n        }\n\n        animationOptions.keyframes = unresolvedKeyframes as ValueKeyframe[]\n    }\n\n    /**\n     * Step 3: Create new animations (write)\n     */\n    const animations: AnimationPlaybackControls[] = []\n    for (let i = 0; i < animationDefinitions.length; i++) {\n        const { map, key, options: animationOptions } = animationDefinitions[i]\n        const animation = new NativeAnimation(\n            animationOptions as NativeAnimationOptions\n        )\n\n        map.set(key, animation)\n        animation.finished.finally(() => map.delete(key))\n\n        animations.push(animation)\n    }\n\n    return animations\n}\n","import {\n    AnimationPlaybackControlsWithThen,\n    AnimationScope,\n    DOMKeyframesDefinition,\n    AnimationOptions as DynamicAnimationOptions,\n    ElementOrSelector,\n    GroupAnimationWithThen,\n} from \"motion-dom\"\nimport { animateElements } from \"./animate-elements\"\n\nexport const createScopedWaapiAnimate = (scope?: AnimationScope) => {\n    function scopedAnimate(\n        elementOrSelector: ElementOrSelector,\n        keyframes: DOMKeyframesDefinition,\n        options?: DynamicAnimationOptions\n    ): AnimationPlaybackControlsWithThen {\n        return new GroupAnimationWithThen(\n            animateElements(\n                elementOrSelector,\n                keyframes as DOMKeyframesDefinition,\n                options,\n                scope\n            )\n        )\n    }\n\n    return scopedAnimate\n}\n\nexport const animateMini = /*@__PURE__*/ createScopedWaapiAnimate()\n","import { supportsScrollTimeline, supportsViewTimeline } from \"motion-dom\"\n\nexport function canUseNativeTimeline(target?: Element) {\n    if (typeof window === \"undefined\") return false\n    return target ? supportsViewTimeline() : supportsScrollTimeline()\n}\n","import { progress, velocityPerSecond } from \"motion-utils\"\nimport { AxisScrollInfo, ScrollInfo } from \"./types\"\n\n/**\n * A time in milliseconds, beyond which we consider the scroll velocity to be 0.\n */\nconst maxElapsed = 50\n\nconst createAxisInfo = (): AxisScrollInfo => ({\n    current: 0,\n    offset: [],\n    progress: 0,\n    scrollLength: 0,\n    targetOffset: 0,\n    targetLength: 0,\n    containerLength: 0,\n    velocity: 0,\n})\n\nexport const createScrollInfo = (): ScrollInfo => ({\n    time: 0,\n    x: createAxisInfo(),\n    y: createAxisInfo(),\n})\n\nconst keys = {\n    x: {\n        length: \"Width\",\n        position: \"Left\",\n    },\n    y: {\n        length: \"Height\",\n        position: \"Top\",\n    },\n} as const\n\nfunction updateAxisInfo(\n    element: Element,\n    axisName: \"x\" | \"y\",\n    info: ScrollInfo,\n    time: number\n) {\n    const axis = info[axisName]\n    const { length, position } = keys[axisName]\n\n    const prev = axis.current\n    const prevTime = info.time\n\n    axis.current = Math.abs(element[`scroll${position}`])\n    axis.scrollLength = element[`scroll${length}`] - element[`client${length}`]\n\n    axis.offset.length = 0\n    axis.offset[0] = 0\n    axis.offset[1] = axis.scrollLength\n    axis.progress = progress(0, axis.scrollLength, axis.current)\n\n    const elapsed = time - prevTime\n    axis.velocity =\n        elapsed > maxElapsed\n            ? 0\n            : velocityPerSecond(axis.current - prev, elapsed)\n}\n\nexport function updateScrollInfo(\n    element: Element,\n    info: ScrollInfo,\n    time: number\n) {\n    updateAxisInfo(element, \"x\", info, time)\n    updateAxisInfo(element, \"y\", info, time)\n    info.time = time\n}\n","import { isHTMLElement } from \"motion-dom\"\n\nexport function calcInset(element: Element, container: Element) {\n    const inset = { x: 0, y: 0 }\n\n    let current: Element | null = element\n    while (current && current !== container) {\n        if (isHTMLElement(current)) {\n            inset.x += current.offsetLeft\n            inset.y += current.offsetTop\n            current = current.offsetParent\n        } else if (current.tagName === \"svg\") {\n            /**\n             * This isn't an ideal approach to measuring the offset of <svg /> tags.\n             * It would be preferable, given they behave like HTMLElements in most ways\n             * to use offsetLeft/Top. But these don't exist on <svg />. Likewise we\n             * can't use .getBBox() like most SVG elements as these provide the offset\n             * relative to the SVG itself, which for <svg /> is usually 0x0.\n             */\n            const svgBoundingBox = current.getBoundingClientRect()\n            current = current.parentElement!\n            const parentBoundingBox = current.getBoundingClientRect()\n            inset.x += svgBoundingBox.left - parentBoundingBox.left\n            inset.y += svgBoundingBox.top - parentBoundingBox.top\n        } else if (current instanceof SVGGraphicsElement) {\n            const { x, y } = current.getBBox()\n            inset.x += x\n            inset.y += y\n\n            let svg: SVGElement | null = null\n            let parent: SVGElement = current.parentNode as SVGElement\n            while (!svg) {\n                if (parent.tagName === \"svg\") {\n                    svg = parent\n                }\n                parent = current.parentNode as SVGElement\n            }\n            current = svg\n        } else {\n            break\n        }\n    }\n\n    return inset\n}\n","import { Edge, NamedEdges } from \"../types\"\n\nexport const namedEdges: Record<NamedEdges, number> = {\n    start: 0,\n    center: 0.5,\n    end: 1,\n}\n\nexport function resolveEdge(edge: Edge, length: number, inset = 0) {\n    let delta = 0\n\n    /**\n     * If we have this edge defined as a preset, replace the definition\n     * with the numerical value.\n     */\n    if (edge in namedEdges) {\n        edge = namedEdges[edge as NamedEdges]\n    }\n\n    /**\n     * Handle unit values\n     */\n    if (typeof edge === \"string\") {\n        const asNumber = parseFloat(edge)\n\n        if (edge.endsWith(\"px\")) {\n            delta = asNumber\n        } else if (edge.endsWith(\"%\")) {\n            edge = asNumber / 100\n        } else if (edge.endsWith(\"vw\")) {\n            delta = (asNumber / 100) * document.documentElement.clientWidth\n        } else if (edge.endsWith(\"vh\")) {\n            delta = (asNumber / 100) * document.documentElement.clientHeight\n        } else {\n            edge = asNumber\n        }\n    }\n\n    /**\n     * If the edge is defined as a number, handle as a progress value.\n     */\n    if (typeof edge === \"number\") {\n        delta = length * edge\n    }\n\n    return inset + delta\n}\n","import { Edge, EdgeString, Intersection, ProgressIntersection } from \"../types\"\nimport { namedEdges, resolveEdge } from \"./edge\"\n\nconst defaultOffset: ProgressIntersection = [0, 0]\n\nexport function resolveOffset(\n    offset: Edge | Intersection | ProgressIntersection,\n    containerLength: number,\n    targetLength: number,\n    targetInset: number\n) {\n    let offsetDefinition: ProgressIntersection | [EdgeString, EdgeString] =\n        Array.isArray(offset) ? offset : defaultOffset\n\n    let targetPoint = 0\n    let containerPoint = 0\n\n    if (typeof offset === \"number\") {\n        /**\n         * If we're provided offset: [0, 0.5, 1] then each number x should become\n         * [x, x], so we default to the behaviour of mapping 0 => 0 of both target\n         * and container etc.\n         */\n        offsetDefinition = [offset, offset]\n    } else if (typeof offset === \"string\") {\n        offset = offset.trim() as EdgeString\n\n        if (offset.includes(\" \")) {\n            offsetDefinition = offset.split(\" \") as [EdgeString, EdgeString]\n        } else {\n            /**\n             * If we're provided a definition like \"100px\" then we want to apply\n             * that only to the top of the target point, leaving the container at 0.\n             * Whereas a named offset like \"end\" should be applied to both.\n             */\n            offsetDefinition = [offset, namedEdges[offset as keyof typeof namedEdges] ? offset : `0`]\n        }\n    }\n\n    targetPoint = resolveEdge(offsetDefinition[0], targetLength, targetInset)\n    containerPoint = resolveEdge(offsetDefinition[1], containerLength)\n\n    return targetPoint - containerPoint\n}\n","import { ProgressIntersection } from \"../types\"\n\nexport const ScrollOffset: Record<string, ProgressIntersection[]> = {\n  Enter: [\n    [0, 1],\n    [1, 1],\n  ],\n  Exit: [\n    [0, 0],\n    [1, 0],\n  ],\n  Any: [\n    [1, 0],\n    [0, 1],\n  ],\n  All: [\n    [0, 0],\n    [1, 1],\n  ],\n}\n","import { defaultOffset, interpolate } from \"motion-dom\"\nimport { clamp } from \"motion-utils\"\nimport { ScrollInfo, ScrollInfoOptions } from \"../types\"\nimport { calcInset } from \"./inset\"\nimport { resolveOffset } from \"./offset\"\nimport { ScrollOffset } from \"./presets\"\n\nconst point = { x: 0, y: 0 }\n\nfunction getTargetSize(target: Element) {\n    return \"getBBox\" in target && target.tagName !== \"svg\"\n        ? (target as SVGGraphicsElement).getBBox()\n        : { width: target.clientWidth, height: target.clientHeight }\n}\n\nexport function resolveOffsets(\n    container: Element,\n    info: ScrollInfo,\n    options: ScrollInfoOptions\n) {\n    const { offset: offsetDefinition = ScrollOffset.All } = options\n    const { target = container, axis = \"y\" } = options\n    const lengthLabel = axis === \"y\" ? \"height\" : \"width\"\n\n    const inset = target !== container ? calcInset(target, container) : point\n\n    /**\n     * Measure the target and container. If they're the same thing then we\n     * use the container's scrollWidth/Height as the target, from there\n     * all other calculations can remain the same.\n     */\n    const targetSize =\n        target === container\n            ? { width: container.scrollWidth, height: container.scrollHeight }\n            : getTargetSize(target)\n\n    const containerSize = {\n        width: container.clientWidth,\n        height: container.clientHeight,\n    }\n\n    /**\n     * Reset the length of the resolved offset array rather than creating a new one.\n     * TODO: More reusable data structures for targetSize/containerSize would also be good.\n     */\n    info[axis].offset.length = 0\n\n    /**\n     * Populate the offset array by resolving the user's offset definition into\n     * a list of pixel scroll offets.\n     */\n    let hasChanged = !info[axis].interpolate\n\n    const numOffsets = offsetDefinition.length\n    for (let i = 0; i < numOffsets; i++) {\n        const offset = resolveOffset(\n            offsetDefinition[i],\n            containerSize[lengthLabel],\n            targetSize[lengthLabel],\n            inset[axis]\n        )\n\n        if (!hasChanged && offset !== info[axis].interpolatorOffsets![i]) {\n            hasChanged = true\n        }\n\n        info[axis].offset[i] = offset\n    }\n\n    /**\n     * If the pixel scroll offsets have changed, create a new interpolator function\n     * to map scroll value into a progress.\n     */\n    if (hasChanged) {\n        info[axis].interpolate = interpolate(\n            info[axis].offset,\n            defaultOffset(offsetDefinition),\n            { clamp: false }\n        )\n\n        info[axis].interpolatorOffsets = [...info[axis].offset]\n    }\n\n    info[axis].progress = clamp(\n        0,\n        1,\n        info[axis].interpolate!(info[axis].current)\n    )\n}\n","import { warnOnce } from \"motion-utils\"\nimport { updateScrollInfo } from \"./info\"\nimport { resolveOffsets } from \"./offsets/index\"\nimport {\n    OnScrollHandler,\n    OnScrollInfo,\n    ScrollInfo,\n    ScrollInfoOptions,\n} from \"./types\"\n\nfunction measure(\n    container: Element,\n    target: Element = container,\n    info: ScrollInfo\n) {\n    /**\n     * Find inset of target within scrollable container\n     */\n    info.x.targetOffset = 0\n    info.y.targetOffset = 0\n    if (target !== container) {\n        let node = target as HTMLElement\n        while (node && node !== container) {\n            info.x.targetOffset += node.offsetLeft\n            info.y.targetOffset += node.offsetTop\n            node = node.offsetParent as HTMLElement\n        }\n    }\n\n    info.x.targetLength =\n        target === container ? target.scrollWidth : target.clientWidth\n    info.y.targetLength =\n        target === container ? target.scrollHeight : target.clientHeight\n    info.x.containerLength = container.clientWidth\n    info.y.containerLength = container.clientHeight\n\n    /**\n     * In development mode ensure scroll containers aren't position: static as this makes\n     * it difficult to measure their relative positions. The document scrolling element\n     * is exempt: offsetParent measurements naturally resolve relative to the document.\n     */\n    if (process.env.NODE_ENV !== \"production\") {\n        if (\n            container &&\n            target &&\n            target !== container &&\n            container !== document.documentElement &&\n            container !== document.scrollingElement &&\n            container !== document.body\n        ) {\n            warnOnce(\n                getComputedStyle(container).position !== \"static\",\n                \"Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.\"\n            )\n        }\n    }\n}\n\nexport function createOnScrollHandler(\n    element: Element,\n    onScroll: OnScrollInfo,\n    info: ScrollInfo,\n    options: ScrollInfoOptions = {}\n): OnScrollHandler {\n    return {\n        measure: (time) => {\n            measure(element, options.target, info)\n            updateScrollInfo(element, info, time)\n\n            if (options.offset || options.target) {\n                resolveOffsets(element, info, options)\n            }\n        },\n        notify: () => onScroll(info),\n    }\n}\n","import { cancelFrame, frame, frameData, resize, Process } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { createScrollInfo } from \"./info\"\nimport { createOnScrollHandler } from \"./on-scroll-handler\"\nimport { OnScrollHandler, OnScrollInfo, ScrollInfoOptions } from \"./types\"\n\nconst scrollListeners = new WeakMap<Element, VoidFunction>()\nconst resizeListeners = new WeakMap<Element, VoidFunction>()\nconst onScrollHandlers = new WeakMap<Element, Set<OnScrollHandler>>()\nconst scrollSize = new WeakMap<Element, { width: number; height: number }>()\nconst dimensionCheckProcesses = new WeakMap<Element, Process>()\n\nexport type ScrollTargets = Array<HTMLElement>\n\nconst getEventTarget = (element: Element) =>\n    element === document.scrollingElement ? window : element\n\nexport function scrollInfo(\n    onScroll: OnScrollInfo,\n    {\n        container = document.scrollingElement as Element,\n        trackContentSize = false,\n        ...options\n    }: ScrollInfoOptions = {}\n) {\n    if (!container) return noop as VoidFunction\n\n    let containerHandlers = onScrollHandlers.get(container)\n\n    /**\n     * Get the onScroll handlers for this container.\n     * If one isn't found, create a new one.\n     */\n    if (!containerHandlers) {\n        containerHandlers = new Set()\n        onScrollHandlers.set(container, containerHandlers)\n    }\n\n    /**\n     * Create a new onScroll handler for the provided callback.\n     */\n    const info = createScrollInfo()\n    const containerHandler = createOnScrollHandler(\n        container,\n        onScroll,\n        info,\n        options\n    )\n    containerHandlers.add(containerHandler)\n\n    /**\n     * Check if there's a scroll event listener for this container.\n     * If not, create one.\n     */\n    if (!scrollListeners.has(container)) {\n        const measureAll = () => {\n            for (const handler of containerHandlers) {\n                handler.measure(frameData.timestamp)\n            }\n\n            frame.preUpdate(notifyAll)\n        }\n\n        const notifyAll = () => {\n            for (const handler of containerHandlers) {\n                handler.notify()\n            }\n        }\n\n        const listener = () => frame.read(measureAll)\n\n        scrollListeners.set(container, listener)\n\n        const target = getEventTarget(container)\n        window.addEventListener(\"resize\", listener)\n        if (container !== document.documentElement) {\n            resizeListeners.set(container, resize(container, listener))\n        }\n\n        target.addEventListener(\"scroll\", listener)\n\n        listener()\n    }\n\n    /**\n     * Enable content size tracking if requested and not already enabled.\n     */\n    if (trackContentSize && !dimensionCheckProcesses.has(container)) {\n        const listener = scrollListeners.get(container)!\n\n        // Store initial scroll dimensions (object is reused to avoid allocation)\n        const size = {\n            width: container.scrollWidth,\n            height: container.scrollHeight,\n        }\n        scrollSize.set(container, size)\n\n        // Add frame-based scroll dimension checking to detect content changes\n        const checkScrollDimensions: Process = () => {\n            const newWidth = container.scrollWidth\n            const newHeight = container.scrollHeight\n\n            if (size.width !== newWidth || size.height !== newHeight) {\n                listener()\n                size.width = newWidth\n                size.height = newHeight\n            }\n        }\n\n        // Schedule with keepAlive=true to run every frame\n        const dimensionCheckProcess = frame.read(checkScrollDimensions, true)\n        dimensionCheckProcesses.set(container, dimensionCheckProcess)\n    }\n\n    const listener = scrollListeners.get(container)!\n    frame.read(listener, false, true)\n\n    return () => {\n        cancelFrame(listener)\n\n        /**\n         * Check if we even have any handlers for this container.\n         */\n        const currentHandlers = onScrollHandlers.get(container)\n        if (!currentHandlers) return\n\n        currentHandlers.delete(containerHandler)\n\n        if (currentHandlers.size) return\n\n        /**\n         * If no more handlers, remove the scroll listener too.\n         */\n        const scrollListener = scrollListeners.get(container)\n        scrollListeners.delete(container)\n\n        if (scrollListener) {\n            getEventTarget(container).removeEventListener(\n                \"scroll\",\n                scrollListener\n            )\n            resizeListeners.get(container)?.()\n            window.removeEventListener(\"resize\", scrollListener)\n        }\n\n        // Clean up scroll dimension checking\n        const dimensionCheckProcess = dimensionCheckProcesses.get(container)\n        if (dimensionCheckProcess) {\n            cancelFrame(dimensionCheckProcess)\n            dimensionCheckProcesses.delete(container)\n        }\n        scrollSize.delete(container)\n    }\n}\n","import { ScrollOffset as ScrollOffsetPresets } from \"../offsets/presets\"\nimport { ProgressIntersection, ScrollOffset } from \"../types\"\n\ninterface ViewTimelineRange {\n    rangeStart: string\n    rangeEnd: string\n}\n\n/**\n * Maps from ProgressIntersection pairs used by Motion's preset offsets to\n * ViewTimeline named ranges. Returns undefined for unrecognised patterns,\n * which signals the caller to fall back to JS-based scroll tracking.\n */\nconst presets: [ProgressIntersection[], string][] = [\n    [ScrollOffsetPresets.Enter, \"entry\"],\n    [ScrollOffsetPresets.Exit, \"exit\"],\n    [ScrollOffsetPresets.Any, \"cover\"],\n    [ScrollOffsetPresets.All, \"contain\"],\n]\n\nconst stringToProgress: Record<string, number> = {\n    start: 0,\n    end: 1,\n}\n\nfunction parseStringOffset(\n    s: string\n): ProgressIntersection | undefined {\n    const parts = s.trim().split(/\\s+/)\n    if (parts.length !== 2) return undefined\n    const a = stringToProgress[parts[0]]\n    const b = stringToProgress[parts[1]]\n    if (a === undefined || b === undefined) return undefined\n    return [a, b]\n}\n\nfunction normaliseOffset(offset: ScrollOffset): ProgressIntersection[] | undefined {\n    if (offset.length !== 2) return undefined\n    const result: ProgressIntersection[] = []\n    for (const item of offset) {\n        if (Array.isArray(item)) {\n            result.push(item as ProgressIntersection)\n        } else if (typeof item === \"string\") {\n            const parsed = parseStringOffset(item)\n            if (!parsed) return undefined\n            result.push(parsed)\n        } else {\n            return undefined\n        }\n    }\n    return result\n}\n\nfunction matchesPreset(\n    offset: ScrollOffset,\n    preset: ProgressIntersection[]\n): boolean {\n    const normalised = normaliseOffset(offset)\n    if (!normalised) return false\n\n    for (let i = 0; i < 2; i++) {\n        const o = normalised[i]\n        const p = preset[i]\n        if (o[0] !== p[0] || o[1] !== p[1]) return false\n    }\n    return true\n}\n\nexport function offsetToViewTimelineRange(\n    offset?: ScrollOffset\n): ViewTimelineRange | undefined {\n    if (!offset) {\n        return { rangeStart: \"contain 0%\", rangeEnd: \"contain 100%\" }\n    }\n\n    for (const [preset, name] of presets) {\n        if (matchesPreset(offset, preset)) {\n            return { rangeStart: `${name} 0%`, rangeEnd: `${name} 100%` }\n        }\n    }\n\n    return undefined\n}\n","import { ProgressTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"../track\"\nimport { ScrollOptionsWithDefaults } from \"../types\"\nimport { canUseNativeTimeline } from \"./can-use-native-timeline\"\nimport { offsetToViewTimelineRange } from \"./offset-to-range\"\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n    constructor(options: ScrollOptions)\n\n    currentTime: null | { value: number }\n\n    cancel?: VoidFunction\n}\n\ndeclare class ViewTimeline implements ProgressTimeline {\n    constructor(options: { subject: Element; axis?: string })\n\n    currentTime: null | { value: number }\n\n    cancel?: VoidFunction\n}\n\nconst timelineCache = new Map<\n    Element,\n    Map<Element | \"self\", Record<string, ProgressTimeline>>\n>()\n\nfunction scrollTimelineFallback(options: ScrollOptionsWithDefaults) {\n    const currentTime = { value: 0 }\n\n    const cancel = scrollInfo((info) => {\n        currentTime.value = info[options.axis!].progress * 100\n    }, options)\n\n    return { currentTime, cancel }\n}\n\nexport function getTimeline({\n    source,\n    container,\n    ...options\n}: ScrollOptionsWithDefaults): ProgressTimeline {\n    const { axis } = options\n\n    if (source) container = source\n\n    let containerCache = timelineCache.get(container)\n    if (!containerCache) {\n        containerCache = new Map()\n        timelineCache.set(container, containerCache)\n    }\n\n    const targetKey = options.target ?? \"self\"\n    let targetCache = containerCache.get(targetKey)\n    if (!targetCache) {\n        targetCache = {}\n        containerCache.set(targetKey, targetCache)\n    }\n\n    const axisKey = axis + (options.offset ?? []).join(\",\")\n\n    if (!targetCache[axisKey]) {\n        if (options.target && canUseNativeTimeline(options.target)) {\n            const range = offsetToViewTimelineRange(options.offset)\n            if (range) {\n                targetCache[axisKey] = new ViewTimeline({\n                    subject: options.target,\n                    axis,\n                })\n            } else {\n                targetCache[axisKey] = scrollTimelineFallback({\n                    container,\n                    ...options,\n                })\n            }\n        } else if (canUseNativeTimeline()) {\n            targetCache[axisKey] = new ScrollTimeline({\n                source: container,\n                axis,\n            } as any)\n        } else {\n            targetCache[axisKey] = scrollTimelineFallback({\n                container,\n                ...options,\n            })\n        }\n    }\n\n    return targetCache[axisKey]!\n}\n","import { AnimationPlaybackControls, observeTimeline } from \"motion-dom\"\nimport { ScrollOptionsWithDefaults } from \"./types\"\nimport { canUseNativeTimeline } from \"./utils/can-use-native-timeline\"\nimport { getTimeline } from \"./utils/get-timeline\"\nimport { offsetToViewTimelineRange } from \"./utils/offset-to-range\"\n\nexport function attachToAnimation(\n    animation: AnimationPlaybackControls,\n    options: ScrollOptionsWithDefaults\n) {\n    const timeline = getTimeline(options)\n\n    const range = options.target\n        ? offsetToViewTimelineRange(options.offset)\n        : undefined\n\n    /**\n     * Use native timeline when:\n     * - No target: ScrollTimeline (existing behaviour)\n     * - Target with mappable offset: ViewTimeline with named range\n     * - Target with unmappable offset: fall back to JS observe\n     */\n    const useNative = options.target\n        ? canUseNativeTimeline(options.target) && !!range\n        : canUseNativeTimeline()\n\n    return animation.attachTimeline({\n        timeline: useNative ? timeline : undefined,\n        ...(range &&\n            useNative && {\n                rangeStart: range.rangeStart,\n                rangeEnd: range.rangeEnd,\n            }),\n        observe: (valueAnimation) => {\n            valueAnimation.pause()\n\n            return observeTimeline((progress) => {\n                valueAnimation.time =\n                    valueAnimation.iterationDuration * progress\n            }, timeline)\n        },\n    })\n}\n","import { ScrollOptionsWithDefaults } from \"../types\"\n\n/**\n * Currently, we only support element tracking with `scrollInfo`, though in\n * the future we can also offer ViewTimeline support.\n */\nexport function isElementTracking(options?: ScrollOptionsWithDefaults) {\n    return options && (options.target || options.offset)\n}\n","import { observeTimeline } from \"motion-dom\"\nimport { scrollInfo } from \"./track\"\nimport { OnScroll, OnScrollWithInfo, ScrollOptionsWithDefaults } from \"./types\"\nimport { getTimeline } from \"./utils/get-timeline\"\nimport { isElementTracking } from \"./utils/is-element-tracking\"\n\n/**\n * If the onScroll function has two arguments, it's expecting\n * more specific information about the scroll from scrollInfo.\n */\nfunction isOnScrollWithInfo(onScroll: OnScroll): onScroll is OnScrollWithInfo {\n    return onScroll.length === 2\n}\n\nexport function attachToFunction(\n    onScroll: OnScroll,\n    options: ScrollOptionsWithDefaults\n) {\n    if (isOnScrollWithInfo(onScroll) || isElementTracking(options)) {\n        return scrollInfo((info) => {\n            onScroll(info[options.axis!].progress, info)\n        }, options)\n    } else {\n        return observeTimeline(onScroll, getTimeline(options))\n    }\n}\n","import { AnimationPlaybackControls } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { attachToAnimation } from \"./attach-animation\"\nimport { attachToFunction } from \"./attach-function\"\nimport { OnScroll, ScrollOptions } from \"./types\"\n\nexport function scroll(\n    onScroll: OnScroll | AnimationPlaybackControls,\n    {\n        axis = \"y\",\n        container = document.scrollingElement as Element,\n        ...options\n    }: ScrollOptions = {}\n): VoidFunction {\n    if (!container) return noop as VoidFunction\n\n    const optionsWithDefaults = { axis, container, ...options }\n\n    return typeof onScroll === \"function\"\n        ? attachToFunction(onScroll, optionsWithDefaults)\n        : attachToAnimation(onScroll, optionsWithDefaults)\n}\n","import { ElementOrSelector, resolveElements } from \"motion-dom\"\n\nexport type ViewChangeHandler = (entry: IntersectionObserverEntry) => void\n\ntype MarginValue = `${number}${\"px\" | \"%\"}`\ntype MarginType =\n    | MarginValue\n    | `${MarginValue} ${MarginValue}`\n    | `${MarginValue} ${MarginValue} ${MarginValue}`\n    | `${MarginValue} ${MarginValue} ${MarginValue} ${MarginValue}`\n\nexport interface InViewOptions {\n    root?: Element | Document\n    margin?: MarginType\n    amount?: \"some\" | \"all\" | number\n}\n\nconst thresholds = {\n    some: 0,\n    all: 1,\n}\n\nexport function inView(\n    elementOrSelector: ElementOrSelector,\n    onStart: (\n        element: Element,\n        entry: IntersectionObserverEntry\n    ) => void | ViewChangeHandler,\n    { root, margin: rootMargin, amount = \"some\" }: InViewOptions = {}\n): VoidFunction {\n    const elements = resolveElements(elementOrSelector)\n\n    const activeIntersections = new WeakMap<Element, ViewChangeHandler>()\n\n    const onIntersectionChange: IntersectionObserverCallback = (entries) => {\n        entries.forEach((entry) => {\n            const onEnd = activeIntersections.get(entry.target)\n\n            /**\n             * If there's no change to the intersection, we don't need to\n             * do anything here.\n             */\n            if (entry.isIntersecting === Boolean(onEnd)) return\n\n            if (entry.isIntersecting) {\n                const newOnEnd = onStart(entry.target, entry)\n                if (typeof newOnEnd === \"function\") {\n                    activeIntersections.set(entry.target, newOnEnd)\n                } else {\n                    observer.unobserve(entry.target)\n                }\n            } else if (typeof onEnd === \"function\") {\n                onEnd(entry)\n                activeIntersections.delete(entry.target)\n            }\n        })\n    }\n\n    const observer = new IntersectionObserver(onIntersectionChange, {\n        root,\n        rootMargin,\n        threshold: typeof amount === \"number\" ? amount : thresholds[amount],\n    })\n\n    elements.forEach((element) => observer.observe(element))\n\n    return () => observer.disconnect()\n}\n","import { Point } from \"motion-utils\"\n\nexport const distance = (a: number, b: number) => Math.abs(a - b)\n\nexport function distance2D(a: Point, b: Point): number {\n    // Multi-dimensional\n    const xDelta = distance(a.x, b.x)\n    const yDelta = distance(a.y, b.y)\n    return Math.sqrt(xDelta ** 2 + yDelta ** 2)\n}\n"]}